/* Night (default) */
:root {
  --bg: #000000;
  --fg: #fafafa;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, .12);
  --glass: rgba(255, 255, 255, .07);
  --glass-hover: rgba(255, 255, 255, .12);
  --glass-line: rgba(255, 255, 255, .14);
  --glass-line-hover: rgba(255, 255, 255, .3);
  --solid: rgba(255, 255, 255, .92);
  --solid-hover: #ffffff;
  --on-solid: #000000;
  --glow: #ffffff;
  --glow-alpha: 1;
  --art: #0d0d0d;
  --ring: rgba(255, 255, 255, .12);
  --card: linear-gradient(140deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .025) 55%, rgba(255, 255, 255, .05));
  --card-edge: rgba(255, 255, 255, .1);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(255, 255, 255, .04), 0 24px 60px rgba(0, 0, 0, .5);
  --sheen: rgba(255, 255, 255, .09);
  color-scheme: dark;
  --blur: blur(24px) saturate(160%);
  --ease: cubic-bezier(.22, .61, .36, 1);
}
/* Day: the inverse, on a warm off-white */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f6f2;
    --fg: #111111;
    --muted: #55555c;
    --line: rgba(0, 0, 0, .09);
    --glass: rgba(0, 0, 0, .035);
    --glass-hover: rgba(0, 0, 0, .09);
    --glass-line: rgba(0, 0, 0, .1);
    --glass-line-hover: rgba(0, 0, 0, .2);
    --solid: rgba(17, 17, 17, .92);
    --solid-hover: #000000;
    --on-solid: #f7f6f2;
    --glow: #000000;
    --glow-alpha: .5;
    --art: #e7e6e1;
    --ring: rgba(0, 0, 0, .1);
    --card: linear-gradient(140deg, rgba(0, 0, 0, .045), rgba(0, 0, 0, .01) 55%, rgba(0, 0, 0, .02));
    --card-edge: rgba(0, 0, 0, .1);
    --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(0, 0, 0, .03), 0 24px 60px rgba(40, 35, 20, .06);
    --sheen: rgba(255, 255, 255, .7);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f6f2;
  --fg: #111111;
  --muted: #55555c;
  --line: rgba(0, 0, 0, .09);
  --glass: rgba(0, 0, 0, .035);
  --glass-hover: rgba(0, 0, 0, .09);
  --glass-line: rgba(0, 0, 0, .1);
  --glass-line-hover: rgba(0, 0, 0, .2);
  --solid: rgba(17, 17, 17, .92);
  --solid-hover: #000000;
  --on-solid: #f7f6f2;
  --glow: #000000;
  --glow-alpha: .5;
  --art: #e7e6e1;
  --ring: rgba(0, 0, 0, .1);
  --card: linear-gradient(140deg, rgba(0, 0, 0, .045), rgba(0, 0, 0, .01) 55%, rgba(0, 0, 0, .02));
  --card-edge: rgba(0, 0, 0, .1);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(0, 0, 0, .03), 0 24px 60px rgba(40, 35, 20, .06);
  --sheen: rgba(255, 255, 255, .7);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  transition: background-color .3s var(--ease), color .3s var(--ease);
  color: var(--fg);
  font: 400 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: inherit; font-weight: 600; line-height: 1.1; letter-spacing: -.026em; margin: 0; }
h3 { letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 12px; z-index: 100; padding: 8px 14px; border-radius: 999px; background: var(--fg); color: var(--bg); }
.skip:focus { left: 16px; }

/* Soft monochrome light behind the page so the glass has something to blur */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; opacity: var(--glow-alpha); }
.ambient i { position: absolute; border-radius: 50%; filter: blur(60px); background: var(--glow); opacity: .2; animation: drift 26s var(--ease) infinite alternate; }
.ambient i:nth-child(1) { width: 40vmax; height: 40vmax; left: -10vmax; top: -12vmax; }
.ambient i:nth-child(2) { width: 30vmax; height: 30vmax; right: -8vmax; top: 22vh; opacity: .16; animation-duration: 32s; animation-delay: -8s; }
.ambient i:nth-child(3) { width: 26vmax; height: 26vmax; left: 28vw; bottom: -12vmax; opacity: .15; animation-duration: 38s; animation-delay: -14s; }
.ambient i:nth-child(4) { width: 16vmax; height: 16vmax; left: 8vw; top: 55vh; opacity: .13; animation-duration: 29s; animation-delay: -20s; }
.ambient i:nth-child(5) { width: 12vmax; height: 12vmax; right: 22vw; top: 6vh; opacity: .14; animation-duration: 35s; animation-delay: -4s; }
@keyframes drift { to { transform: translate3d(6vmax, 5vmax, 0) scale(1.08); } }

.glass-card {
  position: relative;
  isolation: isolate;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 28px;
  box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(110% 70% at 0% 0%, var(--sheen), transparent 60%);
}
.glass {
  background: var(--card);
  border: 1px solid var(--card-edge);
  box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* Nav */
.nav { position: fixed; top: 16px; left: 0; right: 0; z-index: 50; padding-inline: 16px; }
.nav-bar { max-width: 880px; margin-inline: auto; height: 60px; padding: 0 8px 0 22px; border-radius: 999px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 18px/1 Inter, sans-serif; letter-spacing: -.03em; }
.logo-slot { width: 0; }
.links { display: flex; gap: 4px; margin-left: auto; }
.links a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 10px 14px; border-radius: 999px; transition: color .2s var(--ease), background .2s var(--ease); }
.links a:hover { color: var(--fg); background: var(--glass-hover); }
.lang { display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.lang button { border: 0; background: none; color: var(--muted); cursor: pointer; font: 600 12px/1 Inter, sans-serif; min-width: 40px; min-height: 36px; border-radius: 999px; transition: background .2s var(--ease), color .2s var(--ease); }
.lang button:hover { color: var(--fg); }
.lang button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.theme-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--fg); cursor: pointer; transition: background .2s var(--ease); }
.theme-btn:hover { background: var(--glass-hover); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .sun { display: none; }
:root[data-mode="light"] .theme-btn .sun { display: block; }
:root[data-mode="light"] .theme-btn .moon { display: none; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; border-radius: 999px; background: none; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.menu-btn span { width: 18px; height: 1.5px; background: var(--fg); transition: transform .2s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.mobile-menu { max-width: 880px; margin: 8px auto 0; padding: 8px; border-radius: 24px; display: grid; }
.mobile-menu[hidden] { display: none; }
.mobile-menu a { text-decoration: none; padding: 14px 16px; border-radius: 16px; font-size: 17px; }
.mobile-menu a:hover { background: var(--glass-hover); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px; border-radius: 999px;
  font: 500 15px/1 Inter, sans-serif; text-decoration: none; cursor: pointer;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-solid { background: var(--solid); color: var(--on-solid); border: 1px solid var(--solid); }
.btn-solid:hover { background: var(--solid-hover); }
.btn-glass { background: var(--glass); border: 1px solid var(--glass-line); color: var(--fg); }
.btn-glass:hover { background: var(--glass-hover); border-color: var(--glass-line-hover); }

/* Hero */
.hero { min-height: 100svh; display: grid; align-items: center; padding: 140px 0 80px; text-align: center; }
.hero-card { display: grid; justify-items: center; width: min(1000px, 100% - 32px); padding: clamp(40px, 7vw, 80px) clamp(20px, 5vw, 64px); border-radius: 36px; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 24px; }
.hero h1 { font-size: clamp(40px, 7.4vw, 88px); max-width: 15ch; }
.lead { color: var(--muted); font-size: clamp(17px, 1.9vw, 19px); max-width: 56ch; margin-top: 28px; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 44px; }

/* Sections */
.section { padding: 128px 0; border-top: 1px solid var(--line); }
.sec-head { margin-bottom: 64px; }
.sec-head h2, .contact h2 { font-size: clamp(32px, 4.6vw, 52px); max-width: 18ch; }

.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.col { padding: 32px; border-radius: 24px; }
.num { font: 500 13px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; color: var(--muted); }
.col h3 { font-size: 24px; margin: 40px 0 14px; }
.col p { color: var(--muted); }

/* About */
.about { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-text h2 { font-size: clamp(32px, 4.6vw, 52px); max-width: 16ch; margin-bottom: 28px; }
.about-text p:not(.eyebrow) { color: var(--muted); font-size: 17px; max-width: 58ch; }
.about-text p + p { margin-top: 18px; }
.loop { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.loop li { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 24px 28px; border-radius: 22px; }
.loop h3 { font-size: 19px; margin-bottom: 6px; }
.loop p { color: var(--muted); font-size: 15px; }
.loop .num { padding-top: 5px; }
.sec-head .lead { margin-top: 18px; }

/* Games */
.game { display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; }
.game + .game { margin-top: 24px; }
.game-art { position: relative; background: #050505; overflow: hidden; border-right: 1px solid var(--line); }
.game-art img, .game-art svg { width: 100%; height: 100%; object-fit: cover; }
.rainroll-art { display: grid; place-items: center; background: var(--art); }
.rainroll-art img { height: auto; object-fit: contain; filter: grayscale(1) contrast(1.05); transition: filter .6s var(--ease), transform .6s var(--ease); }
.game:hover .rainroll-art img { filter: none; transform: scale(1.02); }
.game-body { padding: 44px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.meta { color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.game-body h3 { font-size: 36px; }
.game-body > p:not(.meta) { color: var(--muted); }
.chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 13px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass); }
.status { margin-top: auto; padding-top: 16px; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 4px var(--ring); }
.dot.hollow { background: none; border: 1.5px solid var(--muted); box-shadow: none; }

/* Approach */
.rows { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rows { display: grid; gap: 12px; }
.rows li { counter-increment: r; display: grid; grid-template-columns: 64px 1fr 1.4fr; gap: 24px; align-items: baseline; padding: 28px 32px; border-radius: 22px; }
.rows li::before { content: counter(r, decimal-leading-zero); font: 500 13px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; color: var(--muted); }
.rows h3 { font-size: 22px; }
.rows p { color: var(--muted); }

/* Contact */
.contact { text-align: center; }
.contact-card { display: grid; justify-items: center; width: min(900px, 100% - 32px); padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 56px); border-radius: 36px; }
.contact .lead { margin-bottom: 44px; }
.mail { font-size: clamp(16px, 2vw, 18px); min-height: 60px; padding: 0 30px; }
.mail svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.foot a { text-decoration: none; transition: color .2s var(--ease); }
.foot a:hover { color: var(--fg); }

/* Scroll reveal (enabled by main.js only when motion is allowed) */
.js-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js-reveal .reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .col { padding: 28px 24px; }
  .col h3 { margin-top: 20px; }
  .game { grid-template-columns: 1fr; }
  .game-art { border-right: 0; border-bottom: 1px solid var(--line); aspect-ratio: 2.05 / 1; }
  .rows li { grid-template-columns: 40px 1fr; padding: 24px 20px; gap: 8px 16px; }
  .rows p { grid-column: 2; }
}
@media (max-width: 720px) {
  .links, .nav-bar .lang { display: none; }
  .theme-btn { margin-left: auto; }
  .menu-btn { display: flex; }
  .mobile-menu .lang { display: flex; justify-self: start; margin: 8px 8px 4px; }
  .section { padding: 88px 0; }
  .game-body { padding: 28px 24px; }
  .game-body h3 { font-size: 30px; }
}
@media (min-width: 721px) { .mobile-menu { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ambient i { animation: none; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
