/* Tiny Thunder Games
   Layout: one 1200px column. A storm-yellow hero holds the logo; each game
   below gets its own panel in that game's colors and type; studio and contact
   sit quietly on paper. Site chrome: Gabarito display, Instrument Sans text,
   Martian Mono for catalog labels. */

:root {
  --paper: #f3f4ee;
  --paper-2: #e8eadf;
  --ink: #111111;
  --ink-2: #54564d;
  --line: #d2d4c8;
  --bolt: #ffd21f;
  --on-bolt: #111111;
  --on-bolt-2: #3b3510;
  --focus: #111111;

  --f-display: 'Gabarito', 'Avenir Next', 'Trebuchet MS', system-ui, sans-serif;
  --f-text: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --r-l: clamp(20px, 2.6vw, 32px);
  --r-m: 14px;
  --section: clamp(72px, 10vw, 136px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121310;
    --paper-2: #1b1c18;
    --ink: #f1f1e8;
    --ink-2: #a5a79b;
    --line: #2e3029;
    --focus: #ffd21f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121310;
  --paper-2: #1b1c18;
  --ink: #f1f1e8;
  --ink-2: #a5a79b;
  --line: #2e3029;
  --focus: #ffd21f;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(76px + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--f-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
img { display: block; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 800; line-height: 1.02; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--bolt); color: var(--on-bolt); padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

.eyebrow, .section-note, .mono {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 22px;
  border: 0; border-radius: 999px;
  font: 600 16px/1 var(--f-text);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--on-bolt); color: var(--bolt); }
.btn-ink:hover { background: #2a2a2a; }
.btn-line { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn-line:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.btn-sm { min-height: 42px; padding: 10px 18px; font-size: 15px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-head.is-stuck { border-bottom-color: var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 21px; height: 35px; flex: none; }
.brand-name { font: 800 19px/1 var(--f-display); letter-spacing: -.01em; white-space: nowrap; }
.brand-name b { font-weight: 600; color: var(--ink-2); }
.site-nav { display: flex; gap: clamp(4px, 1.5vw, 12px); }
.site-nav a, .foot-nav a {
  font: 600 15px/1 var(--f-text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--ink);
  transition: background-color .15s ease;
}
.site-nav a:hover, .foot-nav a:hover { background: var(--paper-2); }
@media (max-width: 520px) {
  .site-head .brand-name { display: none; }
  .site-nav a { padding: 10px 10px; }
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(8px, 1.5vw, 16px) 0; }
.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-areas: "logo copy" "ticker ticker";
  align-items: center;
  column-gap: clamp(24px, 5vw, 72px);
  row-gap: clamp(24px, 3vw, 40px);
  padding: clamp(24px, 4.5vw, 64px) clamp(20px, 4.5vw, 64px) clamp(18px, 2.5vw, 28px);
  background: var(--bolt);
  color: var(--on-bolt);
  border-radius: var(--r-l);
  overflow: hidden;
  isolation: isolate;
}
/* faint rain: the storm the jar was filled from */
.hero-panel::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image: repeating-linear-gradient(115deg, transparent 0 22px, rgba(17, 17, 17, .045) 22px 23.5px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.hero-logo { grid-area: logo; color: var(--on-bolt); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ttl-logo { display: block; width: 100%; height: auto; overflow: visible; }
.hero-copy { grid-area: copy; display: grid; gap: 18px; justify-items: start; min-width: 0; }
.hero-copy .eyebrow { color: var(--on-bolt-2); }
.hero h1 { font-size: clamp(46px, 7.2vw, 96px); font-weight: 900; line-height: .92; letter-spacing: -.03em; }
.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; max-width: 30em; color: var(--on-bolt-2); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hero .btn-line { color: var(--on-bolt); }
.hero .btn-line:hover { background: rgba(17, 17, 17, .08); }
.hero :focus-visible { outline-color: var(--on-bolt); }

.hero-ticker {
  grid-area: ticker;
  display: flex; align-items: center; gap: 14px;
  padding-top: 16px;
  border-top: 2px solid var(--on-bolt);
  color: var(--on-bolt);
  text-decoration: none;
  min-width: 0;
}
.ticker-tag {
  flex: none;
  font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase;
  background: var(--on-bolt); color: var(--bolt);
  padding: 7px 10px 6px; border-radius: 999px;
}
.ticker-text { flex: 1; min-width: 0; font: 600 16px/1.3 var(--f-text); }
.ticker-arrow { flex: none; font: 700 20px/1 var(--f-display); transition: transform .2s ease; }
.hero-ticker:hover .ticker-text { text-decoration: underline; text-underline-offset: 3px; }
.hero-ticker:hover .ticker-arrow { transform: translateY(3px); }

@media (max-width: 880px) {
  .hero-panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "logo" "copy" "ticker"; }
  .hero-logo { max-width: 520px; margin-inline: -2%; }
}

/* ---------- sections ---------- */
.games, .studio, .contact { padding-block: var(--section) 0; }
.contact { padding-bottom: var(--section); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  padding-bottom: 14px; margin-bottom: clamp(24px, 3.5vw, 40px);
  border-bottom: 2px solid var(--ink);
}
.section-head h2 { font-size: clamp(40px, 6vw, 72px); font-weight: 900; letter-spacing: -.03em; line-height: .9; }
.section-note { color: var(--ink-2); }

/* ---------- games ---------- */
.game-list { display: grid; gap: clamp(20px, 3vw, 32px); }
.noscript { font-size: 18px; }

/* A featured game: its own colors, its own type. Variables set per game. */
.game {
  --pad: clamp(20px, 4.5vw, 60px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  grid-template-areas:
    "head stage"
    "body stage"
    "feat feat";
  column-gap: clamp(24px, 4vw, 64px);
  padding: var(--pad);
  background: var(--g-bg);
  color: var(--g-ink);
  border-radius: var(--r-l);
  overflow: hidden;
  isolation: isolate;
  font-family: var(--g-text);
}
.game :focus-visible { outline-color: var(--g-accent); }
.game-head { grid-area: head; align-self: end; display: grid; gap: 18px; min-width: 0; }
.game-body { grid-area: body; align-self: start; display: grid; gap: 22px; margin-top: 26px; min-width: 0; }

.game-meta { display: flex; align-items: center; gap: 14px; min-width: 0; }
.game-icon { width: 56px; height: 56px; border-radius: 14px; flex: none; box-shadow: 0 0 0 1px var(--g-line); }
.game-label { color: var(--g-ink2); font-family: var(--f-mono); }
.game-label b { color: var(--g-accent); font-weight: 500; }

.game-title { font-family: var(--g-display); font-weight: 900; line-height: .82; letter-spacing: -.01em; }
.gt-main { display: block; font-size: clamp(96px, 13vw, 172px); }
.gt-sub { display: block; margin-top: 12px; font-size: clamp(22px, 2.6vw, 34px); font-weight: 800; letter-spacing: .02em; line-height: 1; color: var(--g-accent); }
.game-tagline { font-family: var(--g-flavor); font-style: italic; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.5; color: var(--g-ink2); max-width: 26em; }

.game-summary { font-size: 19px; line-height: 1.45; max-width: 34em; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--g-line); border: 1px solid var(--g-line); border-radius: 12px; overflow: hidden; }
.facts div { background: var(--g-panel); padding: 12px 14px; min-width: 0; }
.facts dt { font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--g-ink2); }
.facts dd { margin: 2px 0 0; font-family: var(--g-display); font-weight: 800; font-size: 21px; line-height: 1.1; }

.game-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 10px 20px;
  border: 0; border-radius: 10px;
  font: 700 19px/1 var(--g-text); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background-color .15s ease;
}
.gbtn:active { transform: translateY(1px); }
.gbtn-accent { background: var(--g-accent); color: var(--g-on-accent); }
.gbtn-accent:hover { filter: brightness(1.08); }
.gbtn[aria-disabled="true"] { cursor: default; opacity: .72; filter: none; }
.gbtn[aria-disabled="true"]:active { transform: none; }
.gbtn-line { background: transparent; color: var(--g-ink); box-shadow: inset 0 0 0 1.5px var(--g-line); }
.gbtn-line:hover { background: var(--g-panel); }
.gbtn svg { width: 18px; height: 18px; }
.game-status { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--g-ink2); }
.game-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7cc488; box-shadow: 0 0 0 4px rgba(124, 196, 136, .18); }

/* stage: screenshots over the game's own ornament */
.game-stage { grid-area: stage; position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; padding-block: 12px; }
.game-ornament { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.rosette { position: absolute; left: 50%; top: 46%; width: min(118%, 640px); aspect-ratio: 1; transform: translate(-50%, -50%); color: var(--g-accent); opacity: .3; }
.rosette svg { width: 100%; height: 100%; }
.skyline {
  position: absolute; left: -8%; right: calc(-1 * var(--pad)); bottom: 0; height: 56%;
  color: var(--g-panel);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 100%);
}
.skyline svg { width: 100%; height: 100%; display: block; }

.shots { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.6vw, 18px); width: 100%; }
.shots li { flex: 0 1 31%; min-width: 0; }
.shots li:nth-child(2) { flex-basis: 34%; transform: translateY(-4%); z-index: 1; }
.shots li:nth-child(n+4) { display: none; }
.phone {
  display: block; width: 100%; padding: 3.4%; border: 0; cursor: zoom-in;
  background: #070b09;
  border-radius: 14% / 6.5%;
  box-shadow: 0 1px 0 1px rgba(255, 255, 255, .06) inset, 0 28px 50px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .5);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.phone img { width: 100%; aspect-ratio: 780 / 1688; object-fit: cover; border-radius: 10.5% / 4.9%; background: var(--g-panel); }
.phone:hover { transform: translateY(-6px); }

/* features */
.game-features {
  grid-area: feat;
  list-style: none; margin: clamp(32px, 4vw, 48px) 0 0; padding: clamp(24px, 3vw, 32px) 0 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px clamp(20px, 3vw, 40px);
  border-top: 1px solid var(--g-line);
  position: relative;
}
.game-features li { display: grid; gap: 8px; align-content: start; min-width: 0; }
.game-features svg { width: 28px; height: 28px; color: var(--g-accent); }
.game-features h4 { font-family: var(--g-display); font-weight: 800; font-size: 23px; line-height: 1.05; }
.game-features p { font-size: 17px; line-height: 1.4; color: var(--g-ink2); }

@media (max-width: 1080px) {
  .game-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .game { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "body" "feat"; }
  .game-stage { margin: 28px calc(-1 * var(--pad)) 0; padding-block: 8px 20px; display: block; }
  .shots {
    justify-content: flex-start; align-items: stretch;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad);
    padding: 12px var(--pad) 16px;
    scrollbar-width: none;
  }
  .shots::-webkit-scrollbar { display: none; }
  .shots li, .shots li:nth-child(2) { flex: 0 0 min(58vw, 260px); transform: none; scroll-snap-align: start; }
  .shots li:nth-child(n+4) { display: block; }
  .phone:hover { transform: none; }
  .rosette { width: min(130%, 560px); }
  .skyline { left: 0; right: 0; height: 38%; }
  .game-body { margin-top: 12px; }
}
@media (max-width: 560px) {
  .game-features { grid-template-columns: minmax(0, 1fr); }
  .facts dd { font-size: 19px; }
  .game-summary { font-size: 18px; }
}

/* compact game cards + the "brewing" card */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(20px, 3vw, 32px); }
.game-card {
  display: grid; gap: 14px; align-content: start;
  padding: clamp(20px, 3vw, 32px);
  background: var(--g-bg); color: var(--g-ink);
  border-radius: var(--r-l);
  font-family: var(--g-text);
}
.game-card .gt-main { font-size: clamp(56px, 7vw, 84px); }
.game-card .gt-sub { font-size: 22px; margin-top: 8px; }

.next-card {
  display: flex; align-items: center; flex-wrap: wrap; gap: 20px clamp(20px, 3vw, 36px);
  padding: clamp(20px, 3vw, 36px);
  border: 2px dashed var(--line);
  border-radius: var(--r-l);
}
.next-jar { flex: none; width: 64px; height: 107px; color: var(--ink); }
.next-copy { flex: 1 1 280px; display: grid; gap: 6px; min-width: 0; }
.next-copy .mono { color: var(--ink-2); }
.next-copy h3 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 900; letter-spacing: -.02em; }
.next-copy p:last-child { color: var(--ink-2); font-size: 18px; }
.next-card .btn { flex: none; }

/* ---------- studio ---------- */
.studio-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.studio-intro { display: grid; gap: 18px; }
.studio-lead { font: 900 clamp(34px, 4.4vw, 56px)/.98 var(--f-display); letter-spacing: -.03em; text-wrap: balance; }
.studio-intro p:last-child { font-size: 19px; color: var(--ink-2); max-width: 30em; }
.principles { list-style: none; margin: 0; padding: 0; display: grid; }
.principles li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; padding-block: 24px; border-top: 1px solid var(--line); }
.principles li:first-child { border-top: 0; padding-top: 4px; }
.principles h3 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; letter-spacing: -.015em; margin-bottom: 6px; }
.principles p { color: var(--ink-2); max-width: 36em; }
.bolt-dot { width: 40px; height: 40px; border-radius: 50%; background: var(--bolt); color: var(--on-bolt); }
@media (max-width: 820px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- contact ---------- */
.contact-body { display: grid; gap: 22px; }
.contact-lead { font-size: 19px; color: var(--ink-2); max-width: 34em; }
.email-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; }
.email {
  font: 900 clamp(24px, 5.6vw, 68px)/1.05 var(--f-display);
  letter-spacing: -.03em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--bolt), var(--bolt)) 0 100% / 100% .14em no-repeat;
  padding-bottom: .1em;
  transition: background-size .2s ease;
  min-width: 0;
}
.email:hover { background-size: 100% .24em; }
.copy-status { font: 500 12px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); }
.foot-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.fine { font-size: 14px; color: var(--ink-2); }

/* ---------- screenshot viewer ---------- */
.viewer {
  width: min(100vw, 560px); max-width: 100vw; max-height: 100dvh; height: 100dvh;
  margin: 0 auto; padding: 0; border: 0;
  background: transparent; color: var(--g-ink, #eee3c8);
  font-family: var(--g-text, var(--f-text));
  overflow: hidden;
}
.viewer::backdrop { background: rgba(6, 10, 8, .9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.viewer[open] { display: flex; }
.viewer-inner {
  flex: 1; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  min-height: 0;
}
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.viewer-title { font-family: var(--g-display, var(--f-display)); font-weight: 800; font-size: 22px; letter-spacing: .01em; }
.viewer-figure { margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; justify-items: center; min-height: 0; }
.viewer-figure img {
  height: 100%; width: auto; max-width: 100%; min-height: 0;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
  background: var(--g-panel, #182e26);
}
.viewer-figure figcaption { font-family: var(--g-flavor, var(--f-text)); font-style: italic; font-size: 17px; text-align: center; color: var(--g-ink2, #a2b4a7); text-wrap: balance; }
.viewer-nav { display: flex; align-items: center; justify-content: center; gap: 18px; }
.viewer-count { font: 500 12px/1 var(--f-mono); letter-spacing: .08em; color: var(--g-ink2, #a2b4a7); min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
.viewer-btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: inherit;
  transition: background-color .15s ease;
}
.viewer-btn:hover { background: rgba(255, 255, 255, .18); }
.viewer-btn svg { width: 22px; height: 22px; }
.viewer :focus-visible { outline: 3px solid var(--g-accent, #d2ab52); }

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