/* emanuel_agi
   The yellow from Emanuel's profile photo on warm cream, with graphite only for
   text and outlines. Bricolage Grotesque for display, Instrument Sans for reading, JetBrains
   Mono for the wordmark and labels (the underscore in the handle is the motif).
   Hard edges: small radii and a solid offset shadow instead of soft pills. */

@font-face { font-family: Bricolage; src: url('/fonts/bricolage-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: Instrument; src: url('/fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Mono; src: url('/fonts/jetbrains-mono.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }

:root {
  --yellow: #B4F261;        /* sampled from Emanuel's profile photo */
  --navy: #262522;          /* graphite: text, outlines, code blocks */
  --navy-2: #3A3833;
  --paper: #F7F1E3;         /* cream */
  --sand: #EEE5CF;
  --white: #FFFCF5;

  --ground: var(--paper);
  --ground-alt: var(--sand);
  --surface: var(--white);
  --text: var(--navy);
  --text-muted: rgba(38, 37, 34, 0.68);
  --line: rgba(38, 37, 34, 0.16);
  --edge: var(--navy);
  --soft: rgba(38, 37, 34, 0.06);
  --block-dark: var(--sand);
  --on-dark: var(--navy);
  --on-dark-muted: rgba(38, 37, 34, 0.68);
  --on-yellow: var(--navy);

  --display: Bricolage, 'Arial Black', ui-sans-serif, system-ui, sans-serif;
  --font: Instrument, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: Mono, ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 10px;
  --r-card: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1C1B18;
    --ground-alt: #23211D;
    --surface: #2B2925;
    --text: #F4EEDF;
    --text-muted: rgba(244, 238, 223, 0.7);
    --line: rgba(244, 238, 223, 0.16);
    --edge: #0E0D0B;
    --soft: rgba(244, 238, 223, 0.08);
    --block-dark: #23211D;
    --on-dark: #F4EEDF;
    --on-dark-muted: rgba(244, 238, 223, 0.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--yellow); color: var(--navy); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; text-wrap: balance; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: fixed; top: 10px; left: 10px; z-index: 30; transform: translateY(-160%); background: var(--navy); color: var(--yellow); padding: 10px 16px; border-radius: var(--r); font-weight: 700; text-decoration: none; }
.skip:focus-visible { transform: none; }

/* ---------- wordmark: the underscore is a yellow cursor ---------- */
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--mono); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.mark img { width: 34px; height: 34px; border-radius: 50%; }
.mark .us { background: linear-gradient(transparent 58%, var(--yellow) 58%); margin: 0 -0.1em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r);
  font-weight: 700; font-size: 16px; white-space: nowrap; text-decoration: none; cursor: pointer;
  border: 2px solid var(--navy); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn--yellow { background: var(--yellow); color: var(--navy); box-shadow: 3px 3px 0 var(--navy); }
.btn--yellow:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--navy); }
.btn--yellow:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.btn--navy { background: var(--navy); color: var(--yellow); }
.btn--navy:hover { background: var(--navy-2); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
@media (prefers-color-scheme: dark) { .btn--navy { background: var(--yellow); color: var(--navy); border-color: var(--yellow); } .btn--navy:hover { background: #C6F77F; } }

/* ---------- nav ---------- */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--ground) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; }
.nav__links { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-weight: 600; font-size: 15px; }
.nav__links a:not(.btn) { text-decoration: none; }
.nav__links a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) { .nav__ig { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(28px, 6vw, 72px) clamp(56px, 8vw, 104px); }
.hero__grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.byline { display: inline-flex; align-items: center; gap: 12px; font-family: var(--mono); font-weight: 700; font-size: 14px; margin-bottom: 22px; }
.byline img { width: 44px; height: 44px; border-radius: 50%; }
.hero h1 { font-size: clamp(2.3rem, 4.1vw, 3.45rem); line-height: 1.03; letter-spacing: -0.035em; max-width: 19ch; }
.hero h1 mark { background: var(--yellow); color: var(--navy); padding: 0 0.12em; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero__sub { margin-top: 20px; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 36ch; }
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; } }

/* ---------- subscribe form ---------- */
.sub { margin-top: 30px; max-width: 520px; }
.sub__label { display: block; font-family: var(--mono); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.sub__row { display: flex; gap: 8px; padding: 6px; background: var(--surface); border: 2px solid var(--edge); border-radius: calc(var(--r) + 4px); }
.sub__row input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 14px; font-size: 16px; outline: none; }
.sub__row input::placeholder { color: var(--text-muted); }
.sub__row:focus-within { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sub__row .btn { box-shadow: none; }
.sub__help { margin-top: 10px; font-size: 14px; color: var(--text-muted); min-height: 1.6em; }
.sub__help a { color: inherit; }
.sub[data-state='ok'] .sub__help { color: var(--text); font-weight: 700; }
.sub[data-state='error'] .sub__help { color: #A8321B; font-weight: 700; }
@media (prefers-color-scheme: dark) { .sub[data-state='error'] .sub__help { color: #FFB4A9; } }
.sub[data-state='loading'] button { opacity: 0.7; pointer-events: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 480px) {
  .sub__row { flex-direction: column; padding: 8px; }
  .sub__row input { min-height: 48px; }
}

/* ---------- issue preview card (real latest issue) ---------- */
.card { background: var(--surface); border: 2px solid var(--edge); border-radius: var(--r-card); overflow: hidden; text-decoration: none; display: block; color: var(--text); }
.preview { box-shadow: 8px 8px 0 var(--edge); max-width: 480px; justify-self: end; width: 100%; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.preview:hover { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--edge); }
@media (prefers-reduced-motion: no-preference) {
  .preview { animation: rise 0.8s var(--ease) both 0.1s; }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); } }
}
@media (max-width: 860px) { .preview { justify-self: start; } }
.preview__head { background: var(--yellow); color: var(--on-yellow); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-family: var(--mono); font-weight: 700; font-size: 13px; border-bottom: 2px solid var(--edge); }
.preview__head .mark { font-size: 16px; }
.preview__head .mark img { width: 28px; height: 28px; }
.preview__head .mark .us { background: none; }
.preview__body { padding: 22px 22px 8px; }
.preview__title { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1.12; letter-spacing: -0.02em; margin-bottom: 16px; }
.preview ol { list-style: none; display: grid; gap: 12px; }
.preview li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-weight: 600; font-size: 15px; line-height: 1.4; }
.num { width: 28px; height: 28px; border-radius: 6px; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-family: var(--mono); font-weight: 800; font-size: 13px; }
.preview__foot { padding: 16px 22px 20px; font-weight: 700; font-size: 15px; }
.preview__foot span { text-decoration: underline; text-underline-offset: 4px; }
.preview__empty { color: var(--text-muted); }

/* ---------- inside every issue ---------- */
.inside { background: var(--ground-alt); padding-block: clamp(64px, 9vw, 120px); border-block: 1px solid var(--line); }
.inside__grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.inside h2, .about h2, .latest h2, .final h2, .page-head h1 { letter-spacing: -0.03em; line-height: 1.04; }
.inside h2 { font-size: clamp(2rem, 4vw, 3rem); position: sticky; top: 104px; }
.parts { display: grid; gap: clamp(36px, 5vw, 56px); }
.part { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.part h3 { font-size: 1.4rem; letter-spacing: -0.015em; margin-bottom: 8px; }
.part p { color: var(--text-muted); }
.snip { background: var(--ground); border: 2px solid var(--edge); border-radius: var(--r-card); padding: 18px 20px; font-size: 15px; line-height: 1.5; }
.snip strong { font-weight: 700; }
.snip--dark { background: var(--yellow); color: var(--navy); }
.snip__label { display: block; font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.snip--dark .snip__label { color: rgba(38, 37, 34, 0.72); }
.chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 6px; background: var(--yellow); color: var(--navy); font-family: var(--mono); font-size: 12px; font-weight: 700; vertical-align: 2px; }
@media (max-width: 860px) {
  .inside__grid { grid-template-columns: 1fr; }
  .inside h2 { position: static; }
}
@media (max-width: 600px) { .part { grid-template-columns: 1fr; } }

/* ---------- about Emanuel: the yellow block, the same yellow as his photo ---------- */
.about { background: var(--yellow); color: var(--on-yellow); padding-block: clamp(64px, 9vw, 120px); }
.about__grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; max-width: 960px; }
.about__photo { width: clamp(140px, 17vw, 210px); aspect-ratio: 1; border-radius: 50%; }
.about h2 { font-size: clamp(2rem, 4.4vw, 3.3rem); max-width: 16ch; margin-bottom: 22px; }
.about p { font-size: 1.12rem; max-width: 58ch; margin-bottom: 14px; }
.about a { font-weight: 700; text-underline-offset: 4px; }
@media (max-width: 640px) { .about__grid { grid-template-columns: 1fr; } }

/* ---------- latest issues ---------- */
.latest { padding-block: clamp(64px, 9vw, 120px); }
.latest__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.latest h2 { font-size: clamp(2rem, 4vw, 3rem); }
.textlink { font-weight: 700; text-underline-offset: 4px; }
.issues { display: grid; gap: 12px; }
.row {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 20px; align-items: center;
  padding: 18px 22px; border-radius: var(--r-card); background: var(--surface); border: 2px solid var(--edge); text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.row:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--edge); }
.row__meta { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text-muted); line-height: 1.5; }
.row__title { font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; line-height: 1.2; }
.row__prev { color: var(--text-muted); font-size: 15px; margin-top: 4px; }
.row__go { font-weight: 800; font-size: 1.3rem; }
@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; gap: 6px; }
  .row__go { display: none; }
}
.empty { background: var(--surface); border: 2px dashed var(--line); border-radius: var(--r-card); padding: 28px; color: var(--text-muted); }

/* ---------- final call ---------- */
.final { background: var(--block-dark); color: var(--on-dark); padding-block: clamp(64px, 9vw, 112px); border-top: 1px solid var(--line); }
.final h2 { font-size: clamp(2rem, 4.6vw, 3.5rem); max-width: 18ch; }
.final h2 em { font-style: normal; background: var(--yellow); color: var(--navy); padding: 0 0.12em; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.final p.lead { margin-top: 14px; color: var(--on-dark-muted); font-size: 1.15rem; }
.final .sub__row { background: var(--surface); color: var(--text); }

.final .sub__help { color: var(--on-dark-muted); }
.final .sub[data-state='ok'] .sub__help { color: var(--on-dark); }

.final .sub__label { color: var(--on-dark); }

/* ---------- footer ---------- */
.foot { padding-block: 40px 48px; font-size: 15px; }
.foot__in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.foot__links { display: flex; gap: 20px; flex-wrap: wrap; font-weight: 600; }
.foot__links a { text-decoration: none; }
.foot__links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot__note { color: var(--text-muted); margin-top: 14px; max-width: 60ch; }

/* ---------- inner pages ---------- */
.page-head { padding-block: clamp(32px, 6vw, 72px) 28px; }
.page-head h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); max-width: 18ch; }
.page-head p { margin-top: 14px; color: var(--text-muted); font-size: 1.15rem; max-width: 52ch; }
.narrow { max-width: 760px; }
.article { padding-bottom: 72px; }
.article .meta { font-family: var(--mono); font-weight: 700; color: var(--text-muted); font-size: 14px; margin-bottom: 14px; }
.article h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 22px; }
.article .intro p { font-size: 1.15rem; margin-bottom: 14px; }
.article h2 { font-size: 1.8rem; letter-spacing: -0.02em; margin: 52px 0 18px; }
.story { display: grid; grid-template-columns: 34px 1fr; gap: 16px; padding: 22px 0; }
.story + .story { border-top: 1px solid var(--line); }
.story .num { width: 34px; height: 34px; font-size: 14px; }
.story h3, .tool h3 { font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1.22; margin-bottom: 10px; }
.story p { margin-bottom: 12px; }
.why { background: var(--surface); border-left: 4px solid var(--yellow); border-radius: 0 var(--r) var(--r) 0; padding: 12px 16px; font-size: 16px; }
.src { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 15px; text-underline-offset: 4px; }
.tools { display: grid; gap: 14px; }
.tool { background: var(--surface); border: 2px solid var(--edge); border-radius: var(--r-card); padding: 20px 22px; }
.tool h3 a { text-underline-offset: 4px; }
.tool p { color: var(--text-muted); }
.try { margin-top: 52px; background: var(--yellow); color: var(--navy); border: 2px solid var(--edge); border-radius: var(--r-card); padding: clamp(22px, 4vw, 36px); }
.try__label { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.try h2 { margin: 6px 0 14px; }
.try p { margin-bottom: 12px; }
.prompt { position: relative; margin-top: 14px; }
.prompt pre { background: var(--navy); color: #F4EEDF; border-radius: var(--r); padding: 18px 18px 60px; font-family: var(--mono); font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.prompt button { position: absolute; right: 12px; bottom: 12px; }
.closing { margin-top: 44px; font-size: 1.1rem; }
.closing .sign { font-family: var(--mono); font-weight: 800; margin-top: 8px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; font-weight: 700; flex-wrap: wrap; }
.pager a { text-underline-offset: 4px; }
.prose h2 { font-size: 1.4rem; margin: 32px 0 10px; letter-spacing: -0.01em; }
.prose p, .prose li { margin-bottom: 10px; }
.prose ul { padding-left: 20px; }
.prose { padding-bottom: 80px; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--soft); padding: 1px 6px; border-radius: 4px; }
