:root {
  color-scheme: light;
  --ink: #141414;
  --muted: #5b6168;
  --paper: #f5f1e8;
  --card: #fffdf8;
  --line: #c9c2b5;
  --red: #a52b2b;
  --red-soft: #f7e5e1;
  --blue: #174d67;
  --blue-soft: #e1edf1;
  --yellow: #f0c64a;
  --green: #285c45;
  --shadow: 0 18px 44px rgba(38, 31, 21, 0.11);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.68)),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(34, 48, 57, 0.04) 31px 32px),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  line-height: 1.55;
}

a { color: inherit; }

button, input, select { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 6px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 10px clamp(18px, 4vw, 64px);
  color: white;
  background: rgba(20, 20, 20, 0.96);
  border-bottom: 3px solid var(--yellow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 50%;
  font-weight: 900;
}

.brand strong { letter-spacing: 0.1em; }
.brand small { color: #d8d8d8; }

.topbar nav { display: flex; flex-wrap: wrap; gap: 8px; }
.topbar nav a, .language-switch button, [data-print] {
  min-height: 44px;
  padding: 10px 13px;
  color: inherit;
  background: transparent;
  border: 1px solid #626262;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
}

.topbar nav a[aria-current="page"], .language-switch button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--yellow);
  border-color: var(--yellow);
}

.language-switch { display: flex; gap: 6px; }

main { width: min(1240px, calc(100% - 32px)); margin: 34px auto 80px; }

.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 0.34fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 5vw, 70px);
  color: white;
  background: var(--ink);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.stage-mark { display: grid; justify-items: center; padding-right: 28px; border-right: 1px solid #555; }
.stage-mark span, .stage-mark small { color: #c9c9c9; letter-spacing: 0.16em; }
.stage-mark strong { font-family: Georgia, serif; font-size: clamp(64px, 10vw, 120px); line-height: 0.9; }

.hero p:first-child { color: var(--yellow); font-weight: 800; letter-spacing: 0.08em; }
.hero h1 { margin: 8px 0 18px; font-size: clamp(34px, 5vw, 64px); line-height: 1.04; }
.hero h1 span, .hero h1 em { display: block; }
.hero h1 em { margin-top: 8px; color: #f4b8ae; font-family: Georgia, serif; font-weight: 500; }
.hero aside { padding: 20px; color: var(--ink); background: var(--red-soft); border: 2px solid #f2a89b; border-radius: 18px; }
.hero aside strong, .hero aside span, .hero aside b { display: block; }
.hero aside strong { color: var(--red); font-size: 26px; line-height: 1.05; }
.hero aside span { margin: 12px 0 4px; font-size: 12px; letter-spacing: 0.12em; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  margin: 20px 0;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.metric-strip article { min-width: 0; padding: 20px 16px; background: var(--card); }
.metric-strip strong { display: block; font-family: Georgia, serif; font-size: clamp(25px, 4vw, 42px); }
.metric-strip span { color: var(--muted); font-size: 13px; }

.report-section {
  margin-top: 24px;
  padding: clamp(24px, 4vw, 48px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 26px rgba(38, 31, 21, 0.05);
}

.section-heading {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.section-heading > p { color: var(--red); font-weight: 900; letter-spacing: 0.1em; }
.section-heading h2 { margin: 0; font-size: clamp(27px, 4vw, 46px); line-height: 1.1; }
.section-heading div > p { color: var(--muted); }

.field-status {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 16px 18px;
  color: #711f1f;
  background: var(--red-soft);
  border: 2px solid var(--red);
}

.field-status strong { font-size: 13px; letter-spacing: 0.06em; }

.field-preflight {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.field-preflight li { display: grid; gap: 12px; min-height: 108px; padding: 16px; background: #f6f2e9; border: 1px solid var(--line); }
.field-preflight li b { align-self: end; color: var(--blue); font-size: 12px; }

.privacy-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 26px;
  padding: 18px;
  color: #153c4d;
  background: var(--blue-soft);
  border-left: 6px solid var(--blue);
}

.privacy-banner strong { font-size: 22px; }

.pilot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pilot-slot { padding: 20px; border: 2px solid var(--ink); border-radius: 16px; }
.pilot-slot > header { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.pilot-slot h3 { margin: 0 0 14px; font-size: 28px; }
.pilot-slot > header b { color: var(--red); }
.session-sheet { margin-top: 16px; padding: 16px; background: #f6f2e9; border-radius: 12px; }
.session-sheet > span { color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: 0.1em; }
.session-sheet h4 { margin: 6px 0; font-size: 18px; }
.session-sheet a { color: var(--blue); font-size: 13px; }
.write-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; margin-top: 14px; }
.write-grid div { min-height: 45px; border-bottom: 1px solid #8d887f; }
.write-grid b { display: block; font-size: 11px; color: var(--muted); }
.check-line { margin-top: 10px; font-size: 13px; }

.criteria-table, .gate-table, .maintenance-table { width: 100%; border-collapse: collapse; }
.criteria-table th, .criteria-table td, .gate-table th, .gate-table td, .maintenance-table th, .maintenance-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.criteria-table thead, .gate-table thead, .maintenance-table thead { background: var(--ink); color: white; }
.criteria-table code, .gate-table code { font-size: 11px; }
.status-pending { color: var(--red); font-weight: 900; }
.evidence-ready { color: var(--green); font-size: 12px; font-weight: 800; }

.matrix-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.matrix-card { padding: 18px; border: 1px solid var(--line); border-top: 7px solid var(--red); }
.matrix-card:nth-child(2) { border-top-color: #d56d2f; }
.matrix-card:nth-child(3) { border-top-color: #c9a321; }
.matrix-card:nth-child(4) { border-top-color: var(--blue); }
.matrix-card strong { display: block; font-size: 26px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.workflow { margin: 0; padding: 0; list-style: none; counter-reset: workflow; }
.workflow li { counter-increment: workflow; display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.workflow li::before { content: counter(workflow, decimal-leading-zero); display: grid; width: 34px; height: 34px; place-items: center; color: white; background: var(--blue); border-radius: 50%; font-size: 12px; }

.release-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 24px;
  padding: clamp(28px, 5vw, 56px);
  color: white;
  background: var(--red);
  border-radius: 22px;
}

.release-block h2 { margin: 0; font-size: clamp(34px, 5vw, 60px); }
.release-block strong { padding: 18px; color: var(--red); background: white; border-radius: 12px; font-size: 24px; text-align: center; }

.field-handoff {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 24px;
  padding: clamp(28px, 5vw, 56px);
  color: #123846;
  background: var(--blue-soft);
  border: 2px solid var(--blue);
  border-radius: 22px;
}

.field-handoff h2 { margin: 0; font-size: clamp(30px, 5vw, 54px); line-height: 1.08; }
.field-handoff > div > p:first-child { color: var(--blue); font-weight: 900; letter-spacing: 0.1em; }
.handoff-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.field-handoff a, .field-handoff button { display: inline-flex; min-height: 44px; align-items: center; padding: 11px 16px; color: white; background: var(--blue); border: 1px solid var(--blue); border-radius: 999px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.field-handoff > strong { padding: 18px; color: white; background: var(--blue); border-radius: 12px; font-size: 20px; text-align: center; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 64px);
  color: white;
  background: var(--ink);
}

footer span { color: #c8c8c8; }

:focus-visible { outline: 4px solid #2f92bf; outline-offset: 3px; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { grid-column: 1 / -1; order: 3; }
  .hero { grid-template-columns: auto 1fr; }
  .hero aside { grid-column: 1 / -1; }
  .metric-strip { grid-template-columns: repeat(3, 1fr); }
  .pilot-grid, .split { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  main { width: min(100% - 20px, 1240px); margin-top: 14px; }
  .topbar { position: static; grid-template-columns: 1fr; gap: 10px; }
  .language-switch { justify-self: start; }
  .hero { grid-template-columns: 1fr; border-radius: 16px; }
  .stage-mark { justify-items: start; padding: 0 0 18px; border-right: 0; border-bottom: 1px solid #555; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .report-section { padding: 20px; border-radius: 16px; }
  .section-heading { grid-template-columns: 1fr; gap: 0; }
  .pilot-grid, .matrix-grid, .field-preflight { grid-template-columns: 1fr; }
  .write-grid { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  .criteria-table, .gate-table, .maintenance-table { min-width: 720px; }
  .release-block, .field-handoff { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (forced-colors: active) {
  .topbar, .hero, .criteria-table thead, .gate-table thead, .maintenance-table thead, .release-block, .field-handoff, .field-status { border: 2px solid CanvasText; }
  .brand > span, .topbar nav a[aria-current="page"], .language-switch button[aria-pressed="true"] { border: 2px solid CanvasText; }
  .status-pending, .evidence-ready { color: CanvasText; }
}

@page { size: A4 portrait; margin: 10mm; }

@media print {
  body { background: white; font-size: 10pt; }
  .skip-link, .topbar, [data-print], footer { display: none !important; }
  main { width: auto; margin: 0; }
  .hero, .report-section, .release-block, .field-handoff { color: black; background: white; border: 1px solid black; border-radius: 0; box-shadow: none; }
  .hero { grid-template-columns: 22mm 1fr; min-height: 70mm; break-after: page; }
  .hero aside { grid-column: 1 / -1; }
  .metric-strip { break-after: page; }
  .pilot-grid { display: block; }
  .pilot-slot { min-height: 257mm; margin: 0; break-after: page; border: 1px solid black; }
  .pilot-slot:last-child { break-after: page; }
  .report-section { break-before: page; }
  .section-heading { grid-template-columns: 36mm 1fr; }
  .criteria-table thead, .gate-table thead, .maintenance-table thead { color: black; background: white; }
  .table-wrap { overflow: visible; }
  .criteria-table, .gate-table, .maintenance-table { font-size: 8pt; }
  .release-block { break-before: page; }
  .field-handoff { display: none; }
  body[data-print-mode="field"] main > * { display: none !important; }
  body[data-print-mode="field"] main > #field-packet { display: block !important; margin: 0; padding: 0; border: 0; break-before: auto; }
  body[data-print-mode="field"] #field-packet .field-preflight { break-after: page; }
  body[data-print-mode="field"] #field-packet .field-preflight li { break-inside: avoid; }
  a { text-decoration: none; }
}
