:root {
  color-scheme: light;
  --ink: #101616;
  --muted: #5f6863;
  --paper: #f3f1e9;
  --panel: #fffdf6;
  --line: #c9c5b7;
  --field: #ffffff;
  --teal: #12625d;
  --teal-dark: #0d413e;
  --amber: #b8782f;
  --coral: #b95442;
  --mint: #dfeee9;
  --slate: #28333a;
  --shadow: 0 18px 50px rgba(32, 39, 34, 0.16);
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(16, 22, 22, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 22, 22, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid rgba(201, 197, 183, 0.9);
  background: rgba(243, 241, 233, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 900;
}

.brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ink);
  color: #f8e5a8;
  letter-spacing: 0;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.topbar nav a {
  padding: 9px 10px;
  color: var(--muted);
  font-weight: 700;
}

main {
  min-height: 100vh;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: clamp(22px, 5vw, 58px);
  align-items: center;
  min-height: 68vh;
  padding: clamp(28px, 5vw, 56px) clamp(16px, 5vw, 58px) clamp(24px, 5vw, 44px);
}

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

.kicker {
  margin: 0;
  color: var(--coral);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

h1 {
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.7rem, 14vw, 12rem);
  line-height: 0.78;
  letter-spacing: 0;
}

h2 {
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  color: var(--panel);
  cursor: pointer;
  font-weight: 850;
  transition: transform 150ms ease-out, box-shadow 150ms ease-out, background 150ms ease-out;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(16, 22, 22, 0.18);
}

.button:active,
button:active {
  transform: translateY(0);
}

.button.ghost,
.form-actions button + button {
  background: transparent;
  color: var(--ink);
}

.status-board,
.input-panel,
.output-panel,
.evidence-band,
.boundary-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.96);
  box-shadow: var(--shadow);
}

.status-board {
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.status-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  min-height: 90px;
  padding: 18px;
  background: var(--panel);
}

.status-row span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.status-row strong {
  font-size: 1.2rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: start;
  padding: clamp(16px, 5vw, 58px);
}

.input-panel {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
}

.panel-head p,
.evidence-band p,
.boundary-grid p,
.packet-head p,
.microcopy {
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  padding: 10px 11px;
}

input,
select {
  min-height: 42px;
}

textarea {
  resize: vertical;
}

button:focus-visible,
a:focus-visible,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(18, 98, 93, 0.28);
  outline-offset: 2px;
}

.microcopy {
  margin: 0;
  font-size: 0.82rem;
}

.output-panel {
  min-height: 640px;
  padding: clamp(18px, 4vw, 32px);
}

.packet-card {
  display: grid;
  gap: 22px;
}

.notice {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(18, 98, 93, 0.24);
  border-radius: 7px;
  background: var(--mint);
  color: var(--teal-dark);
  font-weight: 850;
}

.packet-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.packet-head h2 {
  color: var(--teal-dark);
}

.memo-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.memo-list div {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(201, 197, 183, 0.76);
  border-radius: 7px;
  background: #fffaf0;
}

dt {
  color: var(--muted);
  font-weight: 900;
}

dd {
  margin: 0;
  line-height: 1.45;
}

.rows-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.rows-grid section {
  padding: 16px;
  border: 1px solid rgba(18, 98, 93, 0.2);
  border-radius: 8px;
  background: rgba(223, 238, 233, 0.58);
}

ol,
ul {
  margin: 0;
  padding-left: 22px;
  line-height: 1.58;
}

.evidence-band,
.boundary-grid {
  margin: 0 clamp(16px, 5vw, 58px) clamp(20px, 5vw, 48px);
}

.evidence-band {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 24px;
  padding: clamp(20px, 4vw, 34px);
}

.boundary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.boundary-grid article {
  padding: clamp(20px, 4vw, 32px);
}

@media (max-width: 940px) {
  .hero,
  .workspace,
  .evidence-band,
  .boundary-grid,
  .rows-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .input-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar nav {
    display: none;
  }

  h1 {
    font-size: clamp(4rem, 24vw, 6.8rem);
  }

  .memo-list div {
    grid-template-columns: 1fr;
  }

  .button,
  button,
  .hero-actions,
  .form-actions {
    width: 100%;
  }
}
