/* graphite-design showcase pages. Built on skills/graphite-design/assets/graphite.css
 * (tokens, drawings, small pieces); this file is only the layout of these four pages. */
:root:not([data-lang="en"]) .lang-en, :root[data-lang="en"] .lang-zh { display: none !important; }
html { scroll-padding-top: 76px; }
body.g-page { font-size: 17px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.wrap--wide { max-width: 1400px; }
h1, h2, h3 { font-family: var(--g-hand); font-weight: 400; line-height: 1.25; margin: 0 0 0.5em; color: var(--g-ink); }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); letter-spacing: 0.01em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-color: var(--g-orange); text-underline-offset: 3px; }
a:hover { color: var(--g-orange-ink); }
code { font-family: var(--g-mono); font-size: 0.86em; background: var(--g-paper-2); padding: 0.1em 0.35em; border-radius: 5px; font-variant-ligatures: none; }
.muted { color: var(--g-ink-2); }
.kicker { font: 600 13px/1.4 var(--g-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--g-orange-ink); margin-bottom: 10px; display: block; }
.lede { font-size: 1.12rem; color: var(--g-ink-2); max-width: 46em; }
section { padding: clamp(56px, 7vw, 96px) 0; }
section.band { background: var(--g-paper-2); }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--g-paper) 88%, transparent); backdrop-filter: blur(6px); border-bottom: 1px dashed var(--g-rule); }
.top-in { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { font-family: var(--g-hand); font-size: 24px; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--g-orange-ink); margin-left: 4px; }
.top nav { display: flex; gap: 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; font: 500 15px/1 var(--g-sans); }
.top nav a { text-decoration: none; white-space: nowrap; padding: 6px 2px; }
.top nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--g-orange); text-decoration-thickness: 2px; }
.tools { margin-left: auto; display: flex; gap: 6px; }
.tools button { font: 600 13px/1 var(--g-sans); color: var(--g-ink); background: transparent; border: 1.4px solid var(--g-rule); border-radius: 999px; padding: 7px 11px; cursor: pointer; }
.tools button[aria-pressed="true"] { border-color: var(--g-ink); }
@media (max-width: 760px) { .top nav { display: none; } .brand { font-size: 21px; } }

/* figures in frames that pan sideways on phones instead of shrinking their labels */
.gpan { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.gpan > svg.gfig { margin: 0 auto; }
.pan-hint { margin: 6px 0 0; text-align: center; font: 13px/1.3 var(--g-hand); color: var(--g-ink-2); }
.card { padding: 18px; }
.cap { font-size: 15px; color: var(--g-ink-2); margin-top: 10px; }
.note { font-size: 14px; color: var(--g-ink-2); }

/* hero */
.hero { padding: 28px 0 40px; }
.hero-grid { display: grid; gap: 26px; }
.hero-art { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 1px 0 rgba(30, 26, 21, 0.05), 0 22px 50px -26px rgba(30, 26, 21, 0.45); }
.hero-art img { display: block; width: 100%; height: auto; }
.hero-board { position: absolute; left: 41.9%; top: 25%; width: 39.5%; }
.hero-text { max-width: 54em; }
.hero-text h1 { margin-bottom: 0.3em; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
/* one picture per theme. !important because image rules like `.hero-art img { display: block }`
   are more specific than a bare class and would show both (2026-10-10, both showed) */
.illo-dark { display: none !important; }
:root[data-theme="dark"] .illo-light { display: none !important; }
:root[data-theme="dark"] .illo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .illo-light { display: none !important; }
  :root:not([data-theme]) .illo-dark { display: block !important; }
}

/* the fixed five */
.five { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: 30px; }
.five .g-box { padding: 16px 16px 18px; }
.five h3 { margin-bottom: 4px; }
.five p { font-size: 15px; color: var(--g-ink-2); margin: 0; }
.paper-sw { display: flex; gap: 8px; height: 92px; margin-bottom: 10px; }
.paper-sw i { flex: 1; border-radius: 10px; border: 1px solid var(--g-rule); display: flex; align-items: flex-end; padding: 6px 8px; font: 12px/1.2 var(--g-mono); font-style: normal; }
.free { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.free span { font: 15px/1 var(--g-hand); padding: 8px 12px; border: 1.4px dashed var(--g-rule); border-radius: 12px 16px 11px 15px; }
.hand-sample { font-family: var(--g-hand); font-size: 30px; line-height: 92px; height: 92px; margin-bottom: 10px; text-align: center; }

/* code or image model */
.vs { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 28px; }
.vs figure { margin: 0; }
.vs img { width: 100%; height: auto; border-radius: 14px; display: block; }
.verdict { margin-top: 24px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px dashed var(--g-rule); vertical-align: top; }
th { font: 600 14px/1.3 var(--g-sans); color: var(--g-ink-2); }
td b { font-weight: 600; }

/* categories teaser */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 28px; }
.cats a.g-box { display: block; padding: 14px 14px 16px; text-decoration: none; }
.cats a.g-box:hover { border-color: var(--g-orange); }
.cats h3 { margin: 8px 0 2px; }
.cats p { font-size: 14.5px; color: var(--g-ink-2); margin: 0; }

/* motion lab */
.lab { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 26px; margin-top: 26px; align-items: start; }
@media (max-width: 900px) { .lab { grid-template-columns: minmax(0, 1fr); } }
.scrub { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.scrub input[type="range"] { flex: 1; min-width: 180px; accent-color: var(--g-orange); }
.scrub output { font: 13px/1 var(--g-mono); color: var(--g-ink-2); min-width: 92px; }
.rules { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.rules li { counter-increment: r; position: relative; padding: 0 0 14px 42px; font-size: 15.5px; }
.rules li::before { content: counter(r); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border: 1.5px solid var(--g-line); border-radius: 50%; display: grid; place-items: center; font: 15px/1 var(--g-hand); }
.rules b { font-weight: 600; }

/* taste lab */
.taste { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 26px; margin-top: 26px; align-items: start; }
@media (max-width: 960px) { .taste { grid-template-columns: minmax(0, 1fr); } }
.ab { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .ab { grid-template-columns: 1fr; } }
.ab button { all: unset; cursor: pointer; display: block; border-radius: 16px; border: 1.6px solid var(--g-rule); background: var(--g-card); padding: 10px; }
.ab button:hover, .ab button:focus-visible { border-color: var(--g-orange); outline: none; }
.ab button span { display: block; text-align: center; font: 15px/1.4 var(--g-hand); margin-top: 6px; }
.ab svg { width: 100%; height: auto; display: block; }
.q { font: 18px/1.5 var(--g-hand); margin: 0 0 12px; }
.knobs { display: grid; gap: 7px; font-size: 14px; }
.knob { display: grid; grid-template-columns: 7.5em 1fr 4.4em; align-items: center; gap: 8px; }
.knob .bar { position: relative; height: 10px; border-radius: 6px; background: var(--g-paper-2); border: 1px solid var(--g-rule); }
.knob .bar i { position: absolute; top: -3px; width: 4px; height: 14px; border-radius: 2px; background: var(--g-line-soft); }
.knob .bar b { position: absolute; top: -4px; width: 10px; height: 16px; margin-left: -5px; border-radius: 4px; background: var(--g-orange); transition: left 0.4s; }
.knob output { font: 12.5px/1 var(--g-mono); text-align: right; color: var(--g-ink-2); }
.say { display: flex; gap: 8px; margin-top: 14px; }
.say input { flex: 1; min-width: 0; font: 16px/1.4 var(--g-hand); padding: 8px 12px; color: var(--g-ink); background: var(--g-card); border: 1.4px solid var(--g-rule); border-radius: 12px; }
.heard { font-size: 14px; color: var(--g-ink-2); min-height: 1.6em; margin-top: 8px; }
.log { font: 12.5px/1.6 var(--g-mono); color: var(--g-ink-2); max-height: 150px; overflow: auto; margin-top: 10px; white-space: pre-wrap; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.g-btn--small { font-size: 13.5px; padding: 6px 12px; }

/* works */
.works { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 26px; }
.works figure { margin: 0; }
.works img { width: 100%; height: auto; display: block; border-radius: 14px; }
.works figcaption { font-size: 14.5px; color: var(--g-ink-2); margin-top: 8px; }

/* gallery */
/* gallery: one figure per row. Two per row drew every figure at about 0.7x and made
   the eight densest ones drag sideways (2026-10-10). A figure grows to fill the row,
   but at most 1.3x its drawn size and never taller than most of the window. */
.gal-bar { position: sticky; top: 60px; z-index: 15; background: color-mix(in srgb, var(--g-paper) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px dashed var(--g-rule); }
.gal-nav { display: flex; flex-wrap: nowrap; gap: 8px; padding: 10px 0; overflow-x: auto; scrollbar-width: thin; }
.gal-nav a { flex: none; font: 15px/1 var(--g-hand); padding: 8px 12px; border: 1.4px solid var(--g-rule); border-radius: 999px; text-decoration: none; }
.gal-nav a.hi { border-color: var(--g-orange); }
.gal-nav .hi-tag { margin-left: 6px; font: 600 11px/1 var(--g-sans); color: var(--g-orange-ink); }
.gal-sec { padding: 40px 0 10px; scroll-margin-top: 120px; }
.gal-head p { color: var(--g-ink-2); max-width: 52em; }
.gal-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.gal-card { margin: 0; padding: 18px 18px 16px; scroll-margin-top: 120px; }
.gal-stage > svg.gfig, .assets--wide svg.gfig { max-width: min(100%, calc(var(--fw) * 1.3), calc(78vh * var(--ar))); }
.gal-card figcaption { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 28px; align-items: start; }
.gal-card figcaption > :not(.gal-act) { grid-column: 1; }
.gal-card figcaption b { font: 400 19px/1.35 var(--g-hand); }
.gal-n { font: 13px/1 var(--g-mono); color: var(--g-ink-2); margin-right: 4px; }
.gal-desc { font-size: 14.5px; color: var(--g-ink-2); max-width: 60em; }
.gal-act { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 8px; }
.gal-act .g-btn { font-size: 13.5px; padding: 6px 12px; text-align: center; }
.gal-card .g-tag { justify-self: start; }
@media (max-width: 760px) {
  .gal-card figcaption { grid-template-columns: minmax(0, 1fr); }
  .gal-act { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; }
}

/* assets */
.assets { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 24px; }
.asset { margin: 0; padding: 14px; }
.asset img { width: 100%; height: auto; display: block; border-radius: 10px; }
.asset.phone { max-width: 360px; }
.assets--wide { grid-template-columns: minmax(0, 1fr); }   /* code-drawn figures: one per row, like the gallery */
.asset figcaption { margin-top: 10px; font-size: 14.5px; color: var(--g-ink-2); }
.asset figcaption b { display: block; font: 400 18px/1.35 var(--g-hand); color: var(--g-ink); }

/* reel */
.stage { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #0b0e14; }
.shot { position: absolute; inset: 0; opacity: 0; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .over { position: absolute; }
.shot.paper { background: var(--g-paper); display: grid; place-items: center; }
.shot.paper .gpan { width: 88%; }
.shot.paper svg { width: 100%; }
.reel-sub { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; padding: 14px 18px 16px; text-align: center; font: clamp(15px, 2.1vw, 24px)/1.4 var(--g-hand); color: #f3ece0; background: linear-gradient(transparent, rgba(10, 13, 19, 0.82) 45%); }
.letterbox::before, .letterbox::after { content: ""; position: absolute; left: 0; right: 0; height: 9%; background: #07090d; z-index: 2; }
.letterbox::before { top: 0; } .letterbox::after { bottom: 0; }
.endcard { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: var(--g-paper); color: var(--g-ink); }
.endcard h2 { font-size: clamp(2rem, 6vw, 4rem); margin: 0; }
.reel-ctl { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.reel-ctl input { flex: 1; min-width: 200px; accent-color: var(--g-orange); }
.reel-ctl output { font: 13px/1 var(--g-mono); color: var(--g-ink-2); }
video { width: 100%; height: auto; display: block; border-radius: 14px; background: #000; }

footer { padding: 46px 0 60px; border-top: 1px dashed var(--g-rule); font-size: 14.5px; color: var(--g-ink-2); }
footer a { color: var(--g-ink); }
@media (prefers-reduced-motion: reduce) { .knob .bar b { transition: none; } html { scroll-behavior: auto; } }

/* vertical covers: the picture has no words; the title is page text on top of it.
   The bitmaps keep their colours in both themes, so the title colours are fixed too. */
.covers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 24px; }
.cover { position: relative; border-radius: 10px; overflow: hidden; }
.cover img { width: 100%; height: auto; display: block; }
.cover .cover-title { position: absolute; left: 9%; right: 9%; top: 8%; margin: 0; font: 400 clamp(24px, 2.6vw, 34px)/1.25 var(--g-hand); color: #39332c; }
.cover .cover-title small { display: block; margin-top: .55em; font-size: 15px; color: #5f5649; }
.cover.night .cover-title { color: #ece4d4; }
.cover.night .cover-title small { color: #b9ae9c; }

/* "learns your taste": the loop wide, the two results side by side, then the lab */
.taste-fig { margin: 24px 0 0; padding: 14px; }
.taste-fig figcaption { margin-top: 10px; font-size: 14.5px; color: var(--g-ink-2); max-width: 62em; }
.taste-fig figcaption b { display: block; font: 400 18px/1.35 var(--g-hand); color: var(--g-ink); }
.taste-figs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }   /* full width: these two carry 13 px labels and would pan if halved */
.taste-try { margin-top: 44px; }
