/* =========================================================================
   Pure Water Assembly 2026 — Shared design system
   Built on the locked tokens from Design System.html
   Supports dark (default) + light via [data-theme="light"]
   ========================================================================= */

:root,
[data-theme="dark"] {
  /* Brand */
  --brand-purple: #7C6EE8;
  --brand-purple-600: #6A5DE0;
  --brand-purple-700: #5847C9;
  --brand-cyan: #5BBDE8;
  --brand-cyan-600: #3DA9DC;
  --brand-gradient: linear-gradient(135deg, #7C6EE8 0%, #5BBDE8 100%);

  /* Surfaces (dark) */
  --bg: #0A0E1A;
  --bg-elev: #0F1422;
  --surface: #1A2030;
  --surface-2: #222A3D;
  --surface-3: #2A334A;
  --border: #2D3548;
  --border-strong: #3A455F;

  /* Text */
  --text: #F0F4FF;
  --text-muted: #8B95B0;
  --text-faint: #5C6680;

  /* Semantic */
  --success: #4ADE80;
  --warning: #FBBF24;
  --danger:  #F87171;
  --info:    #5BBDE8;

  /* Tinted backgrounds for pills on dark */
  --success-bg: rgba(74, 222, 128, 0.14);
  --warning-bg: rgba(251, 191, 36, 0.16);
  --danger-bg:  rgba(248, 113, 113, 0.16);
  --info-bg:    rgba(91, 189, 232, 0.16);
  --neutral-bg: rgba(139, 149, 176, 0.16);
  --purple-bg:  rgba(124, 110, 232, 0.18);
  --cyan-bg:    rgba(91, 189, 232, 0.16);

  /* Atmospheric backdrops (dark) */
  --hero-bg:
    radial-gradient(900px 380px at 90% -10%, rgba(91,189,232,0.30), transparent 60%),
    radial-gradient(700px 380px at -10% 120%, rgba(124,110,232,0.40), transparent 60%),
    var(--bg);

  /* Shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg: 0 20px 48px -16px rgba(0,0,0,.6);
  --ring: 0 0 0 3px rgba(124, 110, 232, 0.35);

  /* Spacing scale (4pt) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Type */
  --font-ui: 'Inter', 'Noto Sans KR', 'Noto Sans JP', system-ui, -apple-system, sans-serif;
  --font-display: 'Saira Condensed', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

[data-theme="light"] {
  --bg: #F6F7FB;
  --bg-elev: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F1F3F9;
  --surface-3: #E7EBF5;
  --border: #DCE1ED;
  --border-strong: #C5CCDE;

  --text: #1A2030;
  --text-muted: #5E6A86;
  --text-faint: #97A0B8;

  --brand-purple: #6A5DE0;
  --brand-purple-600: #5847C9;
  --brand-purple-700: #4636B0;
  --brand-cyan-600: #2C97CC;

  --success-bg: rgba(34, 167, 90, 0.10);
  --warning-bg: rgba(202, 138, 4, 0.13);
  --danger-bg:  rgba(220, 38, 38, 0.10);
  --info-bg:    rgba(44, 151, 204, 0.12);
  --neutral-bg: rgba(94, 106, 134, 0.10);
  --purple-bg:  rgba(106, 93, 224, 0.12);
  --cyan-bg:    rgba(44, 151, 204, 0.12);

  --success: #15803D;
  --warning: #B45309;
  --danger:  #B91C1C;
  --info:    #1D6FA5;

  --hero-bg:
    radial-gradient(900px 380px at 90% -10%, rgba(91,189,232,0.22), transparent 60%),
    radial-gradient(700px 380px at -10% 120%, rgba(124,110,232,0.22), transparent 60%),
    var(--bg);

  --shadow-sm: 0 1px 2px rgba(20, 25, 50, .06);
  --shadow-md: 0 8px 24px -10px rgba(20, 25, 50, .15), 0 2px 4px rgba(20,25,50,.05);
  --shadow-lg: 0 20px 40px -16px rgba(20, 25, 50, .18);
  --ring: 0 0 0 3px rgba(106, 93, 224, 0.28);
}

/* =========================================================================
   BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { padding-top: 28px; /* mockup nav */ }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brand-purple); color: white; }
img { max-width: 100%; display: block; }

/* =========================================================================
   MOCKUP NAV (presentation helper)
   ========================================================================= */
.mockup-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 20000;
  height: 28px;
  background: #05070D;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-ui);
  font-size: 11px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mockup-nav-label {
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 9.5px;
  margin-right: 10px;
  white-space: nowrap;
  padding-right: 12px;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 8px;
}
.mockup-nav-label::before {
  content: "";
  width: 14px; height: 14px;
  background: url('assets/pwa-mark-color.png') center/contain no-repeat;
  display: inline-block;
}
.mockup-nav a {
  color: rgba(255,255,255,0.45);
  padding: 3px 9px;
  border-radius: 4px;
  transition: all 0.12s;
  white-space: nowrap;
  font-weight: 500;
  font-size: 11px;
}
.mockup-nav a:hover { color: white; background: rgba(255,255,255,0.06); }
.mockup-nav a.current {
  color: white;
  background: var(--brand-gradient);
}

/* =========================================================================
   TOP BAR
   ========================================================================= */
.topbar {
  position: fixed;
  top: 28px; left: 0; right: 0;
  z-index: 100;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.topbar.scrolled,
.topbar.solid {
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom-color: var(--border);
}

.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.topbar-brand .mark {
  width: 32px; height: 32px;
  background: url('assets/pwa-mark-color.png') center/contain no-repeat;
  filter: drop-shadow(0 4px 14px rgba(124, 110, 232, 0.35));
  flex: 0 0 auto;
}
.topbar-brand .wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-right: 0.28em;
  margin-right: -0.18em;
  line-height: 1;
}
.topbar-brand .tag {
  display: block;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
  -webkit-text-fill-color: var(--text-muted);
}

.topbar-spacer { flex: 1; }

.topbar-nav {
  display: none;
  gap: 2px;
}
@media (min-width: 920px) {
  .topbar-nav { display: flex; }
}
.topbar-nav a {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-weight: 500;
}
.topbar-nav a:hover { color: var(--text); background: var(--surface); }
.topbar-nav a.active { color: var(--text); background: var(--surface-2); }

.topbar-right { display: flex; align-items: center; gap: 8px; }

/* Language switcher (segmented) */
.lang-switcher {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  gap: 1px;
}
.lang-switcher button {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-muted);
  border: 0;
  cursor: pointer;
  font-family: 'Inter', 'Noto Sans KR', 'Noto Sans JP', sans-serif;
  min-width: 44px;
}
.lang-switcher button:hover { color: var(--text); }
.lang-switcher button.active {
  background: var(--brand-gradient);
  color: white;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  gap: 1px;
}
.theme-toggle button {
  font: inherit;
  width: 28px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-muted);
  border: 0;
  cursor: pointer;
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button.active {
  background: var(--surface-2);
  color: var(--text);
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, transform .06s, box-shadow .12s, opacity .12s, filter .12s;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; filter: none; transform: none; }

.btn-primary {
  --btn-bg: var(--brand-gradient);
  --btn-fg: white;
  --btn-bd: transparent;
  background: var(--brand-gradient);
  box-shadow: 0 8px 22px -8px rgba(124, 110, 232, 0.6);
}
.btn-primary:hover { filter: brightness(1.07) saturate(1.05); box-shadow: 0 10px 26px -8px rgba(124, 110, 232, 0.75); }

.btn-secondary {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-3); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--brand-purple);
  --btn-bd: transparent;
}
.btn-ghost:hover { background: var(--purple-bg); }

.btn-inverted {
  --btn-bg: white;
  --btn-fg: #5847C9;
  --btn-bd: transparent;
}
.btn-inverted:hover { transform: translateY(-1px); }

.btn-lg {
  font-size: 16px;
  padding: 14px 28px;
  min-height: 52px;
  border-radius: var(--r-pill);
}
.btn-xl {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 20px;
  padding: 16px 40px;
  min-height: 58px;
  border-radius: var(--r-pill);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* =========================================================================
   PILLS / BADGES
   ========================================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  line-height: 1.4;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.neutral  { background: var(--neutral-bg); color: var(--text-muted); }
.pill.info     { background: var(--info-bg);    color: var(--info); }
.pill.success  { background: var(--success-bg); color: var(--success); }
.pill.warning  { background: var(--warning-bg); color: var(--warning); }
.pill.danger   { background: var(--danger-bg);  color: var(--danger); }
.pill.purple   { background: var(--purple-bg);  color: var(--brand-purple); }
.pill.cyan     { background: var(--cyan-bg);    color: var(--info); }

/* =========================================================================
   FORMS
   ========================================================================= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 6px; }
.field-label .req { color: var(--brand-cyan); }
.field-help  { font-size: 12px; color: var(--text-muted); }
.field-error { font-size: 12px; color: var(--danger); display: flex; align-items: center; gap: 6px; }

.input, .select, .textarea {
  font: inherit;
  font-size: 14px;
  width: 100%;
  padding: 11px 14px;
  min-height: 44px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color .12s, box-shadow .12s, background .12s;
  font-family: inherit;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: var(--ring);
  background: color-mix(in oklab, var(--surface-2) 88%, var(--brand-purple));
}
.textarea { min-height: 96px; resize: vertical; padding-top: 12px; }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.check, .radio {
  display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-size: 14px; color: var(--text); padding: 6px 0;
  position: relative;
}
.check input, .radio input { position: absolute; opacity: 0; pointer-events: none; }
.check .box, .radio .box {
  width: 20px; height: 20px; flex: 0 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s, box-shadow .12s;
  margin-top: 1px;
}
.check .box { border-radius: 5px; }
.radio .box { border-radius: 50%; }
.check input:checked ~ .box { background: var(--brand-gradient); border-color: transparent; }
.check .box svg { width: 13px; height: 13px; color: white; opacity: 0; transition: opacity .12s; }
.check input:checked ~ .box svg { opacity: 1; }
.radio input:checked ~ .box {
  border-color: var(--brand-purple);
  background: radial-gradient(circle, var(--brand-purple) 38%, var(--surface-2) 42%);
}

/* =========================================================================
   CARDS
   ========================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}
.card-alt { background: var(--surface-2); }
.card-frost {
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
}

/* =========================================================================
   HERO (display type)
   ========================================================================= */
.display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.92;
}
.display .grad,
.text-grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-right: 0.18em;
  margin-right: -0.1em;
}

/* Locale tweaks: Korean/Japanese display type should NOT be italic Saira */
.lang-ko .display,
.lang-ja .display {
  font-family: 'Noto Sans KR', 'Noto Sans JP', var(--font-ui);
  font-style: normal;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
}
.lang-ko .text-grad,
.lang-ja .text-grad,
.lang-ko .display .grad,
.lang-ja .display .grad {
  padding-right: 0;
  margin-right: 0;
}
.lang-ja * { font-family: 'Noto Sans JP', 'Inter', sans-serif; }
/* Inter first, Noto Sans KR for hangul — Pretendard's Latin was Inter-based,
   so this reproduces how it read; Noto Sans KR's own Latin does not. */
.lang-ko * { font-family: 'Inter', 'Noto Sans KR', sans-serif; }
/* but keep mono and display Latin where intentional */
.lang-ko .num, .lang-ja .num,
.lang-ko .countdown .v, .lang-ja .countdown .v,
.lang-ko .topbar-brand .wordmark, .lang-ja .topbar-brand .wordmark,
.lang-ko code, .lang-ja code {
  font-family: var(--font-display);
  font-style: italic;
}
.lang-ko .topbar-brand .wordmark,
.lang-ja .topbar-brand .wordmark { font-style: italic; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
  margin-top: 80px;
  padding: 56px 28px 28px;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; gap: 40px;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
}
@media (max-width: 880px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand { display: flex; flex-direction: column; gap: 14px; max-width: 320px; }
.footer-lockup {
  width: 100px; height: auto;
  filter: drop-shadow(0 4px 14px rgba(124, 110, 232, 0.25));
}
.footer-desc { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.footer-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-cyan);
  margin-bottom: 14px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color .12s;
}
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1280px;
  margin: 32px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

/* =========================================================================
   UTILITIES
   ========================================================================= */
.container { max-width: 1280px; margin: 0 auto; padding: 0 28px; }
.container-md { max-width: 980px; margin: 0 auto; padding: 0 28px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 760px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(-18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 110, 232, 0.35); }
  50%      { box-shadow: 0 0 0 14px rgba(124, 110, 232, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple {
  0%   { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* spinner */
.spinner {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--brand-purple);
  animation: spin 0.9s linear infinite;
}
