:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #0a0f1f;
  --muted: #5e6473;
  --line: #d8deea;
  --signal: #0f5bff;
  --signal-2: #0b1328;
  --success: #167347;
  --warn: #a85b00;
  --danger: #ba1b1b;
  --section: 64px;
  --radius: 4px;
  --max: 1320px;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --body: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: #ffffff;
}
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}
.is-hidden { display: none; }

.site-header,
.hero,
.story-grid,
.workspace,
.results,
.details,
.cta-section,
.site-footer {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(216,222,234,0.9);
  z-index: -1;
}
.brand-block { display: grid; gap: 4px; }
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.1rem;
  font-weight: 700;
}
.top-nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.top-nav a:hover, .top-nav a:focus-visible { transform: translateY(-2px); border-color: var(--line); background: rgba(255,255,255,0.8); }
.top-nav .nav-cta { border: 1px solid var(--signal); color: var(--signal); }

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
  font-weight: 700;
}

.hero {
  padding: 56px 0 var(--section);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(320px, 5fr);
  gap: 40px;
  align-items: start;
}
.hero-copy h1 {
  margin: 14px 0 18px;
  font-size: clamp(2.6rem, 4vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}
.hero-body {
  margin: 0;
  max-width: 60ch;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
}
.hero-actions, .cta-actions, .result-tools, .action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.hero-points {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.hero-points li,
.help-text,
.guide-block p,
.file-meta,
.site-footer p,
figcaption,
.panel-copy p,
.headline-panel p,
.cta-copy p {
  color: var(--muted);
  line-height: 1.65;
}
.hero-visual {
  position: relative;
  padding-top: 24px;
}
.image-card {
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
.image-card img { aspect-ratio: 4 / 5; object-fit: cover; }
.tall-card { transform: translateY(28px); }
.tall-card figcaption,
.compact-card figcaption {
  padding: 14px 16px 18px;
  font-size: 0.93rem;
}
.floating-metrics {
  position: absolute;
  left: -28px;
  bottom: -26px;
  display: grid;
  gap: 12px;
  width: min(320px, 82%);
}
.floating-metrics article {
  background: rgba(10,15,31,0.95);
  color: white;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 16px;
  transform: translateX(0);
  animation: drift 6s ease-in-out infinite;
}
.floating-metrics article:nth-child(2) { margin-left: 32px; animation-delay: 0.7s; }
.floating-metrics article:nth-child(3) { margin-left: 10px; animation-delay: 1.3s; }
.metric-label { display: block; font-size: 0.78rem; color: rgba(255,255,255,0.68); margin-bottom: 6px; }

.story-grid {
  padding: 0 0 var(--section);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(280px, 4fr) minmax(0, 3fr);
  gap: 24px;
  align-items: start;
}
.story-panel,
.input-panel,
.guide-panel,
.graph-panel,
.insight-panel,
.detail-panel,
.headline-panel,
.summary-bar article,
.cta-section {
  background: var(--panel);
  border: 1px solid var(--line);
}
.story-panel,
.input-panel,
.guide-panel,
.graph-panel,
.insight-panel,
.detail-panel,
.headline-panel,
.cta-section {
  padding: 24px;
}
.statement-panel h2,
.workspace-head h2,
.section-head h2,
.cta-copy h2 {
  margin: 10px 0 14px;
  font-size: clamp(1.8rem, 2.2vw, 2.8rem);
  line-height: 1.08;
}
.offset-panel { margin-top: 52px; }
.image-panel { padding: 0; }
.image-panel img { aspect-ratio: 4 / 3; object-fit: cover; }
.panel-copy { padding: 18px; }
.feature-list,
.diagnostic-list,
.warning-list,
.action-list {
  margin: 16px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
  line-height: 1.6;
}
.feature-list li::marker,
.action-list li::marker { color: var(--signal); font-weight: 700; }

.workspace,
.results,
.details { padding: var(--section) 0; }
.workspace-head,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}
.workspace-jumps { display: flex; flex-wrap: wrap; gap: 12px; }
.workspace-jumps a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--signal);
  border-bottom: 1px solid rgba(15,91,255,0.24);
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(300px, 4fr);
  gap: 24px;
  align-items: start;
}
.tab-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.tab-button,
.button,
select,
input[type="file"] {
  min-height: 44px;
  border-radius: var(--radius);
}
.tab-button {
  background: #eef3ff;
  border: 1px solid transparent;
  color: var(--signal-2);
  padding: 10px 14px;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.tab-button.active { background: var(--signal); border-color: var(--signal); color: white; }
.tab-button:hover, .button:hover { transform: translateY(-2px); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 320ms ease; }
.label { display: block; margin-bottom: 10px; font-size: 0.92rem; font-weight: 700; }
textarea,
select,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfcff;
  color: var(--ink);
}
textarea {
  min-height: 300px;
  padding: 18px;
  resize: vertical;
  font-family: var(--mono);
  line-height: 1.6;
}
.control-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
select, input[type="file"] { padding: 12px 14px; }
.button {
  border: 1px solid var(--line);
  background: white;
  padding: 12px 18px;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.button.primary {
  background: var(--signal);
  border-color: var(--signal);
  color: white;
}
.button.secondary {
  background: #eef3ff;
  color: var(--signal-2);
  border-color: #c9d6ff;
}
.button.ghost {
  background: transparent;
  color: var(--ink);
}
.button:focus-visible,
.tab-button:focus-visible,
.top-nav a:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}
.status-strip {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #f7faff;
  color: var(--signal-2);
  min-height: 52px;
}
.status-strip.processing {
  background: #0b1328;
  color: white;
  animation: pulseBar 1.4s ease-in-out infinite;
}
.guide-panel {
  display: grid;
  gap: 18px;
}
.guide-block ol { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.subtle-block { background: #f8fbff; }
.compact-card img { aspect-ratio: 4 / 3; object-fit: cover; }

.summary-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.summary-bar article { padding: 18px; display: grid; gap: 8px; }
.summary-bar span,
.panel-head span { color: var(--muted); font-size: 0.9rem; }
.summary-bar strong,
.mono,
#score-value,
#risk-count,
#action-count,
#bottleneck-stage {
  font-family: var(--mono);
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  text-align: right;
}
.headline-panel { margin: 16px 0 24px; }
.headline-panel p { margin: 0; font-size: 1.2rem; }
.results-grid,
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(300px, 4fr);
  gap: 24px;
}
.detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.panel-head h3 { margin: 0; font-size: 1.1rem; }
.graph-shell {
  margin-top: 16px;
  min-height: 500px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #ffffff;
}
#dag-svg { width: 100%; height: 500px; }
.graph-node rect {
  fill: #ffffff;
  stroke: #0f5bff;
  stroke-width: 1.5;
}
.graph-node text { font-family: var(--body); font-size: 14px; fill: var(--ink); }
.graph-edge { fill: none; stroke: #0b1328; stroke-width: 1.5; }
.graph-label { font-family: var(--mono); font-size: 12px; fill: var(--muted); }
.masked-preview {
  margin: 16px 0 0;
  padding: 16px;
  min-height: 240px;
  overflow: auto;
  background: #0b1328;
  color: #f7fbff;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
}
.warning-list li { color: var(--warn); }
.diagnostic-list li strong,
.action-list li strong { display: block; margin-bottom: 4px; }
.cta-section {
  margin-bottom: var(--section);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 5fr);
  gap: 28px;
  align-items: center;
}
.site-footer { padding: 0 0 40px; }

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseBar {
  0%, 100% { background: #0b1328; }
  50% { background: #15306f; }
}
@keyframes drift {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(8px) translateY(-6px); }
}

@media (max-width: 1080px) {
  .hero,
  .story-grid,
  .workspace-grid,
  .results-grid,
  .detail-grid,
  .cta-section {
    grid-template-columns: 1fr;
  }
  .offset-panel,
  .tall-card { margin-top: 0; transform: none; }
  .floating-metrics {
    position: static;
    width: 100%;
    margin-top: 16px;
  }
  .floating-metrics article:nth-child(2),
  .floating-metrics article:nth-child(3) { margin-left: 0; }
}

@media (max-width: 860px) {
  .site-header,
  .workspace-head,
  .section-head {
    align-items: start;
    flex-direction: column;
  }
  .summary-bar,
  .control-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body { background: #ffffff; }
  .site-header,
  .hero,
  .story-grid,
  .workspace,
  .results,
  .details,
  .cta-section,
  .site-footer {
    width: min(calc(100% - 24px), var(--max));
  }
  .hero { padding-top: 24px; }
  .summary-bar,
  .control-grid { grid-template-columns: 1fr; }
  .top-nav { width: 100%; }
  .top-nav a,
  .button,
  .tab-button { width: 100%; justify-content: center; text-align: center; }
  textarea { min-height: 240px; }
  #dag-svg { height: 420px; }
}