/* Self hosted faces, the production half of DESIGN.md's type rules. The
   prototype in site/ pulls these from Google Fonts; the built site never asks
   a third party for anything. Ranges below are the real fvar axes of the two
   woff2 files, which are the same cuts etiennex.com ships. */
@font-face {
  font-family: 'Archivo';
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(/fonts/archivo.woff2) format('woff2');
}
@font-face {
  font-family: 'Martian Mono';
  font-weight: 100 800;
  font-display: swap;
  src: url(/fonts/martianmono.woff2) format('woff2');
}

/* etienne.fyi · the ledger, in prose form.
   Same DNA as etiennex.com (Archivo + Martian Mono, paper + brick red),
   tuned for reading instead of announcing. Light only, on purpose. */

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

:root {
  --paper: oklch(97% 0.004 55);
  --paper-2: oklch(94.5% 0.006 55);
  --ink: oklch(17.5% 0.014 40);
  --soft: oklch(42% 0.014 40);
  --line: oklch(17.5% 0.014 40 / 0.18);
  --red: oklch(37% 0.115 26);
  --red-bright: oklch(60% 0.165 30);
  --on-red: oklch(97% 0.014 60);
  --grot: 'Archivo', system-ui, -apple-system, sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SFMono-Regular', monospace;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  font-family: var(--grot);
  font-weight: 430;
  font-size: 1.04rem;
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: var(--on-red); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.wrap {
  max-width: 45rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2rem);
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1.5rem, 4vh, 2.5rem) 0;
}
.wordmark {
  font-variation-settings: "wght" 820, "wdth" 118;
  text-transform: lowercase;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--red);
  white-space: nowrap;
}
.mast-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: flex-end; }
.mast-nav a, .mono-link {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.18s ease-out, border-color 0.18s ease-out;
}
.mast-nav a:hover, .mono-link:hover { color: var(--red); border-color: currentColor; }

/* ---------- index intro ---------- */
.intro { padding-block: clamp(2.5rem, 7vh, 4.5rem) clamp(2rem, 5vh, 3rem); }
.intro p {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.5;
  max-width: 46ch;
}
.intro p strong { font-weight: 680; }
.intro .quiet { color: var(--soft); }

/* ---------- subscribe ---------- */
.subscribe { display: flex; gap: 0; max-width: 26rem; margin-top: 1.6rem; }
.subscribe input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--ink);
  border-right: none;
  background: var(--paper);
  color: var(--ink);
}
.subscribe input::placeholder { color: var(--soft); }
.subscribe button {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.7rem 1.2rem;
  border: 1.5px solid var(--red);
  background: var(--red);
  color: var(--on-red);
  cursor: pointer;
  transition: background 0.18s ease-out;
}
.subscribe button:hover { background: var(--red-bright); border-color: var(--red-bright); }
/* p.sub-note, not .sub-note: .intro p would otherwise out-specify it and the
   note would render at lede size. Mono stays 0.66-0.72rem everywhere. */
p.sub-note {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--soft);
  margin-top: 0.6rem;
}

/* ---------- entry list (the ledger) ---------- */
.entries { padding-bottom: clamp(3rem, 8vh, 5rem); }
.entry { display: block; border-top: 1px solid var(--line); padding: 1rem 0 2.4rem; }
.entry.latest { border-top: 2.5px solid var(--ink); padding-bottom: 3rem; }
.entry-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.entry-meta .no { color: var(--red); font-weight: 600; }
.entry-meta .date { color: var(--soft); }
.entry h2 {
  font-variation-settings: "wght" 780, "wdth" 110;
  font-size: clamp(1.35rem, 3.4vw, 1.7rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-top: 0.65rem;
  max-width: 24ch;
  text-wrap: balance;
  transition: color 0.18s ease-out;
}
.entry.latest h2 { font-size: clamp(1.9rem, 5.5vw, 2.7rem); max-width: 18ch; }
.entry:hover h2 { color: var(--red); }
.entry .hook {
  color: var(--soft);
  margin-top: 0.7rem;
  max-width: 56ch;
  font-size: 0.98rem;
}

/* ---------- post page ---------- */
.post-head { padding-block: clamp(2.5rem, 7vh, 4.5rem) 0; }
.post-meta {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
}
.post-meta .no { color: var(--red); font-weight: 600; }
.post-head h1 {
  font-variation-settings: "wght" 820, "wdth" 110;
  font-size: clamp(2.1rem, 6.5vw, 3.3rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-top: 1rem;
  max-width: 16ch;
  text-wrap: balance;
}

.prose { padding-block: clamp(2rem, 5vh, 3rem) clamp(3rem, 7vh, 4.5rem); }
.prose > * + * { margin-top: 1.15em; }
.prose p { max-width: 64ch; }
.prose p.lede {
  font-size: 1.22rem;
  line-height: 1.55;
  font-weight: 480;
}
.prose a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.18s ease-out;
}
.prose a:hover { color: var(--red-bright); }
.prose strong { font-weight: 680; }
.prose h2 {
  font-variation-settings: "wght" 760, "wdth" 106;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-top: 2.4em;
}
.prose blockquote {
  padding-left: 1.4rem;
  color: var(--soft);
  font-style: italic;
  max-width: 58ch;
}
/* A talk or a podcast the essay came out of. youtube-nocookie, lazy, so an
   essay nobody scrolls costs the reader nothing. Sharp corners like everything. */
.prose .embed {
  margin: 2em 0 0;
  max-width: 64ch;
}
.prose .embed-frame {
  aspect-ratio: 16 / 9;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.prose .embed-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.prose .embed figcaption {
  margin-top: 0.6rem;
  max-width: 56ch;
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.fin { color: var(--red); font-size: 1.1rem; }

/* ---------- elsewhere ---------- */
/* Talks and podcasts. Same ledger grammar as the entries, quieter: no number,
   no heavy rule, because these are places he showed up, not essays he wrote. */
.standfirst {
  margin-top: 1rem;
  max-width: 48ch;
  color: var(--soft);
  font-size: 1.05rem;
}
.appearances { padding-block: clamp(2rem, 5vh, 3rem) clamp(3rem, 7vh, 4.5rem); }
.appearance { border-top: 1px solid var(--line); padding: 1rem 0 2rem; }
.appearance h2 {
  font-variation-settings: "wght" 700, "wdth" 104;
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 0.65rem;
  max-width: 28ch;
  text-wrap: balance;
}
.appearance h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease-out;
}
.appearance h2 a:hover { color: var(--red); }
.appearance .venue {
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.appearance .note { margin-top: 0.9rem; padding-block: 0; }
.appearance .note p { max-width: 60ch; font-size: 0.98rem; }

/* ---------- footer ---------- */
.site-foot { border-top: 2.5px solid var(--ink); padding-block: 2rem clamp(3rem, 8vh, 5rem); }
.site-foot .about {
  color: var(--soft);
  max-width: 56ch;
  font-size: 0.96rem;
}
.site-foot .about a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.foot-links { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: 1.8rem; }

@media (max-width: 30rem) {
  .masthead { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .mast-nav { justify-content: flex-start; }
}
