:root {
  --ink: #20201e;
  --muted: #6f6e69;
  --canvas: #f7f6f3;
  --surface: #ffffff;
  --line: #e3e1dc;
  --soft: #efeee9;
  --green-bg: #edf3ec;
  --green: #346538;
  --yellow-bg: #fbf3db;
  --yellow: #7b5800;
  --red-bg: #fdebec;
  --red: #8a3635;
  --blue-bg: #e8f2f7;
  --blue: #285f78;
  --radius: 8px;
  --shell: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

button, input, select { font: inherit; }

a { color: inherit; }

button, a, label { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid rgba(40, 95, 120, 0.34);
  outline-offset: 3px;
}

.shell { width: var(--shell); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 68px;
  padding: 10px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 243, 0.94);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.wordmark span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  letter-spacing: 0;
}

.privacy-note {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-link {
  justify-self: end;
  padding: 9px 13px;
  border-radius: 5px;
  background: var(--ink);
  color: white;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.58fr);
  gap: clamp(48px, 8vw, 100px);
  align-items: center;
  min-height: calc(100dvh - 68px);
  padding-block: 72px;
}

.hero-copy { max-width: 720px; }

.kicker {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1, h2, h3 { letter-spacing: -0.035em; }

h1 {
  margin: 0;
  max-width: 780px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(50px, 7vw, 88px);
  font-weight: 500;
  line-height: 0.98;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 500;
  line-height: 1.02;
}

h3 { margin: 0; font-size: 20px; }

.hero-lead {
  max-width: 650px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
}

.primary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  padding: 12px 18px;
  background: var(--ink);
  color: white;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-action:hover { background: #3a3a36; }
.primary-action:active { transform: scale(0.98); }
.primary-action:disabled { background: #aaa8a1; cursor: not-allowed; transform: none; }

.rule-sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.rule-sheet div {
  display: grid;
  grid-template-columns: 108px 1fr;
  align-items: baseline;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.rule-sheet strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.rule-sheet span { color: var(--muted); }

.rule-sheet > p {
  margin: 0;
  padding: 18px 24px;
  color: var(--muted);
  font-size: 12px;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.proof-strip p {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 24px max(24px, calc((100vw - 1180px) / 2));
  border-right: 1px solid var(--line);
}

.proof-strip p:nth-child(2) { padding-inline: 32px; }
.proof-strip p:last-child { border-right: 0; }
.proof-strip span { color: var(--muted); font-size: 13px; }

.workspace { padding-block: 112px; }

.workspace-heading { max-width: 760px; margin-bottom: 40px; }
.workspace-heading > p:last-child { max-width: 62ch; color: var(--muted); font-size: 18px; }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
}

.details-panel, .file-panel, .review-panel, .generate-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.details-panel, .file-panel { padding: 28px; }

.details-panel { display: grid; gap: 16px; }

.details-panel h3, .file-panel h3 { margin-bottom: 6px; }

.details-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d7d5cf;
  border-radius: 5px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}

input::placeholder { color: #9d9b94; }

.field-note { margin: 0; color: var(--muted); font-size: 12px; }

.file-panel { display: flex; min-height: 100%; flex-direction: column; }

.drop-zone {
  display: grid;
  flex: 1;
  min-height: 290px;
  place-content: center;
  justify-items: center;
  margin-top: 22px;
  padding: 34px;
  border: 1px dashed #c9c6bd;
  border-radius: var(--radius);
  background: var(--canvas);
  text-align: center;
  transition: border 160ms ease, background 160ms ease;
}

.drop-zone.dragging { border-color: var(--green); background: var(--green-bg); }
.drop-zone > strong { font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; }
.drop-zone > span { margin-top: 6px; color: var(--muted); }

.picker-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }

.file-picker {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border-radius: 5px;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.secondary-picker { border: 1px solid var(--line); background: white; color: var(--ink); }

.text-button {
  align-self: start;
  margin-top: 14px;
  border: 0;
  padding: 6px 0;
  background: transparent;
  color: var(--red);
  font-weight: 700;
  cursor: pointer;
}

.review-panel { margin-top: 18px; overflow: hidden; }

.review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line);
}

.review-heading p { margin: 4px 0 0; color: var(--muted); }

.status-badge, .check-state {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-badge.ready, .check-state.ready { background: var(--green-bg); color: var(--green); }
.status-badge.error, .check-state.error { background: var(--red-bg); color: var(--red); }
.check-state.warning { background: var(--yellow-bg); color: var(--yellow); }

.empty-state { padding: 58px 28px; text-align: center; }
.empty-state strong { font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 500; }
.empty-state p { max-width: 560px; margin: 8px auto 0; color: var(--muted); }

.file-table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #fbfbfa; color: var(--muted); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
td:nth-child(1) { width: 26%; }
td:nth-child(2) { width: 34%; }
td:nth-child(3) { width: 12%; white-space: nowrap; }
td small { display: block; max-width: 280px; margin-top: 7px; color: var(--muted); }
code { color: var(--blue); font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }

.package-plan { padding: 26px 28px; }
.package-plan h4 { margin: 0 0 16px; font-size: 14px; }
.package-plan > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.package-plan article { display: grid; gap: 4px; min-height: 110px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--canvas); }
.package-plan article span, .package-plan article small { color: var(--muted); font-size: 11px; }
.package-plan article strong { align-self: end; }
.plan-error { margin: 16px 0 0; padding: 12px; border-radius: 5px; background: var(--red-bg); color: var(--red); font-size: 13px; }

.generate-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: center;
  margin-top: 18px;
  padding: 28px;
}

.generate-panel > div:first-child p { max-width: 680px; margin: 6px 0 0; color: var(--muted); }
.generate-actions { display: grid; justify-items: end; gap: 8px; }
.generate-actions p { max-width: 360px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.progress-track { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 4px; background: var(--soft); }
.progress-track span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: var(--green); transition: transform 120ms linear; }

.output-section { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 70px; align-items: start; padding-block: 112px; border-top: 1px solid var(--line); }
.output-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.output-grid article { min-height: 220px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.output-grid article:first-child { grid-row: span 2; min-height: 454px; background: var(--green-bg); }
.output-grid span { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.output-grid h3 { margin-top: 60px; }
.output-grid article:first-child h3 { margin-top: 190px; }
.output-grid p { color: var(--muted); }

.boundary-section { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 70px; padding-block: 112px; border-top: 1px solid var(--line); }
.boundary-section > div { display: grid; gap: 18px; }
.boundary-section p { margin: 0; color: var(--muted); font-size: 18px; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 28px max(20px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--ink); font-weight: 700; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy, .rule-sheet, .workspace-heading {
    animation: enter 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .rule-sheet { animation-delay: 90ms; }
  @keyframes enter { from { opacity: 0; transform: translateY(12px); } }
}

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .privacy-note { display: none; }
  .hero, .workspace-grid, .output-section, .boundary-section { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .proof-strip { grid-template-columns: 1fr; }
  .proof-strip p, .proof-strip p:nth-child(2) { padding: 18px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .proof-strip p:last-child { border-bottom: 0; }
  .package-plan > div { grid-template-columns: repeat(2, 1fr); }
  .output-section, .boundary-section { gap: 36px; }
  .output-grid article:first-child { grid-row: auto; min-height: 220px; }
  .output-grid article:first-child h3 { margin-top: 60px; }
}

@media (max-width: 620px) {
  :root { --shell: min(100% - 32px, 1180px); }
  .site-header { padding-inline: 16px; }
  .wordmark { font-size: 14px; }
  .wordmark span { width: 30px; height: 30px; }
  .header-link { padding: 8px 10px; font-size: 12px; }
  .hero { padding-block: 58px; }
  h1 { font-size: clamp(45px, 14vw, 62px); }
  .rule-sheet div { grid-template-columns: 88px 1fr; padding: 20px; }
  .rule-sheet strong { font-size: 32px; }
  .workspace, .output-section, .boundary-section { padding-block: 78px; }
  .details-panel, .file-panel, .review-heading, .package-plan, .generate-panel { padding: 20px; }
  .drop-zone { min-height: 250px; padding: 22px; }
  .picker-actions { display: grid; width: 100%; }
  .file-picker { justify-content: center; }
  .review-heading { align-items: flex-start; }
  th, td { min-width: 135px; padding: 12px; }
  th:nth-child(3), td:nth-child(3) { min-width: 82px; }
  .package-plan > div, .output-grid { grid-template-columns: 1fr; }
  .generate-panel { grid-template-columns: 1fr; }
  .generate-actions { justify-items: stretch; }
  .generate-actions p { max-width: none; text-align: left; }
  .site-footer { flex-direction: column; }
}

@media (forced-colors: active) {
  .primary-action, .file-picker, .wordmark span { border: 1px solid ButtonText; }
}
