/* Base typography and component primitives — Glyphew design system */

/* =================================================================
   Base + semantic typography
   ================================================================= */
html,
body {
  background: var(--gw-bg);
  color: var(--gw-text);
  font-family: var(--gw-font-body);
  font-size: var(--gw-fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--gw-text);
  font-family: var(--gw-font-body);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--gw-fs-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h2 {
  font-size: var(--gw-fs-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
h3 {
  font-size: var(--gw-fs-h3);
  font-weight: 600;
  line-height: 1.2;
}
h4 { font-size: 22px; font-weight: 600; }
h5 { font-size: 18px; font-weight: 600; }
h6 { font-size: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

p {
  font-size: var(--gw-fs-body);
  color: var(--gw-text);
  text-wrap: pretty;
  margin: 0 0 1em;
}

small,
.text-muted { color: var(--gw-text-muted); font-size: var(--gw-fs-label); }
.text-dim   { color: var(--gw-text-dim); }
.text-accent { color: var(--gw-accent); }

/* Links — always yellow, underline on hover only */
a {
  color: var(--gw-accent);
  text-decoration: none;
  transition: color 120ms ease-out;
}
a:hover { color: var(--gw-accent-hover); text-decoration: underline; }
a:visited { opacity: 0.75; }

/* Code / monospace surfaces — explicitly distinct */
code, kbd, pre {
  font-family: var(--gw-font-mono);
  font-size: var(--gw-fs-kbd);
  background: var(--gw-bg);
  border: 1px solid var(--gw-border);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--gw-text);
}
pre {
  padding: 12px 14px;
  overflow-x: auto;
  line-height: 1.5;
}

/* Wordmark / logo class — used in homepage & marketing */
.gw-logo {
  font-family: var(--gw-font-body);
  font-size: var(--gw-fs-h3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gw-accent);
}

/* Universal focus ring — single rule across the system */
:focus-visible {
  outline: 2px solid var(--gw-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--gw-accent-glow);
  border-radius: var(--gw-radius);
}

/* Selection wash — accent muted */
::selection {
  background: var(--gw-accent-muted);
  color: var(--gw-text);
}

/* =================================================================
   Component primitives — buttons, inputs, cards
   ================================================================= */

.gw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--gw-radius);
  border: 1px solid transparent;
  font: 600 16px/1 var(--gw-font-body);
  cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out;
  user-select: none;
}

/* Primary — yellow pill, navy text. Highest emphasis. */
.gw-btn--primary {
  background: var(--gw-accent);
  color: var(--gw-on-primary);
}
.gw-btn--primary:hover  { background: var(--gw-accent-hover); }
.gw-btn--primary:active { background: var(--gw-accent-pressed); }

/* Secondary — surface fill, off-white text, hairline border */
.gw-btn--secondary {
  background: var(--gw-surface-raised);
  color: var(--gw-text);
  border-color: var(--gw-border);
}
.gw-btn--secondary:hover  { background: var(--gw-surface-hover); border-color: var(--gw-border-strong); }
.gw-btn--secondary:active { background: var(--gw-surface); }

/* Destructive — red outline */
.gw-btn--destructive {
  background: transparent;
  color: var(--gw-error);
  border-color: var(--gw-error);
}
.gw-btn--destructive:hover  { background: var(--gw-error-bg); }

/* Disabled */
.gw-btn[disabled],
.gw-btn--disabled {
  background: var(--gw-surface);
  color: var(--gw-text-disabled);
  border-color: transparent;
  cursor: not-allowed;
}

/* Ghost — minimal, used inside lists */
.gw-btn--ghost {
  background: transparent;
  color: var(--gw-accent);
  border-color: transparent;
}
.gw-btn--ghost:hover { background: var(--gw-accent-muted); }

/* Inputs */
.gw-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--gw-radius);
  background: var(--gw-bg);
  color: var(--gw-text);
  border: 1px solid var(--gw-border);
  font: 400 var(--gw-fs-body)/1.3 var(--gw-font-body);
  transition: border-color 120ms ease-out;
}
.gw-input::placeholder { color: var(--gw-text-dim); }
.gw-input:hover  { border-color: var(--gw-border-strong); }
.gw-input:focus  { border-color: var(--gw-accent); }

/* Card — surface raised, 1px border, no shadow */
.gw-card {
  background: var(--gw-surface-raised);
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius);
  padding: 20px 22px;
}

/* Accent pill / chip */
.gw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--gw-radius-pill);
  background: var(--gw-accent-muted);
  color: var(--gw-accent);
  font: 500 13px/1 var(--gw-font-body);
}

/* Tag (neutral) */
.gw-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--gw-radius-pill);
  background: var(--gw-surface);
  color: var(--gw-text-muted);
  border: 1px solid var(--gw-border);
  font: 500 12px/1 var(--gw-font-body);
}

/* Divider */
.gw-hr {
  height: 1px;
  background: var(--gw-border);
  border: 0;
  margin: 16px 0;
}
