/* style.css — 보장의숲 design tokens + components */

/* ============ DESIGN TOKENS ============ */
:root,
[data-theme='light'] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 1rem + 6vw, 6.5rem);

  /* Spacing (4px system) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Surfaces — soft moss / cream */
  --color-bg: #f6f5ef;
  --color-surface: #fbfaf5;
  --color-surface-2: #ffffff;
  --color-surface-offset: #efede3;
  --color-surface-offset-2: #e6e3d5;
  --color-surface-dynamic: #dfdccb;
  --color-divider: #e0ddd0;
  --color-border: #d3cfbd;

  /* Text */
  --color-text: #1b2620;
  --color-text-muted: #52604f;
  --color-text-faint: #8b9385;
  --color-text-inverse: #f6f5ef;

  /* Primary — deep forest green */
  --color-primary: #2d6a4f;
  --color-primary-hover: #1b4332;
  --color-primary-active: #133024;
  --color-primary-highlight: #d7e6da;
  --color-primary-light: #40916c;
  --color-primary-lighter: #74c69d;

  /* Accent — amber sunlight */
  --color-accent: #d98e2b;
  --color-accent-hover: #b9741d;
  --color-accent-active: #8f5c17;
  --color-accent-highlight: #f6e6cb;

  /* Gap / warning — warm terracotta (not alarming red) */
  --color-warning: #b5542a;
  --color-warning-hover: #97431f;
  --color-warning-active: #793419;
  --color-warning-highlight: #f0dcce;

  --color-success: #2d6a4f;
  --color-error: #b5542a;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-organic: cubic-bezier(0.22, 0.61, 0.36, 1);

  --shadow-sm: 0 1px 3px oklch(0.25 0.05 150 / 0.08);
  --shadow-md: 0 6px 20px oklch(0.25 0.05 150 / 0.10);
  --shadow-lg: 0 16px 40px oklch(0.25 0.05 150 / 0.16);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;

  color-scheme: light;
}

[data-theme='dark'] {
  --color-bg: #10201a;
  --color-surface: #142a22;
  --color-surface-2: #17352a;
  --color-surface-offset: #0d1a15;
  --color-surface-offset-2: #1a3a2e;
  --color-surface-dynamic: #204434;
  --color-divider: #24493a;
  --color-border: #2c5744;

  --color-text: #e7ede8;
  --color-text-muted: #a9bcae;
  --color-text-faint: #6f8577;
  --color-text-inverse: #10201a;

  --color-primary: #74c69d;
  --color-primary-hover: #95d6b6;
  --color-primary-active: #b3e2cb;
  --color-primary-highlight: #1e3f30;
  --color-primary-light: #52b788;
  --color-primary-lighter: #95d6b6;

  --color-accent: #e9a23b;
  --color-accent-hover: #f0b661;
  --color-accent-active: #f6cb8c;
  --color-accent-highlight: #3d3016;

  --color-warning: #d97847;
  --color-warning-hover: #e2946c;
  --color-warning-active: #eaad8f;
  --color-warning-highlight: #402518;

  --color-success: #74c69d;
  --color-error: #d97847;

  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.5);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #10201a;
    --color-surface: #142a22;
    --color-surface-2: #17352a;
    --color-surface-offset: #0d1a15;
    --color-surface-offset-2: #1a3a2e;
    --color-surface-dynamic: #204434;
    --color-divider: #24493a;
    --color-border: #2c5744;
    --color-text: #e7ede8;
    --color-text-muted: #a9bcae;
    --color-text-faint: #6f8577;
    --color-text-inverse: #10201a;
    --color-primary: #74c69d;
    --color-primary-hover: #95d6b6;
    --color-primary-active: #b3e2cb;
    --color-primary-highlight: #1e3f30;
    --color-primary-light: #52b788;
    --color-primary-lighter: #95d6b6;
    --color-accent: #e9a23b;
    --color-accent-hover: #f0b661;
    --color-accent-active: #f6cb8c;
    --color-accent-highlight: #3d3016;
    --color-warning: #d97847;
    --color-warning-hover: #e2946c;
    --color-warning-active: #eaad8f;
    --color-warning-highlight: #402518;
    --color-success: #74c69d;
    --color-error: #d97847;
    color-scheme: dark;
  }
}

/* ============ UTILITIES ============ */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container--narrow {
  max-width: var(--content-default);
}
.sr-only-focusable:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ============ SKIP LINK ============ */
.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 200;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform var(--transition-interactive);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ============ HEADER / NAV ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid oklch(from var(--color-border) l c h / 0.6);
  transition:
    transform 0.3s var(--ease-organic),
    box-shadow 0.3s var(--ease-organic);
}
.site-header--hidden {
  transform: translateY(-100%);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.logo svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}
.nav-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--color-primary);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.nav-toggle {
  display: none;
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
}
.theme-toggle:hover {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-accent {
  background: var(--color-accent);
  color: #1b1206;
  box-shadow: var(--shadow-sm);
}
.btn-accent:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  padding-block: var(--space-24) var(--space-16);
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface-offset) 100%);
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.9;
  pointer-events: none;
}
.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-16);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}
.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 600;
  line-height: 1.08;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.hero__title .tree-icon {
  width: clamp(2.2rem, 1rem + 5vw, 5rem);
  height: clamp(2.2rem, 1rem + 5vw, 5rem);
  color: var(--color-primary);
  flex-shrink: 0;
}
.hero__title .tree-icon--right {
  transform: scaleX(-1);
}
.hero__subhead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-bottom: var(--space-8);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.hero__promo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent-active);
  background: var(--color-accent-highlight);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}
[data-theme='dark'] .hero__promo {
  color: var(--color-accent);
}
.hero__promo svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-accent);
}
.hero__trust {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  max-width: 44ch;
}
.hero__trust svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-primary);
}
.hero__visual {
  position: relative;
  aspect-ratio: 1/1;
  max-width: 480px;
}

/* ============ SECTION GENERIC ============ */
section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}
.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-active);
  margin-bottom: var(--space-4);
}
[data-theme='dark'] .section-label {
  color: var(--color-accent);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-5);
  max-width: 20ch;
}
.section-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  margin-bottom: var(--space-12);
}
.section-header {
  margin-bottom: var(--space-12);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease-organic),
    transform 0.7s var(--ease-organic);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ HOW IT WORKS ============ */
.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}
.step-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-8);
  align-items: center;
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.step-row:nth-child(even) {
  grid-template-columns: auto 1fr auto;
}
.step-row:nth-child(even) .step-icon {
  order: 3;
}
.step-number {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--color-primary-highlight);
  font-weight: 600;
  line-height: 1;
}
.step-icon {
  width: 64px;
  height: 64px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.step-body h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.step-body p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

/* ============ DEMO ============ */
.demo-section {
  background: var(--color-surface-offset);
}
.demo-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-6), 4vw, var(--space-12));
  box-shadow: var(--shadow-md);
}
.dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-8), 6vw, var(--space-16));
  text-align: center;
  cursor: pointer;
  background: var(--color-surface-2);
  transition: border-color var(--transition-interactive), background var(--transition-interactive);
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-highlight);
}
.dropzone__icon {
  width: 56px;
  height: 56px;
  color: var(--color-primary);
  margin: 0 auto var(--space-4);
}
.dropzone__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.dropzone__hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}
.dropzone__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}
.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.preview-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.preview-count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.preview-image-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.preview-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.preview-filename {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  word-break: break-all;
}
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Thumbnail grid — multi-image selection */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-4);
}
.thumb-item {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  box-shadow: var(--shadow-sm);
}
.thumb-item__imgwrap {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--color-surface-offset);
}
.thumb-item__imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-item__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  padding: var(--space-2);
  border-top: 1px solid var(--color-divider);
  background: var(--color-surface);
  word-break: break-word;
}
.thumb-item__remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  min-height: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.2 0.02 150 / 0.55);
  color: #fff;
  font-size: var(--text-sm);
  line-height: 1;
  border: none;
  backdrop-filter: blur(2px);
}
.thumb-item__remove:hover {
  background: var(--color-warning);
}
.thumb-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  aspect-ratio: 3 / 4;
  min-height: 100%;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  background: transparent;
  transition: border-color var(--transition-interactive), color var(--transition-interactive), background var(--transition-interactive);
}
.thumb-add:hover,
.thumb-add:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-highlight);
}
.thumb-add svg {
  width: 28px;
  height: 28px;
}

/* Overall multi-image progress */
.progress-overall {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.progress-overall-track {
  width: 100%;
  height: 6px;
  background: var(--color-surface-offset-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-overall-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width 0.35s var(--ease-organic);
}
.progress-overall-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

/* progress */
.progress-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: center;
  text-align: center;
  padding-block: var(--space-6);
}
.progress-stage {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  min-height: 1.5em;
}
.progress-track {
  width: 100%;
  max-width: 420px;
  height: 10px;
  background: var(--color-surface-offset-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
  border-radius: var(--radius-full);
  transition: width 0.35s var(--ease-organic);
}
.progress-percent {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.progress-sprout {
  width: 72px;
  height: 72px;
  color: var(--color-primary);
}
.progress-sprout .grow-part {
  transform-origin: bottom center;
  animation: sway 2.4s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

/* Results */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}
.results-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-10);
  align-items: center;
}
.gauge-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.gauge-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gauge-track {
  fill: none;
  stroke: var(--color-surface-offset-2);
  stroke-width: 12;
}
.gauge-fill {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease-organic);
}
.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gauge-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.gauge-caption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.results-summary h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.results-summary p {
  color: var(--color-text-muted);
}

.forest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-5);
}
.forest-plot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}
.forest-plot--matched {
  background: var(--color-primary-highlight);
  border-color: color-mix(in oklab, var(--color-primary) 35%, var(--color-border));
}
.forest-plot--empty {
  background: var(--color-warning-highlight);
  border-color: color-mix(in oklab, var(--color-warning) 30%, var(--color-border));
}
.forest-plot__icon {
  width: 64px;
  height: 64px;
  color: var(--color-primary);
}
.forest-plot--empty .forest-plot__icon {
  color: var(--color-warning);
}
.forest-plot__icon.grow-in {
  animation: growIn 0.7s var(--ease-spring) both;
}
@keyframes growIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.forest-plot__label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.forest-plot__hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.forest-plot--empty .forest-plot__hint {
  color: var(--color-warning-active);
  font-weight: 600;
}
[data-theme='dark'] .forest-plot--empty .forest-plot__hint {
  color: var(--color-warning);
}

.detail-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.detail-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.detail-table th,
.detail-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.detail-table th {
  background: var(--color-surface-offset);
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}
.detail-table td {
  color: var(--color-text-muted);
}
.detail-table tr:last-child td {
  border-bottom: none;
}

.detail-table__group-row td {
  background: var(--color-surface-offset);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}
.detail-table__group-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.detail-table__group-name {
  font-weight: 700;
  color: var(--color-text);
  font-size: var(--text-sm);
}
.detail-table__sub-row .detail-table__sub-name {
  padding-left: var(--space-6);
  color: var(--color-text);
  position: relative;
}
.detail-table__sub-row .detail-table__sub-name::before {
  content: '';
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-border);
}

@media (max-width: 480px) {
  .detail-table__group-cell {
    align-items: flex-start;
  }
}
.badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}

.privacy-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-5);
}

.raw-ocr-debug {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.raw-ocr-debug summary {
  cursor: pointer;
  color: var(--color-text-muted);
  font-weight: 600;
}
.raw-ocr-debug pre {
  margin-top: var(--space-3);
  padding: var(--space-4);
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: monospace;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
  padding-block: var(--space-8);
}
.empty-state__icon {
  width: 64px;
  height: 64px;
  color: var(--color-warning);
}
.empty-state__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}
.empty-state__desc {
  color: var(--color-text-muted);
  max-width: 48ch;
}
.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-2);
}

.demo-step {
  display: none;
}
.demo-step.is-active {
  display: block;
}

/* ============ FEATURES ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.feature-card {
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.feature-card--large {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--color-primary-highlight), var(--color-surface));
}
.feature-card__icon {
  width: 40px;
  height: 40px;
  color: var(--color-primary);
}
.feature-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}
.feature-card p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

/* ============ FAQ ============ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: var(--content-default);
}
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  text-align: left;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
}
.faq-question .chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-primary);
  transition: transform var(--transition-interactive);
}
.faq-item[data-open='true'] .chevron {
  transform: rotate(180deg);
}
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease-organic);
}
.faq-answer-inner {
  overflow: hidden;
}
.faq-item[data-open='true'] .faq-answer {
  grid-template-rows: 1fr;
}
.faq-answer p {
  padding: 0 var(--space-6) var(--space-5);
  color: var(--color-text-muted);
}

/* ============ FINAL CTA ============ */
.final-cta {
  text-align: center;
  background: linear-gradient(180deg, var(--color-surface-offset), var(--color-primary-highlight));
}
.final-cta__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  max-width: 24ch;
  margin: 0 auto var(--space-6);
}
.final-cta__desc {
  color: var(--color-text-muted);
  max-width: 48ch;
  margin: 0 auto var(--space-8);
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--color-surface-offset);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-16) var(--space-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-10);
}
.footer-brand p {
  color: var(--color-text-muted);
  max-width: 40ch;
  margin-top: var(--space-3);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}
.footer-links a:hover {
  color: var(--color-primary);
}
.footer-legal {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-6);
  line-height: 1.7;
}
.footer-copyright {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-4);
}
.footer-admin-link {
  color: var(--color-text-faint);
  text-decoration: none;
  margin-left: var(--space-3);
  border-left: 1px solid var(--color-divider);
  padding-left: var(--space-3);
}
.footer-admin-link:hover {
  color: var(--color-text-muted);
  text-decoration: underline;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
  .hero__visual {
    max-width: 320px;
    margin: 0 auto;
    order: -1;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-card--large {
    grid-column: span 2;
  }
  .preview-panel {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
  .step-row,
  .step-row:nth-child(even) {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .step-row:nth-child(even) .step-icon {
    order: 0;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .feature-card--large {
    grid-column: span 1;
  }
  .results-top {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .hero {
    padding-block: var(--space-16) var(--space-12);
    min-height: auto;
  }
  .container {
    padding-inline: var(--space-4);
  }
}

/* ============ 신정원 표준 배지 ============ */
.standard-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary-active);
  background: var(--color-primary-highlight);
  border: 1px solid color-mix(in oklab, var(--color-primary) 35%, var(--color-border));
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  margin-bottom: var(--space-3);
}
[data-theme='dark'] .standard-badge {
  color: var(--color-primary-light);
}

/* ============ 보장리모델링신청 CTA CARD ============ */
.lead-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary-highlight), var(--color-surface-2));
  border: 1px solid color-mix(in oklab, var(--color-primary) 30%, var(--color-border));
}
.lead-cta-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.lead-cta-card__desc {
  color: var(--color-text-muted);
  max-width: 46ch;
}
.lead-cta-card__desc + .lead-cta-card__desc {
  margin-top: var(--space-1);
}
.lead-cta-card .btn {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .lead-cta-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .lead-cta-card .btn {
    width: 100%;
  }
}

/* ============ LEAD CAPTURE MODAL ============ */
.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.lead-modal[hidden] {
  display: none;
}
.lead-modal__overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, black 55%, transparent);
  opacity: 0;
  transition: opacity 0.2s var(--ease-organic, ease);
}
.lead-modal.is-open .lead-modal__overlay {
  opacity: 1;
}
.lead-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - var(--space-10));
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,0.25));
  padding: var(--space-8);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.25s var(--ease-spring, ease), opacity 0.2s ease;
}
.lead-modal.is-open .lead-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.lead-modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.lead-modal__close:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}
.lead-modal__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  padding-right: var(--space-8);
}
.lead-modal__desc {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}
.form-field {
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.form-field label,
.form-field__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.form-field input[type='text'],
.form-field input[type='tel'] {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: var(--text-base);
  min-height: 44px;
}
.form-field input[type='text']:focus,
.form-field input[type='tel']:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 25%, transparent);
}
.form-field input[aria-invalid='true'] {
  border-color: var(--color-warning);
}
.form-error {
  font-size: var(--text-xs);
  color: var(--color-warning);
  font-weight: 600;
}
.segmented-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.segmented-toggle__option {
  flex: 1;
  text-align: center;
  padding: var(--space-3);
  cursor: pointer;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-weight: 600;
  position: relative;
}
.segmented-toggle__option:not(:last-child) {
  border-right: 1px solid var(--color-border);
}
.segmented-toggle__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.segmented-toggle__option:has(input:checked) {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.segmented-toggle__option:has(input:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.lead-modal__actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.lead-modal__actions .btn {
  flex: 1;
}
.lead-modal__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-6) 0;
}
.lead-modal__status-icon {
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.lead-modal__status button {
  margin-top: var(--space-2);
}
.lead-modal__status-icon--error {
  color: var(--color-warning);
}
.lead-modal__status-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}
.lead-modal__status-desc {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
body.modal-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .lead-modal__dialog {
    padding: var(--space-6);
  }
}
