/* ============================================================
   Reseed — "Interlinear"
   A scholar's reading desk: forest ink on sage paper, with
   amber glosses as the one accent. Language learning — the
   lead pillar — is the page's organizing metaphor: you read,
   you look a word up, you mine it, you review it, you chat.
   ============================================================ */

:root {
  /* Ink & paper */
  --paper:        #ffffff;
  --paper-deep:   #f2f6fb;
  --paper-card:   #f7fafd;
  --ink:          #0f1a2b;
  --ink-soft:     #45566e;
  --ink-faint:    #61728c;

  /* Signal blue — structure, links, the loop */
  --seed:         #2c6cb4;
  --seed-bright:  #1f4e86;
  --seed-fg:      #ffffff;

  /* Teal — the lookup accent, used sparingly */
  --gloss:        #0f6e78;
  --gloss-soft:   rgba(15, 110, 120, 0.12);
  --gloss-on-dark: #4fb3bf;
  --on-dark:       #eef3f9;  /* fixed: the closing band is dark in both schemes */
  --on-dark-ink:   #0f1a2b;  /* text on an --on-dark surface */

  --rule:         #d6e0ec;
  --rule-strong:  #aec0d4;
  --code-bg:      #eef3f9;

  --max-width:    1180px;
  --max-content:  720px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-read:    "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:       #0d1520;
    --paper-deep:  #121c2a;
    --paper-card:  #16202f;
    --ink:         #e8edf4;
    --ink-soft:    #a8b6c8;
    --ink-faint:   #8496ab;
    --seed:        #6aa6e0;
    --seed-bright: #8fc0ee;
    --seed-fg:     #0d1520;
    --gloss:       #4fb3bf;
    --gloss-soft:  rgba(79, 179, 191, 0.16);
    --rule:        #24303f;
    --rule-strong: #35455a;
    --code-bg:     #16202f;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 var(--font-read);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--seed); }

::selection { background: var(--gloss-soft); }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Shared type atoms ---------- */

.kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gloss);
}

.kicker--seed { color: var(--seed); }
.kicker--mute { color: var(--ink-faint); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 560;
  font-variation-settings: "opsz" 80, "SOFT" 30;
  letter-spacing: -0.018em;
  color: var(--ink);
}

/* ---------- Top navigation ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  border-bottom: 1px solid var(--rule);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.topbar-brand .product {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 560;
  font-variation-settings: "opsz" 40, "SOFT" 40;
  letter-spacing: -0.01em;
}

.topbar-brand .product::first-letter { color: var(--seed); }

.topbar-brand .gloss-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gloss);
  padding-left: 10px;
  border-left: 1px solid var(--rule-strong);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.topbar-nav a:not(.btn) {
  color: var(--ink-soft);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
}

.topbar-nav a:not(.btn):hover { color: var(--ink); }

@media (max-width: 640px) {
  .topbar-inner { padding: 0 20px; }
  .topbar-nav { gap: 14px; }
  .topbar-nav a:not(.btn) { display: none; }
  .topbar-brand .gloss-tag { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
}

.btn-primary {
  background: var(--seed);
  color: var(--seed-fg);
  border-color: var(--seed);
}

.btn-primary:hover { background: var(--seed-bright); border-color: var(--seed-bright); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-outline:hover { border-color: var(--ink); }

.btn-sm { padding: 9px 15px; font-size: 0.74rem; }

/* ============================================================
   HERO — the thesis is a glossed passage, not a screenshot.
   ============================================================ */

.hero { padding: 76px 0 88px; border-bottom: 1px solid var(--rule); }

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 64px;
  align-items: center;
}

@media (max-width: 920px) {
  .hero { padding: 52px 0 64px; }
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
}

.hero .kicker { display: block; margin-bottom: 22px; }

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  line-height: 1.03;
  font-variation-settings: "opsz" 144, "SOFT" 25, "wght" 540;
  margin: 0 0 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--seed);
  font-variation-settings: "opsz" 144, "SOFT" 60, "wght" 500;
}

.hero .lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 30em;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- The reading card (the signature artifact) ---------- */

.reader {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--seed);
  border-radius: 3px;
  padding: 34px 34px 30px;
  box-shadow: 0 1px 0 var(--rule), 0 26px 50px -34px rgba(15, 26, 43, 0.42);
  position: relative;
}

.reader-tab {
  position: absolute;
  top: -3px;
  left: 34px;
  transform: translateY(-100%);
  background: var(--seed);
  color: var(--seed-fg);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 10px 4px;
  border-radius: 3px 3px 0 0;
}

.passage {
  font-family: var(--font-read);
  font-size: 1.6rem;
  line-height: 2.5;          /* room for glosses overhead */
  color: var(--ink);
  margin: 6px 0 0;
}

.passage[lang] { quotes: "\201C" "\201D"; }

/* <ruby> is the right element for an over-text annotation —
   exactly what a dictionary lookup is. */
ruby.look {
  ruby-position: over;
  ruby-align: center;
}

ruby.look > rt {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gloss);
  text-transform: lowercase;
  font-feature-settings: normal;
  transform: translateY(2px);
}

ruby.look {
  background: linear-gradient(var(--gloss-soft), var(--gloss-soft)) bottom / 100% 38% no-repeat;
  text-underline-offset: 4px;
}

ruby.look.seed {
  background: linear-gradient(var(--gloss-soft), var(--gloss-soft)) bottom / 100% 38% no-repeat;
  box-shadow: 0 2px 0 var(--seed);
}

ruby.look.seed > rt { color: var(--seed); }

.reader-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 26px 0 22px;
}

/* Mined card + spaced-review ladder */
.mine {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.flashcard {
  flex: 0 0 auto;
  min-width: 132px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--gloss);
  border-radius: 3px;
  padding: 12px 16px;
}

.flashcard .fc-front {
  font-family: var(--font-read);
  font-style: italic;
  font-size: 1.18rem;
  color: var(--ink);
}

.flashcard .fc-back {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.ladder { flex: 1 1 200px; }

.ladder-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 9px;
}

.ticks {
  display: flex;
  align-items: center;
  gap: 0;
}

.tick {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.tick.on { color: var(--seed); }

.tick-dot {
  flex: 1 1 auto;
  height: 1px;
  background: var(--rule-strong);
  margin: 0 8px;
  min-width: 8px;
}

.tick.on + .tick-dot { background: var(--seed); }

/* ---------- Hero load choreography (CSS only) ---------- */

@keyframes glossRise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(2px); }
}
@keyframes settle {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

ruby.look > rt { opacity: 0; animation: glossRise 0.5s var(--d, 0s) ease-out forwards; }
.mine { opacity: 0; animation: settle 0.6s 1.05s ease-out forwards; }

@media (prefers-reduced-motion: reduce) {
  ruby.look > rt,
  .mine { animation: none; opacity: 1; transform: none; }
}

/* ============================================================
   THE LOOP — five moves drawn as a returning cycle, not a list.
   ============================================================ */

.loop { padding: 92px 0; border-bottom: 1px solid var(--rule); }

.section-head { max-width: 660px; margin-bottom: 52px; }
.section-head .kicker { display: block; margin-bottom: 16px; }
.section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  margin: 0 0 14px;
}
.section-head .sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: 36em;
}

.loop-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--rule-strong);
}

.move {
  padding: 26px 22px 30px;
  border-right: 1px solid var(--rule);
  position: relative;
}
.move:first-child { padding-left: 0; }
.move:last-child { border-right: none; padding-right: 0; }

.move-verb {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seed);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.move-verb::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--seed);
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.move h3 {
  font-size: 1.18rem;
  font-weight: 560;
  margin: 0 0 8px;
}

.move p {
  font-size: 0.96rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}

.move .gloss-word {
  color: var(--gloss);
  font-style: italic;
}

.loop-return {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.loop-return svg { color: var(--seed); flex: 0 0 auto; }

@media (max-width: 860px) {
  .loop-track { grid-template-columns: 1fr 1fr; border-top: none; }
  .move { border: 1px solid var(--rule); border-radius: 3px; margin: -0.5px; padding: 22px 20px; }
  .move:first-child, .move:last-child { padding: 22px 20px; }
}
@media (max-width: 540px) {
  .loop-track { grid-template-columns: 1fr; }
}

/* ============================================================
   FEEDS — quieter companions that pour into the loop.
   ============================================================ */

.feeds { padding: 92px 0; border-bottom: 1px solid var(--rule); background: var(--paper-deep); }

.feeds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

@media (max-width: 760px) { .feeds-grid { grid-template-columns: 1fr; } }

.feed {
  background: var(--paper);
  padding: 30px 28px;
}

.feed-no {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--gloss);
  margin-bottom: 16px;
}

.feed h3 { font-size: 1.18rem; margin: 0 0 9px; }
.feed p { font-size: 0.96rem; color: var(--ink-soft); line-height: 1.62; margin: 0; }

/* ============================================================
   PRIVACY
   ============================================================ */

.privacy { padding: 92px 0; border-bottom: 1px solid var(--rule); }

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
}
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; gap: 30px; } }

.principle h3 {
  font-size: 1.18rem;
  margin: 0 0 10px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.principle h3 .pno {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--seed);
  letter-spacing: 0.08em;
}

.principle p { font-size: 0.97rem; color: var(--ink-soft); line-height: 1.65; margin: 0; }

.principles-cta { margin-top: 40px; }

/* ============================================================
   DOWNLOAD — set on ink, the page closing its cover.
   ============================================================ */

.closing { background: var(--ink); color: var(--on-dark); padding: 76px 0; }

@media (prefers-color-scheme: dark) {
  .closing { background: #08111c; }
}

.closing-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.closing .kicker { display: block; color: var(--gloss-on-dark); margin-bottom: 16px; }

.closing h2 {
  color: var(--paper);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.1;
  margin: 0;
  max-width: 14em;
}

.closing p {
  color: color-mix(in srgb, var(--paper) 64%, transparent);
  margin: 14px 0 0;
  font-size: 1rem;
  max-width: 30em;
}

.closing .btn-primary {
  background: var(--on-dark);
  color: var(--on-dark-ink);
  border-color: var(--on-dark);
}
.closing .btn-primary:hover { background: #fff; border-color: #fff; }

.closing .btn-outline {
  color: var(--on-dark);
  border-color: color-mix(in srgb, var(--on-dark) 40%, transparent);
}
.closing .btn-outline:hover { border-color: var(--on-dark); }

/* ============================================================
   FOOTER
   ============================================================ */

.footer { background: var(--paper-deep); padding: 60px 0 26px; }

.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }

.footer-cols {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 44px;
  margin-bottom: 44px;
}
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr 1fr; gap: 30px; } }
@media (max-width: 460px) { .footer-cols { grid-template-columns: 1fr; } }

.footer-brand .product {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 560;
  margin-bottom: 12px;
}
.footer-brand .product::first-letter { color: var(--seed); }

.footer-brand p { font-size: 0.94rem; color: var(--ink-soft); max-width: 28em; margin: 0; line-height: 1.6; }

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
  color: var(--ink-faint);
  margin: 0 0 16px;
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 0.94rem; color: var(--ink-soft); text-decoration: none; }
.footer-col a:hover { color: var(--ink); }

.footer-bar {
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* ============================================================
   DOCUMENT (privacy.html) — keep the reading desk consistent
   ============================================================ */

.crumbs {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 26px 32px 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { margin: 0 8px; color: var(--ink-faint); }

.document { max-width: var(--max-content); margin: 0 auto; padding: 22px 32px 92px; }

.document h1 {
  font-size: clamp(2.1rem, 4vw, 2.7rem);
  line-height: 1.12;
  font-variation-settings: "opsz" 120, "SOFT" 30, "wght" 540;
  margin: 0.2em 0 0.5em;
}
.document h2 { font-size: 1.45rem; margin: 2.2em 0 0.7em; }
.document h3 { font-size: 1.12rem; margin: 1.9em 0 0.5em; }

.document p, .document li { color: var(--ink); line-height: 1.7; }
.document p.meta { color: var(--ink-soft); font-size: 0.92em; font-family: var(--font-mono); line-height: 1.9; }

.document a {
  color: var(--seed);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.document a:hover { text-decoration-thickness: 2px; }

.document hr { border: none; border-top: 1px solid var(--rule); margin: 2.4em 0; }
.document ul { padding-left: 1.25em; }
.document li { margin-bottom: 0.4em; }

.document code, .document pre { font-family: var(--font-mono); font-size: 0.88em; }
.document code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }

.document table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.94em;
  border: 1px solid var(--rule);
}
.document th, .document td {
  text-align: left;
  padding: 0.75em 0.95em;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.document th {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.74em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--paper-deep);
  border-bottom: 1px solid var(--rule-strong);
}
.document tr:last-child td { border-bottom: none; }
