/* ============================================================
   Story Tape — website stylesheet
   Dark news-desk theme matching the Android app:
   ink #101418, amber #FFB300 accent, live green #2FD66F,
   risk red #FF6B6B. News ticker / tape motif throughout.
   ============================================================ */

:root {
  /* App brand tokens (from docs/ui-design-spec.md §3.1) */
  --ink: #101418;
  --ink-deep: #0b0e11;
  --surface: #1a2026;
  --surface-raised: #1d242b;
  --border: #2a323a;
  --tabbar: #14191f;
  --amber: #ffb300;
  --amber-bright: #ffc107;
  --amber-container: #3a2a10;
  --on-amber: #101418;
  --live: #2fd66f;
  --live-container: #10351f;
  --risk: #ff6b6b;
  --risk-container: #3a1010;
  --text-primary: #f2f4f6;
  --text-body: #c7cfd8;
  --text-muted: #8a94a0;
  --text-dim: #6b7280;

  /* Layout */
  --maxw: 1120px;
  --nav-h: 64px;
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--ink);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 2000;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--amber);
  color: var(--on-amber);
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }

p { color: var(--text-body); }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--amber-bright); }

code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--amber-bright);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
  word-break: break-all;
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 72px 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: 40px;
}

.section-head .kicker {
  color: var(--amber);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-head p {
  margin-top: 14px;
  font-size: 1.05rem;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(16, 20, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.brand .brand-name { color: var(--text-primary); }
.brand .brand-name em { font-style: normal; color: var(--amber); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  color: var(--text-body);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.nav-links a.cta {
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 700;
}

.nav-links a.cta:hover { background: var(--amber-bright); }

.nav-links a.x-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.3rem;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
}

/* ---------- Ticker ---------- */
.ticker {
  background: var(--ink-deep);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.ticker-track {
  display: inline-block;
  padding: 8px 0;
  animation: ticker-scroll 40s linear infinite;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.ticker-track span {
  margin: 0 24px;
  display: inline-block;
}

.ticker-track .live-dot {
  color: var(--live);
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(255, 179, 0, 0.14), transparent 60%),
    radial-gradient(700px 420px at -10% 20%, rgba(47, 214, 111, 0.07), transparent 55%),
    var(--ink);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 20px 72px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--live-container);
  color: var(--live);
  border: 1px solid rgba(47, 214, 111, 0.35);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(47,214,111,0.6); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(47,214,111,0); }
}

.hero h1 {
  margin-bottom: 18px;
}

.hero h1 .accent {
  color: var(--amber);
}

.hero .slogan {
  font-size: 1.12rem;
  color: var(--text-body);
  margin-bottom: 28px;
  max-width: 520px;
}

.hero .slogan strong {
  color: var(--amber-bright);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  border: 1px solid transparent;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--amber);
  color: var(--on-amber);
  box-shadow: 0 8px 24px rgba(255, 179, 0, 0.25);
}

.btn-primary:hover { background: var(--amber-bright); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.btn .btn-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.75;
}

.hero-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.hero-meta a { color: var(--text-muted); }

.hero-art {
  position: relative;
}

.hero-art .banner {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: block;
}

.hero-art .shot-float {
  position: absolute;
  bottom: -34px;
  left: -26px;
  width: 148px;
  border-radius: 18px;
  border: 2px solid var(--surface-raised);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  transform: rotate(-4deg);
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 56px; gap: 44px; }
  .hero-art { max-width: 560px; }
  .shot-float { display: none; }
}

/* ---------- Feature cards ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 980px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.feature-card:hover {
  border-color: rgba(255, 179, 0, 0.5);
  transform: translateY(-2px);
}

.feature-card .f-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--amber-container);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.95rem;
}

.feature-card .f-chip {
  display: inline-flex;
  margin-top: 14px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- Screenshot gallery ---------- */
.shots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

@media (max-width: 980px) {
  .shots { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .shots { grid-template-columns: repeat(2, 1fr); }
}

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

.shot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.shot:hover { border-color: rgba(255, 179, 0, 0.5); }

.shot img {
  width: 100%;
  display: block;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid var(--border);
}

.shot figcaption {
  padding: 14px 16px 16px;
}

.shot figcaption strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.shot figcaption span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}

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

.step {
  background: var(--ink-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 20px;
  right: 22px;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--amber-container);
  line-height: 1;
}

.step h3 {
  margin-bottom: 10px;
  padding-right: 40px;
}

.step p { font-size: 0.95rem; }

.step .step-note {
  display: block;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

/* ---------- Truth / honesty band ---------- */
.honesty {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-top: 48px;
}

.honesty h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.honesty ul {
  margin-left: 20px;
  color: var(--text-body);
  font-size: 0.95rem;
}

.honesty li { margin-bottom: 6px; }

/* ---------- Data note ---------- */
.data-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--ink-deep);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 18px;
  word-break: break-word;
}

/* ---------- Download ---------- */
.download-band {
  background:
    radial-gradient(720px 380px at 50% 0%, rgba(255, 179, 0, 0.12), transparent 65%),
    var(--ink-deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

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

.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.download-card h3 { margin-bottom: 10px; }

.download-card .apk-meta {
  list-style: none;
  margin: 18px 0;
  font-size: 0.88rem;
  color: var(--text-body);
}

.download-card .apk-meta li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.download-card .apk-meta li span:first-child { color: var(--text-muted); }

.download-card .apk-meta li span:last-child {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.download-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 16px;
}

.download-note code { font-size: 0.78em; }

/* ---------- Page header (legal) ---------- */
.page-head {
  background:
    radial-gradient(800px 300px at 50% -20%, rgba(255, 179, 0, 0.1), transparent 60%),
    var(--ink);
  border-bottom: 1px solid var(--border);
  padding: 64px 0 44px;
}

.page-head h1 {
  margin-bottom: 10px;
}

.page-head .meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.page-head .crumbs {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.page-head .crumbs a { color: var(--text-muted); }

/* ---------- Legal document ---------- */
.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 20px 88px;
}

.legal .doc-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 40px;
}

.legal .doc-intro p { font-size: 0.95rem; }

.legal h2 {
  font-size: 1.3rem;
  margin: 40px 0 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.legal h2:first-of-type { border-top: none; margin-top: 0; }

.legal p {
  margin-bottom: 14px;
  font-size: 0.97rem;
}

.legal ul {
  margin: 0 0 14px 22px;
  color: var(--text-body);
  font-size: 0.97rem;
}

.legal li { margin-bottom: 8px; }

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

.legal .contact-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink-deep);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}

.footer-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

.footer .brand { margin-bottom: 14px; }

.footer p.blurb {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 340px;
}

.footer h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer ul {
  list-style: none;
}

.footer ul li { margin-bottom: 10px; }

.footer ul a {
  color: var(--text-body);
  font-size: 0.92rem;
}

.footer ul a:hover { color: var(--amber); }

.footer-bottom {
  max-width: var(--maxw);
  margin: 40px auto 0;
  padding: 20px 20px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.footer-bottom a { color: var(--text-muted); }

/* ---------- Responsive nav ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--ink-deep);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 20px;
    gap: 4px;
  }

  .nav-links.open { display: flex; }

  .nav-links a { padding: 12px 14px; }

  .nav-links a.cta { text-align: center; margin-top: 6px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
