/* Mahjong site. Palette follows the game: burgundy felt, walnut, ivory tiles, gold. No third-party requests. */
@font-face { font-family: "Mahjong Serif"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/MahjongSerif-SemiBold.40188878.woff2") format("woff2"); }
@font-face { font-family: "Mahjong Serif"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/MahjongSerif-Bold.4fb53699.woff2") format("woff2"); }

:root {
  --bg: #1a0508; --felt: #3a0b12; --felt-2: #54121b; --walnut: #3a2417; --walnut-2: #5a3820; --wood-hi: #8a5a33;
  --gold: #e6c56b; --gold-2: #b8923f; --ivory: #f3ead7; --muted: #d8cbb0; --muted-2: #b8ab95;
  --tile-a: #f4ecd8; --tile-b: #d8caa6; --jade: #1f5a41; --ok: #8fd19a; --bad: #e59a8a;
  --serif: "Mahjong Serif", "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
  color-scheme: dark;
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
/* Tablet and up only (mobile apps are planned): below 768 px the page scrolls sideways. */
html, body { min-width: 768px; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ivory); font: 400 1.0625rem/1.65 var(--sans);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(1200px 600px at 50% -10%, #4a0f18 0%, transparent 70%);
  background-repeat: no-repeat;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #fff3c9; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -64px; background: var(--gold); color: #2a1604; padding: 10px 16px; border-radius: 8px; z-index: 50; font-weight: 700; }
.skip:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
h2 + p { margin-top: 16px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: .01em; }
h2 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); color: var(--gold); }
h3 { font-size: 1.3rem; color: var(--ivory); }
p { margin: 0 0 1em; }
.eyebrow { font: 600 .8rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 34px; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); }
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 46ch; }

/* ivory tile, drawn in CSS like the game's: ivory face, jade back edge */
.tile { display: inline-grid; place-items: center; width: 54px; height: 72px; border-radius: 8px; font: 700 2rem/1 var(--serif); color: #1c1a16;
  background: linear-gradient(160deg, var(--tile-a), var(--tile-b)); box-shadow: 0 5px 0 var(--jade), 0 10px 18px rgb(0 0 0 / .5), inset 0 1px 0 #fff8; }
.tile.red { color: #b3201c; } .tile.green { color: #1d6b43; } .tile.blue { color: #1f3f7a; }
.tile-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* header */
.top { position: absolute; inset: 0 0 auto 0; z-index: 5; padding-block: 18px; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.brand { font: 700 1.5rem/1 var(--serif); color: var(--ivory); text-decoration: none; letter-spacing: .04em; }
.brand span { color: var(--gold); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ivory); border-color: var(--gold); }

/* hero */
.hero { position: relative; min-height: min(92vh, 860px); display: grid; align-items: end; isolation: isolate; overflow: hidden; }
.hero picture, .hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(26 5 8 / .6) 0%, transparent 24%, transparent 55%, rgb(26 5 8 / .88) 88%, var(--bg) 100%), linear-gradient(90deg, rgb(26 5 8 / .6), transparent 55%); }
.hero-body { padding-block: 140px 64px; }
.hero h1 { font-size: clamp(3.4rem, 12vw, 7.5rem); color: var(--gold); text-shadow: 0 4px 30px rgb(0 0 0 / .6); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .35em; }
.hero h1 small { font-size: .38em; color: var(--ivory); font-weight: 600; opacity: .9; }
.hero .lede { max-width: 44ch; margin-block: 20px 30px; color: var(--ivory); text-shadow: 0 2px 12px rgb(0 0 0 / .7); }
.stores { margin: 18px 0 0; color: var(--muted); font-size: .95rem; text-shadow: 0 2px 10px rgb(0 0 0 / .7); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px; font: 700 1rem/1 var(--sans); text-decoration: none; border: 2px solid var(--gold); color: var(--gold); background: rgb(26 5 8 / .45); }
.btn:hover { background: rgb(230 197 107 / .14); color: #fff3c9; }
.btn.primary { background: linear-gradient(180deg, #f0d681, var(--gold-2)); color: #2a1604; border-color: #f0d681; }
.btn[aria-disabled="true"] { cursor: default; background: rgb(243 234 215 / .1); border-color: var(--muted-2); color: var(--ivory); }
.btn small { font-weight: 600; opacity: .85; }

/* facts band */
.band { background: linear-gradient(180deg, var(--walnut), #2a190f); border-block: 1px solid #00000066; box-shadow: inset 0 1px 0 #ffffff14, 0 8px 30px #0008; }
.band ul.stats { list-style: none; margin: 0; padding: 26px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; text-align: center; }
.band li { margin: 0; padding: 0; }
.band b { display: block; font: 700 2.2rem/1.1 var(--serif); color: var(--gold); }
.band span { color: var(--muted); font-size: .95rem; }

section { padding-block: clamp(64px, 9vw, 112px); }
.head { max-width: 62ch; margin-bottom: 40px; }
.head p { color: var(--muted); font-size: 1.1rem; margin-top: 14px; }

/* felt panel texture */
.felt { background-color: var(--felt); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* variants */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 28px; }
.card { display: flex; flex-direction: column; background: linear-gradient(180deg, #4a2c1a, var(--walnut)); border-radius: 14px; overflow: hidden; border: 1px solid #00000080; box-shadow: 0 1px 0 #ffffff1c inset, 0 18px 40px #0009; }
.card figure { margin: 0; position: relative; background: #000; aspect-ratio: 16 / 9; border-bottom: 3px solid var(--gold-2); }
.card figure img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card p { color: var(--muted); margin: 0; font-size: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; padding: 0; list-style: none; }
.chips li { font: 600 .8rem/1 var(--sans); padding: 6px 10px; border-radius: 999px; background: #00000040; border: 1px solid #e6c56b55; color: var(--gold); }
.card .lessons { margin-top: auto; padding-top: 6px; color: var(--muted-2); font-size: .9rem; }
.soon { margin-top: 44px; padding: 28px; border-radius: 14px; border: 1px dashed #e6c56b66; }
.soon h3 { color: var(--gold); margin-bottom: 8px; }
.soon ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.soon li { color: var(--muted); }
.soon li b { color: var(--ivory); font-family: var(--serif); }

/* split layout */
.split { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.05fr 1fr; } .split.flip { grid-template-columns: 1fr 1.05fr; } .split.flip > :first-child { order: 2; } }
.shot { margin: 0; border-radius: 12px; overflow: hidden; border: 3px solid var(--walnut-2); box-shadow: 0 0 0 1px #000, 0 24px 60px #000a; background: #000; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.counts li { background: #00000040; border: 1px solid #e6c56b33; border-radius: 10px; padding: 12px 14px; color: var(--muted); font-size: .92rem; }
.counts b { display: block; font: 700 1.6rem/1.1 var(--serif); color: var(--gold); }
.big { font: 700 clamp(4rem, 12vw, 7rem)/1 var(--serif); color: var(--gold); margin-bottom: 6px; }

/* online */
.status { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: 12px; background: #00000055; border: 1px solid #e6c56b44; width: fit-content; max-width: 100%; margin-block: 8px 24px; font-weight: 600; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted-2); flex: none; }
.status[data-state="online"] .dot { background: var(--ok); box-shadow: 0 0 0 0 #8fd19a99; animation: pulse 2.4s infinite; }
.status[data-state="offline"] .dot { background: var(--bad); }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px #8fd19a00; } 100% { box-shadow: 0 0 0 0 #8fd19a00; } }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.steps li { padding-left: 34px; position: relative; color: var(--muted); }
.steps li::before { content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 24px; border-radius: 4px; background: linear-gradient(160deg, var(--tile-a), var(--tile-b)); box-shadow: 0 3px 0 var(--jade); }
.steps b { color: var(--ivory); }
.muted { color: var(--muted-2); font-size: .95rem; }

.codecard { padding: 34px 28px; border-radius: 16px; text-align: center; background: linear-gradient(180deg, #4a2c1a, var(--walnut)); border: 1px solid #00000080; box-shadow: 0 1px 0 #ffffff1c inset, 0 18px 40px #0009; }
.codecard .tile-row { justify-content: center; margin: 0 0 22px; }
.codecard p { margin: 0; color: var(--muted); font-size: .95rem; }
/* features */
.features { margin-top: 56px !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.features li { padding: 26px; border-radius: 14px; background: linear-gradient(180deg, #ffffff0a, #00000030); border: 1px solid #e6c56b2a; }
.features h3 { color: var(--gold); margin-bottom: 8px; font-size: 1.2rem; }
.features p { margin: 0; color: var(--muted); font-size: 1rem; }

/* footer */
footer { background: #120305; border-top: 4px solid var(--walnut-2); padding-block: 48px; color: var(--muted); font-size: .95rem; }
footer .wrap { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
footer h2 { font-size: 1.1rem; color: var(--gold); margin-bottom: 10px; }
footer p { margin: 0 0 .6em; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer small { color: var(--muted-2); grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid #ffffff14; }

/* legal pages */
.doc { padding-block: 120px 80px; max-width: 74ch; }
.doc h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); color: var(--gold); margin-bottom: 8px; }
.doc h2 { font-size: 1.5rem; margin: 36px 0 10px; }
.doc p, .doc li { color: var(--muted); }
.draft { background: #e6c56b1f; border: 1px solid #e6c56b66; border-radius: 10px; padding: 14px 18px; color: var(--ivory); }

/* reveal on scroll (JS adds .js to html; without JS everything is visible) */
/* Content is visible by default. JS marks only elements that start below the fold with .pre; they fade in when scrolled to (or after 1.5 s). */
.reveal.pre { opacity: 0; transform: translateY(18px); }
.reveal.pre.in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal.pre { opacity: 1; transform: none; transition: none; }
  .status[data-state="online"] .dot { animation: none; }
}
