:root {
  color-scheme: light;
  --paper: #ffffff;
  --wash: #f6f8f7;
  --wash-strong: #eef4f0;
  --ink: #101512;
  --muted: #5e6962;
  --soft: #7b8780;
  --line: #d7dfda;
  --line-strong: #bcc8c1;
  --green: #0d6249;
  --green-strong: #084734;
  --green-soft: #dceee6;
  --blue: #315f82;
  --amber: #a87317;
  --danger: #a13d32;
  --shadow: 0 18px 45px rgba(24, 35, 28, 0.12);
  --shadow-soft: 0 10px 28px rgba(24, 35, 28, 0.08);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(13, 98, 73, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(13, 98, 73, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

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

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

svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(22px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid rgba(215, 223, 218, 0.82);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 760;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  content: "";
  border-radius: 999px;
  background: var(--green);
}

.brand-mark::before {
  width: 4px;
  height: 4px;
  top: 7px;
  left: 7px;
}

.brand-mark::after {
  width: 4px;
  height: 4px;
  right: 7px;
  bottom: 7px;
}

.brand-mark span {
  width: 13px;
  height: 2px;
  transform: rotate(45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  padding: 8px 10px;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--wash-strong);
  color: var(--ink);
  outline: none;
}

.header-action,
.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.91rem;
  font-weight: 760;
  letter-spacing: 0;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.header-action {
  min-height: 38px;
  padding: 0 13px;
  background: var(--ink);
  color: var(--paper);
}

.button {
  padding: 0 16px;
}

.button.primary {
  background: var(--green);
  color: var(--paper);
  box-shadow: 0 8px 18px rgba(13, 98, 73, 0.2);
}

.button.secondary {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.icon-button {
  width: 42px;
  flex: 0 0 42px;
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.header-action:hover,
.button.primary:hover,
.button.secondary:hover,
.icon-button:hover,
.header-action:focus-visible,
.button:focus-visible,
.icon-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 12px 24px rgba(24, 35, 28, 0.14);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--green-strong);
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - 68px);
  padding: 72px max(22px, calc((100vw - var(--max)) / 2)) 38px;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 120px;
  content: "";
  background: linear-gradient(180deg, transparent, var(--paper));
  pointer-events: none;
}

.hero-asset {
  position: absolute;
  inset: 0 0 auto auto;
  width: min(880px, 78vw);
  height: min(660px, 70vh);
  background-image:
    linear-gradient(90deg, var(--paper) 0%, rgba(255, 255, 255, 0.42) 34%, rgba(255, 255, 255, 0) 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 58%, var(--paper) 100%),
    url("assets/provenance-field.png");
  background-position: right top;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.82;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(380px, 0.72fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100svh - 180px);
}

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

.hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(4.2rem, 10.5vw, 8.6rem);
  font-weight: 820;
  line-height: 0.88;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 690px;
  margin: 32px 0 0;
  color: #35423b;
  font-size: clamp(1.17rem, 2vw, 1.42rem);
  line-height: 1.56;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.hero-panel,
.verify-panel,
.result-panel,
.layer-card,
.mode-card,
.continuity-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.hero-panel {
  width: min(100%, 520px);
  justify-self: end;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading h2,
.section-copy h2,
.continuity-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.78rem, 3.8vw, 3rem);
  font-weight: 790;
  line-height: 1.04;
  letter-spacing: 0;
}

.panel-heading h2 {
  font-size: 1.12rem;
  line-height: 1.2;
}

.panel-heading p,
.section-copy p,
.continuity-panel p {
  margin: 10px 0 0;
  color: var(--muted);
}

.panel-heading p {
  font-size: 0.9rem;
}

.state-chip {
  flex: 0 0 auto;
  border: 1px solid var(--green-soft);
  border-radius: 999px;
  background: #f0f8f4;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 780;
  padding: 5px 9px;
}

.drop-zone {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 96px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(13, 98, 73, 0.08), rgba(49, 95, 130, 0.05)),
    var(--paper);
  cursor: pointer;
}

.drop-zone.is-dragging {
  border-color: var(--green);
  background: var(--green-soft);
}

.drop-zone input,
.compact-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.drop-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: var(--paper);
  color: var(--green);
  box-shadow: inset 0 0 0 1px var(--line);
}

.drop-title,
.drop-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-title {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 760;
}

.drop-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 14px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--wash);
}

.segmented-control label {
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
}

.segmented-control span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.segmented-control input:checked + span {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(24, 35, 28, 0.08);
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.field-label input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
  outline: none;
}

.field-label input {
  min-height: 40px;
  margin-top: 7px;
  padding: 0 11px;
}

.field-label input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(13, 98, 73, 0.14);
}

.hash-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.hash-list div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
}

.hash-list dt {
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 820;
  text-transform: uppercase;
}

.hash-list dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proof-actions .button {
  flex: 1 1 auto;
}

.status-line {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.proof-link {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.proof-link a {
  color: var(--green);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section {
  position: relative;
  padding: 84px max(22px, calc((100vw - var(--max)) / 2));
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding-top: 0;
  padding-bottom: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.strip-item {
  min-height: 128px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.92);
}

.strip-item strong,
.strip-item span {
  display: block;
}

.strip-item strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.strip-item span {
  max-width: 300px;
  margin-top: 7px;
  color: var(--muted);
}

.section-copy {
  max-width: 730px;
}

.section-copy.narrow {
  max-width: 660px;
}

.verify-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  background: linear-gradient(180deg, var(--paper), var(--wash));
}

.registry-section {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(420px, 1fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: start;
  background:
    linear-gradient(180deg, rgba(246, 248, 247, 0.94), rgba(255, 255, 255, 0.96)),
    var(--wash);
}

.registry-section[hidden] {
  display: none;
}

.registry-grid {
  display: grid;
  gap: 14px;
}

.registry-facts {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.registry-facts div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
}

.registry-facts dt {
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 820;
  text-transform: uppercase;
}

.registry-facts dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registry-actions {
  display: flex;
  gap: 10px;
}

.registry-actions .button {
  flex: 1 1 0;
}

.verify-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(280px, 0.82fr);
  gap: 16px;
}

.verify-panel,
.result-panel {
  padding: 18px;
}

.compact-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 740;
}

.compact-file::after {
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

textarea {
  min-height: 168px;
  resize: vertical;
  padding: 12px;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}

.verify-panel .button {
  width: 100%;
  margin-top: 10px;
}

.result-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.result-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.result-row strong,
.result-row p {
  display: block;
  margin: 0;
}

.result-row strong {
  color: var(--ink);
}

.result-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.result-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
}

.result-row.is-pass .result-dot {
  border-color: var(--green);
  background: var(--green);
}

.result-row.is-warn .result-dot {
  border-color: var(--amber);
  background: var(--amber);
}

.result-row.is-fail .result-dot {
  border-color: var(--danger);
  background: var(--danger);
}

.architecture {
  background: var(--paper);
}

.architecture-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 34px;
}

.layer-card {
  min-height: 250px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.layer-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--wash);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 820;
}

.layer-card h3,
.mode-card h3 {
  margin: 48px 0 0;
  color: var(--ink);
  font-size: 1.36rem;
  line-height: 1.14;
}

.layer-card p,
.mode-card p,
.mode-card li {
  color: var(--muted);
}

.layer-card p {
  margin: 12px 0 0;
}

.timeline-section {
  background:
    linear-gradient(180deg, rgba(238, 244, 240, 0.7), rgba(255, 255, 255, 0.92)),
    var(--wash);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  min-height: 172px;
  padding: 24px 18px 20px;
  border-top: 2px solid var(--green);
}

.timeline li::before {
  position: absolute;
  top: -8px;
  left: 18px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: var(--paper);
  content: "";
}

.timeline span {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.timeline p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.modes-section {
  background: var(--paper);
}

.mode-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 34px;
}

.mode-card {
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.mode-card h3 {
  margin-top: 0;
}

.mode-card p {
  margin: 12px 0 0;
}

.mode-card ul {
  display: grid;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.mode-card li {
  position: relative;
  padding-left: 22px;
}

.mode-card li::before {
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 8px;
  height: 1px;
  background: var(--green);
  content: "";
}

.continuity-section {
  background:
    radial-gradient(circle at 18% 28%, rgba(13, 98, 73, 0.08), transparent 34%),
    linear-gradient(180deg, var(--wash), var(--paper));
}

.continuity-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.72fr);
  gap: 32px;
  align-items: center;
  padding: 34px;
}

.continuity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.continuity-grid span {
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 760;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px max(22px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.86);
}

.site-footer p {
  max-width: 760px;
  margin: 0;
}

.site-footer a {
  color: var(--paper);
  font-weight: 760;
}

.footer-links {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 980px) {
  .site-header {
    gap: 12px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding-top: 52px;
  }

  .hero-content,
  .verify-section,
  .registry-section,
  .continuity-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    justify-self: stretch;
    width: 100%;
  }

  .verify-grid {
    grid-template-columns: 1fr;
  }

  .architecture-grid,
  .timeline,
  .proof-strip {
    grid-template-columns: 1fr;
  }

  .timeline {
    gap: 18px;
  }

  .timeline li {
    min-height: 0;
    border-top: 0;
    border-left: 2px solid var(--green);
    padding: 0 0 8px 24px;
  }

  .timeline li::before {
    top: 4px;
    left: -8px;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 12px 16px;
  }

  .header-action span {
    display: none;
  }

  .header-action {
    width: 38px;
    padding: 0;
  }

  .hero {
    min-height: auto;
    padding: 42px 16px 28px;
  }

  .hero-content {
    min-height: 0;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 18vw, 4.4rem);
  }

  .hero-lede {
    margin-top: 24px;
    font-size: 1.05rem;
  }

  .hero-actions,
  .proof-actions,
  .registry-actions,
  .mode-columns {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .button,
  .proof-actions .button,
  .icon-button {
    width: 100%;
  }

  .icon-button {
    flex-basis: 42px;
  }

  .panel-heading {
    display: grid;
  }

  .hash-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .registry-facts div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .section {
    padding: 64px 16px;
  }

  .strip-item {
    padding: 22px 16px;
  }

  .mode-columns {
    display: grid;
  }

  .continuity-panel {
    padding: 22px;
  }

  .continuity-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    display: grid;
    padding: 24px 16px;
  }

  .footer-links {
    gap: 12px;
  }
}

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