:root {
  --paper: #f2f0ea; --ink: #171714; --muted: #716f68; --line: #cfcdc6;
  --panel: #e8e6df; --white: #faf9f5; --red: #d9523e; --blue: #4667ad;
  --green: #4c785d; --orange: #d78439; --violet: #67568e;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
a { color: inherit; }
.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark, .quiet-link { text-decoration: none; }
.wordmark { font-family: var(--mono); font-size: 13px; letter-spacing: -.02em; }
.wordmark span { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; background: var(--ink); color: var(--paper); }
.quiet-link { color: var(--muted); font-size: 13px; }
.quiet-link:hover, .text-link:hover { color: var(--ink); }
.intro { padding: 110px 0 125px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; align-items: end; }
.eyebrow { margin: 0 0 18px; color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.intro .eyebrow { grid-column: 1 / -1; }
.intro h1 { margin: 0; font-size: clamp(54px, 8vw, 108px); line-height: .91; letter-spacing: -.075em; font-weight: 550; }
.lede { max-width: 460px; margin: 0 0 7px auto; color: #4e4c47; font-size: clamp(17px, 2vw, 22px); line-height: 1.55; letter-spacing: -.02em; }
.collection-heading { padding: 18px 0; display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--ink); }
.collection-heading h2 { margin: 0; font-size: 14px; font-weight: 600; }
.collection-heading p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.project-card { position: relative; min-width: 0; padding: 18px 18px 24px; color: inherit; text-decoration: none; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color .16s ease; }
.project-card:hover { background: var(--white); }
.project-preview { aspect-ratio: 5 / 3; margin-bottom: 18px; overflow: hidden; background: #dedcd5; }
.project-preview canvas { display: block; width: 100%; height: 100%; }
.project-meta { display: flex; justify-content: space-between; color: var(--muted); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.project-card h3 { margin: 23px 0 9px; font-size: 21px; letter-spacing: -.035em; font-weight: 560; }
.project-card > p { min-height: 66px; margin: 0 42px 24px 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.open-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.open-label i { display: inline-block; margin-left: 3px; font-style: normal; transition: transform .16s ease; }
.project-card:hover .open-label i { transform: translate(2px, -2px); }
.site-footer { min-height: 84px; display: flex; justify-content: flex-end; align-items: center; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.site-footer a { text-decoration: none; }
.game-layout { padding-bottom: 80px; }
.game-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; padding: 74px 0 52px; }
.game-heading h1 { margin: 0; font-size: clamp(48px, 7vw, 86px); line-height: .95; font-weight: 550; letter-spacing: -.065em; }
.game-heading > p { max-width: 500px; margin: 0 0 3px auto; color: var(--muted); font-size: 17px; }
.game-stage { border: 1px solid #aaa79f; background: var(--white); box-shadow: 0 22px 50px rgba(20, 19, 16, .08); }
.stage-bar { height: 42px; padding: 0 14px; display: flex; justify-content: space-between; align-items: center; background: var(--panel); border-bottom: 1px solid #aaa79f; color: #625f58; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.stage-title::before { content: "●"; margin-right: 8px; color: #908d85; }
.game-root { position: relative; min-height: 620px; display: grid; place-items: center; padding: 28px; overflow: hidden; background: #f8f7f3; }
.game-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 42px; padding: 38px 0 58px; border-bottom: 1px solid var(--line); }
.game-notes p:last-child { max-width: 330px; margin: 0; color: #4e4c47; font-size: 13px; line-height: 1.65; }
.text-link { text-underline-offset: 4px; }
.next-projects { display: flex; justify-content: space-between; padding-top: 24px; }
.next-projects a, .next-projects button { color: var(--muted); font-family: var(--mono); font-size: 11px; text-decoration: none; text-transform: uppercase; }
button, select, .game-button { min-height: 38px; padding: 0 14px; border: 1px solid #aaa79f; border-radius: 0; background: var(--white); color: var(--ink); cursor: pointer; }
button:hover, .game-button:hover { background: var(--ink); color: var(--white); }
button:disabled { opacity: .4; cursor: default; }
button:disabled:hover { background: var(--white); color: var(--ink); }
.primary-button { background: var(--ink); color: var(--white); }
.primary-button:hover { background: #373630; }
.game-toolbar { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.game-stack { width: min(100%, 760px); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.game-caption { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.canvas-wrap { position: relative; width: min(100%, 680px); }
.game-canvas { display: block; width: 100%; height: auto; background: #181815; image-rendering: pixelated; touch-action: none; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 18, 16, .84); color: white; text-align: center; }
.game-overlay[hidden] { display: none; }
.game-overlay h2 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.04em; }
.game-overlay p { margin: 0 0 20px; color: #c7c5bd; }
.overlay-card { padding: 28px; }
.touch-controls { display: flex; justify-content: center; gap: 8px; }
.touch-controls button { width: 54px; font-size: 18px; }
.connect-board { width: min(100%, 650px); display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 18px; background: #2d5392; }
.connect-cell { aspect-ratio: 1; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #f2f0ea; box-shadow: inset 0 2px 5px rgba(0,0,0,.28); }
.connect-cell:hover { background: #faf9f5; outline: 3px solid rgba(255,255,255,.45); }
.connect-cell.red { background: #ce4c3f; }
.connect-cell.yellow { background: #e5b94f; }
.connect-cell.win { animation: win-pulse .7s ease-in-out infinite alternate; }
@keyframes win-pulse { to { transform: scale(.84); } }
.hangman-layout { width: min(100%, 820px); display: grid; grid-template-columns: 300px 1fr; gap: 44px; align-items: center; }
.hangman-svg { width: 100%; overflow: visible; }
.hangman-part { opacity: 0; }
.hangman-part.visible { opacity: 1; }
.word-display { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 36px; }
.letter-slot { width: 29px; height: 42px; display: grid; place-items: center; border-bottom: 2px solid var(--ink); font: 600 23px var(--mono); text-transform: uppercase; }
.letter-slot.space { border: 0; width: 15px; }
.keyboard { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; }
.keyboard button { min-width: 0; padding: 0; text-transform: uppercase; }
.secret-form { width: min(100%, 450px); display: flex; flex-direction: column; gap: 12px; text-align: left; }
.secret-form h2 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.secret-form p { margin: 0 0 10px; color: var(--muted); }
.secret-form label { font: 11px var(--mono); text-transform: uppercase; }
.secret-form input { height: 48px; padding: 0 13px; border: 1px solid #aaa79f; background: white; }
.ttt-board { width: min(78vw, 430px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--ink); }
.ttt-cell { aspect-ratio: 1; min-height: 0; border: 0; display: grid; place-items: center; background: #f8f7f3; font: 400 clamp(42px, 8vw, 78px) var(--sans); }
.ttt-cell:hover { background: #eceae3; color: var(--ink); }
.ttt-cell.win { background: #dcd8cc; }
.cube-workbench { width: min(100%, 760px); display: flex; flex-direction: column; align-items: center; gap: 28px; }
.cube-view { width: min(100%, 720px); background: #171714; }
.cube-canvas { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; }
.cube-canvas:active { cursor: grabbing; }
.drag-hint { position: absolute; right: 12px; bottom: 9px; color: #99978e; font: 9px var(--mono); text-transform: uppercase; pointer-events: none; }
.cube-net { display: grid; grid-template-columns: repeat(12, minmax(18px, 42px)); grid-template-rows: repeat(9, minmax(18px, 42px)); gap: 3px; }
.sticker { border: 1px solid rgba(0,0,0,.24); transition: background-color .12s ease, transform .12s ease; }
.cube-moves { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cube-moves button { min-width: 43px; padding: 0 9px; font-family: var(--mono); }
.move-log { min-height: 18px; max-width: 600px; margin: 0; color: var(--muted); font: 11px/1.6 var(--mono); text-align: center; }
.lab-shell { width: min(100%, 920px); display: flex; flex-direction: column; gap: 18px; }
.lab-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lab-toolbar .spacer { flex: 1; }
.lab-stat { color: var(--muted); font: 10px var(--mono); text-transform: uppercase; }
.lab-canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #eeece5; touch-action: none; }
@media (max-width: 800px) {
  .wrap { width: min(100% - 28px, 680px); }
  .intro { padding: 78px 0 86px; grid-template-columns: 1fr; gap: 38px; }
  .intro h1 { font-size: clamp(54px, 16vw, 82px); }
  .lede { margin-left: 0; }
  .project-grid { grid-template-columns: 1fr 1fr; }
  .game-heading { grid-template-columns: 1fr; gap: 24px; }
  .game-heading > p { margin-left: 0; }
  .game-root { min-height: 560px; padding: 18px; }
  .game-notes { grid-template-columns: 1fr; gap: 27px; }
  .hangman-layout { grid-template-columns: 220px 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .site-header { height: 70px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card > p { min-height: 0; }
  .game-heading { padding: 55px 0 36px; }
  .game-root { min-height: 500px; padding: 12px; }
  .hangman-layout { grid-template-columns: 1fr; }
  .hangman-svg { width: 180px; margin: auto; }
  .keyboard { grid-template-columns: repeat(7, 1fr); }
  .cube-net { gap: 2px; }
  .lab-toolbar select { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
