:root {
  --canvas: #f4f0e8;
  --surface: #fffdf8;
  --surface-soft: #e7ede5;
  --ink: #26332d;
  --muted: #68736d;
  --sage: #718674;
  --sage-dark: #506555;
  --peach: #d98a69;
  --peach-soft: #f0d6c8;
  --line: #d6d8d0;
  --danger: #bd554c;
  --shadow: 0 18px 50px rgba(43, 56, 48, .1);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: hidden; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 18px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
button { font: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.shell { width: min(calc(100% - 48px), var(--max)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.site-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 0 max(24px, calc((100vw - var(--max)) / 2)); background: rgba(244, 240, 232, .9); border-bottom: 1px solid rgba(80, 101, 85, .16); backdrop-filter: blur(16px); }
.wordmark { padding: 0; color: var(--ink); background: none; border: 0; font-size: .9rem; font-weight: 750; letter-spacing: .08em; cursor: pointer; }
.wordmark span { color: var(--peach); }
.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav button { padding: 8px 0; color: var(--muted); background: none; border: 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: color .2s ease; }
.site-header nav button:hover { color: var(--sage-dark); }
.menu-button { display: none; color: var(--ink); background: none; border: 0; }

.label { margin: 0 0 18px; color: var(--peach); font-size: .7rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.045em; }
h2 { margin: 0; font-size: clamp(2.7rem, 5vw, 4.8rem); line-height: 1.02; }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: clamp(50px, 8vw, 105px); align-items: center; min-height: calc(100svh - 72px); padding-block: 90px; }
.hero-wedge { position: absolute; z-index: -1; top: 10%; right: -18%; width: 58%; height: 78%; background: linear-gradient(145deg, #dfe9de, #ebddd1); border-radius: 48% 52% 56% 44% / 44% 42% 58% 56%; opacity: .8; }
.hero h1 { max-width: 720px; margin: 0; font-size: clamp(3.6rem, 7vw, 6.8rem); line-height: .95; }
.hero-copy > p:not(.label) { max-width: 620px; margin: 30px 0; color: var(--muted); font-size: 1.2rem; }
.yellow-button, .black-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; padding: 13px 18px; color: #fff; background: var(--sage-dark); border: 0; border-radius: 999px; font-size: .84rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; cursor: pointer; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.yellow-button:hover, .black-button:hover { background: var(--sage); box-shadow: 0 8px 22px rgba(80, 101, 85, .22); transform: translateY(-2px); }
.app-preview { width: min(100%, 310px); margin: 0 auto; }
.app-preview img { width: 100%; height: auto; max-height: 450px; object-fit: contain; border-radius: 22px; clip-path: inset(0 round 22px); overflow: hidden; }
.app-preview figcaption, .climbing-images figcaption, .gallery figcaption { margin-top: 12px; color: var(--muted); font-size: 1rem; line-height: 1.5; text-align: center; }

.climbing { padding-block: 120px 145px; background: var(--surface-soft); box-shadow: 0 0 0 100vmax var(--surface-soft); clip-path: inset(0 -100vmax); }
.section-heading { display: block; }
.section-heading h2 { max-width: 760px; }
.climbing-images { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; width: min(100%, 640px); margin: 55px auto 0; }
.climbing-images figure { display: flex; height: auto; margin: 0; flex-direction: column; align-items: center; background: transparent; border: 0; box-shadow: none; }
.climbing-images figure:last-child { width: min(100%, 280px); height: auto; margin-top: 0; justify-self: center; }
.climbing-images img { width: auto; max-width: 100%; height: auto; max-height: 390px; object-fit: contain; border-radius: 22px; clip-path: inset(0 round 22px); overflow: hidden; }
.climbing-images .bouldering-photo { width: min(100%, 250px); justify-self: center; overflow: hidden; }
.climbing-images .bouldering-photo img { margin-top: -8%; clip-path: inset(8% 0 0 0 round 22px); }

.game-section { padding-block: 115px 125px; background: var(--surface-soft); border-block: 1px solid rgba(80, 101, 85, .13); }
.puzzle-intro { display: grid; grid-template-columns: .78fr 1.22fr; gap: clamp(40px, 7vw, 90px); align-items: start; padding-bottom: 75px; }
.puzzle-intro > .label { grid-column: 1; }
.puzzle-intro > h2 { grid-column: 1; margin-top: 0; }
.puzzle-story { grid-column: 2; grid-row: 1 / span 2; max-width: 610px; color: var(--muted); }
.puzzle-story p { margin: 0 0 17px; }
.puzzle-story strong { color: var(--sage-dark); font-size: 1rem; letter-spacing: .02em; }

.compact-game { width: min(calc(100% - 32px), 650px); height: 560px; min-height: 0; padding: 14px 0 20px; background: transparent; border: 0; box-shadow: none; }
.game-controls { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.game-controls button { min-width: 112px; padding: 11px 17px; color: var(--sage-dark); background: transparent; border: 1px solid #aab7aa; border-radius: 999px; font-size: .82rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: .2s ease; }
.game-controls button:hover { color: #fff; background: var(--sage); border-color: var(--sage); }
.game-controls button:disabled { color: #9da59f; background: transparent; border-color: #d2d7d1; cursor: not-allowed; }
.compact-board { display: grid; grid-template-columns: minmax(175px, 220px) minmax(175px, 220px); gap: clamp(36px, 7vw, 62px); align-items: start; justify-content: center; }
.market-stack, .possession-stack { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 24px; }
.emoji-unit, .owned-unit { width: 100%; text-align: center; }
.emoji-button, .owned-emoji, .cash-token { position: relative; display: inline-grid; padding: 0; place-items: center; color: var(--ink); background: transparent; border: 0; cursor: pointer; transition: transform .2s ease, filter .2s ease; }
.emoji-button:hover, .owned-emoji:hover, .cash-token:hover { filter: drop-shadow(0 10px 12px rgba(56, 72, 62, .14)); transform: scale(1.07); }
.emoji-button:active, .owned-emoji:active, .cash-token:active { transform: scale(.97); }
.emoji-button > span, .owned-emoji > span { display: block; font-size: clamp(4.8rem, 9vh, 6rem); line-height: 1; }
.emoji-button > b, .owned-emoji > b { position: absolute; right: 3px; bottom: 0; padding: 4px 9px; color: #fff; background: var(--sage-dark); border: 3px solid var(--surface-soft); border-radius: 999px; font-size: .7rem; box-shadow: 0 4px 10px rgba(43, 56, 48, .14); }
.emoji-unit.unavailable .emoji-button { visibility: hidden; pointer-events: none; }
.emoji-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; width: 100%; overflow: hidden; max-height: 0; padding-top: 0; visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(-4px); transition: max-height .2s ease, padding .2s ease, opacity .16s ease, transform .16s ease, visibility 0s linear .2s; }
.emoji-unit.open .emoji-actions, .owned-unit.open .emoji-actions { max-height: 76px; padding-top: 12px; visibility: visible; opacity: 1; pointer-events: auto; transform: none; transition-delay: 0s; }
.emoji-unit[data-market-entity="bank"] .emoji-actions { grid-template-columns: minmax(120px, 165px); justify-content: center; }
.inline-action { position: relative; min-height: 42px; padding: 8px; color: #fff; background: var(--sage-dark); border: 0; border-radius: 999px; font-size: .78rem; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.inline-action.secondary { color: var(--sage-dark); background: transparent; border: 1px solid #9dac9e; }
.inline-action:hover { transform: translateY(-1px); }
.inline-action.unaffordable:hover, .inline-action.unaffordable.denied { color: transparent; background: var(--danger); }
.inline-action.unaffordable:hover::after, .inline-action.unaffordable.denied::after { content: attr(data-error); position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }

.possession-stack { position: relative; padding-top: 8px; }
.animation-target { position: absolute; top: 82px; left: 50%; width: 2px; height: 2px; pointer-events: none; }
.have-list { width: 100%; text-align: left; }
.have-list.has-holdings > p { display: none; }
.have-list h4, .owe-list h4 { margin: 0 0 10px; color: var(--sage-dark); font-size: .84rem; letter-spacing: .09em; text-transform: uppercase; }
.have-list p, .owe-list #debt-list p { margin: 4px 0; color: #87918a; font-family: Georgia, "Times New Roman", serif; font-size: 1.75rem; }
.cash-emojis { display: flex; min-height: 78px; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0; }
.cash-token { margin: -4px; font-size: clamp(2.4rem, 5.5vh, 3.2rem); line-height: 1; }
.cash-owned .emoji-actions { min-height: 0; }
.owned-items { display: flex; width: 100%; flex-direction: row; align-items: flex-start; justify-content: center; gap: 10px; }
.owned-items .owned-unit { width: min(calc(50% - 8px), 142px); }
.owned-items .owned-unit .emoji-actions { grid-template-columns: 1fr; width: min(100%, 132px); min-height: 0; margin-inline: auto; }
.owned-items .owned-unit.open .emoji-actions { max-height: 104px; padding-top: 12px; }
.cash-owned .emoji-actions { grid-template-columns: minmax(120px, 165px); justify-content: center; }
.owned-emoji > span { font-size: clamp(4.8rem, 9vh, 6rem); }
.owe-list { width: 100%; margin-top: 8px; padding-top: 18px; border-top: 1px solid rgba(80, 101, 85, .2); }
.owe-list #debt-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.owe-list #debt-list > p { grid-column: 1 / -1; }
.owe-list .debt-token { display: inline-grid; padding: 2px; place-items: center; background: transparent; border: 0; border-radius: 0; }
.owe-list .debt-token span { font-size: 1.75rem; line-height: 1; }
.game-result { margin: 28px auto 0; color: var(--sage-dark); font-size: 1rem; font-weight: 750; letter-spacing: .05em; text-align: center; text-transform: uppercase; }

.project { padding-block: 135px 155px; }
.project-copy { width: min(100%, 790px); margin-inline: auto; padding: clamp(30px, 5vw, 58px); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.project-copy > p:not(.label) { color: var(--muted); }
.trading-stories { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 38px; }
.trade-story { padding: 22px; background: var(--canvas); border-radius: 18px; }
.trade-story h3 { margin: 2px 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 500; }
.trade-story p { margin: 0 0 14px; color: var(--muted); font-size: 1.03rem; }
.trade-story p:last-child { margin-bottom: 0; }
.trade-story .trade-label { color: var(--sage-dark); font-size: .82rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.failure-story .trade-label { color: var(--danger); }
.article-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--sage-dark); font-size: .92rem; font-weight: 750; text-decoration: none; }
.article-link:hover { color: var(--peach); text-decoration: underline; text-underline-offset: 4px; }

.outside { padding-block: 120px 145px; border-top: 1px solid var(--line); }
.outside-heading { display: block; margin-bottom: 48px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery figure { display: flex; height: auto; margin: 0; padding: 0; flex-direction: column; align-items: center; background: transparent; border: 0; box-shadow: none; }
.gallery img { width: auto; max-width: 100%; height: auto; max-height: 210px; object-fit: contain; border-radius: 22px; clip-path: inset(0 round 22px); overflow: hidden; transition: transform .25s ease; }
.gallery figure:hover img { transform: scale(1.015); }
.gallery figcaption { width: 100%; }
.gallery figcaption h3 { margin: 0 0 6px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; font-weight: 500; }
.gallery figcaption p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }

footer { display: flex; justify-content: space-between; gap: 25px; padding-block: 38px 50px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; }
footer p { margin: 0; }
.reveal { opacity: 1; transform: none; animation: gentle-in .6s ease both; }
.reveal.visible { opacity: 1; transform: none; }
@keyframes gentle-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.flying-token { position: fixed; z-index: 500; display: grid; width: 58px; height: 58px; place-items: center; pointer-events: none; font-size: 3rem; filter: drop-shadow(0 8px 8px rgba(43, 56, 48, .18)); }

@media (max-width: 820px) {
  .site-header nav { gap: 16px; }
  .section-heading, .outside-heading { grid-template-columns: 1fr; gap: 4px; }
  .puzzle-intro { grid-template-columns: 1fr; gap: 0; }
  .puzzle-intro > .label, .puzzle-intro > h2, .puzzle-story { grid-column: 1; grid-row: auto; }
  .puzzle-intro > h2 { margin: 0 0 28px; }
}

@media (max-width: 680px) {
  .shell { width: min(calc(100% - 30px), var(--max)); }
  .site-header { padding-inline: 16px; }
  .menu-button { display: grid; gap: 6px; padding: 8px; cursor: pointer; }
  .menu-button > span:not(.sr-only) { width: 23px; height: 2px; background: currentColor; }
  .site-header nav { position: absolute; top: 72px; right: 14px; left: 14px; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
  .site-header nav.open { display: flex; }
  .site-header nav button { padding: 12px; text-align: left; }
  .hero { display: flex; min-height: auto; padding-block: 75px 100px; flex-direction: column; align-items: stretch; }
  .hero-wedge { top: 42%; right: -45%; width: 135%; height: 58%; }
  .hero h1 { font-size: clamp(3.1rem, 14vw, 5rem); }
  .app-preview { width: min(78vw, 320px); }
  .app-preview img { max-height: 430px; }
  .climbing { padding-block: 95px 110px; }
  .climbing-images { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 35px; }
  .climbing-images figure, .climbing-images figure:last-child { width: 100%; height: auto; margin-top: 0; padding: 0; }
  .climbing-images .bouldering-photo { width: 78%; justify-self: end; }
  .climbing-images img { max-height: 300px; }
  .puzzle-intro { padding-bottom: 50px; }
  .compact-game { width: min(calc(100% - 20px), 620px); height: 540px; min-height: 0; padding: 12px 0 18px; }
  .compact-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(18px, 6vw, 34px); }
  .market-stack, .possession-stack { gap: 20px; }
  .emoji-button > span, .owned-emoji > span { font-size: clamp(4.3rem, 17vw, 5.6rem); }
  .cash-token { font-size: 3rem; }
  .project { padding-block: 100px 115px; }
  .trading-stories { grid-template-columns: 1fr; }
  .outside { padding-block: 95px 110px; }
  .gallery { display: flex; flex-direction: column; }
  .gallery figure { height: auto; }
  .gallery img { width: auto; height: auto; max-height: 210px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
