/* HexWerx — styles.css
   Built to ENGRAM v2.0. Tokens §5.2, type scale §5.3, components §5.4,
   responsive §5.5, accessibility §5.6. One accent (amber). Dark only. */

/* ---------- Fonts (self-hosted, Latin subset) ---------- */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;               /* variable file covers 400/500/600 */
  font-display: swap;
  src: url('/fonts/Archivo.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/IBMPlexMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/IBMPlexMono-Medium.woff2') format('woff2');
}

/* ---------- Tokens (§5.2, locked palette) ---------- */
:root {
  --substrate:      #0B0B0C;
  --surface:        #141416;
  --border:         #26262A;
  --accent:         #FFB000;
  --accent-hover:   rgba(255, 176, 0, 0.08);
  --text-primary:   #ECECEC;
  --text-secondary: #9A9AA0;
  --text-muted:     #6A6A70;

  --font-display: 'Archivo', system-ui, -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --radius:     8px;
  --hairline:   1px;
  --gap-section: 2.5rem;   /* divider spacing between sections */
  --measure:    680px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--substrate);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }

/* ---------- Skip link (§5.6) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text-primary);
  padding: 10px 16px;
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  z-index: 10;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---------- Layout ---------- */
.site {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}
section { padding: 0.25rem 0; }

.rule {
  border: 0;
  border-top: var(--hairline) solid var(--border);
  margin: var(--gap-section) 0;
}

/* ---------- Type scale (§5.3) — weights 400/500/600 only ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.15;
}
h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h3 { font-size: 17px; font-weight: 500; }

.body    { font-size: 17px; font-weight: 400; line-height: 1.6; color: var(--text-secondary); }
.body-sm { font-size: 15px; font-weight: 400; line-height: 1.6; color: var(--text-secondary); }
.body strong, .body-sm strong { color: var(--text-primary); font-weight: 500; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--accent);           /* amber — permitted (§7.3) */
  margin: 0 0 1.1rem;
}
.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; }

/* ---------- Masthead / brand lockup (§5.4.1) ---------- */
.masthead { margin-bottom: 1.25rem; }
.masthead__logo {
  width: auto;
  height: auto;              /* aspect ratio preserved */
  max-width: 75%;            /* three-quarters of the column width */
  /* The PNG carries ~27% black padding top & bottom; negative margins clip that
     dead space visually so the larger logo adds no air. File itself is unedited. */
  margin: -2.25rem 0 -2rem -0.5rem;
  /* Brand PNGs are opaque on #000. lighten() composites the black margin into the
     substrate so no rectangle shows — the image file itself is unedited. */
  mix-blend-mode: lighten;
}

/* ---------- Hero (§5.4.1) ---------- */
.hero { padding-top: 0; }
.hero__category {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 2rem;
}
.hero__category strong { color: var(--text-primary); font-weight: 500; }

.signature {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  margin-bottom: 2.25rem;
  min-height: 1.4em;
}
.signature__value { color: var(--text-muted); }
.signature__resolved { color: var(--accent); }   /* amber (§7.3) */

.hero__subhead { max-width: 34rem; margin: 1.5rem 0 0; }

/* ---------- CTA buttons (§7.3 amber) ---------- */
.cta-group { margin-top: 2.5rem; }
.btn-primary {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: transparent;
  border: var(--hairline) solid var(--accent);
  border-radius: var(--radius);
  padding: 13px 22px;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease;
}
.btn-primary:hover { background: var(--accent-hover); }

/* ---------- Cards / pillars (§5.4.3) ---------- */
.lead { max-width: 34rem; margin: 0 0 2rem; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card__offset {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--accent);           /* amber offset (§7.3) */
  margin-bottom: 0.85rem;
}
.card__offset .name { color: var(--text-primary); }
.card .body-sm { margin: 0; }

/* ---------- Method terminal block (§5.4.5) ---------- */
.terminal {
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
}
.method-row {
  display: grid;
  grid-template-columns: 56px 96px 1fr;
  gap: 14px;
  line-height: 2.3;
  white-space: nowrap;
}
.method-row .off  { color: var(--accent); }        /* amber offset (§7.3) */
.method-row .name { color: var(--text-primary); }
.method-row .desc { color: var(--text-secondary); white-space: normal; }  /* AA: secondary passes 4.5:1, muted did not */
.method__close { margin-top: 1.5rem; }

/* ---------- Guarantee (§5.4.6) ---------- */
.guarantees { display: flex; flex-direction: column; gap: 1rem; }
.guarantee { font-size: 16px; color: var(--text-secondary); line-height: 1.55; }
.guarantee strong { color: var(--text-primary); font-weight: 500; }

/* ---------- Alternatives (§5.4.7) ---------- */
.alt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.alt-list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.alt-list li::before {
  content: '·';
  position: absolute;
  left: 0.15rem;
  top: -0.05em;
  color: var(--text-muted);       /* NOT amber — reading list, §7.3 */
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1;
}

/* ---------- Engage (§5.4.9) ---------- */
.phase-list { display: flex; flex-direction: column; gap: 1rem; margin: 0 0 1.75rem; }
.phase { font-size: 16px; color: var(--text-secondary); line-height: 1.55; }
.phase strong { color: var(--text-primary); font-weight: 500; }
.engage__note { color: var(--text-secondary); }  /* AA: 15px is not "large", needs 4.5:1 */

/* ---------- Inquiry form (§5.4.11, §6.1) ---------- */
.form { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.1rem; max-width: 34rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.field .req { color: var(--accent); }
.field input,
.field textarea {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
}
.field textarea { resize: vertical; min-height: 6rem; }
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { font-family: var(--font-mono); font-size: 13px; min-height: 1.2em; }
.form__status[data-state="ok"]  { color: var(--accent); }
.form__status[data-state="err"] { color: var(--text-secondary); }
.form__status a { color: var(--accent); }

/* ---------- Boundary (§5.4.10) ---------- */
.boundary .body { max-width: 38rem; }

/* ---------- Footer (§5.4.12) ---------- */
.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: var(--hairline) solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;        /* center footer contents */
  gap: 0.6rem;
}
.footer__logo {
  width: auto;
  height: auto;               /* aspect ratio preserved */
  max-width: 40%;             /* two-fifths of the column width */
  margin: 0 auto;             /* centered */
  mix-blend-mode: lighten;    /* black margin drops into substrate; file unedited */
}
.footer__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text-secondary);   /* AA: 12px meta needs 4.5:1; muted failed */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;    /* center the wrapped meta items */
  text-align: center;
  gap: 0.4rem 1.25rem;
}
.footer__meta a { color: var(--text-secondary); text-decoration: none; }
.footer__meta a:hover { color: var(--text-primary); }
.footer__accent { color: var(--accent); }   /* the #FFB000 label (§5.4.12) */
.footer__links {
  display: flex;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
}
.footer__links a { color: var(--text-secondary); text-decoration: none; }
.footer__links a:hover { color: var(--text-primary); }
.footer__imprint {
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;         /* <address> defaults to italic */
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
  max-width: 34rem;
}
.footer__imprint a { color: var(--text-secondary); text-decoration: none; }
.footer__imprint a:hover { color: var(--text-primary); }

/* ---------- Legal pages (privacy / terms) ---------- */
.legal { max-width: var(--measure); margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.legal__top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem;
}
.legal__home { font-family: var(--font-mono); font-size: 13px; color: var(--accent); text-decoration: none; }
.legal__home:hover { text-decoration: underline; }
.legal__wordmark { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text-primary); }
.legal__wordmark .accent { color: var(--accent); }
.legal h1 { font-size: 30px; margin: 0 0 0.4rem; }
.legal__eff { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); margin: 0 0 2.5rem; }
.legal h2 { font-size: 19px; margin: 2.5rem 0 0.6rem; }
.legal h2 .num { font-family: var(--font-mono); font-size: 13px; font-weight: 400; color: var(--accent); margin-right: 0.6rem; }
.legal h3 { font-size: 15px; margin: 1.4rem 0 0.4rem; color: var(--text-primary); }
.legal p, .legal li { font-size: 16px; line-height: 1.7; color: var(--text-secondary); }
.legal p { margin: 0.6rem 0; }
.legal p strong, .legal li strong { color: var(--text-primary); font-weight: 500; }
.legal ul { padding-left: 1.2rem; margin: 0.6rem 0; }
.legal li { margin: 0.35rem 0; }
.legal a { color: var(--accent); }
.legal .counsel {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary);
  border: var(--hairline) dashed var(--border); border-radius: var(--radius);
  padding: 0.5rem 0.75rem; display: inline-block;
}
.legal__note {
  margin-top: 2.5rem; padding: 1.25rem 1.5rem;
  background: var(--surface); border: var(--hairline) solid var(--border); border-radius: var(--radius);
}
.legal__note p { font-size: 14px; margin: 0.4rem 0; }
.legal__more { margin-top: 2rem; }

/* ---------- Focus visibility (§5.6) — never suppressed ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Responsive (§5.5) — single column always ---------- */
@media (min-width: 640px) {
  h1 { font-size: 38px; }
  .site { padding: 1.75rem 1.75rem 2rem; }
}
@media (min-width: 1024px) {
  h1 { font-size: 44px; }
  .site { padding: 2rem 2rem 2.5rem; }
}

/* ---------- Reduced motion (§7.6) ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
