/* =========================================================================
   Deep Breath — site stylesheet
   Palette mirrored from /XCode/.../Theme/AppTheme.swift
   ========================================================================= */

:root {
  --bg: #000;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.10);
  --separator: rgba(255, 255, 255, 0.15);
  --text: #fff;
  --text-dim: rgba(255, 255, 255, 0.72);
  --text-faint: rgba(255, 255, 255, 0.50);
  --accent: #fff;
  --accent-fg: #000;
  --quiz-yellow: rgb(230, 255, 56);
  --overlay: rgba(0, 13, 36, 0.78);
  --warning-bg: rgba(255, 70, 70, 0.06);
  --warning-border: rgba(255, 120, 120, 0.35);
  --max-w: 880px;
  --pad-x: 24px;
  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
          Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

/* =========================================================================
   Background video layer
   ========================================================================= */

.bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background: #000;
  overflow: hidden;
}

.bg-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.bg-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0.55) 0%,
      var(--overlay) 30%,
      var(--overlay) 70%,
      rgba(0, 0, 0, 0.92) 100%);
  pointer-events: none;
}

/* =========================================================================
   Layout shell
   ========================================================================= */

.shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

section {
  padding: 88px 0;
  scroll-margin-top: 24px;
}

section + section {
  border-top: 1px solid var(--separator);
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 16px;
}

h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

h3 { font-size: 18px; }

p { margin: 0 0 14px; color: var(--text-dim); }

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.section-lead {
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 36px;
}

/* =========================================================================
   Header / nav
   ========================================================================= */

.site-header {
  position: relative;
  z-index: 2;
  padding: 22px 0;
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-header .brand img {
  height: 22px;
  width: auto;
}

.site-header nav {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--text-dim);
}

.site-header nav a {
  text-decoration: none;
  transition: color 0.2s;
}

.site-header nav a:hover { color: var(--text); }

@media (max-width: 600px) {
  .site-header nav { display: none; }
}

/* =========================================================================
   Hero
   ========================================================================= */

.hero {
  padding: 64px 0 100px;
  text-align: left;
}

.app-icon {
  display: inline-block;
  width: 128px;
  height: 128px;
  margin-bottom: 28px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 40px -12px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s ease;
}

.app-icon:hover { transform: translateY(-2px); }

.app-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (max-width: 600px) {
  .app-icon { width: 104px; height: 104px; border-radius: 23px; margin-bottom: 22px; }
}

.hero h1 {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 18px;
}

.hero .tagline {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--text);
  max-width: 560px;
  margin-bottom: 28px;
  font-weight: 400;
}

.hero .blurb {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 36px;
  line-height: 1.65;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.app-store-badge {
  display: inline-block;
  height: 56px;
  transition: transform 0.2s, opacity 0.2s;
}

.app-store-badge img,
.app-store-badge svg {
  height: 100%;
  width: auto;
}

.app-store-badge:hover { transform: translateY(-1px); opacity: 0.92; }

.placeholder-tag {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--quiz-yellow);
  background: rgba(230, 255, 56, 0.08);
  border: 1px solid rgba(230, 255, 56, 0.30);
  padding: 5px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* =========================================================================
   Features
   ========================================================================= */

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 36px;
}

@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; }
}

.feature {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 22px;
}

.feature h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.feature p {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.55;
}

/* =========================================================================
   Safety section — visually serious, NOT marketing
   ========================================================================= */

.safety {
  position: relative;
}

.safety h2 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.safety h2::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--quiz-yellow);
  border-radius: 2px;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.safety-intro {
  font-size: 15px;
  color: var(--text);
  background: var(--warning-bg);
  border-left: 3px solid var(--quiz-yellow);
  padding: 16px 20px;
  border-radius: 4px;
  margin-bottom: 36px;
}

.ack-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: ack;
  display: grid;
  gap: 18px;
}

.ack {
  counter-increment: ack;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 24px 24px 24px 70px;
}

.ack::before {
  content: counter(ack);
  position: absolute;
  top: 22px;
  left: 22px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--text);
  color: var(--accent-fg);
  border-radius: 50%;
}

.ack h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.35;
}

.ack p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}

@media (max-width: 600px) {
  .ack { padding: 64px 20px 20px; }
  .ack::before { top: 20px; left: 20px; }
}

/* =========================================================================
   Scroll-box (ToS / Privacy on landing page)
   ========================================================================= */

.scroll-box {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 28px 28px 28px 28px;
  max-height: 500px;
  overflow-y: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
  .scroll-box { max-height: 400px; padding: 22px; }
}

/* Custom scrollbar */
.scroll-box::-webkit-scrollbar { width: 10px; }
.scroll-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.scroll-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  background-clip: padding-box;
}
.scroll-box::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.40);
  background-clip: padding-box;
  border: 2px solid rgba(0, 0, 0, 0.3);
}

.scroll-box {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.04);
}

.read-full {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--separator);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.read-full:hover {
  border-bottom-color: var(--text);
}

/* =========================================================================
   Long-form legal content (used inside scroll boxes AND on standalone pages)
   ========================================================================= */

.legal h1 {
  font-size: 30px;
  margin-bottom: 8px;
}

.legal h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
  letter-spacing: 0;
}

.legal h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--text);
}

.legal p,
.legal li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
}

.legal strong { color: var(--text); }

.legal a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--separator);
}

.legal a:hover { text-decoration-color: var(--text); }

.legal hr {
  border: none;
  border-top: 1px solid var(--separator);
  margin: 28px 0;
}

.legal blockquote {
  border-left: 3px solid var(--quiz-yellow);
  margin: 16px 0;
  padding: 4px 0 4px 16px;
  color: var(--text);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.legal ul, .legal ol { padding-left: 22px; margin: 0 0 14px; }
.legal li { margin-bottom: 6px; }

.legal code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

.placeholder {
  color: var(--quiz-yellow);
  background: rgba(230, 255, 56, 0.06);
  padding: 0 4px;
  border-radius: 3px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.last-updated {
  font-size: 13px;
  color: var(--text-faint);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* =========================================================================
   Standalone /terms /privacy pages
   ========================================================================= */

.standalone {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px var(--pad-x) 88px;
}

.standalone .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-faint);
  margin-bottom: 28px;
  transition: color 0.2s;
}

.standalone .back-link:hover { color: var(--text); }

.standalone .legal h1 {
  font-size: 32px;
  margin-bottom: 4px;
}

/* =========================================================================
   Footer
   ========================================================================= */

.site-footer {
  border-top: 1px solid var(--separator);
  padding: 48px 0 60px;
  font-size: 13px;
  color: var(--text-faint);
}

.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

.site-footer .footer-brand strong { color: var(--text); }

.site-footer .footer-brand p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-faint);
}

.site-footer .footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.site-footer .footer-links a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer .footer-links a:hover { color: var(--text); }

@media (max-width: 600px) {
  .site-footer .footer-links { align-items: flex-start; }
}

/* =========================================================================
   Reduced motion
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
