/* ===== Tokens ===== */
:root {
    --ink: #1A1446;
    --ink-soft: #4A4373;
    --paper: #F1ECFB;
    --square: #DDD3F7;
    --crown: #F5B700;
    --white: #FFFFFF;
    --line: rgba(26, 20, 70, .14);

    --display: 'Anybody', system-ui, sans-serif;
    --body: 'Atkinson Hyperlegible', system-ui, sans-serif;

    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1.0625rem/1.6 var(--body);
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.05; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--crown); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 22px;
    font: 700 1rem/1 var(--body);
    text-decoration: none;
    border: 2px solid var(--ink);
    border-radius: 999px;
    transition: background .15s, color .15s;
}
.btn-solid { background: var(--ink); color: var(--white); }
.btn-solid:hover { background: var(--crown); color: var(--ink); border-color: var(--crown); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--white); }

/* ===== Nav ===== */
.navbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--paper);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.navbar.scrolled { border-bottom-color: var(--line); }
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { width: 38px; height: 38px; }
.logo-text {
    font: 800 1.2rem/1 var(--display);
    font-stretch: 125%;
    letter-spacing: -.01em;
}
.logo-text span { color: var(--ink-soft); font-weight: 600; }

.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-menu a { text-decoration: none; font-weight: 700; font-size: .975rem; }
.nav-menu a:not(.nav-cta):hover,
.nav-menu a.active { text-decoration: underline; text-decoration-color: var(--crown); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.nav-cta { padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--white); }
.nav-cta:hover { background: var(--crown); color: var(--ink); }

.hamburger { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.hamburger span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--ink); transition: transform .2s, opacity .2s; }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(64px, 9vw, 120px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 80px); align-items: center; }

.hero h1 {
    font-size: clamp(2.75rem, 7vw, 5.6rem);
    font-weight: 900;
    font-stretch: 140%;
    letter-spacing: -.03em;
    line-height: .95;
}
.hero h1 .narrow { display: block; font-stretch: 60%; font-weight: 300; letter-spacing: -.01em; }
.hero-lead { margin-top: 28px; max-width: 34em; font-size: 1.175rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 32px; font-weight: 700; font-size: .95rem; }
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 10px; height: 10px; background: var(--crown); transform: rotate(45deg); }

/* Board */
.board-wrap { width: 100%; max-width: 480px; justify-self: end; }
.board {
    display: grid; grid-template-columns: repeat(4, 1fr);
    aspect-ratio: 1;
    border: 3px solid var(--ink);
    border-radius: 6px;
    overflow: hidden;
}
.sq { position: relative; background: var(--white); }
.sq:nth-child(8n+2), .sq:nth-child(8n+4),
.sq:nth-child(8n+5), .sq:nth-child(8n+7) { background: var(--square); }

.piece {
    position: absolute; inset: 14%;
    display: grid; place-items: center;
    border: 0; border-radius: 50%;
    background: var(--ink); color: var(--white);
    cursor: pointer;
    transition: transform .2s, background .2s, color .2s;
}
.piece svg { width: 46%; height: 46%; }
.piece:hover { transform: scale(1.06); }
.piece[aria-pressed="true"] { background: var(--crown); color: var(--ink); box-shadow: 0 0 0 4px var(--ink); }

.move {
    margin-top: 18px;
    background: var(--ink); color: var(--white);
    border-radius: 6px;
    padding: 22px 24px 20px;
}
.move-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.move-head b { font: 800 1.15rem/1 var(--display); font-stretch: 125%; }
.move-status { font-size: .875rem; color: rgba(255,255,255,.65); }
.move-status.done { color: var(--crown); font-weight: 700; }
.move-prompt { margin-top: 12px; min-height: 3.2em; font-size: 1.05rem; color: rgba(255,255,255,.88); }
.move-prompt::before { content: "“"; color: var(--crown); font-weight: 700; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--crown); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.move-lines { margin-top: 14px; border-top: 1px solid rgba(255,255,255,.18); }
.move-lines li {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
    font-size: .95rem;
    opacity: 0; transform: translateX(-6px);
    transition: opacity .25s, transform .25s;
}
.move-lines li.in { opacity: 1; transform: none; }
.move-lines span { color: rgba(255,255,255,.6); }
.move-lines b { text-align: right; }
.board-note { margin-top: 10px; font-size: .875rem; color: var(--ink-soft); }

/* ===== Sections ===== */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.sec-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.sec-head h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 800; font-stretch: 120%; letter-spacing: -.02em; }
.sec-head p { margin-top: 18px; font-size: 1.125rem; color: var(--ink-soft); max-width: 40em; }

/* Apps: ruled rows on ink */
.apps { background: var(--ink); color: var(--white); }
.apps .sec-head p { color: rgba(255,255,255,.72); }
.app-row {
    display: grid; grid-template-columns: 72px 1.1fr 1.4fr auto;
    gap: 28px; align-items: start;
    padding: 34px 0;
    border-top: 1px solid rgba(255,255,255,.18);
}
.app-row:last-of-type { border-bottom: 1px solid rgba(255,255,255,.18); }
.app-ic {
    width: 72px; height: 72px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--crown); color: var(--ink);
}
.app-ic svg { width: 32px; height: 32px; }
.app-row h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 900; font-stretch: 130%; letter-spacing: -.02em; }
.app-kind { margin-top: 8px; color: rgba(255,255,255,.6); }
.app-row p { color: rgba(255,255,255,.86); max-width: 36em; }
.app-ai { margin-top: 12px; padding-left: 14px; border-left: 3px solid var(--crown); color: var(--white); font-weight: 700; }
.store-row { display: flex; flex-direction: column; gap: 8px; }
.store {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px;
    border: 1.5px solid rgba(255,255,255,.4); border-radius: 999px;
    font-size: .9rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.store svg { width: 16px; height: 16px; }
.store:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.soon { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 44px; }
.soon h3 { font-size: 1.4rem; font-stretch: 120%; }
.soon p { margin-top: 6px; color: rgba(255,255,255,.72); }
.soon .btn-line { color: var(--white); border-color: var(--white); }
.soon .btn-line:hover { background: var(--white); color: var(--ink); }

/* AI points */
.ai-points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 3px solid var(--ink); }
.ai-points li { display: flex; gap: 20px; padding: 32px 32px 32px 0; border-bottom: 1px solid var(--line); }
.ai-points li:nth-child(odd) { border-right: 1px solid var(--line); }
.ai-points li:nth-child(even) { padding-left: 32px; }
.pt-ic { flex: none; width: 48px; height: 48px; display: grid; place-items: center; background: var(--square); border-radius: 6px; }
.pt-ic svg { width: 24px; height: 24px; }
.ai-points h3 { font-size: 1.3rem; font-stretch: 115%; font-weight: 800; }
.ai-points p { margin-top: 8px; color: var(--ink-soft); }

/* Studio */
.studio { padding-top: 0; }
.studio-wrap { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: end; }
.big { font: 300 clamp(1.7rem, 3.4vw, 2.6rem)/1.2 var(--display); font-stretch: 85%; letter-spacing: -.01em; }
.big strong { font-weight: 800; font-stretch: 120%; }
.studio-side li { padding: 16px 0; border-top: 1px solid var(--line); }
.studio-side b { font: 800 1.2rem/1.2 var(--display); font-stretch: 120%; }
.studio-side p { margin-top: 4px; color: var(--ink-soft); }

/* Principles */
.principles-sec { padding-top: 0; }
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.principle { padding-top: 20px; border-top: 3px solid var(--crown); }
.principle h3 { font-size: 1.2rem; font-stretch: 115%; font-weight: 800; }
.principle p { margin-top: 8px; color: var(--ink-soft); }

/* Contact */
.contact { padding-top: 0; }
.contact-panel {
    display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end;
    padding: clamp(32px, 6vw, 64px);
    background: var(--crown); color: var(--ink);
    border-radius: 6px;
}
.contact-panel h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 900; font-stretch: 125%; letter-spacing: -.02em; }
.contact-panel p { margin-top: 14px; max-width: 34em; font-size: 1.1rem; }
.contact-mail {
    display: inline-block; margin-top: 24px;
    font: 800 clamp(1.1rem, 2.6vw, 1.75rem)/1.2 var(--display);
    font-stretch: 110%;
    word-break: break-all;
    text-decoration-thickness: 3px; text-underline-offset: 6px;
}

/* ===== Footer ===== */
.footer { background: var(--ink); color: rgba(255,255,255,.75); padding: 64px 0 28px; }
.footer .logo-text { color: var(--white); }
.footer .logo-text span { color: rgba(255,255,255,.6); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; }
.footer-brand p { margin-top: 14px; max-width: 26em; }
.footer-cols { display: flex; gap: clamp(32px, 6vw, 72px); }
.footer-col h4 { margin: 0 0 12px; color: var(--white); font: 700 1rem/1 var(--body); }
.footer-col li { margin: 8px 0; }
.footer-col a, .footer-bottom a { text-decoration: none; }
.footer-col a:hover, .footer-bottom a:hover { color: var(--crown); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.15); font-size: .9rem; }

.scroll-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 40;
    width: 46px; height: 46px; display: grid; place-items: center;
    border: 2px solid var(--ink); border-radius: 50%;
    background: var(--crown); color: var(--ink); cursor: pointer;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }

/* ===== Legal pages ===== */
.legal-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(32px, 5vw, 56px); border-bottom: 3px solid var(--ink); }
.legal-hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 900; font-stretch: 135%; letter-spacing: -.03em; }
.legal-hero p { margin-top: 14px; color: var(--ink-soft); }
.legal { display: grid; grid-template-columns: 240px 1fr; gap: clamp(32px, 6vw, 72px); padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(72px, 9vw, 112px); }
.toc { position: sticky; top: 96px; align-self: start; }
.toc h2 { font: 700 1rem/1 var(--body); margin-bottom: 12px; }
.toc a { display: block; padding: 6px 0 6px 12px; border-left: 2px solid var(--line); text-decoration: none; color: var(--ink-soft); font-size: .95rem; }
.toc a:hover { color: var(--ink); border-left-color: var(--crown); }
.legal-body { max-width: 720px; }
.legal-body section + section { margin-top: 44px; }
.legal-body h2 { font-size: 1.6rem; font-weight: 800; font-stretch: 120%; margin-bottom: 14px; }
.legal-body p, .legal-body li { color: var(--ink-soft); }
.legal-body p + p, .legal-body p + ul, .legal-body ul + p { margin-top: 14px; }
.legal-body ul { padding-left: 4px; }
.legal-body li { position: relative; padding-left: 22px; margin: 6px 0; }
.legal-body li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 8px; height: 8px; background: var(--crown); transform: rotate(45deg); }
.legal-body a { color: var(--ink); font-weight: 700; text-decoration-color: var(--crown); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.contact-list { margin-top: 16px; padding: 20px 24px; background: var(--white); border-left: 4px solid var(--crown); }
.contact-list div { display: flex; gap: 16px; padding: 4px 0; }
.contact-list dt { width: 90px; font-weight: 700; color: var(--ink); }
.contact-list dd { margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; }
    .board-wrap { justify-self: start; }
    .app-row { grid-template-columns: 72px 1fr; }
    .app-row > p, .app-row .app-text, .store-row { grid-column: 2; }
    .store-row { flex-direction: row; flex-wrap: wrap; }
    .studio-wrap { grid-template-columns: 1fr; }
    .principles { grid-template-columns: repeat(2, 1fr); }
    .legal { grid-template-columns: 1fr; }
    .toc { position: static; }
}

@media (max-width: 760px) {
    .hamburger { display: block; }
    .nav-menu {
        position: absolute; top: 72px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 8px var(--gutter) 20px;
        background: var(--paper); border-bottom: 1px solid var(--line);
        display: none;
    }
    .nav-menu.active { display: flex; }
    .nav-menu li a { display: block; padding: 12px 0; }
    .nav-cta { text-align: center; margin-top: 8px; }
    .ai-points { grid-template-columns: 1fr; }
    .ai-points li, .ai-points li:nth-child(even) { padding: 28px 0; border-right: 0; }
    .contact-panel { grid-template-columns: 1fr; }
    .footer-cols { flex-wrap: wrap; }
}

@media (max-width: 520px) {
    .app-row { grid-template-columns: 1fr; gap: 16px; }
    .app-row > p, .app-row .app-text, .store-row { grid-column: 1; }
    .app-ic { width: 56px; height: 56px; }
    .principles { grid-template-columns: 1fr; }
    .move { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .caret { animation: none; }
    .move-lines li, .piece { transition: none; }
}
