/* Tokens mirror app/src/main/java/com/declutter/app/ui/theme/Theme.kt. */
:root {
  --bg: #FCFCFF;
  --surface: #F5F5F8;
  --ink: #1D1D1F;
  --ink-2: #666666;
  --hairline: #E0E0E0;
  --accent: #0066CC;
  --accent-bright: #0088FF;
  --remove: #D70015;
  --bezel: #1D1D1F;
  --dialog: #FFFFFF;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --radius: 16px;
  --content: 1040px;
  /* Store composites give ~448px of source width; wider than this looks soft on 2x screens. */
  --phone-max: 280px;

  /* Motion tokens. Only transform/opacity are animated. */
  --dur-fast: 180ms;
  --dur-normal: 350ms;
  --dur-slow: 600ms;
  --dur-crawl: 1000ms;
  --dur-hero: 1200ms;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-settle: cubic-bezier(0.34, 1.56, 0.64, 1);
  --stagger: 90ms;
  --rise: 24px;

  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0C0E;
    --surface: #1E2024;
    --ink: #F2F2F4;
    --ink-2: #A1A1A6;
    --hairline: #2A2D33;
    --accent: #3B9EFF;
    --accent-bright: #409CFF;
    --remove: #FF6961;
    --bezel: #3A3D44;
    --dialog: #2A2D33;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip; /* fanned ghost cards may poke past the gutter on phones */
}
a { color: var(--accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
p { margin: 0; }

.wrap { max-width: var(--content); margin: 0 auto; padding: 0 var(--s4); }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s4) 0;
}
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.lang { font-size: 15px; color: var(--ink-2); }

/* Phone: screen crop + CSS bezel */
.phone {
  width: 100%;
  max-width: var(--phone-max);
  margin: 0 auto;
  border: 7px solid var(--bezel);
  border-radius: 36px;
  overflow: hidden;
  background: var(--bezel);
  box-shadow: 0 0 0 1px var(--hairline), 0 30px 60px -30px rgb(0 0 0 / 0.35);
}
.phone img { width: 100%; border-radius: 29px; }

/* Card stack behind a phone: two translucent accent layers, echoing the app icon. */
.stack { position: relative; isolation: isolate; width: 100%; max-width: var(--phone-max); margin: 0 auto; }
.stack::before, .stack::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: 36px; background: var(--accent-bright);
  transform-origin: 50% 80%;
}
.stack::before { opacity: 0.28; transform: translate(14px, -4px) rotate(4deg); }
.stack::after { opacity: 0.14; transform: translate(28px, -8px) rotate(8deg); }

.soon {
  display: inline-flex; align-items: center; gap: var(--s2);
  margin: 0 0 var(--s4);
  padding: var(--s1) var(--s3);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.soon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-bright); }

/* Waitlist form + pill buttons */
.sr-only, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hp { left: -10000px; }
.waitlist { margin-top: var(--s6); max-width: 460px; }
.waitlist-row { display: flex; gap: var(--s2); }
.waitlist input[type="email"] {
  flex: 1; min-width: 0; height: 48px; padding: 0 var(--s4);
  border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--dialog); color: var(--ink);
  font: inherit; font-size: 16px; /* 16px keeps iOS from zooming on focus */
}
.waitlist button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 var(--s5);
  border: 0; border-radius: 999px;
  background: var(--accent); color: #FFFFFF;
  font: inherit; font-size: 16px; font-weight: 600; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-smooth), opacity var(--dur-fast);
}
.waitlist button:active, .button:active { transform: scale(0.97); }
.waitlist button:disabled { opacity: 0.6; cursor: progress; }
.waitlist :focus-visible, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.consent {
  display: flex; gap: var(--s2); align-items: flex-start;
  margin-top: var(--s3); text-align: left;
  font-size: 14px; line-height: 1.5; color: var(--ink-2); cursor: pointer;
}
.consent input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.consent-detail { margin-top: var(--s1); padding-left: 26px; text-align: left; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.waitlist-status { min-height: 1.5em; margin-top: var(--s2); font-size: 14px; font-weight: 600; text-align: left; }
.waitlist-status[data-state="ok"] { color: var(--accent); }
.waitlist-status[data-state="error"] { color: var(--remove); }
.hero-cta { margin-top: var(--s6); }

/* ---------- Static layout (no JS, or reduced motion). motion.css upgrades these into scenes. ---------- */

.hero-scene .stage {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s7); align-items: center;
  padding: var(--s7) 0 var(--s9);
}
.hero-copy h1 { font-size: clamp(34px, 6vw, 56px); }
.hero-copy .lead { margin-top: var(--s4); font-size: 19px; color: var(--ink-2); max-width: 30em; }

.story .stage {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s7); align-items: center;
  padding: var(--s8) 0; border-top: 1px solid var(--hairline);
}
.story-steps { display: grid; gap: var(--s7); }
.step h2 { font-size: clamp(26px, 4vw, 36px); color: var(--accent); }
.step .sub { margin-top: var(--s2); font-size: 20px; font-weight: 600; }
.step .body { margin-top: var(--s4); color: var(--ink-2); max-width: 28em; }
.screens { position: relative; }
.screen + .screen, .story-dots { display: none; }

.burst .stage {
  display: grid; justify-items: center; gap: var(--s5); text-align: center;
  padding: var(--s8) 0; border-top: 1px solid var(--hairline);
}
.burst-caption { font-size: clamp(28px, 5vw, 48px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.burst-caption b { color: var(--accent); }
.burst-caption.before, .pile { display: none; }
.dialog {
  width: min(320px, 100%);
  padding: var(--s5);
  border-radius: 28px;
  background: var(--dialog);
  box-shadow: 0 0 0 1px var(--hairline), 0 24px 48px -16px rgb(0 0 0 / 0.3);
  text-align: left;
}
.dialog-title { font-size: 18px; font-weight: 600; }
.dialog-actions { margin-top: var(--s5); display: flex; justify-content: flex-end; gap: var(--s6); font-weight: 600; color: var(--accent); }

/* Safety + pricing */
.section { padding: var(--s8) 0; border-top: 1px solid var(--hairline); }
.section > h2 { font-size: clamp(26px, 4vw, 36px); }
.section > .intro { margin-top: var(--s3); color: var(--ink-2); max-width: 32em; }

.facts { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s7); }
.facts strong { display: block; font-size: clamp(24px, 3.6vw, 40px); line-height: 1.25; letter-spacing: -0.02em; text-wrap: balance; }
.facts span { display: block; margin-top: var(--s2); color: var(--ink-2); max-width: 34em; }

.plans { margin-top: var(--s6); display: grid; border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.plan { padding: var(--s5); }
.plan + .plan { border-top: 1px solid var(--hairline); }
.plan h3 { font-size: 17px; color: var(--ink-2); font-weight: 600; }
.plan .price { margin-top: var(--s1); font-size: 28px; font-weight: 700; }
.plan ul { margin: var(--s3) 0 0; padding-left: 1.1em; color: var(--ink-2); }
.plan.pick .price { color: var(--accent); }
.fine { margin-top: var(--s4); font-size: 14px; color: var(--ink-2); }

/* Footer */
.foot {
  padding: var(--s7) 0 var(--s8);
  border-top: 1px solid var(--hairline);
  font-size: 14px; color: var(--ink-2);
  display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5);
}
.foot a { color: var(--ink-2); }

/* Legal page */
.doc { max-width: 44em; padding-bottom: var(--s8); }
.doc h1 { font-size: clamp(28px, 5vw, 40px); margin: var(--s6) 0 var(--s2); }
.doc h2 { font-size: 20px; margin: var(--s6) 0 var(--s2); }
.doc h3 { font-size: 17px; margin: var(--s5) 0 var(--s2); }
.doc code { font-size: 0.9em; }
.doc p, .doc li { color: var(--ink); }
.doc p + p { margin-top: var(--s3); }
.doc ul { padding-left: 1.2em; margin: var(--s2) 0 0; }
.doc .meta { color: var(--ink-2); font-size: 15px; }

@media (min-width: 768px) {
  body { font-size: 18px; }
  .hero-scene .stage { grid-template-columns: 1.2fr 1fr; padding-top: var(--s8); }
  .story .stage { grid-template-columns: 1fr 1fr; gap: var(--s8); }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .plan + .plan { border-top: 0; border-left: 1px solid var(--hairline); }
}

/* Cross-page transitions (ko/en, home/privacy): the header stays, the page slides under it. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .top { view-transition-name: top; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }
  ::view-transition-old(root) { animation: vt-out var(--dur-fast) var(--ease-smooth) both; }
  ::view-transition-new(root) { animation: vt-in var(--dur-normal) var(--ease-smooth) both; }
}
