:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #111827;
  --muted: #475569;
  --line: #cbd5e1;
  --line-strong: #94a3b8;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;
  --green: #047857;
  --green-soft: #dcfce7;
  --amber: #92400e;
  --amber-soft: #fef3c7;
  --danger: #b91c1c;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #121a2c;
    --surface-soft: #172033;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --line: #334155;
    --line-strong: #64748b;
    --blue: #93c5fd;
    --blue-soft: #1e3a8a;
    --green: #34d399;
    --green-soft: #064e3b;
    --amber: #fbbf24;
    --amber-soft: #451a03;
    --danger: #fca5a5;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

code,
pre,
textarea,
input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  transform: translateY(-140%);
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  z-index: 20;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.site-header__inner,
.site-footer__inner,
main > section {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 800;
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.brand__text {
  max-width: 18ch;
  line-height: 1.1;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a[aria-current="page"] {
  background: var(--surface-soft);
  color: var(--text);
}

.hero {
  padding: 5.5rem 0 3rem;
}

.hero__content {
  max-width: 820px;
}

.hero h1,
.page-intro h1 {
  margin: 0;
  font-size: 3.6rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p,
.page-intro p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.12rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.button,
button.button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--text);
  border-radius: 8px;
  padding: 0.68rem 0.95rem;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.button:focus,
.copy-button:hover,
.copy-button:focus {
  transform: translateY(-1px);
}

.button--secondary,
button.button--secondary {
  background: var(--surface);
  color: var(--text);
}

.button--ghost,
button.button--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(9, max-content);
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  max-width: 100%;
  margin-top: 3rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
}

.workflow-strip span:nth-child(odd) {
  color: var(--text);
  font-weight: 700;
}

.section-grid,
.principles-grid,
.doc-grid,
.lab-grid,
.artifact-grid {
  display: grid;
  gap: 1rem;
}

.section-grid {
  grid-template-columns: repeat(3, 1fr);
  padding: 2rem 0;
}

.section-grid > div,
.trust-principle,
.doc-card,
.tool-panel,
.artifact-card,
.download-block,
.contact-panel,
.static-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-width: 0;
}

.section-grid > div,
.trust-principle,
.doc-card,
.tool-panel,
.artifact-card,
.download-block,
.contact-panel {
  padding: 1.25rem;
}

.section-grid h2,
.trust-principle h2,
.doc-card h2,
.tool-panel h2,
.artifact-card h2,
.download-block h2,
.narrow-content h2,
.contact-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1.25rem;
  line-height: 1.25;
}

.content-band,
.principles-grid,
.doc-grid,
.lab-grid,
.download-list,
.narrow-content,
.contact-panel,
.filter-panel {
  margin-top: 2rem;
}

.content-band {
  padding: 2.5rem 0;
}

.section-heading {
  margin-bottom: 1rem;
  max-width: 760px;
}

.section-heading h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
}

.principles-grid {
  grid-template-columns: repeat(3, 1fr);
  padding: 2rem 0 3rem;
}

.principles-grid .section-heading {
  grid-column: 1 / -1;
}

.artifact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.artifact-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.artifact-card__topline {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.version {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.meta-grid div {
  min-width: 0;
}

.meta-grid dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.meta-grid dd {
  margin: 0;
  font-weight: 700;
}

.hash-display {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.hash-display__label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.hash-display code,
.hash-output,
.comparison-output {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.5;
}

.copy-button {
  min-height: 36px;
  padding: 0.5rem 0.7rem;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
}

.copy-button.is-copied {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--text);
}

.verification-note,
.note,
.content-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.page-intro {
  padding: 4rem 0 1rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.filter-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.doc-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 3rem;
}

.example-block,
.manifest-viewer {
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: auto;
  font-size: 0.88rem;
  max-width: 100%;
}

.example-block code,
.manifest-viewer code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lab-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 3rem;
}

.tool-panel {
  display: grid;
  align-content: start;
  gap: 0.8rem;
}

.tool-panel--wide {
  grid-column: 1 / -1;
}

.hash-output,
.comparison-output {
  min-height: 58px;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.comparison-output.is-match {
  border-color: var(--green);
  background: var(--green-soft);
}

.comparison-output.is-mismatch {
  border-color: var(--danger);
}

.download-list {
  display: grid;
  gap: 1rem;
  padding-bottom: 3rem;
}

.download-block {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) auto;
  gap: 1rem;
  align-items: center;
}

.timeline {
  display: grid;
  gap: 0.8rem;
  padding-left: 1.25rem;
}

.narrow-content {
  max-width: 820px;
  padding-bottom: 3rem;
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.static-form {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface-soft);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 0;
}

.site-footer p {
  max-width: 620px;
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-content: start;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--text);
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero h1,
  .page-intro h1 {
    font-size: 2.35rem;
  }

  .section-grid,
  .principles-grid,
  .artifact-grid,
  .doc-grid,
  .lab-grid,
  .filter-panel,
  .download-block,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .download-block {
    align-items: start;
  }
}

@media (max-width: 560px) {
  .site-header__inner,
  .site-footer__inner,
  main > section {
    width: min(100% - 1rem, 1120px);
  }

  .brand__text {
    max-width: 14ch;
  }

  .site-nav a {
    padding-inline: 0.48rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .button,
  button.button {
    width: 100%;
  }

  .workflow-strip {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .workflow-strip span:nth-child(even) {
    display: none;
  }

  .hash-display {
    grid-template-columns: 1fr;
  }

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

  .site-footer__inner {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}
