/* Formantic Intelligence — tokens taken from the logo mark.
   paper #F4F2EF · ink #16171A · accent #E36F38 */

/* Self-hosted so the page makes no third-party request. Both faces are
   variable and OFL-licensed; latin subset only, ~90KB combined. */
@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/eb-garamond-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper:      #ffffff;
  --ink:        #16171a;
  --ink-soft:   #565a60;
  --ink-faint:  #686c72; /* 4.79:1 on paper — the lightest that still passes for small text */
  --accent:     #d6006e; /* EYE TEST — logo orange is #e36f38 */
  --rule:       #ded5da; /* EYE TEST — warm rule is #dedbd5 */

  /* Serif carries the prose; the sans is reserved for chrome — nav, buttons,
     labels — so interface elements stay crisp at small sizes. */
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-ui:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --shell: 72rem;
  /* Shared measure for the hero paragraphs — one edge for the block, held at
     ~66-73 characters so the prose stays inside the readable range. The
     headline runs wider; a heading is meant to. */
  --hero-measure: 38rem;

  color-scheme: light;
}

/* Light only, on purpose — the brand commits to the paper ground the mark was
   drawn on. color-scheme is pinned so form controls and scrollbars stay light
   even for a visitor whose OS is set to dark. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  /* EB Garamond has a small x-height — it sets visually smaller than a UI sans
     at the same value, so the base size goes up to compensate. */
  font-size: 1.125rem;
  line-height: 1.55;
  font-feature-settings: "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
}

/* Serifs need no negative tracking and no extra weight — 500 is the display
   weight here; 600+ turns Garamond clumsy. */
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.01em; line-height: 1.14; }
p { margin: 0; }
a { color: inherit; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 10;
}
.skip:focus { left: 0; }

:where(a, .btn):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- header ---------- */

.site-head {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(1.25rem, 3vw, 2rem);
  /* Three tracks with equal outer gutters, so the brand sits on the true centre
     of the line rather than the centre of whatever space the nav leaves over. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

/* Stacked lockup: mark over wordmark, both on the centre axis. */
.brand {
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: block;
  width: 48px;
  color: var(--ink);
}
.brand-mark svg { display: block; width: 100%; height: auto; }

/* Slight positive tracking — a wordmark under a mark reads as a logotype, and
   letterspacing is what separates one from a line of body text. */
.brand-name {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  letter-spacing: 0.015em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.brand-name b { font-weight: 600; color: var(--ink); }

.site-nav {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  font-family: var(--font-ui);
  font-size: 0.875rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--rule); }


/* ---------- hero ---------- */

/* Single column, all type — the measure on each element does the shaping.
   Centred: each element still has its own max-width, so they need
   margin-inline: auto as well as text-align, or the text centres inside a
   block that is itself sitting on the left. */
.hero {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(4rem, 13vh, 9rem) clamp(4rem, 11vh, 8rem);
}

.hero-copy { text-align: center; }

/* Two lines, deliberately tapered — the break sits on the comma, so the rag is
   a syntactic pause rather than wherever the line-breaker happened to land.
   No text-wrap: balance here; balancing equalises lines, which kills the taper. */
.hero h1 {
  font-size: clamp(2.5rem, 5.8vw, 4rem);
  letter-spacing: -0.012em;
  line-height: 1.1;
  max-width: 56rem;
  margin-inline: auto;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  margin-top: 1.5rem;
  margin-inline: auto;
  max-width: var(--hero-measure);
  font-size: clamp(1.1875rem, 1.7vw, 1.3125rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* Flex ignores text-align, so the button needs centring explicitly — left on
   its own under centred copy it would read as a bug, not a choice. */
.actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- sub-page intro ---------- */

/* Like .band but with no top rule — it sits directly under the header, where a
   second horizontal line would just double up on the header's own edge. */
.page-intro {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(2.5rem, 8vh, 5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.page-title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  letter-spacing: -0.012em;
}

.page-lede {
  margin-top: 1rem;
  max-width: var(--hero-measure);
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ---------- sections ---------- */

/* No divider rules anywhere — whitespace separates sections instead, so the
   vertical padding is larger than it would be with a hairline doing the work. */
.band {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(3.5rem, 9vw, 6rem);
}

main > .band:first-child {
  padding-top: clamp(2.5rem, 8vh, 4.5rem);
}


/* Same two-tone as the wordmark: first word in full ink, the rest stepped back.
   Base weight drops to 500 so the <b> has somewhere to go. */
/* Sentence case at heading size — the wide tracking and the text-indent that
   compensated for it were both there to serve tiny uppercase type, and neither
   belongs on lowercase letterforms. */
.section-h {
  /* Same serif as the hero headline. Garamond has a smaller x-height than the
     sans it replaces, so the size goes up ~10% to look the same on the page. */
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--ink-soft);
  margin-bottom: 2.25rem;
  text-align: center;
}
.section-h b {
  font-weight: 600;
  color: var(--ink);
}

/* Stacked rows with a hairline between — used by Work. */
.stack {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stack li { padding-block: 0 clamp(1.75rem, 3.4vw, 2.5rem); }
.stack li:last-child { padding-bottom: 0; }
.stack h3 { font-size: 1.375rem; margin-bottom: 0.4rem; }

/* Linked rows (the homepage's Work / Founder teasers) — arrow on hover so the
   row reads as navigation without shouting at rest. */
.row-link {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.row-link::after {
  content: " →";
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.row-link:hover { color: var(--accent); }
.row-link:hover::after { opacity: 1; }
.stack p { color: var(--ink-soft); max-width: 58ch; text-wrap: pretty; }

/* 2x2 on the homepage — four summaries, each short enough to sit in a half
   column without becoming a wall of text. Collapses to one column on phones. */
.work-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 3.5vw, 2.75rem) clamp(1.75rem, 4vw, 3.5rem);
}


.work-grid h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  text-wrap: balance;
}

.work-grid p {
  color: var(--ink-soft);
  font-size: 1.0625rem;
  text-wrap: pretty;
}

/* Trailing links under a stack — sit outside the last row's rule. */
.stack-more {
  margin-top: 1.75rem;
  font-size: 1.0625rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

/* ---------- faq ---------- */

/* <details> gives open/close, keyboard support and in-page find for free —
   no JS, and the answers stay in the DOM for crawlers. */
/* No dividers, so the gap between rows has to be unambiguous — a tighter space
   inside each open row than between rows, or the Q/A pairing breaks down. */
.faq details { padding-block: 0 1.5rem; }
.faq details:last-child { padding-bottom: 0; }

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  font-size: 1.1875rem;
  max-width: 58ch;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-ui);
  color: var(--accent);
  font-size: 1.125rem;
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after { content: "–"; }
.faq summary:hover { color: var(--accent); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* Inline links inside prose. `a { color: inherit }` plus no text-decoration
   means an unstyled link is invisible, so these need an explicit affordance —
   same accent underline the email address uses. */
/* No underline — the link sits in full ink against softer body copy, and turns
   accent on hover. See the note in README: ink-vs-body is the only cue at rest. */
.faq p a,
.stack p a,
.work-grid p a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}
.faq p a:hover,
.faq p a:focus-visible,
.stack p a:hover,
.work-grid p a:hover { color: var(--accent); }

.faq details p {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  max-width: 58ch;
  text-wrap: pretty;
}

/* ---------- founder ---------- */

/* One wide row, not a lone card in a grid — a single entry in a three-column
   layout reads as two people missing. */
/* Total width is capped so the two columns stay in proportion — left as 1fr the
   text track ran ~390px wider than the 58ch the prose actually uses, which made
   the portrait look stranded rather than small. */
.founder {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  /* Sized to the columns it actually holds (16rem + gap + the bio's 58ch), so
     shrinking the portrait doesn't just convert it into dead space. */
  max-width: 48rem;
}

.portrait {
  aspect-ratio: 4 / 5;
  width: 100%;
  /* Required. The img's height="" attribute lands as a presentational hint, so
     with only width overridden here the box became 304 x 640 and aspect-ratio
     was ignored (it only applies when one axis is auto). */
  height: auto;
  max-width: 100%;
  border-radius: 3px;
  object-fit: cover;
  display: block;
}
/* Placeholder styling — harmless once the div is replaced by an <img>. */
div.portrait {
  display: grid;
  place-items: center;
  border: 1px dashed var(--rule);
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.founder-body { max-width: 58ch; }
.founder-body h1,
.founder-body h2,
.founder-body h3 { font-size: 1.75rem; }
.founder-body p { color: var(--ink-soft); text-wrap: pretty; }

.role {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-block: 0.35rem 0.9rem;
}

.founder-links {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
}
.founder-links a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}
.founder-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- contact ---------- */

.contact {
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}
.contact h2 {
  font-size: clamp(1.875rem, 3.9vw, 2.625rem);
  max-width: 20ch;
}
.contact p { color: var(--ink-soft); margin-top: 0.75rem; }

.mail {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  word-break: break-word;
}
.mail:hover { color: var(--accent); }

/* ---------- footer ---------- */

.site-foot {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: 2rem clamp(2rem, 5vw, 3rem);
  /* The one rule kept on the page — it marks where the content ends. */
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--ink-faint);
}
.site-foot a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule); }
.site-foot a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- narrow ---------- */

/* Narrower than this, line one no longer fits on one line, so the taper can't
   hold — drop the forced break and let the browser balance the rag instead. */
@media (max-width: 52rem) {
  .hero h1 { max-width: 20ch; text-wrap: balance; }
  .hero h1 br { display: none; }
}

@media (max-width: 46rem) {
  .hero { padding-block: clamp(3rem, 9vh, 4.5rem) clamp(3rem, 8vh, 4.5rem); }
  .site-nav { font-size: 0.8125rem; gap: 1.1rem; }
  .brand-mark { width: 40px; }

  .founder { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 15rem; }

  .work-grid { grid-template-columns: minmax(0, 1fr); }
}

/* On the narrowest phones the nav can't fit beside a centred brand without
   shoving it off-centre — stack instead, so the brand stays on the axis. */
@media (max-width: 30rem) {
  .site-head { grid-template-columns: 1fr; gap: 0.75rem; }
  .brand, .site-nav { grid-column: 1; justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
