/* USAGE LIMIT REACHED — Team A
   Direction: "the error message as luxury object" — now as a four-act
   scroll story. Act 0 impersonates a real rate-limit screen; scrolling
   away triggers a diagnostic; the brand reveals itself only after the turn.
   Accent: EXACT Claude orange #D97757 (starburst), deep #CC785C (book cloth).
   JetBrains Mono display (THE coding font), Newsreader editorial serif.
   Vanilla CSS, no build. */

:root {
  --paper: #f4f1ea;
  --paper-2: #ece8de;
  --ink: #16140f;
  --ink-soft: #4f4a3e;
  --accent: #D97757;        /* Claude orange — exact */
  --accent-deep: #CC785C;   /* book cloth */
  --hair: rgba(22, 20, 15, 0.16);
  --mono: "JetBrains Mono", ui-monospace, monospace;  /* THE coding font — Drew, Day 10 */
  --serif: "Newsreader", Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--paper); }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.mono-small { font-size: 11px; letter-spacing: 0.06em; color: var(--ink-soft); text-transform: lowercase; }
.cursor { animation: blink 1.05s steps(1) infinite; font-weight: 400; }
.cursor-s { animation: blink 1.05s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* ════ ACT 0 — the fake error screen ═══════════════════════ */
.act-error {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; padding: 24px;
}
.err-card {
  width: min(480px, 92vw);
  background: #fffdf7; border: 1px solid var(--hair); border-radius: 10px;
  padding: clamp(28px, 5vw, 44px);
  box-shadow: 0 18px 50px rgba(22, 20, 15, 0.10);
  text-align: center;
}
.err-dot {
  width: 38px; height: 38px; margin: 0 auto 20px; border-radius: 50%;
  background: var(--accent);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 28%, #000 30%);
          mask: radial-gradient(circle at 50% 50%, transparent 28%, #000 30%);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(0.92); opacity: 0.75; } }
.err-title { font-size: clamp(18px, 2.6vw, 24px); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; }
.err-sub { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 26px; }
.err-count { color: var(--accent-deep); font-weight: 600; font-variant-numeric: tabular-nums; }
.err-actions { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.err-btn {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--hair);
  padding: 13px 22px; border-radius: 7px; cursor: not-allowed; opacity: 0.7;
}
.err-hint { font-size: 12px; color: var(--ink-soft); }

.scroll-cue {
  position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%);
  font-size: 18px; color: var(--ink-soft); opacity: 0.45;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateX(-50%) translateY(7px); } }
.skip {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: var(--ink-soft); text-decoration: none; opacity: 0.55;
}
.skip:hover { opacity: 1; color: var(--accent-deep); }

/* ════ ACT 1 — the diagnostic (sticky terminal, scroll-driven) ═ */
.act-diag { position: relative; background: var(--ink); }
.diag-sticky {
  position: sticky; top: 0; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.diag-term {
  width: min(640px, 94vw);
  font-size: clamp(13px, 1.7vw, 16px); line-height: 2.1;
  color: #efece4;
}
.t-prompt { color: var(--accent); font-weight: 600; margin-right: 10px; }
.d-line { opacity: 0; transform: translateY(10px); transition: opacity 0.45s ease, transform 0.45s ease; }
.d-line.on { opacity: 1; transform: none; }
.d-line b { color: var(--accent); font-weight: 600; }
.d-verdict { font-size: clamp(20px, 3.4vw, 34px); line-height: 1.4; margin-top: 14px; font-weight: 600; }
.ellipsis::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.calcbar-wrap { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.calcbar { flex: 1; height: 10px; border: 1px solid rgba(239, 236, 228, 0.3); border-radius: 99px; overflow: hidden; }
.calcbar-fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, var(--accent-deep) 10px 20px);
  transition: width 0.18s linear;
}
.calc-pct { color: #efece4; min-width: 4ch; text-align: right; }
/* tall scroll runway that drives the terminal */
.diag-track { height: 420svh; }
.diag-step { height: calc(420svh / 9); }

/* ════ ACT 2 — the turn ════════════════════════════════════ */
.act-turn {
  background: var(--ink); color: #efece4;
  padding: clamp(70px, 14vh, 160px) clamp(20px, 4vw, 56px);
  display: flex; flex-direction: column; gap: clamp(36px, 8vh, 80px);
  align-items: center; text-align: center;
}
.turn-line { font-family: var(--serif); font-size: clamp(26px, 4.5vw, 52px); line-height: 1.25; max-width: 18em; }
.turn-line em { font-style: italic; color: var(--accent); }
.turn-big { font-family: var(--mono); font-weight: 800; color: var(--accent); letter-spacing: -0.01em; }

/* ════ ACT 3 — the reveal ══════════════════════════════════ */
.act-reveal {
  position: relative;
  padding: clamp(70px, 14vh, 170px) clamp(20px, 4vw, 56px);
  text-align: center;
  border-bottom: 1px solid var(--hair);
}
.reveal-kicker { display: block; margin-bottom: 24px; color: var(--accent-deep); letter-spacing: 0.3em !important; }
.reveal-mark { display: block; width: clamp(240px, 38vw, 520px); height: auto; margin: 0 auto clamp(22px, 4vh, 40px); }
.reveal-wordmark {
  font-weight: 800; font-size: clamp(46px, 10.5vw, 150px);
  line-height: 0.95; letter-spacing: -0.025em;
}
.reveal-wordmark sup { font-size: 0.18em; font-weight: 400; vertical-align: super; }
.reveal-serif {
  font-family: var(--serif); font-size: clamp(19px, 2.4vw, 28px);
  color: var(--ink-soft); margin: clamp(20px, 4vh, 36px) auto clamp(26px, 5vh, 44px);
  max-width: 24em;
}
.reveal-serif em { color: var(--accent-deep); }

.btn-primary {
  display: inline-block; background: var(--ink); color: var(--paper);
  text-decoration: none; font-weight: 600; font-size: 13px; letter-spacing: 0.08em;
  padding: 17px 30px; border: 1px solid var(--ink);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover {
  background: var(--accent); border-color: var(--accent);
  transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink);
}

/* ════ ticker ══════════════════════════════════════════════ */
.ticker {
  background: var(--ink); color: var(--paper);
  overflow: hidden; white-space: nowrap;
  font-size: 11px; letter-spacing: 0.08em; text-transform: lowercase;
  padding: 7px 0;
}
.ticker-track { display: inline-flex; animation: tick 28s linear infinite; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ════ nav (appears post-reveal, sticks for the shop) ══════ */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px clamp(20px, 4vw, 56px);
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
}
.wordmark { font-weight: 800; font-size: 15px; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.wordmark sup { font-size: 8px; font-weight: 400; }
.nav-links { display: flex; gap: clamp(14px, 2.5vw, 32px); align-items: center; }
.nav-links a {
  color: var(--ink); text-decoration: none; font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-bottom: 1px solid transparent; padding-bottom: 2px;
}
.nav-links a:hover { border-bottom-color: var(--ink); }
.nav-cta { background: var(--ink); color: var(--paper) !important; padding: 9px 14px !important; border-bottom: none !important; }
.nav-cta:hover { background: var(--accent); }

/* ════ drops ═══════════════════════════════════════════════ */
.drops { padding: clamp(48px, 8vh, 96px) clamp(20px, 4vw, 56px); }
.section-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: clamp(28px, 5vh, 52px);
}
.section-head h2 { font-size: clamp(22px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.01em; }
.mono-tag { color: var(--accent-deep); font-weight: 600; font-size: 0.6em; vertical-align: middle; margin-right: 10px; }

.drop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(18px, 3vw, 36px); }

.receipt {
  background: #fffdf7; border: 1px solid var(--hair); position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.receipt::before {
  content: ""; position: absolute; top: -7px; left: 0; right: 0; height: 14px;
  background-image: radial-gradient(circle at 7px 7px, var(--paper) 5px, transparent 5.5px);
  background-size: 18px 14px; background-repeat: repeat-x;
}
.receipt:hover { transform: translateY(-6px) rotate(-0.5deg); box-shadow: 8px 10px 0 rgba(22,20,15,0.12); }
.receipt:nth-child(2):hover { transform: translateY(-6px) rotate(0.5deg); }

.receipt-head {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  padding: 16px 18px 12px; border-bottom: 1px dashed var(--hair);
}
.receipt-head span:last-child { color: var(--accent-deep); }
.receipt-img { background: var(--paper-2); border-bottom: 1px dashed var(--hair); overflow: hidden; }
.receipt-img img {
  width: 100%; display: block; aspect-ratio: 1; object-fit: cover;
  filter: grayscale(0.25) contrast(1.02);
  transition: filter 0.3s ease, transform 0.5s ease;
}
.receipt:hover .receipt-img img { filter: grayscale(0) contrast(1.04); transform: scale(1.03); }
.receipt-body { padding: 18px; }
.receipt-body h3 { font-size: 17px; font-weight: 800; letter-spacing: 0.01em; margin-bottom: 8px; }
.receipt-body > p { font-family: var(--serif); font-size: 15.5px; color: var(--ink-soft); margin-bottom: 16px; min-height: 3.2em; }
.receipt-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.dots { flex: 1; border-bottom: 2px dotted var(--hair); }
.price { font-weight: 800; font-size: 22px; }
.btn-receipt {
  display: block; text-align: center; text-decoration: none;
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  color: var(--ink); border: 1.5px solid var(--ink); padding: 13px 10px;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-receipt:hover { background: var(--ink); color: var(--paper); }

/* ════ manifesto ═══════════════════════════════════════════ */
.manifesto { background: var(--ink); color: var(--paper); padding: clamp(56px, 10vh, 120px) clamp(20px, 4vw, 56px); }
.manifesto .mono-tag { display: block; margin-bottom: clamp(24px, 4vh, 44px); color: var(--accent); }
.manifesto-lines p {
  font-family: var(--serif); font-size: clamp(22px, 3.6vw, 40px); line-height: 1.35;
  max-width: 24em; margin-bottom: clamp(18px, 3vh, 30px); color: #efece4;
}
.manifesto-lines em { font-style: italic; color: var(--accent); }
.manifesto .prompt { font-family: var(--mono); color: var(--accent); font-weight: 600; margin-right: 0.4em; font-size: 0.8em; }
.manifesto .sig { font-family: var(--mono); font-size: clamp(16px, 2vw, 22px); color: var(--paper); margin-top: 8px; }

/* ════ spec strip + footer ═════════════════════════════════ */
.specs { border-bottom: 1px solid var(--hair); }
.spec-strip {
  display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; align-items: center;
  padding: 22px clamp(20px, 4vw, 56px);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; color: var(--ink-soft);
}
.spec-strip i { color: var(--accent); font-style: normal; }

.footer { padding: clamp(40px, 7vh, 80px) clamp(20px, 4vw, 56px); }
.terminal {
  max-width: 760px; margin: 0 auto;
  border: 1px solid var(--hair); background: #fffdf7;
  padding: clamp(20px, 3vw, 36px); font-size: 13px; line-height: 1.7;
}
.footer .t-prompt { color: var(--accent-deep); }
.t-out { color: var(--ink-soft); margin: 4px 0 18px 18px; }
.t-out a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.t-out a:hover { color: var(--accent-deep); }

/* ════ reveal animation ════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .cursor, .cursor-s, .scroll-cue, .err-dot, .ellipsis::after { animation: none; }
  .reveal, .d-line { opacity: 1; transform: none; transition: none; }
  .diag-track { height: auto; }
}

/* ════ mobile ══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .receipt-body > p { min-height: 0; }
}
