/* FlouLox Studios: shared styles for every page. Page-specific parts are grouped under comments below. */

@font-face { font-family: "Chakra Petch"; src: url("/assets/fonts/chakra-petch-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("/assets/fonts/chakra-petch-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/assets/fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #06080f;
  --bg-2: #0c1120;
  --bg-3: #131a2e;
  --line: #242d47;
  --line-2: #3a4668;
  --ink: #eef2ff;
  --dim: #a3adc9;
  --teal: #4de8d0;
  --ember: #ff7a45;
  --gold: #ffc34d;
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --cut: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--body); overflow-x: clip; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
::selection { background: var(--teal); color: var(--bg); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; }
.skip:focus { top: 12px; }
.eyebrow { font: 600 13px/1.2 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal); }
.section { padding-block: clamp(64px, 10vw, 128px); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 32px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: clamp(32px, 5vw, 56px); margin-top: 10px; }
.section-head .lede { max-width: 44ch; color: var(--dim); }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(6, 8, 15, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(58, 70, 104, 0.45); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 18px/1 var(--display); letter-spacing: 0.02em; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.brand span span { color: var(--dim); font-weight: 600; }
.nav nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); }
.nav nav a { color: var(--dim); text-decoration: none; font: 600 15px/1 var(--display); padding: 12px 0; }
.nav nav a:hover, .nav nav a[aria-current] { color: var(--ink); }
@media (max-width: 480px) { .brand span span { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border: 0; cursor: pointer; font: 700 15px/1.1 var(--display); letter-spacing: 0.03em; text-decoration: none; text-align: center; color: var(--bg); background: var(--teal); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: background 0.15s, transform 0.15s; }
.btn:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); }
.btn:focus-visible { outline: none; background: var(--ink); color: var(--bg); box-shadow: inset 0 0 0 3px var(--ember); }
.btn-ghost { color: var(--ink); background: var(--bg-3); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-ghost:focus-visible { background: var(--line-2); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.status { display: inline-flex; align-items: center; gap: 9px; font: 600 13px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.status::before { content: ""; width: 9px; height: 9px; flex: none; background: currentColor; border-radius: 50%; box-shadow: 0 0 0 0 currentColor; animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 195, 77, 0.6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(255, 195, 77, 0); } }

/* Scroll reveal: only hides anything once the script has confirmed it can show it again */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Home: hero */
.hero { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: min(calc(100svh - 65px), 920px); padding-block: 72px 32px; overflow: hidden; isolation: isolate; background: radial-gradient(90% 70% at 72% 18%, #15203f 0%, transparent 70%), var(--bg); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero h1 { width: fit-content; font-size: clamp(64px, 17.6vw, 232px); line-height: 0.82; letter-spacing: -0.02em; text-transform: uppercase; margin-left: -0.04em; }
.hero h1 small { display: block; margin: clamp(12px, 1.8vw, 24px) -0.62em 0 0; font: 600 clamp(15px, 2.1vw, 26px)/1 var(--display); letter-spacing: 0.62em; text-align: right; color: var(--dim); }
.hero-foot { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px 48px; margin-top: clamp(24px, 4vw, 44px); padding-top: 22px; border-top: 1px solid var(--line-2); }
.hero-foot p { max-width: 34ch; font-size: clamp(19px, 2.2vw, 25px); line-height: 1.3; }
.now { display: grid; gap: 6px; color: var(--ink); text-decoration: none; }
.now b { font: 700 19px/1.2 var(--display); }
.now b i { font-style: normal; color: var(--teal); transition: margin 0.15s; }
.now:hover { color: var(--ink); }
.now:hover b i { margin-left: 5px; }

/* Home: games */
.game-feature { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 620px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.game-feature .copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: clamp(24px, 4vw, 56px); z-index: 2; }
.game-feature .logo { width: min(100%, 400px); height: auto; margin: 0 0 4px -8px; }
.game-feature h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.game-feature .pitch { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.45; max-width: 34ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--dim); font-size: 15px; line-height: 1.2; }
.tags li { padding: 6px 12px; border: 1px solid var(--line-2); }
.game-feature .btn-row { margin-top: auto; padding-top: 12px; }
.scene { position: relative; min-height: 420px; overflow: hidden; }
.scene .planet { position: absolute; width: 150%; max-width: none; left: -20%; top: -22%; transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.game-feature:hover .planet { transform: scale(1.05) rotate(4deg); }
.scene .phone { position: absolute; left: 50%; bottom: -84px; width: min(66%, 290px); margin-left: calc(min(66%, 290px) / -2); transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.game-feature:hover .phone { transform: translateY(-20px); }
.phone { background: #02040a; border: 7px solid #1c2336; border-radius: 34px; overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line-2); }
.phone img { width: 100%; height: auto; }
@media (max-width: 860px) {
  .game-feature { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .game-feature .btn-row { margin-top: 0; }
}

.next { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px clamp(20px, 4vw, 48px); margin-top: 16px; padding: clamp(24px, 3vw, 36px) clamp(24px, 4vw, 56px); border: 1px dashed var(--line-2); }
.next h3 { font-size: clamp(22px, 3vw, 34px); letter-spacing: 0.04em; color: var(--dim); font-variant-numeric: tabular-nums; min-width: 12ch; }
.next p { color: var(--dim); max-width: 52ch; }
.next .eyebrow { grid-column: 1 / -1; color: var(--ember); }
@media (max-width: 640px) { .next { grid-template-columns: minmax(0, 1fr); } }

/* Home: approach */
.approach { background: var(--bg-2); border-block: 1px solid var(--line); }
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.rules li { counter-increment: rule; border-top: 2px solid var(--line-2); padding-top: 18px; }
.rules li::before { content: "0" counter(rule); display: block; margin-bottom: 26px; font: 700 14px/1 var(--display); letter-spacing: 0.1em; color: var(--ember); }
.rules h3 { font-size: 25px; margin-bottom: 12px; }
.rules p { color: var(--dim); }
@media (max-width: 760px) { .rules { grid-template-columns: minmax(0, 1fr); } }

/* Contact block, used on home and the game page */
.contact { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px clamp(32px, 6vw, 96px); align-items: end; }
.contact h2 { font-size: clamp(32px, 5vw, 56px); margin: 10px 0 18px; }
.contact p { color: var(--dim); max-width: 46ch; }
.mail { display: inline-block; margin-top: 18px; padding-block: 4px; font: 700 clamp(19px, 3.1vw, 36px)/1.15 var(--display); color: var(--ink); text-decoration-color: var(--teal); text-underline-offset: 7px; overflow-wrap: anywhere; }
.mail:hover { color: var(--teal); }
.help { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.help li { border-bottom: 1px solid var(--line); }
.help a, .help button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 12px 2px; color: var(--ink); background: none; border: 0; font: inherit; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; }
.help a::after { content: "\2192"; color: var(--teal); transition: transform 0.15s; }
.help a:hover::after { transform: translateX(5px); }
.help a:hover, .help button:hover { color: var(--teal); }
.help small { font-size: 14px; color: var(--teal); white-space: nowrap; }
@media (max-width: 760px) { .contact { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 28px; color: var(--dim); font-size: 15px; }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.foot a { display: inline-block; padding-block: 6px; color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Game page: hero and demo */
.game-hero { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(40px, 6vw, 72px); background: radial-gradient(70% 80% at 80% 30%, #1a2750 0%, transparent 70%), var(--bg); }
.game-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 390px); gap: 40px clamp(32px, 6vw, 88px); align-items: center; }
.game-hero .logo { width: min(100%, 560px); height: auto; margin-left: -12px; }
.game-hero h1 { font-size: clamp(24px, 3vw, 36px); margin: 16px 0 16px; line-height: 1.16; }
.game-hero .pitch { color: var(--dim); max-width: 48ch; font-size: 18px; }
.game-hero .status { margin: 24px 0 24px; display: flex; }
.demo { position: relative; width: min(100%, 380px); aspect-ratio: 9 / 16; max-height: 76svh; margin-inline: auto; background: #03050c; border: 8px solid #1c2336; border-radius: 38px; overflow: hidden; box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line-2), 0 0 90px rgba(77, 232, 208, 0.12); user-select: none; -webkit-user-select: none; }
.demo-planet { position: absolute; width: 125%; max-width: none; left: -12.5%; top: -26%; opacity: 0.5; pointer-events: none; }
.demo canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: pan-y; }
.demo-hud { position: absolute; left: 12px; right: 12px; top: 14px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; font: 700 19px/1 var(--display); font-variant-numeric: tabular-nums; }
.demo-hud span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 7px; background: rgba(6, 8, 15, 0.72); border-radius: 99px; }
.demo-hud img { width: 24px; height: 24px; }
.demo-hud .combo { padding-left: 12px; color: var(--gold); opacity: 0; transition: opacity 0.2s; }
.demo-hud .combo.on { opacity: 1; }
.demo-hint { position: absolute; left: 0; right: 0; bottom: 30%; text-align: center; pointer-events: none; font: 700 17px/1.2 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); text-shadow: 0 2px 10px #000; transition: opacity 0.4s; animation: hint 1.3s ease-in-out infinite; }
.demo-hint.off { opacity: 0; animation: none; }
@keyframes hint { 50% { transform: translateY(-5px); } }
@media (max-width: 860px) { .game-hero .wrap { grid-template-columns: minmax(0, 1fr); } .demo { max-height: 620px; } }

/* Game page: screenshots */
.shots { display: flex; gap: 18px; margin: 0; padding: 4px var(--gutter) 22px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-color: var(--line-2) transparent; }
.shots li { flex: 0 0 clamp(190px, 21vw, 260px); scroll-snap-align: start; }
.shot { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: zoom-in; }
.shot .phone { border-width: 5px; border-radius: 24px; box-shadow: 0 0 0 1px var(--line-2); transition: transform 0.25s; }
.shot:hover .phone { transform: translateY(-6px); }
.shot span { display: block; margin-top: 12px; color: var(--dim); font-size: 15px; line-height: 1.35; }
.lightbox { width: min(100vw, 460px); max-width: none; max-height: 100svh; padding: 12px; border: 0; background: none; color: var(--ink); overflow: visible; }
.lightbox::backdrop { background: rgba(3, 5, 12, 0.92); backdrop-filter: blur(6px); }
.lightbox .phone { width: auto; max-width: 100%; max-height: calc(100svh - 130px); margin-inline: auto; aspect-ratio: 390 / 844; }
.lightbox .phone img { height: 100%; object-fit: cover; }
.lightbox p { margin: 10px 0; min-height: 2.6em; text-align: center; font-size: 15px; line-height: 1.3; color: var(--dim); }
.lightbox-nav { display: flex; justify-content: center; gap: 8px; }
.lightbox-nav button { min-width: 48px; min-height: 48px; padding: 0 16px; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--ink); font: 700 15px var(--display); cursor: pointer; }
.lightbox-nav button:hover { background: var(--line-2); }

/* Game page: features */
.loop { background: var(--bg-2); border-block: 1px solid var(--line); }
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.cell { position: relative; grid-column: span 2; display: flex; flex-direction: column; gap: 10px; min-height: 300px; padding: 24px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.cell.wide { grid-column: span 3; }
.cell h3 { font-size: 25px; }
.cell p { color: var(--dim); font-size: 16px; line-height: 1.5; max-width: 40ch; }
.cell .art { margin-top: auto; padding-top: 18px; display: flex; align-items: flex-end; justify-content: center; gap: 2%; }
.cell .art img { min-width: 0; flex: 1 1 0; height: auto; }
.cell .art.tight img { max-width: 74px; }
.cell.guardians .art img { max-width: 26%; flex: 0 1 25%; }
.cell.guardians .art img:nth-child(odd) { transform: translateY(-10px); }
@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell, .cell.wide { grid-column: span 1; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .cell { min-height: 0; }
}

/* Game page: worlds */
.worlds { display: flex; gap: 8px; margin: 0; padding: 8px var(--gutter) 22px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-color: var(--line-2) transparent; }
.worlds li { flex: 0 0 210px; scroll-snap-align: start; padding: 0 8px; }
.worlds img { width: 190px; height: 190px; margin: 0 auto 14px; transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.worlds li:hover img { transform: scale(1.08) rotate(-3deg); }
.worlds b { display: block; font: 700 18px/1.2 var(--display); }
.worlds small { display: block; margin-top: 6px; color: var(--dim); font-size: 15px; line-height: 1.35; }
.worlds i { display: block; margin-bottom: 4px; font: 600 12px/1 var(--display); letter-spacing: 0.1em; color: var(--teal); }

/* Text pages: privacy policies */
.prose { max-width: 760px; margin-inline: auto; padding: clamp(36px, 6vw, 72px) var(--gutter) clamp(56px, 8vw, 96px); }
.prose h1 { font-size: clamp(34px, 5.5vw, 52px); margin-bottom: 10px; }
.prose h2 { font-size: 23px; margin: 40px 0 10px; color: var(--teal); }
.prose p, .prose ul { margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose .meta { color: var(--dim); margin-bottom: 28px; }
.prose .table-scroll { overflow-x: auto; margin: 8px 0 16px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { padding: 10px 12px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { font: 600 15px var(--display); color: var(--dim); }
.policy-list { margin: 8px 0 24px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.policy-list li { margin: 0; border-bottom: 1px solid var(--line); }
.policy-list a { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 60px; padding: 12px 2px; color: var(--ink); font: 700 19px var(--display); text-decoration: none; }
.policy-list a span { color: var(--teal); }
.policy-list a:hover { color: var(--teal); }

/* 404 */
.lost { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: calc(100svh - 150px); padding-block: 48px; }
.lost h1 { font-size: clamp(88px, 22vw, 240px); line-height: 0.9; color: var(--ember); }
.lost h2 { font-size: clamp(26px, 4vw, 40px); margin: 14px 0 12px; }
.lost p { color: var(--dim); margin-bottom: 26px; max-width: 44ch; }

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

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
