/* Kapitulu landing — editorial, anti-Material, parchment surface */

:root {
  --parchment: #F7F4EE;
  --parchment-sunk: #F1ECE2;
  --ink: #171311;
  --ink-92: rgba(23, 19, 17, 0.92);
  --ink-72: rgba(23, 19, 17, 0.72);
  --ink-50: rgba(23, 19, 17, 0.50);
  --indigo: #2A2E55;
  --oxblood: #7A2E2E;
  --ochre: #B8843A;
  --moss: #4A6A3B;

  --s-4: 4px;
  --s-8: 8px;
  --s-12: 12px;
  --s-20: 20px;
  --s-32: 32px;
  --s-56: 56px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* easeOutQuint */
}

@media (prefers-color-scheme: dark) {
  :root {
    --parchment: #171311;
    --parchment-sunk: #1C1816;
    --ink: #F7F4EE;
    --ink-92: rgba(247, 244, 238, 0.92);
    --ink-72: rgba(247, 244, 238, 0.72);
    --ink-50: rgba(247, 244, 238, 0.50);
    --indigo: #B8843A; /* ochre swaps in for primary in dark */
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--parchment);
  color: var(--ink-92);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Paper-grain noise overlay — palpable per-screen, invisible per-pixel */
body.paper::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  body.paper::before {
    opacity: 0.04;
    mix-blend-mode: screen;
  }
}

/* Stage — single centered card on parchment */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--s-32) var(--s-20);
}

.card {
  width: 100%;
  max-width: 560px;
  text-align: left;
}

/* Eyebrow — Inter, tracked, uppercase */
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin: 0 0 var(--s-32) 0;
}

/* Title — Fraunces display, opsz max, tight letter-spacing */
.title {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
  font-weight: 400;
  font-size: clamp(48px, 9vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 var(--s-20) 0;
  color: var(--ink-92);
}

.title span {
  display: block;
}

.title em {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--oxblood);
}

@media (prefers-color-scheme: dark) {
  .title em { color: var(--ochre); }
}

/* Subhead — Fraunces small, calm */
.sub {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 36;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.45;
  color: var(--ink-72);
  margin: 0 0 var(--s-56) 0;
  max-width: 44ch;
}

/* Countdown — manuscript-numeral, tabular, calm */
.countdown {
  margin: 0 0 var(--s-56) 0;
  padding: var(--s-32) 0;
  border-top: 1px solid var(--ink-50);
  border-bottom: 1px solid var(--ink-50);
}

.countdown[hidden] { display: none; }

.countdown-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin: 0 0 var(--s-20) 0;
}

.countdown-grid {
  display: flex;
  align-items: baseline;
  gap: var(--s-12);
  font-feature-settings: 'tnum' 1;
}

.countdown-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  min-width: 64px;
}

.countdown-grid b {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144;
  font-weight: 400;
  font-size: clamp(40px, 7vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink-92);
}

.countdown-grid i {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-50);
}

.countdown-grid .sep {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1;
  color: var(--ink-50);
  min-width: 0;
  align-self: flex-start;
  padding-top: 4px;
}

.countdown-date {
  margin: var(--s-20) 0 0 0;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 24;
  font-style: italic;
  font-size: 15px;
  color: var(--ink-72);
}

/* Download buttons — filled rect, 2px corner, no shadow, no ripple */
.downloads {
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
  margin: 0 0 var(--s-56) 0;
}

.downloads[hidden] { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-20);
  padding: var(--s-20) var(--s-32);
  background: var(--indigo);
  color: var(--parchment);
  text-decoration: none;
  border-radius: 2px;
  border: none;
  transition:
    transform 180ms var(--ease),
    background-color 320ms var(--ease);
  will-change: transform;
}

.btn::after {
  content: "↓";
  font-family: 'Fraunces', serif;
  font-size: 22px;
  line-height: 1;
  opacity: 0.7;
  transition: transform 320ms var(--ease), opacity 320ms var(--ease);
}

.btn:hover { background: #1F2342; }
.btn:hover::after { transform: translateY(2px); opacity: 1; }
.btn:active { transform: scale(0.985); }
.btn:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
}

@media (prefers-color-scheme: dark) {
  .btn { background: var(--ochre); color: var(--ink); }
  .btn:hover { background: #C9933F; }
}

.btn-stack {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  min-width: 0;
}

.btn b {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0;
}

.btn i {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

/* Foot — link, oxblood / ochre */
.foot {
  font-size: 13px;
  color: var(--ink-50);
  margin: 0;
}

.foot a {
  color: var(--oxblood);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 180ms var(--ease);
}

.foot a:hover { color: var(--ink-92); }

@media (prefers-color-scheme: dark) {
  .foot a { color: var(--ochre); }
}

/* Entrance — slow settle, paper turning */
@media (prefers-reduced-motion: no-preference) {
  .card > * {
    opacity: 0;
    transform: translateY(8px);
    animation: settle 720ms var(--ease) forwards;
  }
  .card > *:nth-child(1) { animation-delay:  40ms; }
  .card > *:nth-child(2) { animation-delay: 120ms; }
  .card > *:nth-child(3) { animation-delay: 200ms; }
  .card > *:nth-child(4) { animation-delay: 280ms; }
  .card > *:nth-child(5) { animation-delay: 360ms; }

  @keyframes settle {
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 480px) {
  .stage { padding: var(--s-32) var(--s-20); }
  .title { font-size: clamp(40px, 12vw, 60px); }
  .sub { font-size: 18px; margin-bottom: var(--s-32); }
  .downloads { margin-bottom: var(--s-32); }

  .btn { padding: var(--s-20) var(--s-20); gap: var(--s-12); }
  .btn b { font-size: 15px; }
  .btn i { font-size: 11px; }

  .countdown { padding: var(--s-20) 0; margin-bottom: var(--s-32); }
  .countdown-grid { gap: var(--s-8); justify-content: space-between; }
  .countdown-grid > div { min-width: 0; flex: 1; }
  .countdown-grid b { font-size: clamp(28px, 9vw, 40px); }
  .countdown-grid i { font-size: 10px; letter-spacing: 0.08em; }
  .countdown-grid .sep { font-size: 24px; padding-top: 2px; }
}

@media (max-width: 360px) {
  .stage { padding: var(--s-20) var(--s-12); }
  .btn { padding: var(--s-12) var(--s-12); }
  .btn b { font-size: 14px; }
  .countdown-grid { gap: var(--s-4); }
  .countdown-grid .sep { font-size: 20px; }
  .countdown-grid b { font-size: 26px; }
}
