/* ===========================================================
   Odditea - "Tea Arcade" style
   Colors:  config/colors.js  (never hard-code a color here;
            use var(--name) or color-mix() on a variable)
   Text:    config/content.js
   Rules:   STYLE_GUIDE.md
   =========================================================== */

:root {
  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1200px;
  --gutter: 28px;
  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 20px;
  --radius-xl: 28px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--sky-bottom);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-upper) 30%, var(--sky-lower) 75%, var(--sky-bottom) 100%);
  -webkit-font-smoothing: antialiased;
}

/* CRT scanlines over everything (neutral black, not a brand color) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgb(0 0 0 / .12) 0 1px, transparent 1px 3px);
}

canvas.sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* clip, not hidden: nothing sticks out sideways (steam canvas, wobble)
   without turning .page into a scroll container */
.page { position: relative; z-index: 1; overflow-x: clip; }

a { color: var(--salmon-light); }
img { max-width: 100%; display: block; }
.icon { width: 26px; height: 26px; fill: currentColor; flex: none; }
.chunky .icon { fill: var(--button-icons); }

.hl      { color: var(--salmon-light); font-weight: 600; }
.hl-gold { color: var(--gold); font-weight: 600; }

main { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- ticker ---------------------------------------- */

.ticker {
  background: var(--ticker-bg);
  color: var(--ticker-text);
  border-bottom: 4px solid var(--ticker-text);
  overflow: hidden;
  white-space: nowrap;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.ticker-track { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.ticker-half span { display: inline-block; padding: 8px 0 8px 1.1em; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- header ---------------------------------------- */

.site-header {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  font-size: 24px;
}
.brand img { width: 58px; }

.site-nav { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* chunky keycap button, used for the menu */
.key {
  font-weight: 600;
  font-size: 15px;
  color: var(--cream);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: var(--radius-s);
  background: var(--salmon-dark);
  box-shadow: inset 0 -5px 0 rgb(0 0 0 / .35), inset 0 3px 0 rgb(255 255 255 / .18), 0 5px 0 var(--salmon-deep);
  transition: background .15s ease, color .15s ease;
}
.key:hover { background: var(--salmon); }
.key[aria-current="page"] { background: var(--salmon); color: var(--salmon-deep); }
.key:active { box-shadow: inset 0 -2px 0 rgb(0 0 0 / .35), 0 2px 0 var(--salmon-deep); transform: translateY(3px); }

/* ---------- home: hero ------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 50px;
  align-items: center;
  padding-top: 20px;
}

.welcome {
  font-weight: 700;
  font-size: clamp(46px, 6.5vw, 86px);
  line-height: 1;
  letter-spacing: -.02em;
  margin: 0 0 18px;
}
.welcome span { display: inline-block; text-shadow: 0 5px 0 var(--salmon-deep); }
.welcome span:nth-child(8n+1) { color: var(--welcome-1); transform: rotate(-7deg); }
.welcome span:nth-child(8n+2) { color: var(--welcome-2); transform: translateY(-6px) rotate(4deg); }
.welcome span:nth-child(8n+3) { color: var(--welcome-3); transform: rotate(-3deg); }
.welcome span:nth-child(8n+4) { color: var(--welcome-4); transform: translateY(4px) rotate(6deg); }
.welcome span:nth-child(8n+5) { color: var(--welcome-5); transform: rotate(-5deg); }
.welcome span:nth-child(8n+6) { color: var(--welcome-6); transform: translateY(-4px) rotate(3deg); }
.welcome span:nth-child(8n+7) { color: var(--welcome-7); transform: rotate(-2deg); }
.welcome span:nth-child(8n+8) { color: var(--welcome-8); transform: rotate(8deg); }

/* dashed text box */
.box {
  border: 3px dashed var(--salmon);
  border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  padding: 22px 26px;
}
.box p { margin: 0 0 12px; }
.box p:last-child { margin: 0; }
.box h2 { margin: 0 0 12px; font-size: 26px; color: var(--gold); text-shadow: 0 3px 0 var(--salmon-deep); }

.link-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }

/* big chunky 3D button with an icon */
.chunky {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-m);
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  background: linear-gradient(color-mix(in srgb, var(--salmon) 85%, white), var(--salmon-dark));
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / .3), inset 0 4px 0 rgb(255 255 255 / .25), 0 7px 0 var(--salmon-deep);
}
.chunky:hover { filter: brightness(1.08); }
.chunky:active { transform: translateY(4px); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .3), 0 3px 0 var(--salmon-deep); }

/* teapot + wordmark */
.poster {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.steam-canvas {
  position: absolute;
  left: -10%;
  top: -140px;
  width: 120%;
  height: calc(100% + 140px);
  pointer-events: none;
  z-index: 3;
}
.pot { position: relative; z-index: 2; width: min(440px, 92%); animation: bob 2.6s ease-in-out infinite; }
.pot img { width: 100%; filter: drop-shadow(0 0 34px color-mix(in srgb, var(--salmon-light) 55%, transparent)); }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-2deg); } }

.wordmark {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: clamp(54px, 6.6vw, 96px);
  line-height: .95;
  letter-spacing: -.03em;
  color: var(--salmon);
  transform: rotate(-4deg);
  text-shadow:
    1px 1px 0 var(--salmon-dark), 2px 2px 0 var(--salmon-dark), 3px 3px 0 var(--salmon-dark),
    4px 4px 0 var(--salmon-dark), 5px 5px 0 var(--salmon-dark), 6px 6px 0 var(--salmon-dark),
    7px 7px 0 var(--salmon-dark), 8px 8px 0 var(--salmon-deep), 12px 14px 30px rgb(0 0 0 / .6);
}
.wordmark small {
  display: block;
  position: relative;
  left: 8px;               /* optical centering under the 3D extrusion */
  margin-top: 10px;
  font-size: .175em;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold);
  text-shadow: 0 3px 0 var(--salmon-deep);
}

/* ---------- section headings ------------------------------ */

.sec {
  font-weight: 700;
  font-size: clamp(30px, 4vw, 40px);
  text-align: center;
  margin: 80px 0 30px;
  color: var(--gold);
  text-shadow: 0 4px 0 var(--salmon-deep);
  letter-spacing: .02em;
  line-height: 1.15;
}
.sec::before, .sec::after { content: "✦"; color: var(--salmon-light); margin: 0 16px; font-size: .7em; vertical-align: middle; }
h1.sec { margin-top: 40px; }

.page-intro { text-align: center; margin: -14px auto 40px; max-width: 60ch; color: var(--salmon-light); }

.sub { font-size: 24px; margin: 50px 0 18px; text-align: center; color: var(--cream); font-weight: 600; }
.hint { text-align: center; font-size: 14px; color: var(--salmon-light); margin: 22px 0 0; }

/* ---------- game card ------------------------------------- */

.game {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--salmon), var(--salmon-dark));
  box-shadow: 0 10px 0 var(--salmon-deep), 0 0 60px color-mix(in srgb, var(--salmon) 35%, transparent);
}
.game + .game { margin-top: 70px; }
.game-in {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 28px;
  align-items: center;
  padding: 26px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 85%, transparent);
}
.game h3 { font-weight: 700; font-size: 44px; margin: 0; line-height: 1; color: var(--cream); text-shadow: 0 4px 0 var(--salmon-deep); }
.game .label { font-weight: 500; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--mint); margin: 8px 0 14px; }
.game .strap { color: var(--salmon-light); font-size: 15px; margin: -4px 0 12px; }
.game p { margin: 0 0 16px; font-weight: 300; }

.cap {
  width: 100%;
  border-radius: 14px;
  border: 4px solid var(--cream);
  transform: rotate(1.5deg);
  box-shadow: 0 8px 0 var(--salmon-deep);
}

/* looping teaser: capsule image underneath, muted YouTube player on top.
   pointer-events off so clicks can't pause it; it's decoration, the Play
   button is the real call to action */
.cap-video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel); }
.cap-video img,
.cap-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cap-video img { object-fit: cover; }
.cap-video iframe { pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.cap-video.is-playing iframe { opacity: 1; }   /* set by videoGuard() in render.js */

/* transparent looping clip (home page): already shaped and glowing, so no
   frame or drop, just the usual small tilt */
.cap-anim { aspect-ratio: 5 / 3; transform: rotate(1.5deg) scale(1.25); }
/* scaled up past its box (the clip's edges are transparent), so its column
   gets a bit more room and a wider gap to keep it off the text */
.game-in:has(.cap-anim) { grid-template-columns: 1fr 1.4fr; column-gap: 48px; }
.game-in:has(.cap-anim) .stats { grid-template-columns: 1fr 1fr; }
.cap-anim video { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }

.stats { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats li,
.specs div {
  background: color-mix(in srgb, var(--salmon-light) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--salmon-light) 25%, transparent);
  border-radius: var(--radius-s);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
}
.stats li em,
.specs dt {
  display: block;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--salmon-light);
}
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 20px; }
.specs dd { margin: 0; }

.game-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.more-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.text-link { font-weight: 600; color: var(--salmon-light); text-decoration: none; }
.text-link:hover { color: var(--gold); text-decoration: underline; }

.play {
  display: inline-block;
  font-weight: 700;
  font-size: 19px;
  color: var(--salmon-deep);
  text-decoration: none;
  padding: 14px 28px;
  border-radius: var(--radius-m);
  background: linear-gradient(color-mix(in srgb, var(--gold) 60%, white), var(--gold));
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / .18), inset 0 4px 0 rgb(255 255 255 / .5), 0 7px 0 var(--gold-dark);
}
.play:hover { filter: brightness(1.05); }
.play:active { transform: translateY(4px); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18), 0 3px 0 var(--gold-dark); }

/* yellow starburst sticker, slowly pulsing */
.burst {
  position: absolute;
  top: -44px;
  right: -34px;
  z-index: 3;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--salmon-deep);
  background: var(--gold);
  clip-path: polygon(50% 0,61% 16%,79% 9%,79% 28%,98% 32%,87% 48%,100% 62%,81% 69%,84% 88%,65% 84%,50% 100%,39% 84%,19% 90%,21% 70%,2% 64%,13% 48%,3% 32%,21% 28%,21% 9%,39% 16%);
  rotate: 12deg;
  animation: pulse 2.8s ease-in-out infinite;
}
@keyframes pulse { 50% { scale: 1.09; } }

/* ---------- screenshot film strip ------------------------- */

.film {
  max-width: 1100px;
  margin: 44px auto 0;
  padding: 26px 18px;
  position: relative;
  border-radius: 8px;
  background: var(--film-bg);
  transform: rotate(-1deg);
  box-shadow: 0 10px 30px rgb(0 0 0 / .5);
}
.film::before, .film::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 12px;
  border-radius: 2px;
  opacity: .85;
  background: repeating-linear-gradient(90deg, var(--film-holes) 0 14px, transparent 14px 32px);
}
.film::before { top: 7px; }
.film::after { bottom: 7px; }
/* 4 shots in view (2 on phones); the rest scroll sideways */
.film-row {
  --shots: 4;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--shots) - 1) * 12px) / var(--shots));
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;        /* the native bar aliases badly in the tilt; .film-bar replaces it */
  cursor: grab;
}
.film-row::-webkit-scrollbar { display: none; }
.film-row.dragging { cursor: grabbing; user-select: none; }
.film-row.dragging .shot { cursor: grabbing; }
.film-row img { -webkit-user-drag: none; }

/* custom scroll bar: regular elements get smooth edges when rotated */
.film-bar {
  position: relative;
  height: 6px;
  margin-top: 10px;
  border-radius: 3px;
  background: rgb(255 255 255 / .08);
  outline: 1px solid transparent;   /* forces an anti-aliased edge on the tilted layer */
  cursor: pointer;
  touch-action: none;
}
.film-bar::before { content: ""; position: absolute; inset: -7px 0; }   /* easier to grab */
.film-bar[hidden] { display: none; }
.film-bar span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--film-holes);
  opacity: .85;
  will-change: transform;
  outline: 1px solid transparent;
}

.shot {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  cursor: zoom-in;
  overflow: hidden;
  outline-offset: -3px;   /* inset: the scrolling row clips anything outside */
}
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .25s ease; }
.shot:hover img, .shot:focus-visible img { transform: scale(1.06); }
.shot:focus-visible { outline: 3px solid var(--gold); }

/* ---------- contact --------------------------------------- */

.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; align-items: center; }
.contact-grid .pot { width: min(360px, 90%); }

.contact-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.contact-rows li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 2px dashed color-mix(in srgb, var(--salmon) 40%, transparent);
}
.contact-rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.c-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--mint); padding-top: 4px; }
.contact-rows a { font-weight: 600; color: var(--gold); }
.contact-rows .note { display: block; font-size: 14px; font-weight: 300; color: var(--salmon-light); margin-top: 2px; }

/* ---------- footer ---------------------------------------- */

.site-footer { text-align: center; padding: 70px 16px 44px; font-size: 14px; color: var(--salmon-light); }
.site-footer p { margin: 0 0 12px; }
.visits { display: inline-flex; align-items: center; gap: 8px; }
.counter { display: inline-flex; gap: 3px; }
.counter b {
  background: var(--counter-bg);
  color: var(--counter-digits);
  border: 2px solid var(--counter-border);
  font-weight: 700;
  font-size: 18px;
  padding: 1px 7px;
  min-width: 1.4em;
}
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.b88 {
  width: 88px;
  height: 31px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
  font-size: 9px;
  line-height: 1.05;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--b-bg);
  color: var(--b-fg);
  border: 2px outset color-mix(in srgb, var(--b-bg) 55%, white);
}

/* ---------- lightbox -------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 16px;
  background: color-mix(in srgb, var(--sky-top) 94%, transparent);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; border: 4px solid var(--cream); border-radius: 8px; }
.lightbox-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--salmon);
  color: var(--salmon-deep);
  font: 700 26px/1 var(--font);
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgb(0 0 0 / .25), 0 4px 0 var(--salmon-deep);
}
body.no-scroll { overflow: hidden; }

noscript p { max-width: 40ch; margin: 80px auto; text-align: center; }

/* ---------- responsive ------------------------------------ */

@media (max-width: 960px) {
  .hero, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .hero .poster, .contact-grid .poster { order: -1; }
  .pot { width: min(340px, 78%); }
  .welcome { text-align: center; }
  .link-row { justify-content: center; }
  .game-in { grid-template-columns: minmax(0, 1fr); }
  .game-in:has(.cap-anim) { grid-template-columns: minmax(0, 1fr); }
  .cap, .cap-anim { order: -1; }
  .cap-anim { transform: rotate(1.5deg) scale(1.2); margin: 3% 0; }
  .burst { right: -14px; }
  .sec { margin-top: 64px; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .ticker { font-size: 12px; }
  .site-header { flex-wrap: wrap; justify-content: center; padding-top: 16px; padding-bottom: 14px; }
  .site-nav { margin-left: 0; justify-content: center; gap: 8px; }
  .brand { font-size: 22px; }
  .brand img { width: 48px; }
  .key { font-size: 14px; padding: 8px 14px; }
  .steam-canvas { top: -60px; height: calc(100% + 60px); }
  .box { padding: 18px 18px; }
  .chunky { padding: 10px 14px; font-size: 15px; }
  .chunky .icon { width: 22px; height: 22px; }
  .sec::before, .sec::after { margin: 0 8px; }
  .game { padding: 10px; border-radius: 22px; }
  .game-in { padding: 18px 16px 22px; gap: 20px; }
  .game h3 { font-size: 34px; }
  .stats, .specs { grid-template-columns: 1fr 1fr; }
  .burst { width: 104px; height: 104px; font-size: 14px; top: -30px; right: -12px; }
  .film { padding: 24px 12px; }
  .film-row { --shots: 2; }
  .contact-rows li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .contact-rows a { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .pot, .burst { animation: none; }
  .shot img { transition: none; }
}
