/* Game Boy Labs: a hardware maker's catalog. White ground (#f8f8f8, the plates' own ground), objects floating
   with soft studio shadow, one neo-grotesk (TikTok Sans) from huge headline to tiny tracked labels, one orange
   accent reserved for actions. Light only. The first viewport is bound to the approved comp's measured boxes
   (1586 x 992): positions in %, type in --u (one comp pixel at the current width). */
@font-face { font-family: "TikTok Sans"; src: url(fonts/TikTokSans.woff2) format("woff2"); font-weight: 300 800; font-display: swap; }

:root {
  --ground: #f8f8f8;
  --tile: #efefee;
  --ink: #0e0f11;
  --ink-2: #4c4d52;
  --muted: #67686d;
  --rule: #e2e2e1;
  --accent: #f85a17;
  --accent-ink: #ffffff;
  --accent-text: #b8400c;   /* orange for text on the ground (5:1); the fill stays the comp's orange */
  --sans: "TikTok Sans", "Helvetica Neue", Arial, sans-serif;
  --u: calc(min(100vw, 1800px) / 1586);
  --gutter: max(20px, calc(60 * var(--u)));
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.55 var(--sans); font-optical-sizing: auto; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
small { display: block; }

/* ---------------------------------------------------------------- bar */
.bar { position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: calc(69 * var(--u)); display: flex; align-items: center; gap: calc(40 * var(--u)); padding: 0 var(--gutter); max-width: 1800px; margin: 0 auto; }
.bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 1px solid var(--rule); }
.wordmark { font-size: calc(28 * var(--u)); font-weight: 500; letter-spacing: -0.03em; text-decoration: none; white-space: nowrap; }
.nav { position: absolute; left: 31.9%; display: flex; gap: calc(52 * var(--u)); font-size: calc(12.5 * var(--u)); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 0; }
.nav a:hover { color: var(--ink); }
.bar-cta { position: absolute; left: 82.66%; font-size: calc(12.5 * var(--u)); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--ink); padding: 8px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.bar-cta:hover { color: var(--accent-text); border-color: var(--accent-text); }

/* ---------------------------------------------------------------- hero: the comp frame */
.hero { position: relative; width: 100%; max-width: 1800px; margin: 0 auto; aspect-ratio: 1586 / 992; overflow: hidden; }
.hero-text { position: absolute; inset: 0; pointer-events: none; }
.hero-text > * { pointer-events: auto; position: absolute; margin: 0; }
h1 { left: 3.59%; top: 28.6%; width: 36%; font-size: calc(96 * var(--u)); line-height: 0.88; letter-spacing: -0.04em; font-weight: 400; }
.subline { left: 3.9%; top: 56.1%; width: 40%; font-size: calc(23 * var(--u)); color: var(--ink-2); letter-spacing: -0.01em; }
.hero .cta { left: 4.2%; top: 63.6%; }
.cta { display: inline-flex; align-items: center; gap: calc(16 * var(--u)); background: var(--accent); color: var(--accent-ink); text-decoration: none; font-size: max(19px, calc(19 * var(--u))); font-weight: 600; padding: max(12px, calc(18 * var(--u))) max(22px, calc(36 * var(--u))); transition: transform .2s cubic-bezier(.16,1,.3,1), background-color .2s; }
.cta img { width: max(16px, calc(22 * var(--u))); height: auto; filter: invert(1); }
.cta:hover { background: #ea5214; }
.cta:active { transform: translateY(1px); }

.orbit { position: absolute; left: 40%; top: 7%; width: 60%; height: 82%; }
.orbit canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .8s cubic-bezier(.16,1,.3,1); }
.orbit-still { position: absolute; left: 50%; top: 50%; width: auto; height: 86%; transform: translate(-50%, -50%) rotate(0deg); transition: opacity .6s; }
.orbit.live canvas { opacity: 1; }
.orbit.live .orbit-still { opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
.sat { position: absolute; left: 0; top: 0; display: none; text-decoration: none; color: var(--ink); white-space: nowrap; will-change: transform; transition: opacity .35s; }
.orbit.live .sat { display: block; }
.sat { text-align: center; }
.sat b, .sat small { display: block; }
.sat b { font-weight: 500; font-size: max(14px, calc(17 * var(--u))); letter-spacing: -0.01em; }
.sat small { font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.sat:hover b { color: var(--accent-text); }

.strip { position: absolute; left: 0; right: 0; top: 88.8%; bottom: 0; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 23.6% 22.4% 30% 24%; border-top: 1px solid var(--rule); }
.strip li { display: flex; align-items: flex-start; padding-top: calc(16 * var(--u)); }
.strip li { position: relative; }
.strip li + li::before { content: ""; position: absolute; left: 0; top: 22%; height: 56%; border-left: 1px solid var(--rule); }
.strip a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: calc(26 * var(--u)); width: 100%; padding: 0 calc(46 * var(--u)) 0 calc(70 * var(--u)); text-decoration: none; }
.strip a > img:first-child { width: calc(34 * var(--u)); height: auto; opacity: .85; }
.strip b { display: block; font-size: max(11px, calc(11 * var(--u))); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; }
.strip small { font-size: max(11px, calc(10.5 * var(--u))); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: calc(6 * var(--u)); line-height: 1.5; }
.strip .arr { width: calc(18 * var(--u)); opacity: .7; transition: transform .25s cubic-bezier(.16,1,.3,1); }
.strip a:hover .arr { transform: translateX(4px); opacity: 1; }


/* ---------------------------------------------------------------- sections */
.feature, .hardware, .roms, .method, .logbook { max-width: 1800px; margin: 0 auto; padding: clamp(80px, calc(140 * var(--u)), 180px) var(--gutter) 0; }
h2 { font-size: clamp(40px, calc(72 * var(--u)), 96px); line-height: 1; letter-spacing: -0.04em; }
.section-lede { color: var(--ink-2); margin: 16px 0 0; font-size: 19px; }

.feature { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: calc(80 * var(--u)); align-items: end; }
.feature-head p { font-size: clamp(18px, calc(21 * var(--u)), 24px); color: var(--ink-2); margin: 24px 0 36px; max-width: 30em; letter-spacing: -0.005em; }
.pieces { display: grid; grid-template-columns: 1fr 1fr; gap: calc(28 * var(--u)); }
.pieces figure, .consoles figure { margin: 0; }
.pieces img { width: 100%; image-rendering: pixelated; }
figcaption { margin-top: 14px; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
figcaption b { color: var(--ink); font-weight: 500; margin-right: 8px; }
figcaption a { color: var(--ink); text-underline-offset: 3px; margin-left: 4px; }

.hardware h2 { margin-bottom: calc(48 * var(--u)); }
.bento { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: auto auto; gap: calc(24 * var(--u)); }
.tile { background: var(--tile); display: flex; flex-direction: column; overflow: hidden; scroll-margin-top: 24px; }
.tile-kagi { grid-row: 1 / 3; }
.tile-kagi .float { width: 82%; margin: calc(40 * var(--u)) auto 0; }
.tile-board img { width: 78%; margin: calc(36 * var(--u)) auto 0; aspect-ratio: 4 / 3; object-fit: contain; filter: drop-shadow(0 18px 22px rgba(30, 30, 35, .14)); }
.tile-text { padding: calc(32 * var(--u)) calc(40 * var(--u)) calc(36 * var(--u)); margin-top: auto; }
.tile h3 { font-size: clamp(24px, calc(32 * var(--u)), 40px); letter-spacing: -0.03em; margin-bottom: 10px; }
.tile p { margin: 0; color: var(--ink-2); max-width: 36em; }
.links { display: flex; gap: 22px; margin-top: 18px !important; font-weight: 500; }
.links a { color: var(--ink); text-underline-offset: 4px; }
.links a:hover { color: var(--accent-text); }

.consoles { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(40 * var(--u)); margin-top: calc(56 * var(--u)); }
.consoles .float { margin-bottom: 0; }
/* floating renders: object and its caught shadow are separate layers; the object rises, the shadow tightens and fades */
.float { position: relative; }
.float img { width: 100%; height: auto; display: block; }
.float-shadow { position: absolute; inset: 0; transform-origin: 50% 88%; }
@media (prefers-reduced-motion: no-preference) {
  .float-obj { animation: hover 5.5s ease-in-out infinite; }
  .float-shadow { animation: hover-shadow 5.5s ease-in-out infinite; }
  .consoles figure:nth-child(2) .float img { animation-delay: -1.8s; }
  .consoles figure:nth-child(3) .float img { animation-delay: -3.6s; }
}
@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3.5%); } }
@keyframes hover-shadow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.84); opacity: .55; } }
.swipe-dots { display: none; }

.method h2 { max-width: 16em; font-size: clamp(34px, calc(56 * var(--u)), 76px); }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(56 * var(--u)); margin-top: calc(56 * var(--u)); }
.principles p { margin: 0; color: var(--ink-2); max-width: 30em; }
.principles b { display: block; color: var(--ink); font-weight: 500; font-size: 20px; letter-spacing: -0.01em; margin-bottom: 8px; }

.log { list-style: none; margin: calc(40 * var(--u)) 0 0; padding: 0; }
.log li { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 24px; padding: 20px 0; border-top: 1px solid var(--rule); }
.log time { font-size: 13px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding-top: 4px; font-variant-numeric: tabular-nums; }
.log p { margin: 0; font-size: 19px; color: var(--ink-2); max-width: 44em; }
.log b { color: var(--ink); font-weight: 500; }

.foot { max-width: 1800px; margin: clamp(90px, calc(140 * var(--u)), 180px) auto 0; padding: 28px var(--gutter) calc(36px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); }
.foot p { margin: 0; }
.foot a { color: var(--ink); text-underline-offset: 3px; }

/* ---------------------------------------------------------------- narrow screens: the frame unfolds into a column */
@media (max-width: 900px) {
  :root { --u: calc(100vw / 600); }
  .bar { position: relative; height: 60px; padding: 0 20px; }
  .wordmark { font-size: 20px; }
  .nav { display: none; }
  .bar-cta { position: static; margin-left: auto; font-size: 11px; }
  .hero { aspect-ratio: auto; overflow: visible; display: flex; flex-direction: column; padding: 28px 20px 0; }
  .hero-text { position: static; display: flex; flex-direction: column; }
  .hero-text > * { position: static; }
  h1 { width: auto; font-size: clamp(44px, 12.5vw, 64px); margin-top: 22px; }
  .subline { width: auto; font-size: 17px; margin-top: 16px; }
  .hero .cta { align-self: flex-start; margin-top: 24px; }
  .orbit { position: relative; left: auto; top: auto; width: auto; height: 104vw; margin: 8px -20px 0; }
  .sat small { display: none; }
  .strip { position: static; grid-template-columns: 1fr; padding: 0; margin-top: 28px; }
  .strip li { border-top: 1px solid var(--rule); }
  .strip li + li::before { display: none; }
  .strip li { padding-top: 0; }
  .strip a, .strip li:first-child a { padding: 16px 0; gap: 16px; }
  .strip a > img:first-child { width: 26px; }
  .strip b { font-size: 12px; }
  .strip small { font-size: 11px; }
  .strip .arr { width: 16px; }
  .strip small br { display: none; }
  .feature, .hardware, .roms, .method, .logbook { padding: 72px 20px 0; }
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .pieces { gap: 10px; }
  .bento { grid-template-columns: 1fr; gap: 12px; }
  .tile-kagi { grid-row: auto; }
  .tile-text { padding: 20px 20px 24px; }
  .swipe-dots { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
  .swipe-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--rule); transition: background .3s, width .3s; }
  .swipe-dots span.on { background: var(--ink); width: 18px; border-radius: 3px; }
  .consoles figure { background: var(--tile); padding: 20px 18px 18px; }
  .consoles { grid-template-columns: repeat(3, 84%); overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; margin: 28px -20px 0; padding: 0 20px 18px; scrollbar-width: none; scroll-padding: 0 20px; }
  .consoles::-webkit-scrollbar { display: none; }
  .consoles figure { scroll-snap-align: start; }
  .consoles figure:nth-child(2) { transform: none; }
  .principles { grid-template-columns: 1fr; gap: 22px; margin-top: 28px; }
  .log li { grid-template-columns: 1fr; gap: 4px; padding: 16px 0; }
  .log p { font-size: 17px; }
}
