/* ============================================================
   Scanlyne — shared design system
   Identity: "precision studio". Ink ground, hairline rules,
   monospaced index labels, one restrained vermilion accent.
   ============================================================ */

/* ---- Tokens ---- */
:root {
  /* Surfaces — near-black, echoing the WinBall splash's black ground */
  --bg:          #09090b;
  --bg-elev:     #101014;
  --surface:     #141417;
  --surface-2:   #1a1a1f;

  /* Lines */
  --line:        rgba(255,255,255,0.09);
  --line-strong: rgba(255,255,255,0.16);

  /* Text */
  --text:   #eceef1;
  --text-2: #9ca1a9;
  --text-3: #676c75;

  /* Accent — the Scanlyne logo's own orange → gold */
  --accent:        #ffb300;
  --accent-soft:   #ffcf52;
  --accent-orange: #ff6a00;
  --accent-dim:    rgba(255,160,0,0.14);
  --accent-ink:    #1a1200;
  --accent-grad:   linear-gradient(180deg, #ff6a00 0%, #ffc21e 100%);

  /* Type */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --font-title:   "Enka Dot Mincho", "Bricolage Grotesque", "Segoe UI", sans-serif;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  /* Elevation */
  --sh-sm: 0 1px 2px rgba(0,0,0,0.4);
  --sh-md: 0 10px 30px -12px rgba(0,0,0,0.6);

  /* Widths */
  --w-page: 1080px;
  --w-text: 680px;

  color-scheme: dark;
}

/* ---- Web font: Enka Dot Mincho (dot-mincho) for display titles.
       OFL-licensed, subset to Latin (see assets/fonts/OFL-EnkaDotMincho.txt). ---- */
@font-face {
  font-family: "Enka Dot Mincho";
  src: url("/assets/fonts/enka.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset ---- */
*, *::before, *::after { 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;
  /* Warm accent gradient background — an orange ember glow up top and a gold
     glow lower-right, on near-black, matching the SCANLYNE logo's colours.
     Fixed so it stays put while the page scrolls. */
  background:
    radial-gradient(140% 95% at 50% -15%, rgba(255,120,0,0.22), rgba(255,90,0,0.06) 30%, transparent 60%) fixed,
    radial-gradient(120% 90% at 108% 112%, rgba(255,180,20,0.13), transparent 52%) fixed,
    linear-gradient(180deg, #0c0a07 0%, #09090b 42%, #060607 100%) fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01","cv01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---- Global ordered-dither grain ----
   A fixed, non-interactive Bayer-dither tile laid over the whole page — the same
   retro dithering the WinBall app splash uses, echoed site-wide. A black+white
   ordered tile blended with `overlay`, so it lightens and darkens the pixels
   beneath — the dither follows the content instead of sitting on top as flat
   grain. Fine grain, low intensity, pixel-crisp. */
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 9998; pointer-events: none;
  background: url("/assets/dither.png?v=3") repeat;
  background-size: 5px 5px;
  image-rendering: pixelated;
  mix-blend-mode: overlay;
  opacity: 0.7;
}
@media print { body::after { display: none; } }

/* ---- Focus ---- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Layout ---- */
.wrap { width: 100%; max-width: var(--w-page); margin-inline: auto; padding-inline: 24px; }
section { position: relative; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---- Type helpers ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .idx { color: var(--accent); }
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 2px;
  flex: none;
}
.display {
  font-family: var(--font-title);
  font-weight: 400;           /* dot-mincho is single-weight; avoid faux-bold smear */
  letter-spacing: 0;          /* pixel glyphs need no negative tracking */
  line-height: 1.18;
  text-wrap: balance;
}
.lead { color: var(--text-2); font-size: 1.075rem; max-width: 52ch; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.2) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand .mark { color: var(--text); }
.brand .name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.06rem; letter-spacing: -0.01em;
}
/* The header wordmark is the cropped SCANLYNE logo (from the app splash's final
   frame) rather than text, so the top matches the game's own identity. */
.brand-logo { height: 26px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a {
  font-size: 0.92rem; color: var(--text-2);
  transition: color 0.18s ease;
}
.nav a:hover { color: var(--text); }
.nav .mono { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em; }
@media (max-width: 620px) {
  .nav a:not(.contact-link) { display: none; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 46px; padding-inline: 20px;
  border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.16s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-grad); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--text-3); background: var(--surface); }
.btn .arrow { transition: transform 0.18s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding-top: clamp(72px, 12vw, 132px); padding-bottom: clamp(56px, 9vw, 104px); }
/* The Scanlyne wordmark (static final splash frame) as the hero centrepiece. */
.hero-logo {
  width: min(440px, 74%); height: auto;
  margin-bottom: clamp(26px, 4vw, 40px);
  filter: drop-shadow(0 6px 24px rgba(255,120,0,0.18));
}
.hero .display {
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  max-width: 16ch; margin-top: 26px;
}
.hero .lead { margin-top: 22px; font-size: 1.14rem; max-width: 46ch; }
.hero-cta { margin-top: 34px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Meta facts row (honest, monospaced) */
.facts {
  margin-top: 52px; display: flex; flex-wrap: wrap; gap: 0;
  border-top: 1px solid var(--line);
}
.fact { padding: 18px 26px 4px 0; margin-right: 26px; }
.fact:not(:last-child) { border-right: 1px solid var(--line); }
.fact .k {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3);
}
.fact .v { margin-top: 6px; font-size: 0.98rem; color: var(--text); font-weight: 500; }

/* Faint scanline texture, purely decorative, static, subtle */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0 3px, rgba(255,255,255,0.014) 3px 4px);
  mask-image: linear-gradient(to bottom, black, transparent 62%);
}

/* ============================================================
   Section scaffolding
   ============================================================ */
.section { padding-block: clamp(56px, 9vw, 96px); }
.section-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 44px; }
.section-head .display { font-size: clamp(1.6rem, 3.4vw, 2.15rem); font-weight: 600; }

/* ============================================================
   Work — product entries
   ============================================================ */
.work-list { display: grid; gap: 16px; }
.product {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 22px;
  align-items: center;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.product:hover { border-color: var(--line-strong); background: var(--surface-2); }
.product .thumb {
  width: 76px; height: 76px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line-strong); flex: none; background: var(--bg-elev);
}
.product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product .pname {
  font-family: var(--font-display); font-weight: 700; font-size: 1.22rem;
  letter-spacing: -0.01em; display: flex; align-items: center; gap: 12px;
}
.product .pdesc { margin-top: 7px; color: var(--text-2); font-size: 0.98rem; max-width: 48ch; }
.chip {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent-soft); background: var(--accent-dim);
  white-space: nowrap;
}
.product .plink { color: var(--text-3); font-family: var(--font-mono); font-size: 0.8rem; }
.product:hover .plink { color: var(--text-2); }

/* honest "more coming" note */
.more-note {
  margin-top: 18px; padding: 20px 22px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  color: var(--text-3); font-size: 0.94rem;
  display: flex; align-items: center; gap: 12px;
}
.more-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }

@media (max-width: 620px) {
  .product { grid-template-columns: 58px 1fr; grid-template-areas: "thumb name" "thumb desc" "chip chip"; row-gap: 6px; }
  .product .thumb { width: 58px; height: 58px; grid-area: thumb; align-self: start; }
  .product .pbody { grid-area: name; }
  .product .plink { display: none; }
}

/* ============================================================
   Studio — approach
   ============================================================ */
.approach { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.approach .cell { background: var(--bg); padding: 28px 26px; }
.approach .n { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); letter-spacing: 0.1em; }
.approach h3 { margin-top: 14px; font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; }
.approach p { margin-top: 8px; color: var(--text-2); font-size: 0.95rem; }
@media (max-width: 760px) { .approach { grid-template-columns: 1fr; } }

/* ============================================================
   Contact
   ============================================================ */
.contact { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 28px; }
.contact .display { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 600; max-width: 14ch; }
.mailto {
  font-family: var(--font-mono); font-size: 0.95rem; color: var(--text);
  border-bottom: 1px solid var(--accent); padding-bottom: 3px;
  transition: color 0.18s ease;
}
.mailto:hover { color: var(--accent-soft); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding-block: 44px; margin-top: 40px; }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.footer-brand { max-width: 30ch; }
.footer-brand p { margin-top: 12px; color: var(--text-3); font-size: 0.9rem; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h4 {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; font-weight: 500;
}
.footer-col a { display: block; color: var(--text-2); font-size: 0.92rem; padding: 5px 0; transition: color 0.16s ease; }
.footer-col a:hover { color: var(--text); }
.footer-base { margin-top: 40px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--text-3); font-size: 0.82rem; }
.footer-base .mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* ============================================================
   Article (legal pages)
   ============================================================ */
.article { padding-block: clamp(48px, 8vw, 88px); }
.article-head { max-width: var(--w-text); margin-bottom: 40px; }
.article-head .display { font-size: clamp(2rem, 4.4vw, 2.9rem); font-weight: 600; margin-top: 20px; }
.article-head .meta { margin-top: 16px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-3); letter-spacing: 0.03em; }
.prose { max-width: var(--w-text); }
.prose h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.28rem;
  letter-spacing: -0.01em; margin-top: 44px; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.prose p { margin-top: 15px; color: var(--text-2); }
.prose ul { margin-top: 15px; padding-left: 20px; color: var(--text-2); }
.prose li { margin-top: 8px; }
.prose a { color: var(--text); border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.prose a:hover { color: var(--accent-soft); }
.prose strong { color: var(--text); font-weight: 600; }
.callout {
  margin-top: 22px; padding: 20px 22px; background: var(--surface);
  border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--r-md);
}
.callout p, .callout ol { color: var(--text); }
.callout ol { margin: 0; padding-left: 20px; }
.callout li { margin-top: 8px; }

/* ============================================================
   Load-in motion (respectful, subtle)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); animation: reveal 0.7s cubic-bezier(.2,.7,.2,1) forwards; }
  .reveal[data-d="1"] { animation-delay: 0.05s; }
  .reveal[data-d="2"] { animation-delay: 0.11s; }
  .reveal[data-d="3"] { animation-delay: 0.17s; }
  .reveal[data-d="4"] { animation-delay: 0.24s; }
  @keyframes reveal { to { opacity: 1; transform: none; } }
}

/* ============================================================
   Floating music player — a glossy "Aero" gadget rendered in the
   studio's own dark + vermilion identity. Fixed, follows scroll,
   minimizes to a bubble.
   ============================================================ */
.aero-dock {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 306px; max-width: calc(100vw - 32px);
}
.aero {
  position: relative; border-radius: 18px; padding: 16px 16px 18px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.015) 42%, rgba(0,0,0,0.22)),
    linear-gradient(180deg, #1c1f26 0%, #14161b 100%);
  border: 1px solid var(--line-strong);
  box-shadow:
    0 26px 55px -20px rgba(0,0,0,0.78),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -20px 34px -24px rgba(0,0,0,0.6);
}
/* glossy upper sheen */
.aero::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 42%;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
  border-radius: 14px 14px 70% 70% / 14px 14px 24px 24px; pointer-events: none;
}
.aero-min {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 24px; height: 24px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); border: 1px solid var(--line); background: rgba(255,255,255,0.05);
  transition: color 0.15s ease, background 0.15s ease;
}
.aero-min:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.aero-min svg { width: 14px; height: 14px; }
.aero-top { display: flex; gap: 13px; align-items: center; position: relative; padding-right: 26px; }
.aero-art {
  width: 52px; height: 52px; flex: none; border-radius: 12px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #2a2d34, #17191f);
  border: 1px solid var(--line-strong); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.aero-art::after { content: ""; position: absolute; inset: 0 0 55% 0; background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0)); }
.aero-art svg { width: 26px; height: 26px; position: relative; }
.aero-meta { min-width: 0; }
.aero-title { font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aero-sub { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-top: 5px; }

.aero-progress { margin-top: 15px; }
.aero-trackbar {
  height: 7px; border-radius: 999px; cursor: pointer; position: relative; overflow: hidden;
  background: rgba(0,0,0,0.4); box-shadow: inset 0 1px 2px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(255,255,255,0.05);
}
.aero-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%; border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 0 10px rgba(255,160,0,0.5);
}
.aero-times { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-3); }

.aero-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 13px; }
.aero-btn {
  cursor: pointer; border: 1px solid var(--line-strong); color: var(--text-2);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
  transition: transform 0.12s ease, color 0.15s ease, border-color 0.15s ease;
}
.aero-btn:hover { color: var(--text); border-color: var(--text-3); }
.aero-btn:active { transform: translateY(1px) scale(0.96); }
.aero-btn.sm { width: 36px; height: 36px; }
.aero-btn.sm svg { width: 15px; height: 15px; }
.aero-play {
  width: 54px; height: 54px; color: var(--accent-ink); border: 1px solid rgba(255,200,90,0.55);
  background: radial-gradient(120% 90% at 50% 24%, var(--accent-soft), var(--accent) 62%, #b35a00);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), inset 0 -8px 12px -7px rgba(90,45,0,0.5), 0 6px 16px rgba(255,160,0,0.32);
}
.aero-play:hover { filter: brightness(1.05); color: var(--accent-ink); }
.aero-play svg { width: 21px; height: 21px; }
.aero-btn:focus-visible, .aero-min:focus-visible, .aero-bubble:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* play / pause icon swap */
.aero .i-pause { display: none; }
.aero.playing .i-play { display: none; }
.aero.playing .i-pause { display: block; }

/* collapsed bubble */
.aero-bubble {
  display: none; margin-left: auto;
  width: 58px; height: 58px; border-radius: 50%; cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--accent-ink); border: 1px solid rgba(255,200,90,0.55);
  background: radial-gradient(120% 90% at 50% 24%, var(--accent-soft), var(--accent) 62%, #b35a00);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 0 12px 26px -6px rgba(255,160,0,0.5), 0 6px 16px rgba(0,0,0,0.5);
  transition: transform 0.14s ease, filter 0.14s ease;
}
.aero-bubble:hover { filter: brightness(1.06); transform: translateY(-1px); }
.aero-bubble svg { width: 26px; height: 26px; }
.aero-dock.min .aero { display: none; }
.aero-dock.min .aero-bubble { display: flex; }

@media (max-width: 520px) {
  .aero-dock { right: 12px; bottom: 12px; width: calc(100vw - 24px); max-width: 320px; }
}

