/* ============================================================
   BiblioSync — marketing site
   Extends the brand toolkit v1.0. Tokens are the source of truth;
   do not introduce colours, fonts, or curves outside this system.
   ============================================================ */

:root {
  /* ── Paper (light) ── */
  --paper:        #F2EDE3;
  --surface:      #EDE6D6;
  --surface-alt:  #E5DEC8;
  --ink:          #2C2416;
  --ink-active:   rgba(44,36,22,1);
  --ink-passive:  rgba(44,36,22,0.45);
  --ink-muted:    rgba(44,36,22,0.34);
  --rule:         rgba(44,36,22,0.13);
  --rule-strong:  rgba(44,36,22,0.26);
  --amber:        #C17F3A;
  --amber-wash:   rgba(193,127,58,0.12);
  --moss:         #6B7B5E;
  --clay:         #A8552F;
  --shadow:       rgba(44,36,22,0.10);
  --nav-bg:       rgba(242,237,227,0.82);
}
[data-theme="dark"] {
  --paper:        #1A1612;
  --surface:      #221E18;
  --surface-alt:  #2A2520;
  --ink:          #E8DFC8;
  --ink-active:   rgba(240,230,204,1);
  --ink-passive:  rgba(240,230,204,0.42);
  --ink-muted:    rgba(240,230,204,0.30);
  --rule:         rgba(232,223,200,0.10);
  --rule-strong:  rgba(232,223,200,0.22);
  --amber:        #D4963A;
  --amber-wash:   rgba(212,150,58,0.15);
  --moss:         #7A9068;
  --clay:         #C2703F;
  --shadow:       rgba(0,0,0,0.45);
  --nav-bg:       rgba(26,22,18,0.82);
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  transition: background 400ms cubic-bezier(0.83,0,0.17,1), color 400ms cubic-bezier(0.83,0,0.17,1);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

/* The one curve. */
:root { --quint: cubic-bezier(0.83,0,0.17,1); }

/* ── Grain ── */
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 200; opacity: 0.028; }

/* ── Shell ── */
.shell { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.eyebrow {
  font-family: 'DM Sans', sans-serif; font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 18px;
}
.eyebrow .num { color: var(--ink-muted); font-family: 'JetBrains Mono', monospace; margin-right: 10px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
  transition: background 400ms var(--quint), border-color 400ms var(--quint);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 15px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-word {
  font-family: 'Lora', Georgia, serif; font-size: 19px; font-weight: 600; letter-spacing: -0.015em;
}
.brand-word em { font-style: normal; color: var(--amber); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--ink-passive);
  text-decoration: none; transition: color 200ms var(--quint);
}
.nav-links a:hover { color: var(--amber); }
.theme-toggle {
  font-family: 'DM Sans', sans-serif; font-size: 12px;
  background: transparent; border: 1px solid var(--rule-strong); color: var(--ink-passive);
  border-radius: 20px; padding: 7px 15px; cursor: pointer;
  transition: color 200ms var(--quint), border-color 200ms var(--quint);
}
.theme-toggle:hover { color: var(--amber); border-color: var(--amber); }
@media (max-width: 760px) { .nav-links .link-hide { display: none; } }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500;
  text-decoration: none; cursor: pointer; border-radius: 26px;
  padding: 13px 26px; border: 1px solid transparent;
  transition: transform 220ms var(--quint), background 320ms var(--quint),
              color 320ms var(--quint), border-color 320ms var(--quint);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--amber); color: #fff; }
.btn-ghost { border-color: var(--rule-strong); color: var(--ink-active); background: transparent; }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn svg { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: 84px 0 76px; border-bottom: 1px solid var(--rule); }
.hero-eyebrow {
  font-family: 'DM Sans', sans-serif; font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-muted); margin-bottom: 30px;
}
.hero-head {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(34px, 6vw, 66px);
  font-weight: 600; line-height: 1.08; letter-spacing: -0.02em;
  max-width: 15ch;
}
.hero-head em { font-style: italic; color: var(--amber); font-weight: 500; }
.hero-sub {
  margin-top: 26px; max-width: 52ch; font-size: 18px; line-height: 1.7;
  color: var(--ink-passive);
}
.hero-sub strong { color: var(--ink-active); font-weight: 600; }
.hero-cta { margin-top: 38px; display: flex; gap: 14px; flex-wrap: wrap; }

/* Live reading strip — the mechanic, running */
.hero-demo {
  margin-top: 62px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 40px clamp(24px, 5vw, 56px);
  box-shadow: 0 30px 60px -40px var(--shadow);
}
.hero-demo-label {
  font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-muted); margin-bottom: 22px;
  display: flex; align-items: center; gap: 10px;
}
.hero-demo-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.reader-text {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.85; letter-spacing: -0.005em; max-width: 30ch;
}
.reader-text .w {
  color: var(--ink-passive); font-weight: 400; cursor: pointer;
  transition: color 130ms ease, font-weight 130ms ease;
  border-radius: 3px;
}
.reader-text .w:hover { color: var(--ink-muted); }
.reader-text .w.lit { color: var(--ink-active); font-weight: 500; }

/* Player controls under the demo */
.reader-controls { margin-top: 32px; display: flex; align-items: center; gap: 18px; }
.play-btn {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  border: none; cursor: pointer; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  transition: background 320ms var(--quint), transform 220ms var(--quint);
}
.play-btn:hover { background: var(--amber); color: #fff; }
.play-btn:active { transform: scale(0.94); }
.scrubber {
  flex: 1; height: 4px; border-radius: 4px; background: var(--rule-strong);
  position: relative; cursor: pointer;
}
.scrubber-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--amber); border-radius: 4px; }
.scrubber-knob {
  position: absolute; top: 50%; left: 0; width: 13px; height: 13px; border-radius: 50%;
  background: var(--amber); transform: translate(-50%, -50%); box-shadow: 0 1px 4px var(--shadow);
}
.reader-time {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-muted);
  min-width: 84px; text-align: right; letter-spacing: 0.02em;
}
.reader-hint {
  margin-top: 16px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--ink-muted);
}

/* ============================================================
   SECTION SCAFFOLD
   ============================================================ */
.section { padding: 84px 0; border-bottom: 1px solid var(--rule); }
.section-head { max-width: 40ch; margin-bottom: 48px; }
.section-head h2 {
  font-family: 'Lora', Georgia, serif; font-size: clamp(26px, 4vw, 38px);
  font-weight: 600; letter-spacing: -0.015em; line-height: 1.18;
}
.section-head p.lead {
  margin-top: 18px; font-size: 18px; color: var(--ink-passive); line-height: 1.7; max-width: 56ch;
}
.section-head p.lead strong { color: var(--ink-active); font-weight: 600; }

/* ── Two-column mechanic explainer ── */
.mechanic { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.mechanic-copy h3 {
  font-family: 'Lora', Georgia, serif; font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em; margin-bottom: 10px;
}
.mechanic-copy p { color: var(--ink-passive); max-width: 46ch; margin-bottom: 26px; line-height: 1.7; }
.mechanic-copy p:last-child { margin-bottom: 0; }
.mechanic-list { list-style: none; display: grid; gap: 22px; }
.mechanic-list li { display: grid; grid-template-columns: 26px 1fr; gap: 14px; }
.mechanic-list .k {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--amber); padding-top: 3px;
}
.mechanic-list .t strong {
  display: block; color: var(--ink-active); font-weight: 600; font-size: 16px;
  font-family: 'DM Sans', sans-serif; margin-bottom: 3px;
}
.mechanic-list .t span { color: var(--ink-passive); font-size: 14.5px; line-height: 1.6; }

/* Phone-ish frame demo */
.mech-visual {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 20px;
  padding: 34px 30px; box-shadow: 0 30px 60px -40px var(--shadow);
}
.mech-visual .chip {
  font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-muted); margin-bottom: 20px;
}
.mech-para {
  font-family: 'Lora', Georgia, serif; font-size: 19px; line-height: 1.9; color: var(--ink-passive);
}
.mech-para b { color: var(--ink-active); font-weight: 500; }
.mech-scrub { margin-top: 26px; height: 3px; background: var(--rule-strong); border-radius: 3px; position: relative; }
.mech-scrub::after { content:''; position: absolute; left:0; top:0; bottom:0; width: 46%; background: var(--amber); border-radius: 3px; }

/* ============================================================
   FEATURES GRID
   ============================================================ */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.feature { background: var(--paper); padding: 30px 28px; transition: background 320ms var(--quint); }
.feature:hover { background: var(--surface); }
.feature-ico {
  width: 34px; height: 34px; border-radius: 9px; background: var(--amber-wash);
  color: var(--amber); display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.feature-ico svg { width: 18px; height: 18px; }
.feature h3 {
  font-family: 'DM Sans', sans-serif; font-size: 16px; font-weight: 500; color: var(--ink-active);
  margin-bottom: 8px; letter-spacing: -0.005em;
}
.feature p { font-size: 14.5px; color: var(--ink-passive); line-height: 1.6; }
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .features { grid-template-columns: 1fr; } }

/* ============================================================
   CLIP STUDIO SHOWCASE
   ============================================================ */
.clip-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 56px; align-items: center; }
.endcard {
  width: 220px; aspect-ratio: 9/16; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--rule-strong); background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 26px 18px; position: relative;
  box-shadow: 0 34px 60px -34px var(--shadow);
}
.endcard-cover { width: 78px; height: 78px; border-radius: 7px; background: linear-gradient(150deg, var(--amber), var(--clay)); }
.endcard-title { font-family: 'Lora', Georgia, serif; font-size: 15px; font-weight: 600; color: var(--ink-active); text-align: center; line-height: 1.35; }
.endcard-stars { font-size: 12px; color: var(--amber); letter-spacing: 0.16em; }
.endcard-mark { position: absolute; bottom: 16px; font-family: 'DM Sans', sans-serif; font-size: 8px; letter-spacing: 0.26em; color: var(--ink-muted); }
.clip-copy h3 { font-family: 'Lora', Georgia, serif; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 12px; }
.clip-copy p { color: var(--ink-passive); max-width: 52ch; margin-bottom: 18px; line-height: 1.7; }
.clip-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.clip-tag {
  font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--ink-passive);
  border: 1px solid var(--rule); border-radius: 20px; padding: 6px 14px; background: var(--surface);
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.step { position: relative; padding-top: 34px; border-top: 2px solid var(--rule-strong); }
.step .n { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--amber); letter-spacing: 0.08em; position: absolute; top: 14px; }
.step h3 { font-family: 'DM Sans', sans-serif; font-size: 17px; font-weight: 500; color: var(--ink-active); margin-bottom: 9px; }
.step p { font-size: 14.5px; color: var(--ink-passive); line-height: 1.65; }
.step .meta { margin-top: 12px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--moss); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 8px; } .step { padding-bottom: 26px; } }

/* ============================================================
   OWNERSHIP BAND
   ============================================================ */
.band { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band .shell { padding-top: 78px; padding-bottom: 78px; }
.band-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.band h2 { font-family: 'Lora', Georgia, serif; font-size: clamp(26px, 4vw, 36px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; max-width: 16ch; }
.band p { color: var(--ink-passive); font-size: 17px; line-height: 1.7; margin-top: 18px; max-width: 50ch; }
.band p strong { color: var(--ink-active); font-weight: 600; }
.band-points { display: grid; gap: 18px; }
.band-point { display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; }
.band-point .tick { color: var(--moss); padding-top: 2px; }
.band-point div strong { display: block; color: var(--ink-active); font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500; margin-bottom: 3px; }
.band-point div span { color: var(--ink-passive); font-size: 14px; line-height: 1.55; }

/* ============================================================
   CLOSING CTA
   ============================================================ */
.closer { padding: 96px 0; text-align: center; border-bottom: 1px solid var(--rule); }
.closer h2 { font-family: 'Lora', Georgia, serif; font-size: clamp(30px, 5vw, 50px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; max-width: 18ch; margin: 0 auto; }
.closer h2 em { font-style: italic; color: var(--amber); }
.closer p { margin: 22px auto 0; color: var(--ink-passive); font-size: 17px; max-width: 46ch; }
.closer .hero-cta { justify-content: center; margin-top: 36px; }

/* ============================================================
   FOOTER / COLOPHON
   ============================================================ */
.footer { padding: 54px 0 72px; }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; flex-wrap: wrap; margin-bottom: 40px; }
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col h4 { font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14px; color: var(--ink-passive); text-decoration: none; margin-bottom: 9px; transition: color 200ms var(--quint); }
.footer-col a:hover { color: var(--amber); }
.colophon-note {
  font-family: 'Lora', Georgia, serif; font-size: 14.5px; font-style: italic;
  color: var(--ink-passive); max-width: 58ch; line-height: 1.8; padding-top: 30px; border-top: 1px solid var(--rule);
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--quint), transform 600ms var(--quint); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .shell { padding: 0 22px; }
  .nav-inner { padding: 13px 22px; }
  .mechanic, .band-grid { grid-template-columns: 1fr; gap: 34px; }
  .clip-wrap { grid-template-columns: 1fr; gap: 34px; justify-items: center; text-align: center; }
  .clip-copy { text-align: left; }
  .clip-tags { justify-content: flex-start; }
  .hero { padding: 60px 0 56px; }
  .section { padding: 62px 0; }
}
