:root {
  color-scheme: light;
  --paper: #f4f0fa;
  --white: #fcfaff;
  --ink: #201435;
  --muted: #635575;
  --line: #cfc2e1;
  --violet: #5c28be;
  --lilac: #e8dcff;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --display: "Space Grotesk", "Arial", sans-serif;
}
* { box-sizing: border-box }
html { scroll-behavior: smooth }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--display) }
a { color: inherit; text-decoration: none }
button { font: inherit; color: inherit }
svg { display: block; width: 1.25rem; height: 1.25rem; flex: none }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden }
[hidden] { display: none !important }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px }
.wrap { width: min(100% - 5rem, 1230px); margin-inline: auto }
.top { background: var(--white); border-bottom: 1px solid var(--line) }
.mast, .foot { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 74px }
.brand { display: inline-flex; align-items: center; gap: .55rem; font: 700 1.15rem/1 var(--display); letter-spacing: -.035em }
.brand small { display: block; margin-top: .25rem; color: var(--muted); font: 500 .63rem/1 var(--mono); letter-spacing: .025em }
.brand-icon { display: grid; place-items: center; width: 2.4rem; aspect-ratio: 1; border-radius: .62rem; color: var(--white); background: var(--violet) }
.brand-icon svg { width: 1.48rem; height: 1.48rem }
nav, .social { display: flex; gap: .35rem }
nav { gap: 1.9rem; font-weight: 600; font-size: .95rem }
nav a:hover, .text-link:hover { color: var(--violet) }
.social a { display: grid; place-items: center; width: 2.35rem; aspect-ratio: 1; color: var(--violet); background: var(--paper); border: 1px solid var(--line); border-radius: 50% }
.social a:hover { color: white; background: var(--violet); border-color: var(--violet) }
.social svg { width: 1rem; height: 1rem }

.hero { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); position: relative; width: min(100% - 5rem,1230px); margin: 2.6rem auto 1.5rem; min-height: 495px; border: 1px solid var(--line); border-radius: 1.15rem; overflow: hidden; background: var(--white) }
.hero-inner { grid-column: 1; grid-row: 1; width: auto; margin: 0; align-self: center; padding: 2.5rem 1.65rem 2.5rem 2.8rem }
.hero-art { grid-column: 2; grid-row: 1; margin: .66rem; border-radius: .78rem; background: #e1d1fc url("stitched-puppet.png") center 46% / cover no-repeat }
.hero-caption { grid-column: 2; grid-row: 1; align-self: end; z-index: 1; display: flex; justify-content: space-between; gap: .3rem; margin: 1.35rem; padding: .48rem .7rem; border: 1px solid #ffffff74; border-radius: .45rem; background: #281844bc; color: white; font: 500 .66rem/1.35 var(--mono) }
.eyebrow { margin: 0; color: var(--violet); font: 600 .74rem/1.4 var(--mono); letter-spacing: .14em }
.hero .eyebrow { display: inline-flex; align-items: center; gap: .48rem; border-radius: 99px; padding: .43rem .7rem; background: var(--lilac); letter-spacing: .045em }
.eyebrow i { width: .39rem; height: .39rem; border-radius: 50%; background: var(--violet) }
h1, h2, h3, p { margin-top: 0 }
h1 { font: 700 clamp(3.25rem,7vw,7.8rem)/.94 var(--display); letter-spacing: -.09em; margin: 1rem 0 .6rem }
h1 span { color: var(--violet) }
.hero-sub { font: 600 clamp(1.4rem,3vw,2.7rem)/1.05 var(--display); letter-spacing: -.06em; margin: 0 0 .9rem }
.hero-copy { max-width: 31ch; margin-bottom: 1.35rem; color: var(--muted); font-size: 1.05rem }
.hero-actions { display: flex; flex-wrap: wrap; gap: .55rem }
.button { min-height: 2.85rem; display: inline-flex; justify-content: center; align-items: center; gap: .43rem; border: 1px solid transparent; border-radius: .5rem; padding: .57rem .92rem; font-size: .91rem; font-weight: 700; cursor: pointer }
.primary { background: var(--violet); color: white }
.primary:hover { background: #431c95 }
.secondary { border-color: var(--line); background: var(--paper); color: var(--ink) }
.secondary:hover { border-color: var(--violet); color: var(--violet) }
.contract { display: flex; gap: .64rem; align-items: center; width: max-content; max-width: 100%; margin-top: 1.1rem; padding: .05rem .22rem .05rem .65rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--white); color: var(--muted); font: 500 .76rem/1.2 var(--mono) }
.contract>span { color: var(--violet) }
.contract code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; user-select: all }
.contract button { display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: .35rem; background: transparent; color: var(--violet); cursor: pointer }
.contract button:disabled { opacity: .52; cursor: default }
.contract .copied { background: var(--lilac) }
.contract svg { width: .95rem; height: .95rem }
.frequency { background: var(--violet); color: white }
.frequency .wrap { display: flex; justify-content: space-between; align-items: center; gap: .5rem; min-height: 43px; font: 600 .76rem/1.2 var(--mono); letter-spacing: .085em }

.section { padding-top: 4.75rem; scroll-margin-top: 1rem }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem }
.section-heading h2 { margin: .22rem 0 0; font: 700 clamp(2.3rem,5.8vw,4.5rem)/.96 var(--display); letter-spacing: -.075em }
.text-link { display: inline-flex; align-items: center; gap: .4rem; padding-bottom: .25rem; font-weight: 600; font-size: .9rem; white-space: nowrap }
.text-link svg { width: 1rem; height: 1rem; color: var(--violet) }
.panel { overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: .9rem }
.panel-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line) }
.pair { display: flex; align-items: center; gap: .6rem; line-height: 1.2 }
.pair small { display: block; margin-top: .23rem; color: var(--muted); font: 500 .67rem/1.1 var(--mono); letter-spacing: .06em }
.tag { display: inline-block; max-width: 100%; padding: .28rem .49rem; border: 1px solid var(--line); border-radius: 99px; background: var(--white); color: var(--muted); font: 600 .66rem/1.2 var(--mono); letter-spacing: .025em }
.tag.complete { background: var(--lilac); color: #492095; border-color: #d2b7ff }
.demo-chart { background: #f7f2ff }
.chart-tools { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .72rem 1.15rem 0; color: var(--muted); font: 500 .8rem/1.3 var(--mono) }
#periods { display: flex; gap: .25rem }
#periods button, .game-top button, .touch button { padding: .33rem .62rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--white); color: var(--ink); cursor: pointer }
#periods button[aria-pressed=true], .game-top button:hover:not(:disabled), .touch button:active { background: var(--violet); border-color: var(--violet); color: white }
#market-canvas { display: block; width: 100%; height: 264px }
#market-frame iframe { display: block; border: 0; width: 100%; height: 450px; background: #1f1535 }
.panel-note { margin: 0; padding: .78rem 1.15rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem }

.road { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: .9rem; overflow: hidden }
.road li { display: grid; grid-template-columns: 5rem 9rem minmax(0,.8fr) minmax(0,1.2fr); align-items: center; gap: 1rem; min-height: 88px; padding: 1.05rem 1.3rem; background: var(--white) }
.road li + li { border-top: 1px solid var(--line) }
.road li:nth-child(even) { background: #eee6fb }
.road-act { margin: 0; color: var(--violet); font: 600 .78rem/1.2 var(--mono); letter-spacing: .04em }
.road .tag { justify-self: start }
.road h3 { margin: 0; font-size: clamp(1.15rem,2vw,1.55rem); line-height: 1.12; letter-spacing: -.045em }
.road li>p:last-child { margin: 0; color: var(--muted); font-size: .93rem }

.game-section { padding-bottom: 4.75rem }
.record, .game-top { font: 600 .82rem/1.3 var(--mono) }
.record { color: var(--muted); white-space: nowrap }
.record strong, .game-top b { color: var(--violet) }
.game-top { display: flex; gap: 1rem; align-items: center; min-height: 3.3rem; padding: .55rem 1rem }
.game-top button { margin-left: auto }
.game-top button:disabled { opacity: .5; cursor: default }
.arena { position: relative; background: #241448 }
.arena.playing { touch-action: none }
#game-canvas { display: block; width: 100%; height: clamp(310px,41vw,460px) }
.game-cover { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1rem; color: white; background: radial-gradient(ellipse,#3b1d71f4 1%,#2a174d90 64%) }
.game-cover>div { max-width: 31rem }
.game-cover .eyebrow { color: #e1c7ff }
.game-cover h3 { margin: .38rem 0 .5rem; font: 700 clamp(2.25rem,6vw,4.4rem)/.98 var(--display); letter-spacing: -.075em }
.game-cover p:not(.eyebrow) { color: #e7d9fa; font-size: .97rem }
.game-cover .primary { background: #e3ceff; color: #31185a }
.game-cover .primary:hover { background: white }
.game-controls { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .66rem 1rem }
.game-controls p { margin: 0; color: var(--muted); font-size: .87rem }
.touch { display: flex; gap: .35rem; touch-action: none }
.touch button { min-width: 2.5rem; min-height: 2.5rem }
footer { background: var(--white); border-top: 1px solid var(--line) }
.foot { min-height: 92px }
.foot p { margin: 0; color: var(--muted); font-size: .88rem }

@media (max-width: 960px) {
  .wrap, .hero { width: calc(100% - 2.75rem) }
  .hero-inner { width: auto; padding: 1.65rem 1.15rem 1.65rem 1.8rem }
  .hero { min-height: 435px }
  .road li { grid-template-columns: 4.2rem 7.25rem minmax(0,.8fr) minmax(0,1fr); gap: .72rem }
}
@media (max-width: 680px) {
  .wrap, .hero { width: calc(100% - 1.5rem) }
  .mast { display: grid; grid-template-columns: auto 1fr; gap: .62rem; padding-block: .62rem }
  .mast nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; border-top: 1px solid var(--line); padding-top: .5rem }
  .top-links { justify-self: end; gap: .23rem }
  .social a { width: 1.9rem }
  .social svg { width: .9rem; height: .9rem }
  .brand { font-size: 1rem; gap: .38rem }
  .brand-icon { width: 2rem }
  .hero { display: grid; grid-template-columns: minmax(0,1fr); min-height: 0; margin-top: .8rem; margin-bottom: 1rem }
  .hero-art, .hero-caption { grid-column: 1; grid-row: 1 }
  .hero-art { min-height: clamp(235px,69vw,370px); margin: .45rem; background-position: center 40% }
  .hero-caption { margin: 1.02rem }
  .hero-inner { grid-row: 2; width: auto; padding: .95rem 1rem 1.25rem }
  h1 { font-size: clamp(3rem,13vw,5.3rem); margin-top: .7rem }
  .hero-copy { font-size: .98rem }
  .frequency .wrap { font-size: .65rem; letter-spacing: .025em }
  .frequency .wrap span:nth-child(3), .frequency .wrap span:nth-child(4) { display: none }
  .section { padding-top: 3.25rem }
  .section-heading { gap: .35rem }
  .section-heading h2 { font-size: clamp(2.1rem,8vw,3rem) }
  .text-link { font-size: .75rem }
  .road li { grid-template-columns: 1fr auto; gap: .45rem; padding: .85rem .92rem }
  .road .tag { justify-self: end }
  .road h3, .road li>p:last-child { grid-column: 1 / -1 }
  .game-controls p { font-size: .79rem }
  .record { font-size: .74rem }
  .foot p { display: none }
}
@media (max-width: 350px) {
  .social a { width: 1.62rem }
  .hero-actions .button { padding-inline: .64rem; font-size: .83rem }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
}
