:root {
  --canvas: #ffffff;
  --ink: #000000;
  --line: #e5e5e5;
  --signal: #0052cc;
  --signal-soft: #f0f4ff;
  --danger: #d32f2f;
  --warn: #8a5a00;
  --ok: #1b7f3a;
  --muted: #555555;
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Courier New", monospace;
  --radius: 4px;
  --section: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a, textarea, input { touch-action: manipulation; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  background: var(--signal);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius);
}
.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand-block, nav { display: flex; align-items: center; gap: 12px; }
.brand-block { font-weight: 700; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--mono);
}
nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
nav a:hover { border-bottom-color: var(--signal); }

.hero-section, .workspace-section, .results-section, .output-section, .cta-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--section) 24px;
}
.hero-section {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 48px;
  align-items: center;
}
.hero-copy { padding-top: 24px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--signal);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.07em;
  font-weight: 700;
}
h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 700;
}
h3 { font-size: 20px; line-height: 1.2; font-weight: 700; }
.hero-lede, .section-title p, .cta-copy p { max-width: 720px; color: var(--muted); }
.hero-actions, .input-actions, .filter-row, .copy-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.button {
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--signal);
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 400;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, filter 180ms ease;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(0.98); }
.button-primary { background: var(--signal); color: #ffffff; }
.button-primary:hover { filter: brightness(0.92); }
.button-secondary { background: #ffffff; color: var(--signal); }
.button-secondary:hover, .button-ghost:hover { background: var(--signal-soft); }
.button-ghost { background: #ffffff; color: var(--ink); border-color: var(--line); }
.privacy-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.privacy-list li::before { content: "검증됨 · "; color: var(--ok); font-family: var(--mono); }
.hero-media {
  margin: 0;
  align-self: stretch;
  display: grid;
  grid-template-rows: 1fr auto;
  transform: translateY(36px);
}
.hero-media img, .summary-image img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  filter: grayscale(100%) contrast(1.08);
}
.hero-media figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.signal-strip {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.signal-strip div {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-right: 0;
  background: #ffffff;
}
.signal-strip div:last-child { border-right: 1px solid var(--line); }
.signal-number, .score-value, .metrics-grid dd {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.signal-number { display: block; margin-bottom: 28px; color: var(--signal); }
.signal-strip p { margin: 0; font-weight: 700; }

.section-title { margin-bottom: 32px; }
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 28px;
  align-items: start;
}
.input-panel, .summary-panel, .copy-card, .empty-card, .finding-card, .cta-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.input-panel, .summary-panel, .copy-card { padding: 20px; }
.upload-box {
  min-height: 132px;
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 20px;
  border: 1px dashed var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}
.upload-box:hover { background: var(--signal-soft); transform: translateX(4px); }
.upload-title { font-weight: 700; }
.upload-help, .file-meta, .status-box { color: var(--muted); }
.upload-box input { margin-top: 8px; }
.file-meta { margin: 12px 0 20px; font-size: 14px; }
.field-label { display: block; margin-bottom: 8px; font-weight: 700; }
textarea {
  width: 100%;
  min-height: 340px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
  font-family: var(--mono);
  line-height: 1.5;
  color: var(--ink);
  background: #ffffff;
}
.input-actions { margin-top: 16px; }
.status-box {
  margin-top: 16px;
  padding: 12px;
  border-left: 4px solid var(--signal);
  background: var(--signal-soft);
}
.status-box.error { border-left-color: var(--danger); background: #fff5f5; color: #5f1111; }
.status-box.ok { border-left-color: var(--ok); background: #f1fff6; color: #123b22; }
.summary-panel {
  position: sticky;
  top: 80px;
}
.summary-image { height: 188px; margin-bottom: 20px; overflow: hidden; }
.summary-image img { min-height: 188px; border-color: var(--line); }
.score-block {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 20px 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.score-value { font-size: clamp(64px, 9vw, 112px); line-height: 0.9; letter-spacing: -0.08em; text-align: right; }
.score-label { font-weight: 700; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-bottom: 0;
}
.metrics-grid div { padding: 12px; border-bottom: 1px solid var(--line); }
.metrics-grid dt { color: var(--muted); font-size: 14px; }
.metrics-grid dd { margin: 4px 0 0; text-align: right; font-size: 24px; }
.top-drivers { margin: 0; padding-left: 20px; }
.top-drivers li { margin-bottom: 8px; }
.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}
.filter-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  cursor: pointer;
}
.filter-button.active, .filter-button:hover { border-color: var(--signal); color: var(--signal); background: var(--signal-soft); }
.findings-list { display: grid; gap: 12px; }
.empty-card, .finding-card { padding: 16px; }
.finding-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 190px;
  gap: 16px;
  align-items: start;
  animation: slideIn 260ms ease both;
}
.severity-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  font-family: var(--mono);
  text-transform: uppercase;
}
.severity-critical { color: var(--danger); }
.severity-high { color: #8a2d00; }
.severity-medium { color: var(--warn); }
.severity-info { color: var(--signal); }
.finding-meta { margin: 0; color: var(--muted); font-size: 14px; }
.finding-action { margin: 8px 0 0; }
.finding-evidence {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.output-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.copy-card-header { justify-content: space-between; margin-bottom: 12px; }
.copy-card-header h2 { font-size: 24px; margin-bottom: 0; }
pre {
  min-height: 240px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  font-family: var(--mono);
  font-size: 14px;
  white-space: pre-wrap;
}
.copy-status { min-height: 24px; margin-top: 12px; color: var(--ok); }
.cta-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.cta-copy p:last-child { margin-bottom: 0; }
.cta-button { min-width: 260px; }
.reveal { animation: riseIn 520ms ease both; }
.reveal-b { animation-delay: 120ms; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
@media (max-width: 980px) {
  .hero-section, .workspace-grid, .output-grid, .cta-section { grid-template-columns: 1fr; }
  .hero-section { min-height: auto; }
  .hero-media { transform: none; }
  .summary-panel { position: static; }
  .signal-strip { grid-template-columns: repeat(2, 1fr); }
  .signal-strip div:nth-child(2) { border-right: 1px solid var(--line); }
  .finding-card { grid-template-columns: 1fr; }
  .results-heading { align-items: start; flex-direction: column; }
}
@media (max-width: 560px) {
  .site-header { position: static; flex-direction: column; align-items: stretch; padding: 12px 16px; }
  nav { justify-content: space-between; }
  .hero-section, .workspace-section, .results-section, .output-section, .cta-section { padding: 48px 16px; }
  h1 { font-size: 44px; }
  .hero-media img { min-height: 280px; }
  .signal-strip { grid-template-columns: 1fr; padding: 0 16px 32px; }
  .signal-strip div { border-right: 1px solid var(--line); }
  .hero-actions .button, .input-actions .button, .cta-button { width: 100%; }
  .summary-image { display: none; }
  textarea { min-height: 280px; }
}
