:root {
  color-scheme: dark;
  --bg: #080e15;
  --panel: #0e1721;
  --panel-raised: #121e2a;
  --panel-deep: linear-gradient(120deg, rgba(20, 33, 47, .96), rgba(11, 19, 28, .96));
  --line: #263746;
  --line-bright: #3b5365;
  --ink: #edf4fb;
  --muted: #a0afbf;
  --quiet: #708293;
  --cyan: #69d9ee;
  --amber: #ffbd65;
  --green: #8ae3a3;
  --accent-ink: #071116;
  --accent-hover: #8deafa;
  --outline: #a9bac9;
  --ambient: rgba(56, 104, 131, .16);
  --ring: rgba(105, 217, 238, .22);
  --ring-halo: rgba(105, 217, 238, .035);
  --control: #0b141d;
  --board: #101b26;
  --cell-empty: #243443;
  --tile-2: #cee5e9;
  --tile-4: #93dbe7;
  --tile-8: #5fc8db;
  --tile-16: #69d9ee;
  --tile-32: #ffbd65;
  --tile-128: #ffe39b;
  --piece-1: #69d9ee;
  --piece-2: #96e0a9;
  --piece-3: #ffbd65;
  --piece-4: #a89df3;
  --piece-border: #a0f0fc;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --content: 1028px;
}

html[data-theme="fresh"] {
  color-scheme: light;
  --bg: #f2f8f4;
  --panel: #edf5ef;
  --panel-raised: #f9fcf9;
  --panel-deep: linear-gradient(120deg, rgba(222, 239, 228, .98), rgba(244, 249, 245, .98));
  --line: #cfddd2;
  --line-bright: #aac2b1;
  --ink: #20372c;
  --muted: #526b5d;
  --quiet: #788f81;
  --cyan: #3e8065;
  --amber: #b67743;
  --green: #4a936d;
  --accent-ink: #f7fbf8;
  --accent-hover: #2e6b53;
  --outline: #709484;
  --ambient: rgba(193, 221, 202, .42);
  --ring: rgba(62, 128, 101, .2);
  --ring-halo: rgba(62, 128, 101, .045);
  --control: #f5faf6;
  --board: #e3ede5;
  --cell-empty: #d4e2d7;
  --tile-2: #e6f0e7;
  --tile-4: #c9e0ce;
  --tile-8: #9bc9aa;
  --tile-16: #72ad88;
  --tile-32: #d8ba8a;
  --tile-128: #b5d6bf;
  --piece-1: #4b9270;
  --piece-2: #87b98d;
  --piece-3: #c88f58;
  --piece-4: #91aa9a;
  --piece-border: #eff7f0;
}

html[data-theme="paper"] {
  color-scheme: light;
  --bg: #f6f0e5;
  --panel: #eee6d7;
  --panel-raised: #fcf8f0;
  --panel-deep: linear-gradient(120deg, rgba(237, 225, 206, .98), rgba(250, 246, 237, .98));
  --line: #d9cdb9;
  --line-bright: #c0ad92;
  --ink: #332a20;
  --muted: #6f6253;
  --quiet: #8b7d6b;
  --cyan: #a15f38;
  --amber: #a77a35;
  --green: #667d58;
  --accent-ink: #fff8ef;
  --accent-hover: #814729;
  --outline: #a18468;
  --ambient: rgba(224, 202, 165, .3);
  --ring: rgba(161, 95, 56, .19);
  --ring-halo: rgba(161, 95, 56, .04);
  --control: #fbf7ef;
  --board: #e9dfcf;
  --cell-empty: #dacebb;
  --tile-2: #f4e9d6;
  --tile-4: #ead8bb;
  --tile-8: #d5b58a;
  --tile-16: #c89468;
  --tile-32: #e2bf81;
  --tile-128: #d1a76e;
  --piece-1: #a15f38;
  --piece-2: #718466;
  --piece-3: #c09250;
  --piece-4: #9a7d6b;
  --piece-border: #fff7eb;
}

html[data-theme="graphite"] {
  color-scheme: dark;
  --bg: #15181c;
  --panel: #1d2228;
  --panel-raised: #262d34;
  --panel-deep: linear-gradient(120deg, rgba(39, 46, 54, .98), rgba(24, 29, 35, .98));
  --line: #373f47;
  --line-bright: #55616b;
  --ink: #f0f1ed;
  --muted: #b6bbb8;
  --quiet: #89918f;
  --cyan: #c2cf71;
  --amber: #e1a45c;
  --green: #91bd83;
  --accent-ink: #20251a;
  --accent-hover: #d4df85;
  --outline: #aeb798;
  --ambient: rgba(103, 116, 93, .18);
  --ring: rgba(194, 207, 113, .19);
  --ring-halo: rgba(194, 207, 113, .04);
  --control: #181d22;
  --board: #191e23;
  --cell-empty: #2b333b;
  --tile-2: #cbd1a0;
  --tile-4: #b3c18a;
  --tile-8: #9eae71;
  --tile-16: #c2cf71;
  --tile-32: #e1a45c;
  --tile-128: #f0d58b;
  --piece-1: #c2cf71;
  --piece-2: #91bd83;
  --piece-3: #e1a45c;
  --piece-4: #b6a7d8;
  --piece-border: #e6ecbd;
}

* { box-sizing: border-box; }
html.theme-switching * { transition: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 30px; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 72% -14%, var(--ambient), transparent 37%), var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
}
::selection { color: var(--accent-ink); background: var(--cyan); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.site-shell { width: min(var(--content), calc(100% - 44px)); margin: 0 auto; }

.site-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--accent-ink);
  background: var(--cyan);
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}
.brand-name { font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.brand-name span { color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .09em; }
.main-nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.main-nav a, .header-contact { color: var(--muted); font-size: 12px; transition: color .18s ease; }
.main-nav a:hover, .header-contact:hover, .footer-links a:hover, .text-link:hover { color: var(--cyan); }
.header-contact { padding-left: 25px; border-left: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.header-contact span { color: var(--cyan); margin-left: 5px; }
.theme-picker { display: inline-flex; align-items: center; gap: 6px; color: var(--quiet); font-size: 10px; white-space: nowrap; }
.theme-picker select { max-width: 105px; min-height: 31px; padding: 0 8px; border: 1px solid var(--line-bright); border-radius: 0; color: var(--ink); background: var(--panel); font-size: 10px; cursor: pointer; }
.menu-toggle { display: none; }

.hero { display: grid; grid-template-columns: 1.24fr .76fr; align-items: center; gap: 46px; padding: 61px 0 57px; }
.hero-kicker, .section-kicker, .mini-label { margin: 0; color: var(--amber); font: 700 10px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.hero-kicker span { padding: 0 8px; color: var(--quiet); }
.hero h1 { margin: 13px 0 18px; font-size: clamp(54px, 6.15vw, 76px); font-weight: 800; line-height: .99; letter-spacing: -.075em; }
.hero h1 span { display: block; }
.headline-outline { color: transparent; -webkit-text-stroke: 1.35px var(--outline); }
.hero-description { max-width: 455px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; gap: 23px; margin-top: 24px; }
.button { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 18px; padding: 0 16px; border: 1px solid var(--line-bright); font-size: 12px; font-weight: 700; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.button:hover { border-color: var(--cyan); }
.button-primary { border-color: var(--cyan); color: var(--accent-ink); background: var(--cyan); }
.button-primary:hover { color: var(--accent-ink); background: var(--accent-hover); }
.button-primary span { font-size: 16px; }
.text-link { color: var(--muted); font-size: 12px; transition: color .18s ease; }
.text-link span { margin-left: 5px; color: var(--cyan); }
.update-panel {
  position: relative;
  min-height: 174px;
  padding: 17px 20px;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  background: var(--panel-deep);
}
.panel-topline { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 10px var(--mono); letter-spacing: .09em; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px color-mix(in srgb, var(--green) 45%, transparent); }
.panel-date { margin-left: auto; color: var(--amber); }
.panel-number { position: relative; z-index: 1; margin-top: 9px; color: var(--cyan); font: 800 50px/.95 var(--mono); letter-spacing: -.08em; }
.panel-label { margin-top: 3px; color: var(--ink); font-size: 12px; font-weight: 700; }
.panel-update { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 7px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.panel-update b { color: var(--ink); font: 700 13px var(--mono); }
.panel-update i { width: 1px; height: 12px; margin: 0 4px; background: var(--line-bright); }
.panel-ring { position: absolute; width: 216px; height: 216px; right: -57px; top: 35px; border: 1px solid var(--ring); border-radius: 50%; box-shadow: 0 0 0 22px var(--ring-halo), 0 0 0 48px var(--ring-halo); }

section[id] { scroll-margin-top: 25px; }
.path-section, .latest-section, .library-section, .play-section, .mac-section, .project-section { padding: 30px 0 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 17px; }
.section-heading-compact { margin-bottom: 13px; }
.section-heading h2, .about-copy h2 { margin: 5px 0 0; font-size: 26px; line-height: 1.25; letter-spacing: -.04em; }
.section-kicker { color: var(--quiet); }
.section-note { max-width: 380px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.section-link { color: var(--muted); font-size: 12px; white-space: nowrap; }
.section-link span { margin-left: 6px; color: var(--cyan); }
.path-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); }
.path-card { min-height: 112px; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 13px 14px; border-right: 1px solid var(--line); background: var(--panel); transition: border-color .18s ease, background .18s ease; }
.path-card:last-child { border-right: 0; }
.path-card:hover { z-index: 1; border-color: var(--cyan); background: var(--panel-raised); }
.path-count { color: var(--cyan); font: 700 18px/1 var(--mono); }
.path-name { font-size: 14px; font-weight: 700; }
.path-detail { color: var(--quiet); font-size: 10px; }

.latest-list { border-top: 1px solid var(--line); }
.latest-row { display: grid; grid-template-columns: 105px minmax(0, 1fr) auto 20px; align-items: center; gap: 14px; min-height: 66px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.latest-date { color: var(--amber); font: 10px var(--mono); }
.latest-copy { min-width: 0; }
.latest-copy strong { display: block; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.latest-copy span { display: block; color: var(--muted); font-size: 11px; }
.latest-type { color: var(--quiet); font: 10px var(--mono); text-transform: uppercase; }
.latest-arrow { color: var(--cyan); font-size: 17px; }

.library-section { padding-top: 43px; }
.library-heading { margin-bottom: 15px; }
.library-controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.filter-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-button { min-height: 31px; padding: 0 10px; border: 1px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.filter-button:hover, .filter-button[aria-pressed="true"] { border-color: var(--line-bright); color: var(--cyan); background: var(--panel-raised); }
.filter-count { margin-left: 5px; color: var(--quiet); font: 10px var(--mono); }
.search-box { width: 220px; min-height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line); color: var(--quiet); }
.search-box span { font-size: 20px; line-height: 1; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.search-box input::placeholder { color: var(--quiet); }
.result-line { margin: 10px 0 12px; color: var(--quiet); font: 10px var(--mono); }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.resource-card { min-height: 185px; display: flex; flex-direction: column; padding: 13px 14px 12px; border: 1px solid var(--line); background: var(--panel); transition: border-color .18s ease, background .18s ease; }
.resource-card:hover { border-color: var(--cyan); background: var(--panel-raised); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--quiet); font: 9px var(--mono); letter-spacing: .04em; }
.card-type { color: var(--green); }
.card-price { color: var(--amber); white-space: nowrap; }
.resource-card h3 { margin: 12px 0 5px; font-size: 16px; line-height: 1.35; letter-spacing: -.025em; }
.resource-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-bottom { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 13px; }
.card-source { overflow: hidden; color: var(--quiet); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-open { flex: 0 0 auto; color: var(--cyan); font-size: 10px; }
.load-more { min-height: 38px; display: block; margin: 14px auto 0; padding: 0 14px; border: 1px solid var(--line-bright); color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.load-more:hover { border-color: var(--cyan); color: var(--cyan); }
.load-more span { padding-left: 8px; color: var(--cyan); }
.library-note { margin: 12px 0 0; color: var(--quiet); font-size: 10px; }
.empty-state { padding: 40px 15px; border: 1px dashed var(--line-bright); color: var(--muted); font-size: 13px; text-align: center; }

.play-section { padding-top: 59px; }
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.game-card { padding: 16px; border: 1px solid var(--line); background: var(--panel); }
.game-card-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.game-card h3 { margin: 4px 0 0; font-size: 22px; line-height: 1.2; }
.game-index { color: var(--quiet); font: 11px var(--mono); }
.game-card-body { display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: center; gap: 17px; margin-top: 13px; }
.game-art { position: relative; width: 100%; height: 126px; display: grid; align-content: center; justify-content: center; gap: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-raised); }
.game-art::after { position: absolute; inset: 0; background: linear-gradient(135deg, transparent 46%, var(--ring-halo)); content: ""; pointer-events: none; }
.game-art-2048 { grid-template-columns: repeat(2, 43px); grid-template-rows: repeat(2, 43px); }
.game-art-2048 span { display: grid; place-items: center; color: var(--accent-ink); background: var(--tile-2); font: 700 17px var(--mono); }
.game-art-2048 span:nth-child(2) { background: var(--tile-4); }
.game-art-2048 span:nth-child(3) { background: var(--tile-8); }
.game-art-2048 span:nth-child(4) { background: var(--tile-32); }
.game-art-tetris { grid-template-columns: repeat(6, 17px); grid-template-rows: repeat(5, 17px); gap: 3px; }
.game-art-tetris i { display: block; border: 1px solid var(--piece-border); background: var(--piece-1); }
.game-art-tetris i:nth-child(1) { grid-column: 2; grid-row: 2; }
.game-art-tetris i:nth-child(2) { grid-column: 1; grid-row: 3; background: var(--piece-3); }
.game-art-tetris i:nth-child(3) { grid-column: 2; grid-row: 3; background: var(--piece-3); }
.game-art-tetris i:nth-child(4) { grid-column: 3; grid-row: 3; background: var(--piece-3); }
.game-art-tetris i:nth-child(5) { grid-column: 4; grid-row: 3; background: var(--piece-2); }
.game-art-tetris i:nth-child(6) { grid-column: 4; grid-row: 4; background: var(--piece-2); }
.game-art-tetris i:nth-child(7) { grid-column: 5; grid-row: 4; background: var(--piece-2); }
.game-description { min-height: 38px; margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.game-inputs { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 12px; color: var(--quiet); font-size: 9px; }
.game-start { min-height: 35px; padding: 0 11px; font-size: 10px; }
.game-score { min-width: 70px; display: grid; justify-items: end; padding: 5px 9px; border: 1px solid var(--line); background: var(--panel-raised); }
.game-score span { color: var(--quiet); font: 9px var(--mono); }
.game-score b { color: var(--cyan); font: 700 16px var(--mono); }
.game-description { min-height: 38px; margin: 9px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.board-2048 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; width: min(100%, 310px); aspect-ratio: 1; margin: 0 auto; padding: 8px; border: 1px solid var(--line-bright); background: var(--board); touch-action: none; }
.tile { display: grid; place-items: center; min-width: 0; color: var(--ink); background: var(--cell-empty); font: 700 clamp(16px, 3.4vw, 24px)/1 var(--mono); transition: background .12s ease, transform .12s ease; }
.tile[data-value="2"] { background: var(--tile-2); }
.tile[data-value="4"] { background: var(--tile-4); }
.tile[data-value="8"] { background: var(--tile-8); }
.tile[data-value="16"] { background: var(--tile-16); }
.tile[data-value="32"], .tile[data-value="64"] { color: var(--accent-ink); background: var(--tile-32); }
.tile[data-value="128"], .tile[data-value="256"], .tile[data-value="512"], .tile[data-value="1024"], .tile[data-value="2048"] { color: var(--accent-ink); background: var(--tile-128); font-size: clamp(13px, 3vw, 19px); }
.game-controls { min-height: 35px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.game-controls button { min-width: 35px; min-height: 34px; border: 1px solid var(--line-bright); color: var(--ink); background: var(--control); cursor: pointer; font-size: 15px; }
.game-controls button:hover { border-color: var(--cyan); color: var(--cyan); }
.game-controls .game-reset { margin-left: 8px; padding: 0 10px; color: var(--muted); font-size: 10px; }
.game-source { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 9px; }
.game-source a { color: var(--muted); }
.game-source a:hover { color: var(--cyan); }
.tetris-frame { display: flex; align-items: center; justify-content: center; gap: 15px; min-height: 258px; padding: 8px; border: 1px solid var(--line); background: var(--panel-raised); }
.tetris-board { display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(16, 1fr); width: min(58%, 208px); aspect-ratio: 10 / 16; gap: 2px; padding: 4px; border: 1px solid var(--line-bright); background: var(--board); touch-action: none; }
.tetris-cell { min-width: 0; min-height: 0; background: var(--cell-empty); }
.tetris-cell.filled { background: var(--piece-1); border: 1px solid var(--piece-border); }
.tetris-cell.filled[data-color="2"] { background: var(--piece-2); }
.tetris-cell.filled[data-color="3"] { background: var(--piece-3); }
.tetris-cell.filled[data-color="4"] { background: var(--piece-4); }
.tetris-side { display: flex; flex-direction: column; align-items: start; gap: 8px; width: 105px; }
.tetris-side .button { min-height: 34px; padding: 0 10px; font-size: 10px; }
.next-piece { display: grid; grid-template-columns: repeat(4, 16px); grid-template-rows: repeat(4, 16px); gap: 2px; padding: 4px; border: 1px solid var(--line); background: var(--board); }
.next-cell { background: transparent; }
.next-cell.filled { background: var(--amber); }
.tetris-status { min-height: 28px; margin: 0; color: var(--muted); font-size: 10px; }
.tetris-controls { gap: 5px; }
.tetris-controls button { min-width: 34px; }
.source-note { margin: 12px 0 0; color: var(--quiet); font-size: 10px; }

.mac-section { padding-top: 60px; }
.mac-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.mac-card { min-height: 127px; display: flex; flex-direction: column; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 78%, transparent); }
.mac-card:hover { background: var(--panel-raised); }
.mac-card-top { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.mac-license { color: var(--amber); font: 9px var(--mono); }
.mac-card h3 { margin: 11px 0 4px; font-size: 14px; line-height: 1.3; }
.mac-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.mac-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.mac-links a { color: var(--cyan); font-size: 9px; }
.mac-links a.secondary { color: var(--amber); }
.mac-caveat { margin: 7px 0 0; color: var(--quiet); font-size: 9px; line-height: 1.4; }
.mac-credit { margin: 10px 0 0; color: var(--quiet); font-size: 10px; }
.mac-credit a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-bright); text-underline-offset: 3px; }

.project-section { padding-top: 58px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.project-card { min-height: 145px; display: flex; flex-direction: column; padding: 15px; border: 1px solid var(--line); background: var(--panel); }
.project-card:hover { border-color: var(--cyan); }
.project-card .section-kicker { color: var(--amber); }
.project-card h3 { margin: 9px 0 5px; font-size: 17px; }
.project-card p { margin: 0; color: var(--muted); font-size: 12px; }
.project-card a { align-self: flex-start; margin-top: auto; padding-top: 10px; color: var(--cyan); font-size: 10px; }

.about-section { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; margin-top: 59px; padding: 24px 0 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-number { color: var(--cyan); font: 700 24px var(--mono); }
.about-number span { color: var(--quiet); font-size: 10px; letter-spacing: .08em; }
.about-copy h2 { font-size: 23px; }
.about-copy p { max-width: 600px; margin: 10px 0 15px; color: var(--muted); font-size: 14px; }
.site-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 23px 0 27px; }
.footer-links { display: flex; gap: 17px; color: var(--muted); font-size: 11px; }
.site-footer p { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; margin: 0; color: var(--quiet); font-size: 10px; }

@media (max-width: 800px) {
  .site-shell { width: min(var(--content), calc(100% - 36px)); }
  .site-header { gap: 16px; }
  .main-nav { gap: 16px; }
  .header-contact { padding-left: 16px; }
  .hero { grid-template-columns: 1fr .82fr; gap: 24px; }
  .hero h1 { font-size: clamp(48px, 8.3vw, 65px); }
  .path-grid { grid-template-columns: repeat(3, 1fr); }
  .path-card { border-bottom: 1px solid var(--line); }
  .path-card:nth-child(3) { border-right: 0; }
  .path-card:nth-child(4), .path-card:nth-child(5), .path-card:nth-child(6) { border-bottom: 0; }
  .path-card:nth-child(4) { border-right: 1px solid var(--line); }
  .mac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  html { scroll-padding-top: 18px; }
  .site-shell { width: calc(100% - 32px); }
  .site-header { position: relative; min-height: 62px; gap: 10px; }
  .brand-name { font-size: 12px; }
  .brand-name span { font-size: 8px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 7px 9px; border: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
  .menu-toggle span { color: var(--cyan); font-size: 14px; }
  .main-nav { display: none; position: absolute; z-index: 10; top: 61px; left: 0; right: 0; align-items: stretch; gap: 0; border: 1px solid var(--line-bright); background: var(--panel); }
  .main-nav.is-open { display: grid; grid-template-columns: 1fr 1fr; }
  .main-nav a { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .main-nav .theme-picker { grid-column: 1 / -1; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--line); }
  .main-nav .theme-picker select { max-width: none; }
  .header-contact { padding-left: 10px; border-left: 0; font-size: 10px; }
  .hero { grid-template-columns: 1fr; gap: 23px; padding: 42px 0 33px; }
  .hero-kicker { font-size: 9px; }
  .hero h1 { margin: 12px 0 14px; font-size: clamp(44px, 12vw, 58px); line-height: 1.02; }
  .hero-description { font-size: 14px; }
  .hero-actions { gap: 16px; margin-top: 18px; }
  .button { min-height: 39px; padding: 0 13px; }
  .update-panel { min-height: 144px; padding: 13px 15px; }
  .panel-number { margin-top: 8px; font-size: 42px; }
  .panel-update { margin-top: 7px; }
  .panel-ring { width: 180px; height: 180px; right: -53px; top: 21px; }
  .path-section, .latest-section { padding-top: 21px; }
  .section-heading { align-items: start; gap: 12px; margin-bottom: 12px; }
  .section-heading h2, .about-copy h2 { font-size: 21px; }
  .section-note { max-width: 45%; font-size: 10px; line-height: 1.5; }
  .path-grid { grid-template-columns: repeat(2, 1fr); }
  .path-card { min-height: 92px; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line) !important; }
  .path-card:nth-child(2n) { border-right: 0; }
  .path-card:nth-child(4), .path-card:nth-child(5), .path-card:nth-child(6) { border-bottom: 0 !important; }
  .path-card:last-child { border-right: 1px solid var(--line); border-bottom: 0 !important; }
  .path-count { font-size: 16px; }
  .path-name { font-size: 13px; }
  .latest-row { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 8px; min-height: 62px; }
  .latest-date { font-size: 9px; }
  .latest-copy strong { font-size: 11px; }
  .latest-copy span { font-size: 10px; }
  .latest-type { display: none; }
  .library-section, .play-section, .mac-section, .project-section { padding-top: 43px; }
  .library-heading { display: block; }
  .library-heading .section-note { max-width: 100%; margin-top: 7px; text-align: left; }
  .library-controls { display: block; padding: 9px 0; }
  .filter-list { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
  .filter-button { flex: 0 0 auto; padding: 0 8px; }
  .search-box { width: 100%; margin-top: 8px; }
  .resource-grid { grid-template-columns: 1fr; gap: 8px; }
  .resource-card { min-height: 153px; padding: 12px; }
  .resource-card h3 { margin-top: 9px; font-size: 15px; }
  .resource-card p { font-size: 11px; -webkit-line-clamp: 2; }
  .card-bottom { padding-top: 9px; }
  .library-note, .source-note, .mac-credit { font-size: 9px; }
  .games-grid { grid-template-columns: 1fr; gap: 10px; }
  .game-card { padding: 13px; }
  .game-card-body { grid-template-columns: 105px minmax(0, 1fr); gap: 12px; margin-top: 11px; }
  .game-art { height: 116px; }
  .game-art-2048 { grid-template-columns: repeat(2, 34px); grid-template-rows: repeat(2, 34px); gap: 5px; }
  .game-art-tetris { grid-template-columns: repeat(6, 13px); grid-template-rows: repeat(5, 13px); gap: 3px; }
  .game-description { min-height: 0; margin-bottom: 8px; font-size: 10px; }
  .game-inputs { gap: 4px 8px; margin-bottom: 8px; font-size: 8px; }
  .game-start { min-height: 33px; padding: 0 9px; font-size: 9px; }
  .board-2048 { width: min(100%, 300px); }
  .tetris-frame { min-height: 232px; gap: 12px; }
  .tetris-board { width: min(58%, 192px); }
  .tetris-side { width: 98px; }
  .game-source { gap: 8px; }
  .mac-section .section-heading { display: block; }
  .mac-section .section-note { max-width: 100%; margin-top: 7px; text-align: left; }
  .mac-card { min-height: 145px; padding: 10px; }
  .mac-card h3 { font-size: 13px; }
  .mac-card p { font-size: 9px; }
  .mac-links { gap: 7px; }
  .project-grid { grid-template-columns: 1fr; }
  .about-section { grid-template-columns: 1fr; gap: 10px; margin-top: 44px; padding: 19px 0 22px; }
  .about-number { font-size: 18px; }
  .about-copy p { font-size: 12px; }
  .site-footer { grid-template-columns: 1fr; padding: 18px 0 22px; }
  .footer-links { gap: 14px; }
  .site-footer p { grid-column: auto; flex-direction: column; gap: 2px; font-size: 9px; }
}

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

/* Shared section flow; current homepage ordering is defined in the final layout rules. */
.site-shell main { display: flex; flex-direction: column; }

.visual-orbit { position: absolute; right: 25%; bottom: 10%; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 18px color-mix(in srgb, var(--amber) 50%, transparent); }

/* Fresh: magazine flow with a larger editorial hero. */
html[data-theme="fresh"] { --content: 1160px; --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
html[data-theme="fresh"] body { background: radial-gradient(ellipse at 76% 10%, rgba(184, 216, 194, .48), transparent 35%), var(--bg); }
html[data-theme="fresh"] .site-header { min-height: 76px; border: 0; }
html[data-theme="fresh"] .brand-mark { border-radius: 50%; }
html[data-theme="fresh"] .main-nav a { padding: 7px 10px; border-radius: 999px; }
html[data-theme="fresh"] .main-nav a:hover { background: var(--panel-raised); }
html[data-theme="fresh"] .hero { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 45px; min-height: 415px; padding: 54px 0 50px; }
html[data-theme="fresh"] .hero h1 { font-family: Georgia, "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(66px, 7.5vw, 91px); font-weight: 700; letter-spacing: -.09em; }
html[data-theme="fresh"] .headline-outline { color: var(--green); -webkit-text-stroke: 0; }
html[data-theme="fresh"] .hero-kicker { color: var(--green); }
html[data-theme="fresh"] .update-panel { min-height: 260px; display: flex; flex-direction: column; justify-content: center; padding: 25px 28px; border: 0; border-radius: 42% 14px 42% 14px; background: radial-gradient(circle at 84% 30%, rgba(255,255,255,.62), transparent 28%), linear-gradient(140deg, #d6edda, #e8f1e8 68%, #dcebe0); box-shadow: 0 23px 55px rgba(63, 105, 75, .12); }
html[data-theme="fresh"] .panel-number { font-size: 68px; }
html[data-theme="fresh"] .panel-ring { width: 250px; height: 250px; border-width: 0; right: -30px; top: auto; bottom: -145px; box-shadow: 0 0 0 24px rgba(62,128,101,.08), 0 0 0 53px rgba(62,128,101,.05); }
html[data-theme="fresh"] .path-section { order: 2; }
html[data-theme="fresh"] .project-section { order: 3; }
html[data-theme="fresh"] .latest-section { order: 4; }
html[data-theme="fresh"] .path-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; border: 0; }
html[data-theme="fresh"] .path-card { min-height: 138px; border: 0; border-radius: 18px; background: var(--panel); box-shadow: 0 8px 24px rgba(32, 55, 44, .045); }
html[data-theme="fresh"] .path-card:last-child { border-right: 0; }
html[data-theme="fresh"] .latest-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; border: 0; }
html[data-theme="fresh"] .latest-row { min-height: 150px; grid-template-columns: 1fr auto; align-content: start; padding: 17px; border: 0; border-radius: 16px; background: var(--panel); }
html[data-theme="fresh"] .latest-copy { grid-column: 1 / -1; grid-row: 2; }
html[data-theme="fresh"] .latest-copy strong { overflow: visible; white-space: normal; font-size: 14px; }
html[data-theme="fresh"] .latest-copy span { margin-top: 7px; }
html[data-theme="fresh"] .latest-type { grid-column: 2; grid-row: 1; }

/* Paper: a quieter literary index. */
html[data-theme="paper"] { --content: 920px; }
html[data-theme="paper"] body { background-color: var(--bg); background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(110,88,61,.025) 31px 32px); }
html[data-theme="paper"] .site-header { min-height: 74px; gap: 26px; }
html[data-theme="paper"] .brand-mark { border-radius: 50%; }
html[data-theme="paper"] .hero { grid-template-columns: minmax(0, 1fr) minmax(220px, .58fr); gap: 36px; padding: 70px 0 55px; }
html[data-theme="paper"] .hero h1 { font-size: clamp(58px, 7vw, 78px); font-weight: 600; letter-spacing: -.075em; }
html[data-theme="paper"] .headline-outline { color: var(--cyan); -webkit-text-stroke: 0; }
html[data-theme="paper"] .update-panel { min-height: 190px; border: 0; border-top: 2px solid var(--cyan); border-bottom: 1px solid var(--line); background: transparent; }
html[data-theme="paper"] .panel-ring { display: none; }
html[data-theme="paper"] .panel-number { color: var(--cyan); }
html[data-theme="paper"] .path-section { order: 3; }
html[data-theme="paper"] .latest-section { order: 2; }
html[data-theme="paper"] .project-section { order: 5; }
html[data-theme="paper"] .path-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
html[data-theme="paper"] .path-card { min-height: 95px; padding: 13px 11px; border-right: 1px solid var(--line); background: transparent; }

/* Graphite: a project-first wall with an asymmetric hero. */
html[data-theme="graphite"] { --content: 1240px; }
html[data-theme="graphite"] body { background: #15181c; }
html[data-theme="graphite"] .site-header { min-height: 78px; border-bottom-color: #30363d; }
html[data-theme="graphite"] .brand-mark { width: 36px; height: 36px; transform: rotate(-5deg); }
html[data-theme="graphite"] .hero { grid-template-columns: minmax(240px, .54fr) minmax(0, 1.46fr); gap: 52px; min-height: 430px; padding: 45px 0 52px; }
html[data-theme="graphite"] .update-panel { order: -1; min-height: 330px; align-self: stretch; display: flex; flex-direction: column; justify-content: end; padding: 20px; border: 0; background: linear-gradient(145deg, #2a3032 0 45%, #20252a 45% 100%); }
html[data-theme="graphite"] .update-panel::after { position: absolute; top: 22%; left: 24%; width: 130px; height: 130px; border: 20px solid var(--cyan); border-radius: 50%; opacity: .8; content: ""; }
html[data-theme="graphite"] .panel-topline, html[data-theme="graphite"] .panel-number, html[data-theme="graphite"] .panel-label, html[data-theme="graphite"] .panel-update { z-index: 1; }
html[data-theme="graphite"] .panel-ring { display: none; }
html[data-theme="graphite"] .panel-number { font-size: 72px; }
html[data-theme="graphite"] .hero-copy { text-align: right; }
html[data-theme="graphite"] .hero-description { margin-left: auto; }
html[data-theme="graphite"] .hero-actions { justify-content: end; }
html[data-theme="graphite"] .hero h1 { font-size: clamp(76px, 10vw, 124px); line-height: .88; letter-spacing: -.095em; }
html[data-theme="graphite"] .headline-outline { -webkit-text-stroke-width: 1px; }
html[data-theme="graphite"] .project-section { order: 1; }
html[data-theme="graphite"] .path-section { order: 2; }
html[data-theme="graphite"] .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
html[data-theme="graphite"] .project-card { min-height: 210px; padding: 19px; border: 0; background: linear-gradient(145deg, #262d34, #1d2228); }

@media (max-width: 800px) {
  html[data-theme="fresh"] .path-grid { grid-template-columns: repeat(3, 1fr); }
  html[data-theme="paper"] .path-grid { grid-template-columns: repeat(3, 1fr); }
  html[data-theme="graphite"] .hero { grid-template-columns: minmax(200px, .55fr) minmax(0, 1fr); gap: 25px; }
  html[data-theme="graphite"] .hero h1 { font-size: clamp(64px, 9vw, 86px); }
  html[data-theme="graphite"] .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  html[data-theme="fresh"] .hero { grid-template-columns: 1fr; gap: 25px; padding-top: 38px; }
  html[data-theme="fresh"] .hero h1 { font-size: clamp(54px, 14vw, 72px); }
  html[data-theme="fresh"] .update-panel { min-height: 190px; border-radius: 28px 10px 28px 10px; }
  html[data-theme="fresh"] .path-grid, html[data-theme="paper"] .path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html[data-theme="fresh"] .path-card, html[data-theme="paper"] .path-card { min-height: 92px; border: 0; border-radius: 12px; }
  html[data-theme="fresh"] .latest-list { grid-template-columns: 1fr; }
  html[data-theme="fresh"] .latest-row { min-height: 105px; }
  html[data-theme="paper"] .hero { grid-template-columns: 1fr; padding-top: 44px; }
  html[data-theme="paper"] .update-panel { min-height: 150px; }
  html[data-theme="graphite"] .hero { grid-template-columns: 1fr; gap: 18px; padding-top: 35px; }
  html[data-theme="graphite"] .update-panel { order: 1; min-height: 180px; }
  html[data-theme="graphite"] .hero-copy { text-align: left; }
  html[data-theme="graphite"] .hero-description { margin-left: 0; }
  html[data-theme="graphite"] .hero-actions { justify-content: start; }
  html[data-theme="graphite"] .hero h1 { font-size: clamp(57px, 15vw, 76px); }
  html[data-theme="graphite"] .project-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
}


/* Current homepage order: games before the content index in every theme. */
.site-shell main > section { order: initial; }
.site-shell main > .hero { order: 0; }
.site-shell main > .path-section { order: 1; }
.site-shell main > .play-section { order: 2; }
.site-shell main > .latest-section { order: 3; }
.site-shell main > .library-section { order: 4; }
.site-shell main > .mac-section { order: 5; }
.site-shell main > .project-section { order: 6; }
.site-shell main > .services-section { order: 7; }
.site-shell main > .about-section { order: 8; }
.site-shell main > .contact-section { order: 9; }
.games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.game-card-wrap { min-width: 0; }
.game-card { height: 100%; display: flex; flex-direction: column; padding: 17px; border-color: var(--line-bright); transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.game-card:hover { transform: translateY(-3px); border-color: var(--cyan); background: var(--panel-raised); }
.game-card-body { grid-template-columns: 1fr; gap: 13px; }
.game-art { height: 150px; }
.game-card-copy { display: flex; flex-direction: column; align-items: flex-start; }
.game-description { min-height: 0; font-size: 12px; }
.game-inputs { font-size: 10px; }
.game-start { margin-top: 2px; }
.game-source { min-height: 30px; }
.resource-card { padding: 0; }
.resource-main { position: relative; width: 100%; min-height: 165px; display: flex; flex-direction: column; align-items: stretch; padding: 13px 14px 12px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.resource-main:hover { background: transparent; }
.resource-main h3 { margin: 12px 0 5px; }
.resource-main p { text-align: left; }
.resource-main .card-bottom { width: 100%; }
.resource-card footer { display: flex; justify-content: flex-end; padding: 0 14px 12px; color: var(--quiet); font-size: 10px; }
.resource-card footer a { color: var(--cyan); }
.card-art { position: absolute; right: 12px; top: 12px; width: 48px; height: 48px; overflow: hidden; opacity: .18; pointer-events: none; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.latest-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); color: inherit; background: transparent; text-align: left; cursor: pointer; font: inherit; }
.latest-row:hover .latest-copy strong { color: var(--cyan); }
.project-card .text-link, .service-card .text-link { margin-top: auto; padding: 11px 0 0; border: 0; color: var(--cyan); background: transparent; text-align: left; cursor: pointer; font-size: 11px; }
.project-status { margin-top: 9px; color: var(--quiet); font-size: 10px; line-height: 1.5; }
.services-section { padding-top: 58px; }
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.service-card { min-height: 155px; display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--line); background: var(--panel); }
.service-card h3 { margin: 9px 0 5px; font-size: 15px; }
.service-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.contact-section { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; margin-top: 55px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact-section h2 { margin: 0 auto 0 0; font-size: 20px; }
.purchase-history { min-height: 34px; padding: 0 11px; border: 1px solid var(--line-bright); color: var(--muted); background: var(--panel); cursor: pointer; font-size: 10px; }
.purchase-history:hover { border-color: var(--cyan); color: var(--cyan); }
.site-footer p a { color: var(--muted); }
.site-header .main-nav a[aria-current="location"] { color: var(--cyan); }
@media (max-width: 900px) {
  .site-header { gap: 14px; }
  .main-nav { gap: 10px; }
  .main-nav a { font-size: 10px; }
  .header-contact { padding-left: 11px; font-size: 10px; }
  .games-grid { grid-template-columns: 1fr 1fr; }
  .games-grid > :last-child { grid-column: 1 / -1; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .site-header { gap: 9px; }
  .header-contact { padding-left: 0; }
  .games-grid { grid-template-columns: 1fr; }
  .games-grid > :last-child { grid-column: auto; }
  .game-card-body { grid-template-columns: 105px minmax(0, 1fr); gap: 12px; }
  .game-art { height: 116px; }
  .service-grid { grid-template-columns: 1fr; }
  .contact-section { align-items: flex-start; flex-direction: column; }
  .contact-section h2 { margin-right: 0; }
  .path-card:nth-child(4), .path-card:nth-child(5), .path-card:nth-child(6) { border-bottom: 1px solid var(--line) !important; }
  .path-card:nth-child(7) { border-right: 0; }
  .path-card:nth-child(7) { border-bottom: 0 !important; }
  .resource-main { min-height: 150px; }
}

/* Modal controls follow the selected theme while retaining the existing checkout flow. */
dialog { color: var(--ink); border: 1px solid var(--line-bright); border-radius: 8px; background: var(--panel); box-shadow: 0 24px 90px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(2, 7, 12, .7); backdrop-filter: blur(3px); }
.dialog-close { color: var(--muted); }
.dialog-actions > button, .dialog-action { border: 1px solid var(--line-bright); border-radius: 0; color: var(--accent-ink); background: var(--cyan); }
.dialog-actions > button:disabled { color: var(--quiet); background: var(--panel-raised); }
.prompt-content { border-radius: 0; color: var(--ink); background: var(--control); }
.dialog-source a { border-color: var(--line-bright); }
.checkout-price { color: var(--amber); }

/* Ink and cobalt homepage: keep the existing content and controls intact. */
html[data-theme="tech"] {
  color-scheme: light;
  --bg: #f8f5ee;
  --panel: #f3efe7;
  --panel-raised: #fffdf8;
  --panel-deep: #f3efe7;
  --line: #dedbd3;
  --line-bright: #c6c2b8;
  --ink: #171816;
  --muted: #5c605e;
  --quiet: #767d7d;
  --cyan: #073ad2;
  --amber: #9a4434;
  --green: #073ad2;
  --accent-ink: #fff;
  --accent-hover: #002cae;
  --control: #fffdf8;
  --tile-2: #dcc9b4;
  --tile-4: #d0b291;
  --tile-8: #e59462;
  --tile-32: #d56937;
  --piece-1: #073ad2;
  --piece-2: #cfdbed;
  --piece-3: #d85143;
  --piece-border: #f7f4eb;
}
html[data-theme] { --content: 1320px; --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun, serif; }
html[data-theme] body { background: var(--bg); }
html[data-theme] .site-shell { width: min(var(--content), calc(100% - 88px)); }
html[data-theme] .site-header { min-height: 80px; border-bottom: 1px solid var(--line); }
html[data-theme] .brand { gap: 13px; }
.brand-calligraphy { font: 700 34px/1 "STKaiti", "Kaiti SC", KaiTi, var(--serif); letter-spacing: -.12em; }
html[data-theme] .brand-name { padding-left: 13px; border-left: 1px solid var(--line-bright); font-size: 12px; letter-spacing: .04em; }
html[data-theme] .main-nav { gap: clamp(20px, 3vw, 48px); }
html[data-theme] .main-nav a { position: relative; color: var(--ink); font-size: 13px; font-weight: 600; }
html[data-theme] .main-nav a:hover, html[data-theme] .main-nav a[aria-current="location"] { color: var(--cyan); }
html[data-theme] .theme-picker { margin-left: 10px; }
html[data-theme] .hero { position: relative; display: grid; grid-template-columns: 42% 1fr; gap: 0; align-items: center; min-height: 570px; padding: 38px 0 0; overflow: hidden; }
html[data-theme] .hero-copy { position: relative; z-index: 2; align-self: center; padding-bottom: 44px; text-align: left; }
html[data-theme] .hero-kicker { margin-bottom: 18px; color: var(--quiet); font-size: 10px; letter-spacing: .18em; }
html[data-theme] .hero h1 { margin: 0 0 3px; color: var(--ink); font: 800 clamp(100px, 13vw, 174px)/1 "STKaiti", "Kaiti SC", KaiTi, var(--serif); letter-spacing: -.14em; }
.hero-role { margin: 12px 0 22px; color: var(--ink); font: 600 clamp(29px, 3vw, 42px)/1.25 var(--serif); letter-spacing: .07em; }
html[data-theme] .hero-description { max-width: 100%; margin: 0; color: var(--ink); font: 16px/1.9 var(--serif); }
.hero-bio { max-width: 360px; margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.hero-subjects { margin: 23px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .18em; }
.hero-subjects::before { display: inline-block; width: 24px; margin-right: 12px; border-top: 1px solid var(--quiet); vertical-align: middle; content: ""; }
html[data-theme] .hero-actions { justify-content: flex-start; margin-top: 26px; }
.hero-discover { display: inline-flex; align-items: center; gap: 10px; color: var(--cyan); font-size: 12px; font-weight: 600; }
.hero-discover span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-bright); border-radius: 50%; color: var(--ink); font-size: 16px; transition: color .2s, border-color .2s; }
.hero-discover:hover span { border-color: var(--cyan); color: var(--cyan); }
.hero-visual { position: absolute; right: -2%; bottom: 0; width: 70%; height: 100%; display: flex; align-items: end; justify-content: end; pointer-events: none; }
.hero-visual img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: right bottom; }
.hero-aside { position: absolute; z-index: 1; top: 24%; right: 0; margin: 0; padding-left: 15px; border-left: 1px solid var(--line-bright); color: var(--quiet); font: 12px/1.9 var(--serif); letter-spacing: .12em; }
html[data-theme] .update-panel { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); }
html[data-theme] main > .library-section { order: 1; }
html[data-theme] main > .play-section { order: 2; }
html[data-theme] main > .services-section { order: 3; }
html[data-theme] .library-section, html[data-theme] .play-section, html[data-theme] .services-section { padding: 58px 0 0; border-top: 1px solid var(--line); }
html[data-theme] .section-heading { align-items: end; margin-bottom: 25px; }
html[data-theme] .section-heading h2 { margin-top: 13px; font: 600 clamp(30px, 3vw, 40px)/1.25 var(--serif); letter-spacing: .02em; }
html[data-theme] .section-kicker { color: var(--quiet); font: 11px/1.4 var(--mono); letter-spacing: .08em; }
html[data-theme] .section-note { max-width: 370px; font: 13px/1.8 var(--serif); }
html[data-theme] .purchase-history { min-height: 38px; margin: 0; padding: 0 12px; border: 1px solid var(--line-bright); background: transparent; color: var(--muted); font-size: 11px; }
html[data-theme] .library-controls { padding: 14px 0; }
html[data-theme] .filter-button { min-height: 36px; padding: 0 14px; font-size: 12px; }
html[data-theme] .filter-button[aria-pressed="true"] { border-color: var(--cyan); background: var(--cyan); color: var(--accent-ink); }
html[data-theme] .filter-button[aria-pressed="true"] .filter-count { color: inherit; opacity: .75; }
html[data-theme] .search-box { min-height: 40px; background: var(--panel-raised); }
html[data-theme] .search-box input { font-size: 12px; }
html[data-theme] .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
html[data-theme] .resource-card { min-height: 218px; padding: 0; border: 1px solid var(--line); border-radius: 0; background: var(--panel); box-shadow: none; }
html[data-theme] .resource-card:hover, html[data-theme] .resource-card:focus-within { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 12px 25px -20px var(--cyan); }
html[data-theme] .resource-main { min-height: 180px; padding: 20px 20px 16px; }
html[data-theme] .resource-main h3 { margin: 15px 0 10px; font: 600 21px/1.35 var(--serif); letter-spacing: 0; }
html[data-theme] .resource-main p { max-width: 100%; min-height: 0; font-size: 12px; line-height: 1.8; }
html[data-theme] .card-open { color: var(--cyan); font-size: 11px; }
html[data-theme] .resource-card footer { justify-content: flex-end; padding: 0 20px 14px; border: 0; background: transparent; }
html[data-theme] .card-art { top: 15px; right: 15px; bottom: auto; width: 50px; height: 50px; opacity: .12; }
html[data-theme] .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
html[data-theme] .game-card { min-height: 290px; padding: 20px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); }
html[data-theme] .game-card h3 { font: 600 25px/1.3 var(--serif); }
html[data-theme] .game-card-body { grid-template-columns: 112px minmax(0, 1fr); gap: 17px; flex: 1; }
html[data-theme] .game-art { height: 112px; }
html[data-theme] .game-art-2048 { grid-template-columns: repeat(2, 34px); grid-template-rows: repeat(2, 34px); }
html[data-theme] .game-art-tetris { grid-template-columns: repeat(6, 12px); grid-template-rows: repeat(5, 12px); }
html[data-theme] .game-description { margin-top: 0; font-size: 12px; line-height: 1.7; }
html[data-theme] .game-start { color: var(--cyan); border: 0; padding: 0; background: transparent; }
html[data-theme] .game-start:hover { color: var(--cyan); background: transparent; }
html[data-theme] .game-source { font-size: 10px; }
html[data-theme] .service-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
html[data-theme] .service-card { min-height: 210px; padding: 24px 20px; background: var(--panel); }
html[data-theme] .service-card::before { display: block; width: 30px; height: 3px; margin-bottom: 22px; background: var(--cyan); content: ""; }
html[data-theme] .service-card h3 { margin: 12px 0 9px; font: 600 20px/1.35 var(--serif); }
html[data-theme] .service-card p { font-size: 12px; line-height: 1.8; }
html[data-theme] .service-card .text-link { font-size: 11px; }
html[data-theme] .site-footer { margin-top: 60px; padding: 30px 0; border-top: 1px solid var(--line); }
html[data-theme] dialog { border-radius: 2px; }
html[data-theme] .dialog-download { border-radius: 0; color: var(--accent-ink); background: var(--cyan); }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  html[data-theme] .site-shell { width: calc(100% - 48px); }
  html[data-theme] .hero { min-height: 480px; }
  .hero-aside { display: none; }
  html[data-theme] .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-theme] .games-grid > :last-child { grid-column: 1 / -1; }
  html[data-theme] .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  html[data-theme] .site-shell { width: calc(100% - 36px); }
  html[data-theme] .site-header { min-height: 67px; }
  .brand-calligraphy { font-size: 29px; }
  html[data-theme] .brand-name { font-size: 11px; }
  html[data-theme] .main-nav { top: 66px; gap: 0; }
  html[data-theme] .main-nav a { font-size: 13px; }
  html[data-theme] .hero { grid-template-columns: 1fr; min-height: 660px; padding: 40px 0 0; align-items: start; }
  html[data-theme] .hero-copy { align-self: start; padding-bottom: 0; }
  html[data-theme] .hero-kicker { margin-bottom: 12px; }
  html[data-theme] .hero h1 { font-size: clamp(88px, 23vw, 120px); }
  .hero-role { margin: 7px 0 14px; font-size: 28px; }
  html[data-theme] .hero-description { max-width: 100%; font-size: 14px; }
  .hero-subjects { margin-top: 15px; font-size: 10px; }
  html[data-theme] .hero-actions { margin-top: 18px; }
  .hero-visual { right: -5%; width: 110%; height: 54%; }
  html[data-theme] .library-section, html[data-theme] .play-section, html[data-theme] .services-section { padding-top: 42px; }
  html[data-theme] .section-heading { display: block; margin-bottom: 20px; }
  html[data-theme] .section-heading h2 { margin-top: 8px; font-size: 30px; }
  html[data-theme] .section-note { max-width: 100%; margin-top: 8px; text-align: left; }
  html[data-theme] .purchase-history { margin-top: 14px; }
  html[data-theme] .library-controls { padding: 10px 0; }
  html[data-theme] .search-box { width: 100%; }
  html[data-theme] .resource-grid { grid-template-columns: 1fr; gap: 10px; }
  html[data-theme] .resource-card { min-height: 0; }
  html[data-theme] .resource-main { min-height: 155px; }
  html[data-theme] .games-grid { grid-template-columns: 1fr; }
  html[data-theme] .games-grid > :last-child { grid-column: auto; }
  html[data-theme] .game-card { min-height: 205px; }
  html[data-theme] .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html[data-theme] .service-card { min-height: 205px; padding: 20px 15px; }
  html[data-theme] .service-card h3 { font-size: 17px; }
  html[data-theme] .site-footer { margin-top: 42px; }
}

/* Blend the artwork into each theme while keeping the blue-cat scene legible. */
html[data-theme] .hero-visual img {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 14%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 14%);
  mask-composite: intersect;
}
html[data-theme="graphite"] .hero-visual img { content: url('visuals/invest-hero-dark.webp'); filter: none; }
html[data-theme="graphite"] .main-nav a { color: #f0f1ed; }
html[data-theme="graphite"] .main-nav a:hover, html[data-theme="graphite"] .main-nav a[aria-current="location"] { color: var(--cyan); }
.hero-aside { top: 14px; padding: 7px 10px 7px 15px; background: var(--bg); color: var(--muted); font-size: 13px; }
.hero-bio { font-size: 13px; }
.hero-subjects { font-size: 13px; }
html[data-theme] .section-note, html[data-theme] .resource-main p, html[data-theme] .game-description, html[data-theme] .service-card p { font-size: 14px; }
html[data-theme] .card-open, html[data-theme] .service-card .text-link { font-size: 12px; }
@media (max-width: 620px) {
  .hero-subjects { font-size: 11px; }
  html[data-theme] .section-note, html[data-theme] .resource-main p, html[data-theme] .game-description, html[data-theme] .service-card p { font-size: 13px; }
}

/* Keep the graphite palette readable across cards, controls and dialogs. */
html[data-theme="graphite"] .resource-card,
html[data-theme="graphite"] .game-card,
html[data-theme="graphite"] .service-card,
html[data-theme="graphite"] dialog {
  color: #f0f1ed;
  background: #1d2228;
  border-color: #49525a;
}
html[data-theme="graphite"] .resource-card:hover,
html[data-theme="graphite"] .resource-card:focus-within,
html[data-theme="graphite"] .game-card:hover { background: #262d34; }
html[data-theme="graphite"] .resource-main { color: #f0f1ed; background: transparent; }
html[data-theme="graphite"] .resource-main h3,
html[data-theme="graphite"] .game-card h3,
html[data-theme="graphite"] .service-card h3,
html[data-theme="graphite"] dialog h2 { color: #f0f1ed; }
html[data-theme="graphite"] .resource-main p,
html[data-theme="graphite"] .game-description,
html[data-theme="graphite"] .service-card p,
html[data-theme="graphite"] .dialog-description,
html[data-theme="graphite"] .dialog-detail { color: #c5cac7; }
html[data-theme="graphite"] .card-type,
html[data-theme="graphite"] .card-open,
html[data-theme="graphite"] .resource-card footer a,
html[data-theme="graphite"] .game-start,
html[data-theme="graphite"] .service-card .text-link { color: #d2df86; }
html[data-theme="graphite"] .card-source,
html[data-theme="graphite"] .resource-card footer,
html[data-theme="graphite"] .game-source,
html[data-theme="graphite"] .game-source a { color: #bac1bd; }
html[data-theme="graphite"] .filter-button { color: #d5d9d6; }
html[data-theme="graphite"] .filter-button[aria-pressed="true"] { color: #15181c; background: #d2df86; border-color: #d2df86; }
html[data-theme="graphite"] .filter-button:not([aria-pressed="true"]):hover,
html[data-theme="graphite"] .search-box,
html[data-theme="graphite"] .theme-picker select,
html[data-theme="graphite"] .prompt-content { color: #f0f1ed; background: #262d34; border-color: #49525a; }
html[data-theme="graphite"] .search-box input { color: #f0f1ed; }
html[data-theme="graphite"] .search-box input::placeholder { color: #bac1bd; }
html[data-theme="graphite"] .dialog-actions > button,
html[data-theme="graphite"] .dialog-action,
html[data-theme="graphite"] .dialog-download { color: #15181c; background: #d2df86; border-color: #d2df86; }
html[data-theme="graphite"] .dialog-actions > button:disabled { color: #bac1bd; background: #262d34; border-color: #49525a; }

/* Homepage follows the four compact editorial sections of the approved concept. */
html[data-theme] main > .featured-prompts { order: 1; }
html[data-theme] main > .featured-skills { order: 2; }
html[data-theme] main > .featured-agents { order: 3; }
html[data-theme] main > .play-section { order: 4; }
html[data-theme] main > .services-section { order: 5; }
html[data-theme] main > .library-section { order: 6; }
html[data-theme] .featured-section { display: grid; grid-template-columns: minmax(205px, 24%) minmax(0, 1fr); gap: 30px; padding: 38px 0; border-top: 1px solid var(--line); }
.featured-intro h2 { margin: 15px 0; color: var(--ink); font: 600 clamp(30px, 2.7vw, 39px)/1.15 var(--serif); letter-spacing: .02em; }
.featured-intro h3 { margin: 0 0 18px; font: 600 clamp(16px, 1.5vw, 20px)/1.4 var(--serif); }
.featured-intro > p:not(.feature-number) { margin: 0; color: var(--muted); font: 14px/1.9 var(--serif); }
.feature-number { display: flex; align-items: start; gap: 11px; margin: 0; color: var(--quiet); font: 10px/1.15 var(--serif); }
.feature-number strong { color: var(--ink); font: 20px/1 var(--serif); }
.feature-link { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; color: var(--cyan); font: 600 14px var(--serif); }
.feature-link > span, .circle-arrow { display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid currentColor; border-radius: 50%; line-height: 1; }
.feature-link:not(.text-only) > span { color: white; border-color: var(--cyan); background: var(--cyan); }
.feature-link.text-only > span { width: auto; height: auto; border: 0; }
.prompt-covers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.prompt-cover { position: relative; isolation: isolate; min-height: 300px; overflow: hidden; padding: 24px 23px 22px; border: 0; color: var(--ink); background: #efece4; text-align: left; cursor: pointer; transition: transform .2s ease; }
.prompt-cover:hover, .skill-highlight:hover, .service-feature button:hover { transform: translateY(-4px); }
.prompt-cover::before { position: absolute; z-index: -1; inset: 40% 0 0; background: linear-gradient(145deg, transparent 48%, rgba(25,27,27,.16) 49%, #222 77%, #080b0b 100%); clip-path: polygon(0 100%, 0 88%, 12% 75%, 23% 80%, 39% 42%, 49% 62%, 61% 27%, 76% 58%, 88% 34%, 100% 55%, 100% 100%); content: ""; }
.prompt-cover-2 { color: #fff; background: #073ad2; }
.prompt-cover-2::before { background: linear-gradient(140deg, #f8f5ee 20%, #929391 54%, #131515 85%); }
.cover-title { display: block; font: 600 clamp(20px, 2vw, 27px)/1.25 var(--serif); }
.cover-desc { display: -webkit-box; max-width: 14em; overflow: hidden; margin-top: 16px; color: inherit; opacity: .76; font: 13px/1.8 var(--serif); -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.prompt-cover .circle-arrow { position: absolute; bottom: 18px; left: 22px; width: 30px; height: 30px; background: #f8f5ee; color: #171816; }
.skill-highlights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.skill-highlight { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; padding: 5px 20px; border: 0; border-left: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; cursor: pointer; transition: transform .2s ease; }
.skill-highlight strong { font: 600 17px/1.45 var(--serif); }
.skill-highlight > span:last-child { display: -webkit-box; overflow: hidden; color: var(--muted); font: 12px/1.7 var(--serif); -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.skill-symbol { position: relative; height: 42px; font: 700 35px/1 sans-serif; }
.skill-symbol i { position: absolute; right: -4px; bottom: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.agent-feature { display: flex; width: 100%; min-height: 210px; padding: 0; overflow: hidden; border: 1px solid var(--line); color: var(--ink); background: var(--panel); text-align: left; cursor: pointer; }
.agent-feature:hover { border-color: var(--cyan); }
.agent-image { width: 230px; flex: 0 0 230px; background: #f5ecd6; }
.agent-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.agent-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; padding: 24px 32px; }
.agent-copy small { color: var(--quiet); font: 11px var(--mono); letter-spacing: .08em; }
.agent-copy strong { font: 600 27px/1.2 var(--serif); }
.agent-copy > span:not(.agent-link) { max-width: 460px; color: var(--muted); font: 14px/1.8 var(--serif); }
.agent-copy .agent-link { color: var(--cyan); font-size: 13px; }
.checkout-contact:not([hidden]) { display: grid; gap: 10px; margin: 20px 0; }
.checkout-contact label { color: var(--ink); font-size: 14px; }
.checkout-contact input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-bright); color: var(--ink); background: var(--panel); font: inherit; }
.checkout-contact button { min-height: 44px; padding: 10px 16px; border: 0; color: var(--bg); background: var(--cyan); cursor: pointer; }
.checkout-contact button:disabled { opacity: .55; cursor: default; }
html[data-theme] .game-card .game-art-arcade { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; color: #d2df86; background: #252d2b; border: 5px solid #404a43; }
.game-art-arcade span { font: 48px/1 var(--mono); }
.game-art-arcade small { text-align: center; font: 700 10px/1.2 var(--mono); letter-spacing: .08em; }
html[data-theme] .game-card .game-art-hop { color: #f9e9c6; background: #183b76; border-color: #35629f; }
html[data-theme] .play-section, html[data-theme] .services-section { align-items: start; }
html[data-theme] .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
html[data-theme] .game-card { position: relative; display: flex; min-height: 210px; overflow: hidden; padding: 24px; border: 0; border-radius: 3px; color: var(--ink); background: var(--panel); }
html[data-theme] .game-card-copy { position: relative; z-index: 1; width: 60%; }
html[data-theme] .game-card h3 { margin: 0 0 14px; font: 600 28px/1.2 var(--serif); }
html[data-theme] .game-card-copy p { color: var(--muted); font: 13px/1.8 var(--serif); }
html[data-theme] .game-card .circle-arrow { position: absolute; bottom: 0; left: 0; width: 30px; height: 30px; }
html[data-theme] .game-card .game-art { position: absolute; right: 8%; bottom: 14px; width: 39%; height: 86%; transform: rotate(6deg); box-shadow: 5px 8px 10px #0003; }
html[data-theme] .game-card .game-art-2048 { display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); gap: 4px; padding: 9px; border: 6px solid #f3dfc2; background: #bca387; }
html[data-theme] .game-art-2048 span { color: #6e5c50; background: #e9d8c3; font: 700 clamp(15px, 1.4vw, 24px)/1 var(--sans); }
html[data-theme] .game-art-2048 span:nth-child(n+3) { color: white; background: #ed9565; }
html[data-theme] .game-art-2048 span:nth-child(n+5) { background: #da6635; }
html[data-theme] .game-card .game-art-tetris { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(7, 1fr); gap: 2px; padding: 12px; border: 5px solid #262829; background: repeating-linear-gradient(0deg,#111 0 18px,#242424 19px 20px); }
html[data-theme] .game-art-tetris i { background: #f5f2e9; }
html[data-theme] .game-art-tetris i:nth-child(1) { grid-area: 2 / 4; background: #073ad2; }
html[data-theme] .game-art-tetris i:nth-child(2) { grid-area: 3 / 3; background: #073ad2; }
html[data-theme] .game-art-tetris i:nth-child(3) { grid-area: 3 / 4; background: #073ad2; }
html[data-theme] .game-art-tetris i:nth-child(4) { grid-area: 4 / 5; background: #e84e40; }
html[data-theme] .game-art-tetris i:nth-child(5) { grid-area: 5 / 2; }
html[data-theme] .game-art-tetris i:nth-child(6) { grid-area: 6 / 2; }
html[data-theme] .game-art-tetris i:nth-child(7) { grid-area: 6 / 3; }
html[data-theme] .game-source, .source-note { color: var(--quiet); font-size: 10px; }
html[data-theme] .game-source { margin-top: 4px; }
.source-note { margin: 8px 0 0; }
.service-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.service-feature { background: var(--panel); }
.service-feature .service-detail { width: 100%; padding: 0; border: 0; color: var(--ink); background: var(--panel); text-align: left; cursor: pointer; transition: transform .2s ease; }
.service-feature .service-buy { margin: 0 18px 18px; padding: 8px 12px; border: 1px solid var(--cyan); color: var(--cyan); background: transparent; font-size: 13px; cursor: pointer; }
.service-feature .service-buy:hover { color: var(--bg); background: var(--cyan); }
.service-feature .service-buy:disabled { opacity: .55; cursor: default; }
.service-feature-art { display: block; height: 120px; background: linear-gradient(115deg,#151719 55%,#073ad2 55%); }
.service-art-2 { background: linear-gradient(155deg,#171819 38%,#f6f1e9 39% 46%,#073ad2 47%); }
.service-art-3 { background: radial-gradient(circle at 70% 30%,#073ad2 0 24%,transparent 25%),linear-gradient(145deg,#f3eee3 55%,#222 56%); }
.service-feature-copy { display: flex; min-height: 190px; flex-direction: column; align-items: flex-start; padding: 18px 18px 15px; }
.service-feature-copy strong { font: 600 19px/1.3 var(--serif); }
.service-feature-copy small { margin: 2px 0 12px; color: var(--quiet); font: 10px/1.4 var(--serif); }
.service-feature-copy > span:not(.circle-arrow) { display: -webkit-box; overflow: hidden; color: var(--muted); font: 12px/1.7 var(--serif); -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.service-feature-copy .circle-arrow { width: 28px; height: 28px; margin-top: auto; }
.more-services { margin-top: 20px; }
.more-services summary, .library-drawer summary { color: var(--cyan); cursor: pointer; font: 600 14px var(--serif); }
.more-services .service-grid { margin-top: 20px; }
html[data-theme] .library-section { padding-top: 28px; }
.library-section:not(:has(.library-drawer[open])) { display: none; }
.library-drawer > summary { display: flex; justify-content: space-between; padding: 14px 0 20px; }
.library-drawer[open] > summary { border-bottom: 1px solid var(--line); }
.library-drawer .library-heading { margin-top: 30px; }
@media (max-width: 900px) {
  html[data-theme] .featured-section { grid-template-columns: minmax(165px, 25%) minmax(0, 1fr); gap: 18px; }
  .prompt-covers, .service-feature-grid { gap: 10px; }
  .prompt-cover { min-height: 260px; padding: 18px 14px; }
  .skill-highlight { padding: 4px 10px; }
  .skill-highlight strong { font-size: 15px; }
  html[data-theme] .games-grid > :last-child { grid-column: auto; }
}
@media (max-width: 620px) {
  html[data-theme] .featured-section { display: block; padding: 30px 0; }
  .featured-intro { margin-bottom: 22px; }
  .featured-intro h2 { margin: 10px 0; font-size: 30px; }
  .featured-intro h3 { margin-bottom: 8px; }
  .featured-intro > p:not(.feature-number) { font-size: 13px; }
  .feature-link { margin-top: 12px; }
  .prompt-covers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .prompt-cover { min-height: 200px; padding: 14px 10px; }
  .cover-title { font-size: 16px; }
  .cover-desc { margin-top: 8px; font-size: 11px; -webkit-line-clamp: 3; }
  .prompt-cover .circle-arrow { left: 10px; bottom: 10px; width: 25px; height: 25px; }
  .skill-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  .skill-highlight { min-height: 140px; }
  .agent-image { width: 38%; flex-basis: 38%; }
  .agent-copy { gap: 8px; padding: 18px; }
  .agent-copy strong { font-size: 22px; }
  .agent-copy > span:not(.agent-link) { font-size: 13px; }
  html[data-theme] .games-grid { grid-template-columns: 1fr; }
  html[data-theme] .game-card { min-height: 190px; }
  .service-feature-grid { grid-template-columns: 1fr; gap: 10px; }
  .service-feature .service-detail { display: grid; grid-template-columns: 40% 1fr; }
  .service-feature-art { height: 100%; min-height: 170px; }
  .service-feature-copy { min-height: 170px; padding: 15px; }
}

@font-face { font-family: 'Ma Shan Zheng Local'; src: url('visuals/MaShanZheng-zhilin.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
.brand-calligraphy { font-family: 'Ma Shan Zheng Local', 'STKaiti', 'Kaiti SC', KaiTi, var(--serif); font-weight: 400; }
.service-art-1 { background: #151719 url('visuals/invest-card-workflow.webp') center/cover no-repeat; }
.service-art-2 { background: #151719 url('visuals/invest-card-trend.webp') center/cover no-repeat; }
.service-art-3 { background: #151719 url('visuals/invest-card-risk.webp') center/cover no-repeat; }
.prompt-cover::before { inset: 45% 0 0; background: linear-gradient(to bottom, #efece4, transparent 34%), url('visuals/invest-card-risk.webp') center bottom/cover; clip-path: none; }
.prompt-cover-2::before { background: linear-gradient(to bottom, #073ad2, transparent 35%), url('visuals/invest-card-trend.webp') center bottom/cover; }
.prompt-cover-3::before { background: linear-gradient(to bottom, #efece4, transparent 34%), url('visuals/invest-card-workflow.webp') right bottom/cover; }
html[data-theme] .prompt-cover-1, html[data-theme] .prompt-cover-3 { color: #171816; }
html[data-theme] .site-header { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; }
html[data-theme] .main-nav { justify-content: center; width: 100%; margin-left: 0; }
html[data-theme] .theme-picker { margin-left: auto; }
@media (min-width: 621px) {
  html[data-theme] .main-nav { gap: clamp(22px, 2.5vw, 38px); background: transparent; }
  html[data-theme] .main-nav a { color: var(--muted); font-weight: 500; white-space: nowrap; }
  html[data-theme] .main-nav a:hover, html[data-theme] .main-nav a[aria-current="location"] { color: var(--cyan); }
  html[data-theme] .theme-picker { gap: 8px; padding-left: 20px; border-left: 1px solid var(--line); }
  html[data-theme] .theme-picker select { min-height: 32px; padding: 0 8px; border-color: transparent; border-radius: 4px; color: var(--muted); background: transparent; font-size: 12px; }
  html[data-theme] .theme-picker select:hover { color: var(--ink); background: var(--panel); }
  html[data-theme] .theme-picker select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
}
@media (min-width: 621px) and (max-width: 900px) {
  html[data-theme] .main-nav { gap: 10px; }
  html[data-theme] .theme-picker { padding-left: 10px; }
}
html[data-theme] .hero { min-height: 520px; }
html[data-theme] .hero-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; color: var(--quiet); font-size: 10px; letter-spacing: .12em; }
html[data-theme] .hero-kicker span { padding: 0; color: inherit; }
html[data-theme] .hero-kicker span:first-child { color: var(--cyan); font-weight: 700; }
html[data-theme] .hero-kicker span:first-child::before { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: currentColor; content: ""; }
html[data-theme] .hero-kicker span + span { padding-left: 12px; border-left: 1px solid var(--line-bright); }
html[data-theme] .hero h1 { margin: 0 0 24px; font: 600 clamp(36px, 3.8vw, 52px)/1.25 var(--serif); letter-spacing: .04em; }
@media (max-width: 620px) {
  html[data-theme] .site-header { display: flex; }
  html[data-theme] .main-nav { width: auto; }
  html[data-theme] .hero { min-height: 590px; }
  html[data-theme] .hero-kicker { margin-bottom: 20px; font-size: 9px; }
  html[data-theme] .hero h1 { margin-bottom: 18px; font-size: clamp(32px, 8vw, 40px); }
}

/* Keep cover copy and game credits in their own space at every viewport. */
.prompt-cover { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; }
.prompt-cover::before { inset: 60% 0 0; }
.cover-desc { line-height: 1.5; }
.game-card-wrap { display: flex; flex-direction: column; }
html[data-theme] .game-card { height: auto; flex: 1 0 auto; }
html[data-theme] .game-card-copy { align-self: stretch; }
html[data-theme] .game-card-copy p { margin: 0 0 12px; }
html[data-theme] .game-card .circle-arrow { position: static; margin-top: auto; }
html[data-theme] .game-source { min-height: 0; margin-top: 8px; padding-top: 7px; line-height: 1.5; }
.games-area .source-note { display: block; margin: 12px 0 0; line-height: 1.6; }
@media (max-width: 620px) {
  .prompt-cover { min-height: 220px; }
  .prompt-cover::before { inset: 70% 0 0; }
  .cover-desc { margin-top: 8px; line-height: 1.4; }
}
html[data-theme] .game-card-copy { width: 52%; }
html[data-theme] .game-card .game-art { right: 4%; width: 37%; }
@media (max-width: 620px) {
  .prompt-covers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt-cover:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 190px; }
}

/* Resource themes work alongside type and text search. */
.topic-filters { display: flex; align-items: center; gap: 12px; padding: 13px 0 4px; }
.topic-filters > span { flex: 0 0 auto; color: var(--quiet); font-size: 12px; }
.cover-price { display: inline-block; margin-top: 12px; color: inherit; font: 600 13px/1.4 var(--sans); }
@media (max-width: 620px) { .topic-filters { align-items: flex-start; } .topic-filters > span { padding-top: 10px; } }

/* Keep the investment Skill prominent when it is the only featured item. */
.skill-highlights { grid-template-columns: minmax(0, 1fr); }
.skill-highlight { max-width: 680px; padding: 10px 24px; }
.skill-highlight > span:not(.skill-symbol) { color: var(--muted); font: 14px/1.7 var(--serif); }
.skill-highlight > span.skill-feature-price { color: var(--cyan); font-weight: 600; }

html[data-theme] .game-card .game-art-trading { display: grid; place-items: center; padding: 14px; border: 5px solid var(--line); color: var(--cyan); background: var(--panel-raised); }
.game-art-trading svg { width: 100%; height: auto; }
@media (min-width: 1101px) { html[data-theme] .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }

/* Live A-share quote card in the hero; red rises and green falls, as in the A-share market. */
.market-card { --market-up: #e5484d; --market-down: #1aa36b; --market-flat: var(--muted); position: relative; z-index: 2; grid-column: 2; justify-self: end; align-self: center; width: min(100%, 440px); margin: 40px 6% 40px 0; padding: 22px 24px 16px; border: 1px solid var(--line-bright); border-radius: 18px; background: color-mix(in srgb, var(--panel) 82%, transparent); box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); font-family: var(--mono); }
.market-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px dashed var(--line-bright); }
.market-status { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font: 13px/1 var(--sans); letter-spacing: .04em; white-space: nowrap; }
.market-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--quiet); }
.market-status b { color: var(--quiet); font: 700 13px/1 var(--mono); letter-spacing: .14em; }
.market-card[data-state="live"] .market-status i { background: var(--market-up); box-shadow: 0 0 0 0 var(--market-up); animation: market-pulse 1.6s ease-out infinite; }
.market-card[data-state="live"] .market-status b { color: var(--market-up); }
.market-time { flex-basis: 100%; color: var(--quiet); font-size: 12px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.market-list { margin: 0; padding: 4px 0; list-style: none; }
.market-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(84px, auto) 92px; align-items: center; gap: 14px; padding: 13px 8px; margin: 0 -8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 8px; font-variant-numeric: tabular-nums; transition: background-color .25s; }
.market-row:last-child { border-bottom: 0; }
.market-name { overflow: hidden; color: var(--ink); font: 15px/1.3 var(--sans); white-space: nowrap; text-overflow: ellipsis; }
.market-price { color: var(--ink); font-size: 15px; text-align: right; }
.market-change { color: var(--market-flat); font-size: 15px; font-weight: 700; text-align: right; }
.market-change::before { display: inline-block; width: 1em; font-size: .7em; vertical-align: .12em; content: ""; }
.market-row[data-direction="up"] .market-change { color: var(--market-up); }
.market-row[data-direction="up"] .market-change::before { content: "▲"; }
.market-row[data-direction="down"] .market-change { color: var(--market-down); }
.market-row[data-direction="down"] .market-change::before { content: "▼"; }
.market-row.is-flash-up { animation: market-flash-up 1s ease-out; }
.market-row.is-flash-down { animation: market-flash-down 1s ease-out; }
.market-foot { padding-top: 12px; border-top: 1px dashed var(--line-bright); color: var(--quiet); font: 11px/1.6 var(--sans); letter-spacing: .04em; }
.market-card[data-state="error"] .market-list { opacity: .55; }
@keyframes market-pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes market-flash-up { from { background: color-mix(in srgb, var(--market-up) 22%, transparent); } }
@keyframes market-flash-down { from { background: color-mix(in srgb, var(--market-down) 22%, transparent); } }
html[data-theme] .hero-aside { display: none; }
@media (max-width: 900px) {
  .market-card { width: min(100%, 380px); margin-right: 0; padding: 18px 18px 12px; }
  .market-row { grid-template-columns: minmax(0, 1fr) 52px minmax(76px, auto) 80px; gap: 10px; }
}
@media (max-width: 620px) {
  html[data-theme] .hero { min-height: 0; padding-bottom: 36px; }
  html[data-theme] .hero-visual { height: 62%; opacity: .55; }
  .market-card { grid-column: 1; justify-self: stretch; width: auto; margin: 32px 0 0; border-radius: 14px; }
  .market-name, .market-price, .market-change { font-size: 14px; }
  .market-row { grid-template-columns: minmax(0, 1fr) 48px minmax(72px, auto) 76px; padding: 11px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .market-card[data-state="live"] .market-status i, .market-row.is-flash-up, .market-row.is-flash-down { animation: none; }
}

/* Sparklines: intraday path against the previous close. */
.market-spark { width: 100%; height: 24px; overflow: visible; color: var(--market-flat); }
.market-row[data-direction="up"] .market-spark { color: var(--market-up); }
.market-row[data-direction="down"] .market-spark { color: var(--market-down); }
.market-spark-line { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.market-spark-base { stroke: var(--line-bright); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.market-spark.is-empty { visibility: hidden; }

/* Scrolling quote strip under the header. */
.market-ticker { --market-up: #e5484d; --market-down: #1aa36b; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); font-family: var(--mono); -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); }
.market-ticker-track { display: flex; width: max-content; animation: market-ticker var(--ticker-duration, 40s) linear infinite; }
.market-ticker:hover .market-ticker-track { animation-play-state: paused; }
.market-ticker-group { display: flex; margin: 0; padding: 0; list-style: none; }
.market-ticker-item { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 26px 10px 0; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.market-ticker-item + .market-ticker-item::before, .market-ticker-group + .market-ticker-group .market-ticker-item:first-child::before { margin-right: 18px; color: var(--line-bright); content: "/"; }
.market-ticker-name { color: var(--muted); font-family: var(--sans); }
.market-ticker-price { color: var(--ink); }
.market-ticker-change { color: var(--quiet); font-weight: 700; }
.market-ticker-item[data-direction="up"] .market-ticker-change { color: var(--market-up); }
.market-ticker-item[data-direction="down"] .market-ticker-change { color: var(--market-down); }
@keyframes market-ticker { to { transform: translateX(-50%); } }
html[data-theme] .site-header + .market-ticker { margin-top: -1px; }

/* Hero entrance: the title rises character by character, the rest follows. */
.hero h1 .hero-char { display: inline-block; white-space: pre; }
.hero-animate .hero-char { animation: hero-char .8s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 45ms + 120ms); }
.hero-animate .hero-kicker { animation: hero-rise .7s ease-out both; }
.hero-animate .hero-description, .hero-animate .hero-bio, .hero-animate .hero-subjects, .hero-animate .hero-actions { animation: hero-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero-animate .hero-description { animation-delay: .75s; }
.hero-animate .hero-bio { animation-delay: .85s; }
.hero-animate .hero-subjects { animation-delay: .95s; }
.hero-animate .hero-actions { animation-delay: 1.05s; }
.hero-animate .hero-visual { animation: hero-fade 1.4s ease-out both; }
.hero-animate .market-card { animation: hero-card 1s cubic-bezier(.2, .7, .2, 1) .5s both; }
@keyframes hero-char { from { opacity: 0; transform: translateY(.45em); filter: blur(6px); } }
@keyframes hero-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes hero-fade { from { opacity: 0; } }
@keyframes hero-card { from { opacity: 0; transform: translate(28px, 10px) scale(.98); } }
@media (max-width: 620px) {
  .hero-animate .market-card { animation-name: hero-rise; }
}
@media (prefers-reduced-motion: reduce) {
  .market-ticker { overflow-x: auto; scrollbar-width: none; }
  .market-ticker-track { animation: none; }
  .market-ticker-group[aria-hidden] { display: none; }
}

/* Featured prompt cover follows each theme instead of a fixed bright blue. */
html[data-theme] { --cover-feature: #1f3550; --cover-feature-ink: #f4f1ea; }
html[data-theme="fresh"] { --cover-feature: #2f5a47; }
html[data-theme="paper"] { --cover-feature: #4a3424; }
html[data-theme="graphite"] { --cover-feature: #2b3440; }
.prompt-cover-2 { color: var(--cover-feature-ink); background: var(--cover-feature); }
.prompt-cover-2::before { background: linear-gradient(to bottom, var(--cover-feature), transparent 35%), url('visuals/invest-card-trend.webp') center bottom/cover; }
