/* Loopa.AI promotion site. Spec: team/website/DECISION.md (D11 to D20). */

@font-face { font-family: "Outfit"; src: url("../assets/fonts/outfit-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../assets/fonts/outfit-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../assets/fonts/outfit-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --white: #FFFFFF;
  --ink: #111111;
  --gray: #5C5C5C;
  --gray-dark: #A3A3A3;
  --black: #080808; /* sampled from the character sheet background so crops show no edge */
  --blue: #2447D6;
  --blue-hover: #1B37AE;
  --red: #E5222B;
  --yellow: #FFC21F;
  --glow: #FFD84D;
  --focus: var(--blue);
  --max: 1200px;
  --gutter: 48px;
  --section-y: 96px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.section-dark, .site-footer { --focus: var(--glow); }

.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;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--ink); color: var(--white); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-y) 0; }
.section-light { background: var(--white); color: var(--ink); }
.section-dark { background: var(--black); color: var(--white); }

/* Type (D12) */
h1 {
  font-size: clamp(2.5rem, 5.5vw + .5rem, 4.75rem);
  font-weight: 800; line-height: 1.02; letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(2rem, 3.5vw + .5rem, 3.25rem);
  font-weight: 800; line-height: 1.08; letter-spacing: -0.015em;
}
h3 { font-size: 1.375rem; font-weight: 800; line-height: 1.2; }
.label {
  font-size: 0.8125rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; font-variant-numeric: tabular-nums;
  color: var(--gray); margin-bottom: 16px;
}
.label .ts { color: var(--ink); }
.section-dark .label { color: var(--gray-dark); }
.section-dark .label .ts { color: var(--glow); }
.label .sep { margin: 0 .6em; }
.intro { margin-top: 16px; max-width: 34em; color: var(--gray-dark); font-size: 1.25rem; line-height: 1.5; }

/* Buttons (D13) */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 16px 28px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 600; font-size: 1.0625rem; line-height: 1; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-hover); }
.btn-yellow { background: var(--yellow); color: #000; }
.btn-yellow:hover { background: var(--glow); }
.btn-ghost { background: transparent; color: var(--white); border-color: #4A4A4A; }
.btn-ghost:hover { border-color: var(--white); }
.btn-small { padding: 12px 20px; font-size: .9375rem; }
.btn-big { min-height: 60px; padding: 20px 36px; font-size: 1.25rem; }
.text-link { color: var(--blue); font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.text-link:hover { color: var(--blue-hover); }

/* Header (D4) */
.site-header { background: var(--white); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 80px; }
.brand { display: inline-flex; padding: 6px 0; }
.brand img { height: 28px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 32px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; font-weight: 600; font-size: 1rem; color: var(--ink); }
.nav-links a:hover { color: var(--blue); }

/* Hero (D5) */
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 48px; align-items: center; }
.hero h1 { max-width: 11em; }
.hero .lead { margin-top: 24px; max-width: 30em; color: var(--gray); font-size: 1.25rem; line-height: 1.55; }
.cta-row { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.hero-art img { width: 100%; max-width: 560px; margin-left: auto; }

/* The loop (D6) */
.loop-track { margin-top: 48px; }
.loop-svg { width: 100%; height: auto; display: block; overflow: visible; }
.loop-line {
  fill: none; stroke: #E9E9E9; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 0;
}
.loop-marker .halo { fill: var(--black); stroke: #E9E9E9; stroke-width: 2.5; }
.stations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 24px; }
.station { display: flex; flex-direction: column; align-items: center; text-align: center; }
.station img { height: 150px; width: auto; max-width: 220px; }
.station h3 { margin-top: 12px; display: inline-flex; align-items: center; gap: 10px; }
.station p { margin-top: 8px; color: var(--gray-dark); max-width: 22em; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.dot-red { background: var(--red); }
.dot-blue { background: var(--blue); box-shadow: 0 0 0 1px #6F87F0; }
.dot-yellow { background: var(--yellow); }

/* Gameplay (D7) */
.formats {
  margin-top: 56px; display: grid; grid-template-columns: repeat(2, minmax(0, 360px));
  justify-content: center; gap: 72px;
}
.format { display: flex; flex-direction: column; }
.format h3 { margin-top: 28px; }
.format > p:last-child { margin-top: 8px; color: var(--gray); }
.tag {
  align-self: flex-start; margin-bottom: 14px;
  font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 12px; border-radius: 999px; border: 1.5px dashed var(--gray); color: var(--ink); background: #F4F4F4;
}
.phone {
  width: 100%; border: 10px solid #111; border-radius: 36px; background: #111;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  transition: box-shadow .2s ease;
}
.phone:hover { box-shadow: 0 22px 48px rgba(0,0,0,.22); }
.screen { position: relative; aspect-ratio: 9 / 16; border-radius: 26px; overflow: hidden; }
.soon { margin-top: 56px; text-align: center; color: var(--gray); font-weight: 600; }

/* Frame A: the real game in an iframe. Frame B: the 30 second gameplay video. */
.screen-game, .screen-video { background: var(--white); }
.screen-game iframe, .screen-video video { display: block; width: 100%; height: 100%; border: 0; }
.screen-video video { object-fit: cover; cursor: pointer; }
.screen-video video[controls] { cursor: auto; }

/* End card (D8) */
.endcard-inner { display: grid; grid-template-columns: auto 1fr; gap: 64px; align-items: center; }
.endcard-art { width: 200px; max-width: 200px; }
.endcard h2 { max-width: 14em; }
.contact-slot { margin-top: 32px; }
.coming-soon {
  display: inline-block; padding: 16px 28px; border: 2px dashed var(--yellow); border-radius: 14px;
  color: var(--yellow); font-weight: 600; font-size: 1.125rem; line-height: 1.3;
}
.endcard .small { margin-top: 28px; color: var(--gray-dark); font-size: 1rem; max-width: 34em; }

/* Footer (D9) */
.site-footer { background: var(--black); color: var(--gray-dark); font-size: .9375rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 32px; padding-top: 28px; padding-bottom: 40px; border-top: 1px solid #1F1F1F; }
.site-footer a { color: var(--gray-dark); }

/* Responsive */
@media (max-width: 1023px) {
  :root { --gutter: 24px; }
  .formats { gap: 40px; }
}
@media (max-width: 767px) {
  :root { --section-y: 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-art img { max-width: 340px; margin: 0 auto; }
  .stations { grid-template-columns: 1fr; gap: 28px; margin-top: 16px; }
  .station { flex-direction: row; align-items: center; text-align: left; gap: 16px; }
  .station img { height: auto; width: 96px; flex: none; }
  .loop-line { stroke-width: 7; }
  .loop-marker .halo { stroke-width: 5; }
  .station h3 { margin-top: 0; }
  .formats { grid-template-columns: minmax(0, 360px); gap: 56px; }
  .endcard-inner { grid-template-columns: 1fr; gap: 24px; justify-items: center; text-align: center; }
  .endcard-art { width: 160px; }
  .endcard .intro, .endcard .small, .endcard h2 { margin-left: auto; margin-right: auto; }
  .footer-inner { justify-content: center; text-align: center; }
}
@media (max-width: 639px) {
  .nav-links { display: none; }
}
@media (max-width: 479px) {
  .header-inner { min-height: 68px; }
  .label .sep { margin: 0 .4em; }
}

/* Motion (D17). Only under .motion-ready, and never with reduced motion. */
@keyframes fade-up-12 { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-up-16 { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .motion-ready .hero-in { animation: fade-up-12 .4s ease-out both; }
  .motion-ready .hero-in:nth-child(2) { animation-delay: 80ms; }
  .motion-ready .hero-in:nth-child(3) { animation-delay: 160ms; }
  .motion-ready .hero-in:nth-child(4) { animation-delay: 240ms; }
  .motion-ready .hero-art img { animation: fade-up-16 .5s ease-out both; }

  .motion-ready .loop-track:not(.in-view) .loop-line { stroke-dashoffset: 1; }
  .motion-ready .loop-track:not(.in-view) .loop-marker,
  .motion-ready .loop-track:not(.in-view) .station { opacity: 0; }
  .motion-ready .loop-track.in-view .loop-line { animation: draw 1.6s linear both; }
  .motion-ready .loop-track.in-view .loop-marker { animation: fade-in .3s ease-out both; }
  .motion-ready .loop-track.in-view .station { animation: fade-up-12 .5s ease-out both; }
  .motion-ready .loop-track.in-view .m1, .motion-ready .loop-track.in-view .s1 { animation-delay: .3s; }
  .motion-ready .loop-track.in-view .m2, .motion-ready .loop-track.in-view .s2 { animation-delay: .8s; }
  .motion-ready .loop-track.in-view .m3, .motion-ready .loop-track.in-view .s3 { animation-delay: 1.3s; }

  .phone { transition: box-shadow .2s ease, transform .2s ease; }
  .phone:hover { transform: translateY(-4px); }
}

/* Reduced motion: state changes are instant, final states stay the same. */
@media (prefers-reduced-motion: reduce) {
  .btn, .phone { transition: none; }
}
