:root {
  color-scheme: light;
  --paper: #f5f4ed;
  --ink: #22231f;
  --muted: #5b5b52;
  --line: #d0cfc4;
  --accent: #b44023;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.shell { width: min(1120px, calc(100% - 88px)); margin-inline: auto; }
.skip { position: absolute; left: 16px; top: -100px; padding: 10px; background: var(--paper); z-index: 10; }
.skip:focus { top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.brand { display: inline-flex; align-items: center; font-weight: 800; letter-spacing: -.06em; font-size: 21px; }
.brand i { width: 9px; height: 9px; margin-right: 11px; background: var(--accent); box-shadow: 3px -3px 0 #b4402340; }
.brand:hover, .jump-link:hover, .site-footer a:hover { color: var(--accent); }

.jump-link { font-weight: 700; font-size: 13px; flex-shrink: 0; }
.jump-link span { color: var(--accent); margin-left: 5px; }

.portfolio-page { scroll-snap-type: y mandatory; scroll-padding-top: 0; }

.game {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(140px, 1fr) auto;
}
.game-header, .game-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-inline: max(22px, (100% - 1120px) / 2); }
.game-header { min-height: 55px; background: #eae8df; }
.scores { display: flex; gap: clamp(12px, 3vw, 35px); font-size: 12px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.scores b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 3px; }
.game-stage {
  position: relative;
  background-color: #efeee5;
  background-image: linear-gradient(#22231f09 1px, transparent 1px), linear-gradient(90deg, #22231f09 1px, transparent 1px);
  background-size: 22px 22px;
  overflow: hidden;
  touch-action: manipulation;
}
.game-stage:focus { outline: none; }
.game-stage canvas { display: block; position: absolute; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.game-menu { position: absolute; inset: 0; display: grid; justify-items: center; align-content: center; gap: 11px; padding-bottom: 31px; pointer-events: none; }
.game-menu p { margin: 0; background: #efeee5; padding: 3px 6px; font-size: 14px; font-weight: 700; }
.game-start { display: flex; align-items: center; gap: 11px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 13px 19px; font-size: 13px; font-weight: 700; cursor: pointer; pointer-events: auto; box-shadow: 3px 3px 0 #22231f37; }
.game-start:hover { background: var(--accent); border-color: var(--accent); }
.play-icon { display: inline-block; width: 9px; height: 12px; background: currentColor; clip-path: polygon(0 0, 33% 0, 33% 17%, 66% 17%, 66% 33%, 100% 33%, 100% 67%, 66% 67%, 66% 83%, 33% 83%, 33% 100%, 0 100%); }
.game-footer { min-height: 48px; padding-block: 8px; font-size: 11px; color: var(--muted); }
.game-help { display: flex; flex-wrap: wrap; gap: 5px 20px; align-items: baseline; }
.game-footer .jump-link { color: var(--ink); }
.game-footer .jump-link:hover { color: var(--accent); }
kbd { font: 700 10px var(--mono); color: var(--ink); background: #eae8df; border: 1px solid #c5c3b7; padding: 2px 5px; }
.touch-help { display: none; }

.portfolio-details {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: clamp(24px, 5vw, 64px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding-bottom: 17px; border-bottom: 1px solid var(--ink); }
.section-heading h2 { font-size: clamp(35px, 5vw, 57px); letter-spacing: -.075em; line-height: 1; margin: 0; }
.section-heading span { color: var(--muted); font-size: 12px; }
.project { display: block; max-width: 550px; margin-top: 24px; border: 1px solid var(--line); background: #faf9f3; }
.project:hover { border-color: var(--ink); }
.project-image { display: grid; place-items: center; height: clamp(150px, 19vw, 220px); overflow: hidden; border-bottom: 1px solid var(--line); }
.bubbles { background: #ead4c1; }
.bubbles-art { position: relative; width: 200px; height: 125px; color: #7b3222; }
.bubbles-art i { position: absolute; border: 2px solid; border-radius: 50%; box-shadow: inset 3px 3px 0 #f7ece1; }
.bubbles-art i:nth-child(1) { width: 51px; height: 51px; top: 56px; left: 25px; }
.bubbles-art i:nth-child(2) { width: 77px; height: 77px; top: 31px; left: 88px; }
.bubbles-art i:nth-child(3) { width: 25px; height: 25px; top: 10px; left: 156px; }
.bubbles-art i:nth-child(4) { width: 14px; height: 14px; top: 15px; left: 52px; }
.bird { position: absolute; left: 105px; top: 5px; width: 36px; height: 25px; background: currentColor; clip-path: polygon(28% 22%, 45% 22%, 45% 0, 76% 0, 76% 22%, 100% 22%, 100% 44%, 76% 44%, 76% 80%, 56% 80%, 56% 100%, 28% 100%, 28% 80%, 12% 80%, 12% 60%, 0 60%, 0 36%, 28% 36%); }
.bird::after { position: absolute; content: ""; width: 4px; height: 4px; background: #f7ece1; right: 10px; top: 4px; }
.project-info { display: flex; justify-content: space-between; gap: 10px; padding: clamp(17px, 2.4vw, 28px); }
.project-info h3 { font-size: clamp(24px, 3vw, 35px); letter-spacing: -.06em; margin: 7px 0 8px; }
.project-info p { margin: 0; color: var(--muted); line-height: 1.45; }
.project-info .project-type { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .075em; }
.project-arrow { border: 1px solid var(--line); min-width: 35px; height: 35px; display: grid; place-items: center; }
.project:hover .project-arrow { color: var(--paper); background: var(--ink); border-color: var(--ink); }

.contact { background: var(--ink); color: var(--paper); margin-top: clamp(65px, 9.5vw, 119px); padding: clamp(19px, 3.8vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.contact h2 { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #f3a38a; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 20px; }
.contact-links a { font: 700 clamp(12px, 1.65vw, 17px) var(--mono); border-bottom: 1px solid #b8b7ac; padding-bottom: 6px; }
.contact-links a span { color: #f3a38a; }
.contact-links a:hover { color: #f3a38a; }
.contact-links a:focus-visible { outline-color: #f3a38a; }
.site-footer { min-height: 88px; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); }

@media (max-width: 720px) {
  .shell { width: calc(100% - 38px); }
  .game-header, .game-footer { padding-inline: 12px; gap: 9px; }
  .contact { align-items: start; flex-direction: column; }
  .contact-links { justify-content: flex-start; }
  .site-footer { min-height: 70px; }
}

@media (max-width: 380px) {
  .brand { font-size: 17px; }
  .scores { font-size: 10px; }
  .scores b { margin-left: 0; }
  .game-footer { font-size: 10px; }
  .game-footer .jump-link { font-size: 11px; }
}

@media (pointer: coarse) {
  .desktop-help { display: none; }
  .touch-help { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.policy { padding-block: clamp(35px, 7vw, 96px) 72px; }
.policy-heading { padding-bottom: clamp(25px, 4vw, 42px); border-bottom: 1px solid var(--ink); }
.policy-heading h1 { margin: 0 0 20px; font-size: clamp(43px, 9vw, 110px); line-height: .96; font-weight: 800; letter-spacing: -.08em; }
.policy-heading h1 span { color: var(--accent); }
.policy-heading > p { max-width: 62ch; margin: 0; color: var(--muted); font-size: clamp(16px, 2vw, 21px); line-height: 1.5; }
.policy-heading .policy-date { margin-top: 22px; font-size: 12px; }
.policy-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: clamp(24px, 6vw, 84px); margin-top: clamp(25px, 4.5vw, 52px); }
.policy-nav { align-self: start; position: sticky; top: 24px; font-size: 12px; }
.policy-nav p { margin: 0 0 12px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.policy-nav ul { margin: 0; padding: 0; list-style: none; }
.policy-nav a { display: block; padding-block: 6px; }
.policy-nav a:hover { color: var(--accent); text-decoration: underline; }
.policy-content { max-width: 72ch; font-size: 16px; line-height: 1.65; }
.policy-content section { padding-bottom: 26px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.policy-content section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.policy-content h2 { margin: 0 0 15px; font-size: clamp(22px, 3.5vw, 33px); letter-spacing: -.05em; line-height: 1.15; }
.policy-content h3 { margin: 22px 0 4px; font-size: 16px; line-height: 1.4; }
.policy-content p, .policy-content ul { margin: 0 0 14px; }
.policy-content ul { padding-left: 1.25em; }
.policy-content li + li { margin-top: 7px; }
.policy-content p:last-child { margin-bottom: 0; }
.policy-content a { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.policy-content a:hover { text-decoration-thickness: 2px; }
.policy-content .note { padding: 15px 18px; border-left: 3px solid var(--accent); background: #eae8df; }

@media (max-width: 720px) {
  .policy-layout { grid-template-columns: minmax(0, 1fr); }
  .policy-nav { position: static; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
  .policy-nav ul { display: flex; flex-wrap: wrap; gap: 0 14px; }
}

@media print {
  .policy { width: auto; padding: 0; }
  .policy-layout { display: block; }
  .policy-nav { display: none; }
}
