/* ============================================================
   WatchWall — landing page styles
   Black/white base · red accent · light + dark mode
   ============================================================ */

:root {
  --accent: #d50000;
  --accent-hover: #b00000;
  --accent-soft: rgba(213, 0, 0, 0.12);
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1120px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 30px rgba(0,0,0,.06);
}

/* ---------- Light theme (default vars below get overridden in dark) ---------- */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #f3f3f4;
  --text: #0e0e0f;
  --text-muted: #5c5c63;
  --border: #e6e6e9;
  --border-strong: #d4d4d8;
  --nav-bg: rgba(255,255,255,0.78);
  --accent: #cc0000;
  --accent-hover: #a30000;
  --accent-soft: rgba(204, 0, 0, 0.09);
  --code-bg: #0e0e0f;
  --code-text: #f4f4f5;
}

:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --bg-alt: #111113;
  --surface: #151517;
  --surface-2: #1c1c1f;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --border: #26262a;
  --border-strong: #34343a;
  --nav-bg: rgba(11,11,12,0.72);
  --accent: #ff2d2d;
  --accent-hover: #ff5252;
  --accent-soft: rgba(255, 45, 45, 0.14);
  --code-bg: #000000;
  --code-text: #f4f4f5;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 40px rgba(0,0,0,.45);
}

/* logo swapping */
.logo-dark { display: none; }
.logo-light { display: inline-block; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }
:root[data-theme="dark"] .logo-light { display: none; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; }

.accent { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 600; font-size: 1rem;
  padding: .8rem 1.4rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .55rem 1.05rem; font-size: .9rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  background: transparent; color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: .7rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 26px; width: auto; }
.nav-links { display: flex; gap: 1.6rem; margin-left: auto; font-weight: 500; font-size: .95rem; }
.nav-links a { color: var(--text-muted); transition: color .2s ease; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: .7rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: clamp(3rem, 7vw, 6rem) 1.5rem 1rem; }
.hero-inner { max-width: var(--maxw); margin: 0 auto; text-align: center; }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 600;
  letter-spacing: .02em; color: var(--accent);
  background: var(--accent-soft); padding: .4rem .9rem; border-radius: 999px;
  margin-bottom: 1.4rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 800; letter-spacing: -0.035em;
}
.lead {
  max-width: 640px; margin: 1.4rem auto 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
}
.lead strong { color: var(--text); font-weight: 600; }
.hero-actions {
  display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap;
  margin-top: 2rem;
}

/* ============================================================
   DEMO — faithful recreation of the WatchWall app UI
   Always dark (the app is always dark), regardless of site theme.
   Mirrors reference/app: #0f0f0f stage, flush black boxes with a
   1px #1e1e1e separator, number-badge overlays, a highlighted box
   with a colored ring, a per-box hover menu, and the bottom menu.
   ============================================================ */
.demo {
  max-width: 980px;
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  --hl: var(--accent);          /* highlight color (a real, user-set option) */
}

/* The "screen" — like the app running fullscreen on one monitor */
.demo-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f0f0f;          /* --app-bg */
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* #grid-stage equivalent — boxes absolutely positioned for smooth morph.
   Each box keeps a true 16:9 aspect because the screen is 16:9 and the JS
   sizes every box with an equal width%/height% number (see script.js). */
.demo-stage { position: absolute; inset: 0; }

/* ── .box ────────────────────────────────────────────────── */
.ww-box {
  position: absolute;
  overflow: hidden;
  background: #000;
  border-radius: clamp(4px, 1.1vw, 9px);   /* rounded corners */
  transition: left .6s cubic-bezier(.22,.61,.36,1),
              top .6s cubic-bezier(.22,.61,.36,1),
              width .6s cubic-bezier(.22,.61,.36,1),
              height .6s cubic-bezier(.22,.61,.36,1),
              opacity .35s ease, box-shadow .35s ease;
}
.ww-box.is-hidden { opacity: 0; pointer-events: none; }

/* primary / highlighted box: red ring that follows the rounded corners */
.ww-box.is-highlight {
  box-shadow: 0 0 0 3px var(--hl), 0 6px 22px rgba(0,0,0,.45);
  z-index: 3;
}

/* faux web view: a dark video thumbnail per genre */
.ww-thumb {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.ww-thumb::after {            /* subtle vignette so overlays stay legible */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 50% 35%, transparent 40%, rgba(0,0,0,.45) 100%);
}
.ww-emoji {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(1.1rem, 3.6vw, 2.4rem);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); opacity: .92;
}
.ww-genre {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  font-size: clamp(.5rem, 1.5vw, .72rem); font-weight: 600; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8); letter-spacing: .01em;
}

/* ── Box number overlay (badge, top-left) ────────────────── */
.ww-overlay {
  position: absolute; top: 8px; left: 8px; z-index: 20;
  background: rgba(0,0,0,.62); color: #fff;
  font-size: clamp(.6rem, 1.6vw, .75rem); font-weight: 600; line-height: 1;
  padding: 4px 7px; border-radius: 5px;
}

/* ── Audio-override indicator (speaker, top-right) ────────── */
.ww-audio {
  position: absolute; top: 8px; right: 8px; z-index: 20;
  background: rgba(0,0,0,.62); color: var(--hl);
  display: none; align-items: center; padding: 4px 6px; border-radius: 5px;
}
.ww-box.show-audio .ww-audio { display: flex; }

/* ── Per-box hover menu (top-center pill) ─────────────────── */
.ww-boxmenu {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 30; display: none; gap: 4px; padding: 5px 6px;
  background: rgba(0,0,0,.78); border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px; white-space: nowrap;
}
.ww-box.show-menu .ww-boxmenu { display: flex; }
.ww-bm {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 8px; line-height: 1.4;
  background: transparent; color: #d8d8d8;
  border: 1px solid rgba(255,255,255,.14); border-radius: 4px;
  font: inherit; font-size: 11px;
}
.ww-bm--icon { padding: 4px 6px; line-height: 0; }
.ww-bm--icon svg { width: 13px; height: 13px; }
.ww-bm--close { color: #ff7070; border-color: rgba(255,100,100,.2); }

/* ── App control bar — floated in its own rounded bar below the demo ── */
.ww-menu {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 6px;
  width: max-content; max-width: 100%;
  margin: 14px auto 0; padding: 8px 14px;
  background: rgba(18,18,18,.96); border: 1px solid #2e2e2e;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.ww-menu-logo { height: 18px; width: auto; opacity: .85; flex: 0 0 auto; }
.ww-sep { width: 1px; height: 18px; background: #2e2e2e; flex: 0 0 auto; }
.ww-menu-label { font-size: 12px; color: #888; }
.ww-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; background: transparent; color: #c8c8c8;
  border: 1px solid #333; border-radius: 5px;
  font: inherit; font-size: 12px; line-height: 1; white-space: nowrap;
}
.ww-btn svg { width: 14px; height: 14px; }
.ww-btn--icon { padding: 5px 7px; }
.ww-btn--on { background: #3a1414; color: var(--hl); border-color: #5a2020; } /* overlays active */
.ww-select {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; background: #1a1a1a; color: #e8e8e8;
  border: 1px solid #333; border-radius: 5px;
  font-size: 12px; white-space: nowrap; transition: color .3s ease;
}
.ww-caret { width: 10px; height: 10px; opacity: .7; }

.demo-caption {
  text-align: center; color: var(--text-muted);
  font-size: .95rem; margin: 1.1rem auto 0; max-width: 540px;
  min-height: 1.4em; transition: opacity .3s ease;
}

@media (max-width: 600px) {
  .ww-hide-sm { display: none !important; }
  .ww-menu { gap: 5px; padding: 7px 9px; }
  /* Collapse to icons so the bar fits a phone screen */
  .ww-menu-logo,
  .ww-menu-logo + .ww-sep,
  .ww-menu-label,
  .ww-btn-txt { display: none; }
  .ww-btn { padding: 5px 7px; }
  .ww-select { font-size: 11px; padding: 4px 7px; }
  /* The per-box hover menu is wider than a phone-sized box — hide it here
     (the feature is covered in the Features section). */
  .ww-box.show-menu .ww-boxmenu { display: none; }
  /* Sidebar boxes get tiny on phones — drop the decorative genre label so it
     doesn't collide with the number badge. */
  .ww-genre { display: none; }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: clamp(4rem, 9vw, 7rem) 1.5rem; max-width: var(--maxw); margin: 0 auto; }
.section-alt { background: var(--bg-alt); max-width: none; }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.kicker {
  display: inline-block; font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--accent);
  margin-bottom: .8rem;
}
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; }
.section-head p { color: var(--text-muted); font-size: 1.1rem; margin: .9rem 0 0; }

/* ---------- feature grid ---------- */
.feature-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.7rem;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.feature-ic {
  width: 46px; height: 46px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 1.1rem;
}
.feature-ic svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.18rem; font-weight: 700; margin-bottom: .5rem; }
.feature-card p { color: var(--text-muted); font-size: .96rem; margin: 0; }

/* ---------- use cases ---------- */
.usecase-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.usecase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  text-align: center;
}
.usecase-emoji { font-size: 2.2rem; display: block; margin-bottom: .7rem; }
.usecase h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.usecase p { color: var(--text-muted); font-size: .92rem; margin: 0; }

/* ---------- download ---------- */
.download-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 2.2rem;
}
.dl-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.dl-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.dl-os { width: 34px; height: 34px; flex-shrink: 0; color: var(--text); }
.dl-info { display: flex; flex-direction: column; }
.dl-platform { font-weight: 700; font-size: 1.1rem; }
.dl-meta { font-size: .82rem; color: var(--text-muted); }
.dl-go { margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ---------- macOS note card ---------- */
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.8rem;
  max-width: 820px; margin: 0 auto;
}
.note-head { display: flex; align-items: center; gap: .7rem; color: var(--accent); margin-bottom: .9rem; }
.note-head h3 { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.note-card p { color: var(--text-muted); margin: 0 0 1rem; }
.note-card strong { color: var(--text); }
.note-step {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 1.1rem 1.2rem; margin-top: 1rem;
}
.note-step p { margin: 0 0 .7rem; }
.note-step p:last-child { margin-bottom: 0; }
.step-num {
  display: inline-block; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); background: var(--accent-soft);
  padding: .25rem .65rem; border-radius: 999px; margin-bottom: .7rem;
}
.note-sub { font-size: .88rem; }

.codeblock {
  display: flex; align-items: center; gap: .8rem;
  background: var(--code-bg); color: var(--code-text);
  border-radius: 10px; padding: .85rem 1rem;
  font-family: var(--mono); font-size: .86rem;
  overflow-x: auto;
}
.codeblock code { flex: 1; white-space: nowrap; }
.copy-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  flex-shrink: 0;
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px; padding: .4rem .7rem;
  font-family: var(--font); font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: background-color .2s ease;
}
.copy-btn:hover { background: rgba(255,255,255,.2); }
.copy-btn.copied { background: var(--accent); border-color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between;
}
.footer-logo { height: 24px; margin-bottom: .8rem; }
.footer-brand p { color: var(--text-muted); font-size: .92rem; max-width: 300px; margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; align-content: flex-start; font-size: .95rem; font-weight: 500; }
.footer-links a { color: var(--text-muted); transition: color .2s ease; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  max-width: var(--maxw); margin: 0 auto;
  padding: 1.4rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between;
  color: var(--text-muted); font-size: .82rem;
}
.footer-bottom p { margin: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .demo-menubar { font-size: .72rem; }
  .mb-layout { min-width: 0; }
  .footer-inner { flex-direction: column; gap: 1.6rem; }
}
@media (max-width: 480px) {
  .nav-cta { display: none; }
  .mb-btn:nth-child(3) { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ww-box { transition: opacity .3s ease !important; }
  .feature-card:hover, .dl-card:hover { transform: none; }
}
