/* SCRATCH. Act one is the mint ground the hero was rendered on; act two is the desk. */
:root {
  --mint: #c9e5d3;
  --mint-deep: #b3d8c3;
  --mint-pale: #dfeee6;
  --ink: #1b2620;
  --muted: #586860;
  --line: #a9c8b7;
  --foil: #c9cfd4;
  --cherry: #d8262a;
  --cherry-deep: #b51d21;
  --gold: #e0b43b;
  --live: #1d7f4c;
  --down: #a34a2b;
  --desk: #132019;
  --desk-2: #1b2b23;
  --desk-3: #24362c;
  --desk-ink: #e6efe9;
  --desk-muted: #95a89c;
  --desk-line: #2c4136;
  --radius: 18px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(27, 38, 32, .08), 0 14px 40px rgba(27, 38, 32, .10);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--mint); color: var(--ink);
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, .display { font-family: "Bricolage Grotesque", "Instrument Sans", sans-serif; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.2rem, 5.6vw, 4.2rem); line-height: 1.02; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.12; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .3em; }
p { margin: 0 0 1em; }
.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: 0; }
.mono, .n, code { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
code { font-size: .86em; background: rgba(27, 38, 32, .07); padding: .05em .35em; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.col { max-width: 66ch; }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(201, 229, 211, .86); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(27, 38, 32, .08); }
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.menu { display: flex; gap: 4px; margin-left: 6px; }
.menu a { text-decoration: none; font-size: .92rem; font-weight: 500; padding: 8px 12px; border-radius: var(--pill); color: var(--ink); }
.menu a:hover { background: rgba(27, 38, 32, .07); }
.menu a[aria-current="page"] { background: var(--ink); color: var(--mint-pale); }
.nav .spacer { flex: 1; }
.state { font-family: "JetBrains Mono", monospace; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: var(--pill); border: 1px solid rgba(27, 38, 32, .2); white-space: nowrap; }
.state.live { border-color: var(--live); color: var(--live); }
.state.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 7px; vertical-align: 1px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: var(--pill); font-weight: 600; font-size: .95rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1; transition: transform .12s ease, background .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid rgba(216, 38, 42, .35); outline-offset: 2px; }
.btn.primary { background: var(--cherry); color: #fff; }
.btn.primary:hover { background: var(--cherry-deep); }
.btn.ghost { background: rgba(255, 255, 255, .55); color: var(--ink); border-color: rgba(27, 38, 32, .12); }
.btn.ghost:hover { background: rgba(255, 255, 255, .85); }
.btn.dark { background: var(--ink); color: var(--mint-pale); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* act one */
.hero { padding: 0 0 46px; text-align: center; overflow: hidden; }
.hero-art { display: block; width: 100vw; max-width: none; margin: 0 calc(50% - 50vw); height: auto; max-height: 82vh; object-fit: cover; object-position: center 45%; -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%); mask-image: linear-gradient(to bottom, #000 88%, transparent 100%); }
@media (max-width: 720px) { .hero-art { object-fit: contain; max-height: none; } }
.hero h1 { margin: -6px auto 14px; max-width: 18ch; position: relative; }
.hero .sub { font-size: clamp(1.05rem, 1.8vw, 1.35rem); color: var(--muted); max-width: 44ch; margin: 0 auto 26px; }
.hero .sub .serif { color: var(--ink); font-size: 1.12em; }
.ribbon { display: inline-flex; gap: 10px; align-items: center; margin: 22px auto 0; padding: 9px 14px; border-radius: 12px; background: rgba(255, 255, 255, .55); border: 1px solid rgba(27, 38, 32, .12); font-size: .88rem; color: var(--muted); }
.ribbon b { color: var(--ink); font-weight: 600; }

/* act two */
.desk { background: var(--desk); color: var(--desk-ink); padding: 56px 0 72px; }
.desk h2 { color: #fff; }
.desk .eyebrow { color: var(--desk-muted); }
.desk .muted { color: var(--desk-muted); }
.eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.section { margin-bottom: 52px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head .meta { font-family: "JetBrains Mono", monospace; font-size: .76rem; color: var(--desk-muted); }
.panel { background: var(--desk-2); border: 1px solid var(--desk-line); border-radius: var(--radius); overflow: hidden; }
.tw { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--desk-line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--desk-muted); font-weight: 600; background: var(--desk-3); }
tbody tr:last-child td { border-bottom: none; }
td.n, th.n { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
.tok { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.tok img { width: 22px; height: 22px; border-radius: 6px; background: transparent; }
.tok small { color: var(--desk-muted); font-weight: 400; }
.dash { color: var(--desk-muted); }
.ok { color: #6fd39a; }
.no { color: var(--desk-muted); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--desk-line); border: 1px solid var(--desk-line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.stat { background: var(--desk-2); padding: 16px 18px; }
.stat .k { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--desk-muted); }
.stat .v { font-family: "JetBrains Mono", monospace; font-size: 1.5rem; margin-top: 6px; line-height: 1.1; }
.stat .s { font-size: .82rem; color: var(--desk-muted); margin-top: 5px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 16px; border-bottom: 1px solid var(--desk-line); font-size: .9rem; }
.feed li:last-child { border-bottom: none; }
.feed .who { font-family: "JetBrains Mono", monospace; color: var(--desk-muted); font-size: .8rem; }
.feed .when { color: var(--desk-muted); font-size: .8rem; text-align: right; }
.empty { padding: 22px 18px; color: var(--desk-muted); font-size: .92rem; }

/* light sections below the desk (how, odds, faq) */
.light { padding: 60px 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { background: rgba(255, 255, 255, .6); border: 1px solid rgba(27, 38, 32, .1); border-radius: var(--radius); padding: 22px; }
.step .verb { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; margin-bottom: 8px; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }
.odds { width: 100%; border-collapse: collapse; background: rgba(255, 255, 255, .6); border: 1px solid rgba(27, 38, 32, .1); border-radius: var(--radius); overflow: hidden; }
.odds th, .odds td { border-bottom: 1px solid rgba(27, 38, 32, .1); padding: 12px 16px; }
.odds thead th { background: rgba(27, 38, 32, .06); color: var(--muted); }
.odds tbody tr:last-child td { border-bottom: none; }
.pill { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: var(--pill); border: 1px solid currentColor; }
.pill.live { color: var(--live); }
.pill.off { color: var(--muted); }
.pill.gold { color: #8a6a12; }
.faq details { border-top: 1px solid rgba(27, 38, 32, .12); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid rgba(27, 38, 32, .12); }
.faq summary { cursor: pointer; font-weight: 600; font-family: "Bricolage Grotesque", sans-serif; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin: 10px 0 0; color: var(--muted); }
.split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.split div { background: rgba(255, 255, 255, .6); border: 1px solid rgba(27, 38, 32, .1); border-radius: 14px; padding: 16px; }
.split .pct { font-family: "JetBrains Mono", monospace; font-size: 1.6rem; }
.split .lab { color: var(--muted); font-size: .88rem; }

/* footer */
footer { padding: 34px 0 60px; border-top: 1px solid rgba(27, 38, 32, .12); font-size: .86rem; color: var(--muted); }
footer .row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 10px; }
footer .mono { font-size: .78rem; }

/* the scratch app */
.app { padding: 30px 0 70px; }
.app-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; align-items: start; }
.card-stage { display: grid; place-items: center; }
.card { position: relative; width: min(100%, 520px); aspect-ratio: 1.55; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: #fff; border: 6px solid var(--cherry); touch-action: none; user-select: none; }
.card .under { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; background: radial-gradient(circle at 50% 40%, #fff, #eef5f0 70%); }
.card .under img { width: 96px; height: 96px; border-radius: 22px; background: transparent; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .16)); }
.card .under .amt { font-family: "JetBrains Mono", monospace; font-size: 1.35rem; margin-top: 10px; }
.card .under .usd { color: var(--muted); font-size: .9rem; }
.card .under .tier { margin-top: 8px; }
.card canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; transition: opacity .6s ease; }
.card.revealed canvas { opacity: 0; pointer-events: none; }
.card .blank { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .95rem; padding: 20px; text-align: center; background: linear-gradient(135deg, #d9dde1, #f2f4f5 40%, #cfd4d8 70%, #e9ecee); }
.panel-light { background: rgba(255, 255, 255, .62); border: 1px solid rgba(27, 38, 32, .1); border-radius: var(--radius); padding: 22px; }
.panel-light h2 { margin-bottom: 8px; }
.wallet-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wallet-pick .wallet img { width: 18px; height: 18px; border-radius: 4px; margin-right: 8px; vertical-align: -4px; }
.status { font-size: .92rem; color: var(--muted); min-height: 1.4em; margin: 10px 0 0; }
.status.err { color: var(--down); }
.status.good { color: var(--live); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; margin-top: 12px; }
.kv .k { color: var(--muted); }
.kv .v { font-family: "JetBrains Mono", monospace; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.demo-tag { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: var(--pill); background: var(--gold); color: #3a2a05; }

/* docs */
.doc { padding: 40px 0 80px; }
.doc-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
.toc { position: sticky; top: 84px; font-size: .9rem; }
.toc a { display: block; text-decoration: none; color: var(--muted); padding: 5px 0; }
.toc a:hover { color: var(--ink); }
.doc h2 { margin: 42px 0 12px; padding-top: 8px; }
.doc h2:first-child { margin-top: 0; }
.doc pre { background: rgba(27, 38, 32, .07); padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: .82rem; line-height: 1.5; max-width: 100%; }
.doc article { min-width: 0; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: .45em; }
.roadmap { list-style: none; padding: 0; margin: 0; }
.roadmap li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid rgba(27, 38, 32, .12); }
.roadmap .st { font-family: "JetBrains Mono", monospace; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding-top: 3px; }
.st.shipped { color: var(--live); } .st.building { color: #8a6a12; } .st.next { color: var(--muted); } .st.open { color: var(--down); } .st.never { color: var(--muted); text-decoration: line-through; }

@media (max-width: 860px) {
  .app-grid, .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .roadmap li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .split { grid-template-columns: 1fr; }
  .menu a { padding: 8px 9px; font-size: .86rem; }
  .nav .wrap { gap: 8px; }
  .state { display: none; }
}
@media (max-width: 520px) {
  .menu { overflow-x: auto; }
  h1 { font-size: 2.1rem; }
}
/* the reveal: foil shavings on a canvas above the foil, then one wobble, a logo pop, a shine sweep, a tier ring */
.card .flakes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.card .under::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .8) 50%, transparent 62%); transform: translateX(-130%); pointer-events: none; }
.card.revealed { animation: card-wobble .55s ease-out; }
.card.revealed .under img { animation: logo-pop .75s cubic-bezier(.2, 1.5, .4, 1) both; }
.card.revealed .under .amt { animation: amt-pop .5s cubic-bezier(.2, 1.4, .4, 1) .1s both; }
.card.revealed .under .usd, .card.revealed .under .tier { animation: rise .5s ease-out .22s both; }
.card.revealed .under::after { animation: shine .9s ease-out .18s both; }
.card.tier-1.revealed { animation: card-wobble .55s ease-out, ring-mint 1s ease-out; }
.card.tier-2.revealed { animation: card-wobble .55s ease-out, ring-cherry 1.1s ease-out; }
.card.tier-3.revealed { animation: card-wobble .55s ease-out, ring-gold 1.4s ease-out; border-color: var(--gold); }
@keyframes card-wobble { 0% { transform: rotate(0) scale(1); } 25% { transform: rotate(-1.2deg) scale(1.025); } 60% { transform: rotate(.8deg) scale(1.01); } 100% { transform: rotate(0) scale(1); } }
@keyframes logo-pop { 0% { transform: scale(.55); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
@keyframes amt-pop { 0% { transform: scale(.82); } 100% { transform: scale(1); } }
@keyframes rise { 0% { transform: translateY(10px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes shine { 0% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
@keyframes ring-mint { 0% { box-shadow: 0 0 0 0 rgba(179, 216, 195, .95), var(--shadow); } 100% { box-shadow: 0 0 0 30px rgba(179, 216, 195, 0), var(--shadow); } }
@keyframes ring-cherry { 0% { box-shadow: 0 0 0 0 rgba(216, 38, 42, .75), var(--shadow); } 100% { box-shadow: 0 0 0 34px rgba(216, 38, 42, 0), var(--shadow); } }
@keyframes ring-gold { 0% { box-shadow: 0 0 0 0 rgba(224, 180, 59, .95), var(--shadow); } 100% { box-shadow: 0 0 0 42px rgba(224, 180, 59, 0), var(--shadow); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
