/*
  Final Instinct website. No build step: this one stylesheet serves every page.
  Colours, radii and the solid bottom "lip" come from the game (apps/mobile/src/theme/tokens.ts).
  The fonts are referenced relative to this file, so the site works from any subpath.
*/
@font-face { font-family: 'Archivo Black'; font-weight: 400; font-display: swap; src: url('../fonts/ArchivoBlack-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('../fonts/Inter-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('../fonts/Inter-Bold.ttf') format('truetype'); }

:root {
  --slate: #7D90A3; --slate-deep: #66798C; --dark: #1F2A30; --violet: #2E2A4F;
  --paper: #F3E6C4; --card: #E8DCC4; --ink: #1E1B22; --ink-muted: #4F4958;
  --cube-light: #A9BBA6; --cube-mid: #93B4A3; --cube-dark: #6FA596;
  --sky: #8DB7C9; --moss: #6E9A4F; --coral: #D8495F; --gold: #E8BD3C; --rose: #E08AA8;
  --lip-paper: #BDB298; --lip-gold: #B5932F; --lip-ink: #0B0A0D;
  --radius: 16px; --lip: 4px;
  --display: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wrap: 1180px; --gutter: clamp(18px, 4.5vw, 48px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--ui); font-weight: 500; font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--slate); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
strong, b { font-weight: 700; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible, .site-foot :focus-visible { outline-color: var(--gold); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* Type */
.display { font-family: var(--display); font-weight: 400; letter-spacing: -0.02em; line-height: 1; text-wrap: balance; }
.kicker { font-weight: 700; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.lead { font-size: clamp(18px, 2.1vw, 21px); line-height: 1.5; text-wrap: pretty; }

/* A band is one full-width coloured section with the game's faint grain. */
.band { position: relative; padding: clamp(64px, 9vw, 120px) 0; isolation: isolate; }
.band::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); opacity: 0.1; mix-blend-mode: multiply; pointer-events: none; }
.band--slate { background: var(--slate); }
.band--paper { background: var(--paper); }
.band--dark { background: var(--dark); color: var(--paper); }
.band--violet { background: var(--violet); color: var(--paper); }
.band--sky { background: var(--sky); }
.band h2 { font-size: clamp(34px, 5.4vw, 60px); text-shadow: 0 3px 0 rgba(30, 27, 34, 0.14); }
.on-dark h2 { text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); }
.on-dark .muted { color: #C9C2AE; }
.muted { color: var(--ink-muted); }

/* Header */
.site-head { position: absolute; top: 0; left: 0; right: 0; z-index: 10; padding: 18px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--display); font-size: 17px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); }
.brand img { width: 38px; height: 38px; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; font-weight: 700; font-size: 15px; padding: 9px 13px; border-radius: 999px; }
.nav a:hover { background: rgba(30, 27, 34, 0.14); }
@media (max-width: 760px) { .nav { display: none; } }

/* Hero */
.hero { padding: clamp(96px, 12vw, 150px) 0 0; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(46px, 8.4vw, 104px); text-shadow: 0 5px 0 rgba(30, 27, 34, 0.16); }
.hero h1 em { font-style: normal; display: inline-block; background: var(--paper); padding: 0.02em 0.16em 0.1em; margin: 0.08em 0 0 -0.1em; border-radius: 0.16em; box-shadow: 0 0.07em 0 var(--lip-paper); text-shadow: none; transform: rotate(-1.5deg); }
.hero .lead { margin-top: 22px; max-width: 34em; }
.hero-copy { padding-bottom: clamp(40px, 7vw, 110px); }

.badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.badge { display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 20px 9px 16px; background: var(--ink); color: var(--paper); border-radius: 14px; box-shadow: 0 var(--lip) 0 var(--lip-ink); cursor: default; }
.badge svg { width: 26px; height: 26px; flex: none; }
.badge small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); line-height: 1.2; }
.badge b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.15; }
.hero-note { margin-top: 18px; font-size: 14.5px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { font-weight: 700; font-size: 13.5px; padding: 6px 13px; border-radius: 999px; background: rgba(30, 27, 34, 0.2); }
.on-dark .chip { background: rgba(243, 230, 196, 0.14); }

/* Phone: a plain ink bezel around a real capture (all captures are 1148x1986). */
.phone { position: relative; background: var(--ink); border-radius: 13.5% / 7.8%; padding: 3.1%; box-shadow: 0 10px 0 rgba(30, 27, 34, 0.28); width: 100%; max-width: 330px; }
.phone img { width: 100%; aspect-ratio: 1148 / 1986; object-fit: cover; object-position: top; border-radius: 11% / 6.4%; background: var(--slate); }
.on-dark .phone { box-shadow: 0 10px 0 rgba(0, 0, 0, 0.45), 0 0 0 1.5px rgba(243, 230, 196, 0.2); }

.hero-art { position: relative; align-self: end; min-height: 420px; display: flex; justify-content: center; }
.hero-art .phone { z-index: 2; max-width: 340px; margin: 0 0 -70px 16%; }
.hero-art .phone--back { position: absolute; z-index: 1; left: -2%; bottom: -90px; max-width: 270px; transform: rotate(-8deg); margin: 0; }
.win { position: absolute; z-index: 3; right: -5%; bottom: 3%; width: min(52%, 250px); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 0 rgba(30, 27, 34, 0.3); transform: rotate(4deg); }
.win img { width: 118%; max-width: none; margin: -5.5% -9% -8.5%; }

/* The island of game blocks: real prop art tiled on an isometric lattice by site.js. */
.lattice { position: relative; margin: 0 auto; }
.lattice img { position: absolute; }
.float { animation: bob 7s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Feature rows */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.feature--flip .feature-art { order: -1; }
.feature-art { display: flex; justify-content: center; position: relative; }
.feature h2 + .lead { margin-top: 20px; }
.ticks { margin-top: 26px; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--moss) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6 11.5l3.2 3.2L16 8' fill='none' stroke='%23F3E6C4' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.pair { display: flex; gap: 18px; justify-content: center; align-items: flex-end; }
.pair .phone { max-width: 260px; }
.pair .phone:last-child { transform: translateY(34px); }

/* Odds callouts: figures copied from the capture beside them. */
.odds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.odds div { background: #2B363D; border: 1.5px solid rgba(243, 230, 196, 0.22); border-radius: var(--radius); padding: 14px 10px; text-align: center; box-shadow: 0 var(--lip) 0 rgba(0, 0, 0, 0.35); }
.odds b { display: block; white-space: nowrap; font-family: var(--display); font-weight: 400; font-size: clamp(16px, 2.6vw, 26px); color: var(--gold); line-height: 1.1; }
.odds span { font-size: 13.5px; color: #C9C2AE; }

/* Wall of games: two rows of real game blocks drifting past. */
/* The bottom padding leaves room for the last row's lip (a shadow, which overflow would clip). */
.wall { margin-top: clamp(36px, 5vw, 60px); display: grid; gap: 14px; overflow: hidden; padding-bottom: calc(var(--lip) + 4px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.wall-row { display: flex; gap: 14px; width: max-content; animation: drift 90s linear infinite; }
.wall-row:nth-child(2) { animation-direction: reverse; animation-duration: 110s; }
.wall:hover .wall-row { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(-50%); } }
.tile { flex: none; width: 132px; background: var(--card); border-radius: var(--radius); padding: 8px 8px 10px; text-align: center; box-shadow: 0 var(--lip) 0 var(--lip-paper); border: 1.5px solid rgba(30, 27, 34, 0.1); }
.tile img { width: 96px; height: 96px; margin: 0 auto; }
.tile span { display: block; font-weight: 700; font-size: 12.5px; line-height: 1.2; min-height: 2.4em; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.cats li { font-weight: 700; font-size: 14px; padding: 7px 14px; border-radius: 999px; background: var(--card); box-shadow: 0 3px 0 var(--lip-paper); border: 1.5px solid rgba(30, 27, 34, 0.1); }

/* Fair play */
.fair { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: clamp(30px, 4vw, 48px); }
.fair li { background: var(--card); border-radius: var(--radius); padding: 22px 20px 24px; box-shadow: 0 var(--lip) 0 var(--lip-paper); border: 1.5px solid rgba(30, 27, 34, 0.1); }
.fair h3 { font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.15; margin-bottom: 8px; }
.fair p { font-size: 15.5px; color: var(--ink-muted); }
.fair .stamp { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--coral); color: var(--paper); font-family: var(--display); font-size: 17px; margin-bottom: 14px; box-shadow: 0 3px 0 #9C3344; }
.fair li:nth-child(2) .stamp { background: var(--gold); color: var(--ink); box-shadow: 0 3px 0 var(--lip-gold); }
.fair li:nth-child(3) .stamp { background: var(--moss); box-shadow: 0 3px 0 #4C6B36; }
.fair li:nth-child(4) .stamp { background: var(--violet); box-shadow: 0 3px 0 #16142A; }
.small-print { margin-top: 26px; font-size: 14.5px; color: var(--ink-muted); max-width: 62em; }

/* Gallery: the store panels in a strip you can swipe. */
.gallery { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px var(--gutter) 22px; margin: clamp(28px, 4vw, 44px) 0 0; scrollbar-color: var(--ink) transparent; }
.gallery li { flex: none; scroll-snap-align: center; width: min(68vw, 270px); }
.gallery img { width: 100%; aspect-ratio: 9 / 16; border-radius: 22px; box-shadow: 0 6px 0 rgba(30, 27, 34, 0.3); }
@media (min-width: 1240px) { .gallery { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-left: auto; margin-right: auto; overflow: visible; } .gallery li { width: auto; flex: 1 1 0; } }

/* FAQ */
.faq { max-width: 820px; margin: clamp(28px, 4vw, 44px) auto 0; display: grid; gap: 12px; }
.faq details { background: var(--card); border-radius: var(--radius); box-shadow: 0 var(--lip) 0 var(--lip-paper); border: 1.5px solid rgba(30, 27, 34, 0.1); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 54px 18px 20px; font-weight: 700; font-size: 18px; position: relative; border-radius: var(--radius); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-family: var(--display); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { padding: 0 20px 20px; color: var(--ink-muted); }
.center { text-align: center; }
.center .lead { margin: 18px auto 0; max-width: 38em; }

/* Closing band */
.closing .badges { justify-content: center; }
.closing .lattice { width: min(100%, 520px); margin-bottom: 26px; }
.friends-art { position: relative; width: 100%; display: flex; justify-content: center; }
.friends-art .lattice { position: absolute; width: 74%; left: -6%; bottom: -8%; margin: 0; opacity: 0.95; }
.friends-art .phone { position: relative; z-index: 1; margin-left: 30%; max-width: 280px; }

/* Footer */
.site-foot { background: var(--ink); color: var(--paper); padding: 44px 0 34px; font-size: 15px; }
.site-foot .wrap { display: grid; gap: 22px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-links a { font-weight: 700; text-underline-offset: 3px; }
.foot-fine { color: #B9B2A0; font-size: 13.5px; max-width: 70em; }

/* Reveal on scroll (site.js adds .in). Without JS, or with reduced motion, everything is simply visible. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Legal and support pages */
.doc-head { background: var(--slate); padding: 18px 0; position: relative; }
.doc-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.doc-head .back { font-weight: 700; font-size: 15px; text-underline-offset: 3px; }
.doc-main { background: var(--slate); padding: clamp(20px, 4vw, 44px) 0 clamp(56px, 8vw, 96px); position: relative; isolation: isolate; }
.doc-main::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); opacity: 0.1; mix-blend-mode: multiply; }
.doc { background: var(--paper); border-radius: 22px; box-shadow: 0 6px 0 rgba(30, 27, 34, 0.28); max-width: 820px; margin: 0 auto; padding: clamp(24px, 5vw, 56px); }
.doc h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 5.4vw, 48px); line-height: 1.05; letter-spacing: -0.02em; }
.doc .meta { margin-top: 12px; color: var(--ink-muted); font-size: 15px; }
.doc h2 { font-family: var(--display); font-weight: 400; font-size: clamp(21px, 3vw, 25px); line-height: 1.2; margin-top: 38px; scroll-margin-top: 20px; }
.doc h3 { font-size: 17px; font-weight: 700; margin-top: 22px; }
.doc p, .doc ul, .doc ol, .doc table, .doc .steps { margin-top: 14px; }
.doc ul:not(.plain) { list-style: disc; padding-left: 22px; display: grid; gap: 6px; }
.doc ol:not(.steps) { list-style: decimal; padding-left: 22px; display: grid; gap: 6px; }
.doc a { color: #2E4A75; font-weight: 700; text-underline-offset: 3px; }
.doc .callout { background: var(--card); border: 1.5px solid rgba(30, 27, 34, 0.12); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 var(--lip) 0 var(--lip-paper); }
.doc .steps { counter-reset: step; display: grid; gap: 10px; }
.doc .steps li { counter-increment: step; position: relative; background: var(--card); border: 1.5px solid rgba(30, 27, 34, 0.12); border-radius: var(--radius); padding: 14px 16px 14px 60px; box-shadow: 0 var(--lip) 0 var(--lip-paper); font-weight: 700; }
.doc .steps li::before { content: counter(step); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: var(--paper); font-family: var(--display); display: flex; align-items: center; justify-content: center; }
.doc .steps li span { display: block; font-weight: 500; color: var(--ink-muted); font-size: 15px; }
.table-scroll { overflow-x: auto; margin-top: 14px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 560px; margin-top: 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1.5px solid rgba(30, 27, 34, 0.14); }
.doc th { font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.toc { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { display: inline-block; text-decoration: none; color: var(--ink); background: var(--card); border: 1.5px solid rgba(30, 27, 34, 0.12); padding: 6px 12px; border-radius: 999px; font-size: 14px; box-shadow: 0 3px 0 var(--lip-paper); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 24px; border-radius: var(--radius); background: var(--gold); color: var(--ink) !important; font-family: var(--display); font-weight: 400 !important; font-size: 17px; text-decoration: none; box-shadow: 0 var(--lip) 0 var(--lip-gold); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip-gold); }

/* Smaller screens */
@media (max-width: 900px) {
  .hero .wrap, .feature { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-bottom: 8px; }
  .hero-art { min-height: 0; margin-top: 18px; }
  .hero-art .phone { max-width: min(60vw, 300px); margin-left: 22%; }
  .hero-art .phone--back { max-width: min(46vw, 230px); left: 0; }
  .win { right: 0; width: min(46%, 230px); bottom: 6%; }
  .feature--flip .feature-art { order: 0; }
  .feature-art { margin-top: 8px; }
  .fair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .fair { grid-template-columns: minmax(0, 1fr); }
  .odds { gap: 8px; }
  .badge { flex: 1 1 100%; }
  .pair { gap: 10px; }
  .pair .phone:last-child { transform: translateY(20px); }
  .tile { width: 112px; }
  .tile img { width: 80px; height: 80px; }
  .phone { box-shadow: 0 7px 0 rgba(30, 27, 34, 0.28); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float, .wall-row { animation: none; }
  .wall { overflow-x: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* On phones the privacy table reads as a stack of entries instead of scrolling sideways. */
@media (max-width: 640px) {
  .doc table { min-width: 0; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .doc tbody, .doc tr, .doc td { display: block; }
  .doc tr { padding: 12px 0; border-bottom: 1.5px solid rgba(30, 27, 34, 0.14); }
  .doc td { padding: 3px 0; border: 0; }
  .doc td:nth-child(2)::before { content: 'Why: '; font-weight: 700; }
  .doc td:nth-child(3)::before { content: 'Kept in: '; font-weight: 700; }
}

/* Former inline styles, moved here so the Content-Security-Policy needs no 'unsafe-inline'. */
.odds-note { margin-top: 14px; font-size: 14.5px; }
.fair-lead { margin-top: 18px; max-width: 40em; }
.site-foot .brand { color: inherit; }
.fair a { font-weight: 700; text-underline-offset: 3px; }

/* Legal pages: call-outs, wide tables and long links */
.doc .callout { margin-top: 22px; }
.doc .callout > :first-child { margin-top: 0; }
.doc .meta + p { margin-top: 22px; }
.doc { overflow-wrap: anywhere; }
.doc li { min-width: 0; }
.doc li > strong:first-child { font-weight: 700; }
.table-scroll:focus-visible { outline: 3px solid #2E4A75; outline-offset: 3px; }
@media (max-width: 600px) { .doc table { font-size: 14px; } .doc th, .doc td { padding: 8px 9px; } }
