/* ============================================================
   Design Tokens
   ============================================================ */

:root {
  /* Base */
  --bg: #FFFFFF;
  --bg-elevated: #FAFAFA;
  --bg-subtle: #F5F5F5;

  /* Text */
  --text-primary: #0A0A0A;
  --text-secondary: #525252;
  --text-tertiary: #A3A3A3;

  /* Borders */
  --border: #E5E7EB;
  --border-strong: #D4D4D8;

  /* Accent */
  --accent: #5B5BD6;
  --accent-hover: #4747B8;
  --accent-subtle: #EEF0FF;

  /* Status */
  --status-info: #2563EB;
  --status-error: #DC2626;
  --status-warn: #D97706;
  --status-success: #059669;
  --status-neutral: #71717A;

  /* Typography scale */
  --text-display: 56px;
  --text-h1: 40px;
  --text-h2: 28px;
  --text-h3: 20px;
  --text-body: 16px;
  --text-sm: 14px;
  --text-meta: 12px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  /* Radius */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 16px;

  /* Container */
  --container: 1200px;

  /* Code / terminal — added for developer track */
  --code-bg: #0D0D10;
  --code-text: #E4E4E7;
  --code-prompt: #7FB069;
  --code-output-dim: rgba(228, 228, 231, 0.7);
  --code-success: #4ADE80;
  --code-error: #F87171;
  --code-border: #2D2D35;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0A0A;
    --bg-elevated: #171717;
    --bg-subtle: #262626;
    --text-primary: #FAFAFA;
    --text-secondary: #A3A3A3;
    --text-tertiary: #525252;
    --border: #262626;
    --border-strong: #404040;
    --accent: #818CF8;
    --accent-hover: #A5B4FC;
    --accent-subtle: #1E1B4B;
    --code-bg: #050507;
    --code-text: #FAFAFA;
    --code-border: #1F1F25;
  }
}

/* ============================================================
   Reset + Base
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Pretendard,
    -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto,
    "Helvetica Neue", Arial,
    sans-serif;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease;
}

a:hover {
  color: var(--accent-hover);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ============================================================
   Layout container
   ============================================================ */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  height: 40px;
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
}

.btn-secondary {
  height: 36px;
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ============================================================
   Card
   ============================================================ */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 120ms ease;
}

.card:hover {
  border-color: var(--border-strong);
}

/* ============================================================
   Badge
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--space-2);
  font-size: var(--text-meta);
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.badge-info    { background: rgba(37, 99, 235, 0.1);  color: var(--status-info); }
.badge-error   { background: rgba(220, 38, 38, 0.1);  color: var(--status-error); }
.badge-warn    { background: rgba(217, 119, 6, 0.1);  color: var(--status-warn); }
.badge-success { background: rgba(5, 150, 105, 0.1);  color: var(--status-success); }

/* ============================================================
   Typography utilities
   ============================================================ */

.display { font-size: var(--text-display); line-height: 1.05; letter-spacing: -0.02em; font-weight: 700; }
.h1      { font-size: var(--text-h1);      line-height: 1.1;  letter-spacing: -0.015em; font-weight: 700; }
.h2      { font-size: var(--text-h2);      line-height: 1.2;  letter-spacing: -0.01em;  font-weight: 600; }
.h3      { font-size: var(--text-h3);      line-height: 1.3;  font-weight: 600; }
.body    { font-size: var(--text-body);    line-height: 1.6; }
.sm      { font-size: var(--text-sm);      line-height: 1.5; }
.meta    { font-size: var(--text-meta);    line-height: 1.4; letter-spacing: 0.02em; color: var(--text-secondary); }

.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }

/* ============================================================
   Scroll fade-in (used by scripts.js in Task 13)
   ============================================================ */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 400ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    transform: none;
    transition: opacity 200ms ease;
  }
}

/* ============================================================
   Focus ring (accessibility)
   ============================================================ */

a:focus-visible,
.btn:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ============================================================
   Section base
   ============================================================ */

.section {
  padding: var(--space-24) 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

@media (max-width: 640px) {
  .section { padding: var(--space-16) 0; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  padding: var(--space-24) 0 var(--space-16);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-6);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--text-meta);
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 920px;
  margin: 0 auto var(--space-6);
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto var(--space-8);
  color: var(--text-secondary);
  font-size: var(--text-body);
}

.hero-ctas {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-16);
}

.hero-brand {
  font-size: var(--text-meta);
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
}

@media (max-width: 640px) {
  .hero { padding: var(--space-16) 0 var(--space-12); }
  .display { font-size: 36px; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { width: 100%; }
}

/* ============================================================
   Showcase (§2)
   ============================================================ */

.showcase {
  padding: var(--space-24) 0;
}

/* Showcase is the visual centerpiece — give it a wider container
   so the mockup snapshots render large enough to read. */
.showcase > .container {
  max-width: 1400px;
}

.showcase-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.showcase-header h2 {
  margin-bottom: var(--space-3);
}

.showcase-notice {
  max-width: 760px;
  margin: 0 auto var(--space-16);
  padding: var(--space-4) var(--space-6);
  background: var(--accent-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.showcase-notice strong {
  color: var(--text-primary);
  font-weight: 600;
}

.showcase-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.showcase-item {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-12);
  align-items: start;
}

.showcase-meta {
  position: sticky;
  top: var(--space-8);
}

.showcase-meta-num {
  font-size: var(--text-meta);
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.showcase-meta-title {
  font-size: var(--text-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: var(--space-6);
}

.showcase-meta-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.showcase-meta-label {
  color: var(--text-tertiary);
  font-size: var(--text-meta);
  letter-spacing: 0.05em;
}

.showcase-meta-value {
  color: var(--text-primary);
}

.showcase-mockup {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
}

.showcase-mockup img {
  width: 100%;
  display: block;
}

.showcase-caption {
  margin-top: var(--space-3);
  font-size: var(--text-meta);
  color: var(--text-tertiary);
}

@media (max-width: 1024px) {
  .showcase-item {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .showcase-meta { position: static; }
}

/* Showcase — expanded meta blocks (problem, workflow, outputs) */

.showcase-block {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.showcase-block-label {
  font-size: var(--text-meta);
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.showcase-problem {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.showcase-flow {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: flow-step;
}

.showcase-flow li {
  counter-increment: flow-step;
  position: relative;
  padding-left: 32px;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-primary);
}

.showcase-flow li:last-child {
  margin-bottom: 0;
}

.showcase-flow li::before {
  content: counter(flow-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: var(--text-meta);
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-outputs {
  list-style: none;
  padding: 0;
  margin: 0;
}

.showcase-outputs li {
  position: relative;
  padding-left: 22px;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.showcase-outputs li:last-child {
  margin-bottom: 0;
}

.showcase-outputs li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--status-success);
  font-weight: 600;
}

/* ============================================================
   Methodology (§3)
   ============================================================ */

.methodology {
  padding: var(--space-24) 0;
  background: var(--bg-subtle);
  border-block: 1px solid var(--border);
}

.methodology-header {
  text-align: center;
  margin-bottom: var(--space-16);
  max-width: 760px;
  margin-inline: auto;
}

.methodology-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.methodology-card {
  padding: var(--space-12);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.methodology-card h3 {
  margin-bottom: var(--space-4);
}

.methodology-quote {
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background: var(--accent-subtle);
  border-radius: var(--radius);
  font-size: var(--text-h3);
  color: var(--text-primary);
  font-weight: 500;
}

.methodology-arrow {
  margin-block: var(--space-3);
  text-align: center;
  color: var(--text-tertiary);
}

.methodology-outcome {
  color: var(--text-secondary);
}

.methodology-footnote {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .methodology-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Matrix (§4)
   ============================================================ */

.matrix {
  padding: var(--space-24) 0;
}

.matrix-header {
  text-align: center;
  margin-bottom: var(--space-12);
  max-width: 760px;
  margin-inline: auto;
}

.matrix-table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.matrix-table th,
.matrix-table td {
  padding: var(--space-3) var(--space-4);
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.matrix-table th {
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.matrix-table tbody tr:last-child td {
  border-bottom: none;
}

.matrix-table td:first-child,
.matrix-table th:first-child {
  text-align: left;
  font-weight: 500;
  background: var(--bg-elevated);
  position: sticky;
  left: 0;
  z-index: 1;
}

.matrix-cell-full { color: var(--accent); font-weight: 600; }
.matrix-cell-half { color: var(--text-secondary); }
.matrix-cell-low  { color: var(--text-tertiary); }

.matrix-legend {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.matrix-footnote {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  color: var(--text-secondary);
}

/* ============================================================
   Operations (§5)
   ============================================================ */

.operations {
  padding: var(--space-24) 0;
  background: var(--bg-subtle);
  border-block: 1px solid var(--border);
}

.operations-header {
  text-align: center;
  margin-bottom: var(--space-16);
  max-width: 760px;
  margin-inline: auto;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.operations-col {
  padding: var(--space-8);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.operations-col h3 {
  margin-bottom: var(--space-4);
  font-size: var(--text-h3);
  font-weight: 600;
}

.operations-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.operations-row:last-child { border-bottom: none; }

.operations-row span:first-child { color: var(--text-secondary); }
.operations-row span:last-child  { color: var(--text-primary); font-weight: 500; }

@media (max-width: 1024px) {
  .operations-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Final CTA (§6) + Footer
   ============================================================ */

.cta {
  padding: var(--space-24) 0;
  text-align: center;
}

.cta h2 {
  margin-bottom: var(--space-4);
}

.cta p {
  max-width: 540px;
  margin: 0 auto var(--space-8);
  color: var(--text-secondary);
}

.cta .btn-primary {
  height: 48px;
  padding: 0 var(--space-8);
  font-size: var(--text-body);
}

.footer {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--text-meta);
}

.footer-brand {
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* ====== Code / terminal blocks (developer track) ====== */

.code-block {
  font-family: "SF Mono", Menlo, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: var(--code-bg);
  color: var(--code-text);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--code-border);
  overflow-x: auto;
}

.code-block .code-prompt { color: var(--code-prompt); }
.code-block .code-output-dim { color: var(--code-output-dim); }
.code-block .code-success { color: var(--code-success); }
.code-block .code-error { color: var(--code-error); }

/* Color-independent encoding: success/fail labels next to the symbol */
.code-block .code-label {
  font-size: 11px;
  margin-left: var(--space-2);
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid currentColor;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Dark-mode shadow boost for the code block outline */
@media (prefers-color-scheme: dark) {
  .code-block {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

/* ====== DORA matrix cells (developer track) ====== */

.matrix-dora td .dora-label {
  display: inline-block;
  font-size: 11px;
  margin-left: 6px;
  opacity: 0.65;
  letter-spacing: 0.02em;
}
