:root {
  --paper: #d8d0bd;
  --paper-pale: #eee8da;
  --ink: #1c2628;
  --night: #17262d;
  --blue: #486d79;
  --rust: #a54a34;
  --line: rgba(28, 38, 40, .28);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
  font-family: var(--sans);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.55; }
button, a { color: inherit; font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #f0a45f; outline-offset: 4px; }
.skip-link { position: fixed; z-index: 100; top: .75rem; left: .75rem; padding: .7rem 1rem; background: #fff; transform: translateY(-180%); }
.skip-link:focus { transform: none; }

.side-head { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1rem clamp(1rem, 4vw, 4rem); border-bottom: 1px solid var(--ink); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.side-head a { text-decoration: none; }
.side-head p { margin: 0; }
.side-head p span { color: var(--rust); }

.opening { min-height: calc(100vh - 78px); position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); align-items: end; gap: clamp(2rem, 7vw, 8rem); padding: clamp(4rem, 9vw, 9rem) clamp(1rem, 6vw, 7rem); border-bottom: 1px solid var(--ink); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 58px 58px; }
.opening::after { content: ""; position: absolute; width: min(45vw, 650px); aspect-ratio: 1; right: -12vw; top: -16vw; border: 1px solid var(--ink); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.08), 0 0 0 140px rgba(255,255,255,.06); }
.kicker, .field-label { margin: 0 0 1rem; color: var(--rust); font-size: .7rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.opening .kicker { position: absolute; top: clamp(3rem, 7vw, 6rem); left: clamp(1rem, 6vw, 7rem); }
.opening h1 { position: relative; z-index: 2; margin: 0; font: 400 clamp(4rem, 9vw, 10rem)/.78 var(--serif); letter-spacing: -.07em; }
.opening h1 em { color: var(--rust); font-weight: 400; }
.opening-note { position: relative; z-index: 2; max-width: 520px; padding: 1.5rem 0 0 1.5rem; border-left: 1px solid var(--ink); font-size: clamp(1rem, 1.3vw, 1.2rem); }
.orbit { position: absolute; z-index: 1; color: rgba(28,38,40,.42); font: italic 1rem var(--serif); }
.orbit-a { top: 26%; left: 63%; transform: rotate(11deg); }
.orbit-b { top: 42%; right: 8%; transform: rotate(-8deg); }
.orbit-c { bottom: 12%; left: 46%; transform: rotate(5deg); }

.workbench { display: grid; grid-template-columns: minmax(300px, .68fr) minmax(0, 1.32fr); min-height: 760px; border-bottom: 1px solid var(--ink); }
.memory-field { position: relative; overflow: hidden; padding: clamp(2rem, 5vw, 5rem); color: #edf0e8; background: var(--night); border-right: 1px solid var(--ink); }
.memory-field::before { content: ""; position: absolute; width: 480px; aspect-ratio: 1; left: 50%; top: 46%; transform: translate(-50%, -50%); border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 65px rgba(255,255,255,.035), 0 0 0 130px rgba(255,255,255,.025); }
.memory-field .field-label { color: #dba878; }
.memory-core { position: relative; height: 390px; display: grid; place-items: center; text-align: center; }
.memory-core span { display: block; max-width: 280px; font: italic clamp(2rem, 4vw, 4.5rem)/.92 var(--serif); filter: blur(2px); opacity: .52; transform: translateX(0) scale(1); transition: filter .5s ease, opacity .5s ease, transform .5s ease; }
.memory-status { position: relative; min-height: 3.2em; color: #c7d0ca; }
.force-button { position: relative; width: 100%; padding: .9rem 1rem; border: 1px solid rgba(255,255,255,.48); background: transparent; color: #fff; text-align: left; }
.force-button:hover { background: rgba(255,255,255,.08); }
.force-count { position: relative; margin: .7rem 0 0; color: #9eaaa4; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }

.hands-field { padding: clamp(2rem, 5vw, 5rem); background: var(--paper-pale); }
.hands-heading { display: flex; align-items: start; justify-content: space-between; gap: 2rem; }
.hands-heading h2 { max-width: 720px; margin: 0; font: 400 clamp(2.6rem, 5vw, 5.5rem)/.92 var(--serif); letter-spacing: -.045em; }
.hands-heading > p { min-width: 90px; margin: .2rem 0 0; font-weight: 850; }
.shape-tray, .slot-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(.5rem, 1.5vw, 1.2rem); }
.shape-tray { margin-top: clamp(3rem, 7vw, 7rem); }
.slot-row { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--ink); }
.shape, .slot { min-height: 126px; display: grid; place-items: center; border: 1px solid var(--ink); background: transparent; }
.shape { background: #fffaf0; box-shadow: 5px 5px 0 rgba(28,38,40,.14); transition: transform .16s ease, background .16s ease; }
.shape:hover { transform: translateY(-5px); }
.shape[aria-pressed="true"] { color: #fff; background: var(--rust); transform: translateY(-8px); }
.shape[disabled] { visibility: hidden; }
.slot { border-style: dashed; }
.slot:not(.filled) .glyph { opacity: .2; }
.slot.ready { background: rgba(86,124,136,.12); }
.slot.filled { border-style: solid; color: #fff; background: var(--blue); }
.slot.filled .glyph { opacity: 1; }
.glyph { display: block; width: var(--size); height: var(--size); border: 5px solid currentColor; }
.glyph.circle { border-radius: 50%; }
.glyph.diamond { transform: rotate(45deg); }
.glyph.bar { width: calc(var(--size) * .38); }
.glyph.cross { position: relative; border: 0; }
.glyph.cross::before, .glyph.cross::after { content: ""; position: absolute; inset: 42% 0; background: currentColor; }
.glyph.cross::after { transform: rotate(90deg); }
.glyph.half { border-radius: 50% 50% 0 0; border-bottom: 0; height: calc(var(--size) * .55); }
.instruction { margin: 2rem 0 0; color: #596360; }
.instruction.error { color: var(--rust); font-weight: 750; }

.return { padding: clamp(5rem, 11vw, 11rem) clamp(1rem, 10vw, 12rem); color: #f4efe4; background: var(--blue); }
.return .kicker { color: #ffe0a9; }
.return blockquote { max-width: 1200px; margin: 0; font: italic clamp(3.2rem, 7vw, 7.5rem)/.95 var(--serif); letter-spacing: -.04em; }
.return > p:not(.kicker) { max-width: 630px; margin: 3rem 0 0 auto; font-size: 1.15rem; }
.return-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 4rem; }
.return-actions button, .return-actions a { min-height: 48px; padding: .8rem 1.1rem; border: 1px solid currentColor; background: transparent; text-decoration: none; }
.return-actions button:hover, .return-actions a:hover { color: var(--ink); background: #fff; }

footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2rem clamp(1rem, 4vw, 4rem); font-size: .72rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

@media (max-width: 820px) {
  .side-head { display: block; }
  .side-head p { margin-top: .7rem; }
  .opening { min-height: 720px; display: block; padding-top: 8rem; }
  .opening h1 { font-size: clamp(4rem, 18vw, 7rem); }
  .opening-note { margin-top: 4rem; }
  .orbit-a { left: auto; right: 8%; }
  .workbench { display: block; }
  .memory-field { border-right: 0; border-bottom: 1px solid var(--ink); }
  .memory-core { height: 300px; }
  .shape-tray, .slot-row { grid-template-columns: repeat(5, minmax(54px, 1fr)); gap: .4rem; overflow-x: auto; }
  .shape, .slot { min-height: 82px; }
  .glyph { border-width: 3px; transform: scale(.72); }
  .glyph.diamond { transform: rotate(45deg) scale(.72); }
  .hands-heading { display: block; }
  .hands-heading > p { margin-top: 1rem; }
  .return blockquote { overflow-wrap: anywhere; }
  footer { display: block; }
}
