/* Ruby Puzzle · voidsensory.com
   One stylesheet for every page. Dark, quiet, system type (SF Rounded on Apple devices). */

:root {
  --bg: #0a0a0b;
  --bg-raised: #131315;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f2f2;
  --muted: rgba(242, 242, 242, 0.62);
  --faint: rgba(242, 242, 242, 0.38);
  --ruby: #d41729;
  --ruby-soft: rgba(212, 23, 41, 0.14);
  --radius: 22px;
  --max: 1080px;
  --read: 680px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ruby); outline-offset: 3px; border-radius: 6px; }

img, video, canvas { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.read { max-width: var(--read); }

/* ── Top bar ─────────────────────────────────────────────── */
.bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.bar a { text-decoration: none; color: var(--muted); }
.bar a:hover { color: var(--text); }
.bar .brand { color: var(--text); display: flex; align-items: center; gap: 10px; }
.bar .brand img { width: 26px; height: 26px; border-radius: 7px; }
.bar nav { display: flex; gap: 22px; }

.bar.solid { position: sticky; background: rgba(10, 10, 11, 0.86); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  overflow: hidden; text-align: center; isolation: isolate;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 46% 38% at 50% 48%, rgba(10,10,11,0.9) 0%, rgba(10,10,11,0.72) 50%, rgba(10,10,11,0.18) 100%),
    linear-gradient(to bottom, rgba(10,10,11,0.75) 0%, rgba(10,10,11,0) 18%, rgba(10,10,11,0) 72%, var(--bg) 100%);
}
.hero-inner { padding: 120px 24px 96px; }
.app-icon { width: 112px; height: 112px; border-radius: 26px; margin: 0 auto 28px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08); }
h1 { font-size: clamp(44px, 8vw, 84px); line-height: 1.02; margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.tagline { font-size: clamp(19px, 2.4vw, 24px); color: var(--muted); margin: 16px 0 36px; font-weight: 500; }
.note { margin-top: 22px; font-size: 14px; color: var(--muted); letter-spacing: 0.02em; }

/* App Store badge: the official artwork if present, a clean fallback otherwise. */
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; text-decoration: none; }
.badge img { height: 54px; width: auto; }
.badge .fallback {
  display: none; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 14px;
  background: #fff; color: #000; font-weight: 700; font-size: 17px; white-space: nowrap;
}
.badge.no-art img { display: none; }
.badge.no-art .fallback { display: inline-flex; }

/* ── Sections ───────────────────────────────────────────── */
section { padding: 120px 0; }
section + section { border-top: 1px solid var(--line); }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ruby); margin: 0 0 14px; }
h2 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.08; margin: 0 0 20px; font-weight: 800; letter-spacing: -0.015em; }
h3 { font-size: 20px; margin: 0 0 8px; font-weight: 800; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); margin: 0; max-width: 620px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 48px; } section { padding: 88px 0; } }

/* Phone frame for the preview / screenshots */
.phone {
  position: relative; width: min(320px, 78vw); aspect-ratio: 886 / 1920; margin: 0 auto;
  border-radius: 46px; padding: 10px; background: #1b1b1e;
  box-shadow: 0 40px 90px rgba(0,0,0,0.65), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.phone canvas, .phone img { display: block; width: 100%; height: 100%; border-radius: 37px; background: #000; }

.modes { display: grid; gap: 34px; margin-top: 40px; }
.mode { padding-left: 20px; border-left: 2px solid var(--line); }
.mode p { margin: 0; color: var(--muted); }
.mode.on { border-left-color: var(--ruby); }

/* Worlds strip */
.worlds { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 18px 12px; margin-top: 56px; }
@media (max-width: 720px) { .worlds { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.world { text-align: center; }
.world canvas { width: 100%; height: auto; aspect-ratio: 1; margin: 0 auto 8px; }
.world span { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }

/* Screens gallery (hidden until the images exist) */
.gallery { display: flex; gap: 22px; overflow-x: auto; padding: 8px 24px 28px; margin: 48px -24px 0;
  scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { margin: 0; flex: 0 0 auto; scroll-snap-align: center; }
.gallery img { width: min(250px, 62vw); aspect-ratio: 1320 / 2868; object-fit: cover; border-radius: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06); background: #000; }

/* Daily */
.daily-card {
  margin-top: 48px; padding: 32px; border-radius: var(--radius); background: var(--bg-raised);
  border: 1px solid var(--line); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px;
}
.day { text-align: center; padding: 14px 4px; border-radius: 14px; background: rgba(255,255,255,0.03); }
.day b { display: block; font-size: 12px; letter-spacing: 0.14em; color: var(--faint); margin-bottom: 6px; }
.day span { font-size: 13px; font-weight: 700; }
.day.today { background: var(--ruby-soft); box-shadow: inset 0 0 0 1px rgba(212,23,41,0.5); }
.day.today b { color: var(--ruby); }
@media (max-width: 720px) { .daily-card { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 20px; } }

/* Closing */
.closing { text-align: center; }
.closing .lead { margin: 0 auto 36px; }

/* ── Footer ─────────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 14px; color: var(--faint); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
footer a { text-decoration: none; color: var(--muted); }
footer a:hover { color: var(--text); }

/* ── Document pages (privacy, support, press) ───────────── */
.doc { padding: 72px 0 96px; }
.doc h1 { font-size: clamp(36px, 6vw, 56px); margin-bottom: 10px; }
.doc .updated { color: var(--faint); font-size: 14px; margin: 0 0 48px; }
.doc h2 { font-size: 24px; margin: 48px 0 12px; letter-spacing: 0; }
.doc h3 { font-size: 18px; margin: 28px 0 6px; }
.doc p, .doc li { color: var(--muted); }
.doc strong { color: var(--text); font-weight: 700; }
.doc ul { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.doc th, .doc td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--text); font-weight: 700; }
.doc td { color: var(--muted); }
.table-scroll { overflow-x: auto; }
.callout { padding: 20px 22px; border-radius: 16px; background: var(--bg-raised); border: 1px solid var(--line); margin: 24px 0; }
.callout p { margin: 0; }

details { border-bottom: 1px solid var(--line); padding: 18px 0; }
details summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--faint); font-weight: 400; font-size: 22px; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { margin: 12px 0 0; color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 999px;
  background: var(--ruby); color: #fff; text-decoration: none; font-weight: 700; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.22); }

.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-top: 20px; }
.asset { padding: 20px; border-radius: 16px; background: var(--bg-raised); border: 1px solid var(--line); }
.asset p { margin: 4px 0 14px; font-size: 14px; }
.asset a { font-weight: 700; color: var(--text); }

@media (max-width: 560px) {
  .bar nav { gap: 16px; }
  .bar .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* Phones: the text column is as wide as the screen, so the shade widens with it. */
@media (max-width: 560px) {
  .hero::after {
    background:
      radial-gradient(ellipse 95% 42% at 50% 50%, rgba(10,10,11,0.9) 0%, rgba(10,10,11,0.75) 55%, rgba(10,10,11,0.25) 100%),
      linear-gradient(to bottom, rgba(10,10,11,0.75) 0%, rgba(10,10,11,0) 14%, rgba(10,10,11,0) 78%, var(--bg) 100%);
  }
}
