:root {
  --paper: #fcf7ef;
  --paper-soft: #f3eadc;
  --ink: #1f2530;
  --ink-soft: #586172;
  --line: #d6c6ab;
  --accent: #cc5b2a;
  --accent-soft: #e88f53;
  --teal: #1f6f6c;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 20px 45px rgb(57 40 17 / 10%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Trebuchet MS", "Lucida Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(70rem 30rem at 90% -10%, rgb(204 91 42 / 16%) 0%, transparent 52%),
    radial-gradient(50rem 22rem at -8% 100%, rgb(31 111 108 / 18%) 0%, transparent 58%),
    var(--paper);
  line-height: 1.6;
}

.site-shell {
  position: relative;
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 2rem;
}

.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(42px);
  opacity: 0.35;
  pointer-events: none;
}

.glow-a {
  width: 180px;
  height: 180px;
  right: -20px;
  top: 20px;
  background: rgb(204 91 42 / 45%);
}

.glow-b {
  width: 150px;
  height: 150px;
  left: -20px;
  top: 280px;
  background: rgb(31 111 108 / 45%);
}

.panel {
  background: color-mix(in srgb, var(--paper), white 24%);
  border: 1px solid color-mix(in srgb, var(--line), transparent 8%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.site-header {
  display: grid;
  grid-template-columns: 1.2fr auto;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
}

.brand {
  margin: 0;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 700;
}

.site-header h1 {
  margin: 0.1rem 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.8rem, 4.2vw, 2.8rem);
}

.strap {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  max-width: 60ch;
}

.header-meta {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 0.45rem;
  text-align: right;
}

.header-meta p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--teal), transparent 30%);
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
}

.site-nav {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem;
}

.nav-link {
  border-radius: 999px;
  padding: 0.44rem 0.85rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 700;
}

.nav-link.active {
  background: linear-gradient(130deg, var(--accent-soft), var(--accent));
  color: #fff8ee;
}

.content-stack {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.95rem;
}

.hero {
  padding: 1.2rem 1.3rem;
}

.kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

.hero h2,
.hero h1 {
  margin: 0.35rem 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.5rem, 3.6vw, 2.35rem);
  line-height: 1.2;
}

.hero p {
  margin: 0.75rem 0 0;
  max-width: 70ch;
}

.cta-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.52rem 0.95rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 20%);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  background: #fff;
}

.button.primary {
  border-color: color-mix(in srgb, var(--accent), transparent 20%);
  background: linear-gradient(130deg, var(--accent-soft), var(--accent));
  color: #fff8ef;
}

.section-block {
  display: grid;
  gap: 0.6rem;
}

.section-header h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.feature-grid,
.action-grid,
.guide-grid,
.docs-grid,
.gallery-grid,
.profile-grid {
  display: grid;
  gap: 0.7rem;
}

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

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

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

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

.feature-card,
.action-card,
.guide-step,
.doc-card,
.profile-card,
.spec-shell,
.note {
  padding: 0.95rem 1rem;
}

.feature-card h3,
.action-card h3,
.guide-step h3,
.doc-card h3,
.profile-card h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.22rem;
}

.feature-card p,
.action-card p,
.guide-step p,
.doc-card p,
.profile-card p {
  margin: 0.45rem 0 0;
}

.action-card {
  text-decoration: none;
  color: inherit;
  background: color-mix(in srgb, var(--paper), white 20%);
  transition: transform 180ms ease, border-color 180ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent), transparent 30%);
}

.docs-code {
  margin-top: 0.8rem;
  background: #f4ecdf;
  border-radius: var(--radius-md);
  border: 1px solid #e2d4bd;
  padding: 0.85rem;
  overflow: auto;
}

.docs-code code {
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

.gallery-card {
  display: grid;
  grid-template-columns: minmax(145px, 180px) 1fr;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
  background: color-mix(in srgb, var(--paper), white 20%);
  transition: transform 180ms ease, border-color 180ms ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--teal), transparent 30%);
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--line), transparent 10%);
  background: #f5e0c5;
}

.gallery-copy h3 {
  margin: 0.1rem 0 0;
}

.gallery-copy p {
  margin: 0.4rem 0 0;
}

.private-panel {
  border-left: 5px solid var(--accent);
}

.private-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.private-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--line), transparent 18%);
  background: color-mix(in srgb, var(--paper-soft), white 25%);
}

.private-dots {
  color: var(--teal);
  font-weight: 700;
  letter-spacing: 0.22em;
}

.checklist-list {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
}

.submit-validator {
  display: grid;
  gap: 0.7rem;
}

.submit-validator-form {
  display: grid;
  gap: 0.55rem;
}

.submit-validator-form label {
  font-weight: 700;
}

.submit-validator-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--line), transparent 8%);
  background: #fffef9;
  color: var(--ink);
  font: 500 0.95rem/1.5 "Courier New", monospace;
  padding: 0.7rem 0.75rem;
  resize: vertical;
  min-height: 220px;
}

.submit-validator-input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent), white 18%);
  outline-offset: 1px;
}

.submit-validator-results {
  margin-top: 0.1rem;
  display: grid;
  gap: 0.45rem;
}

.submit-validator-pass {
  margin: 0;
  padding: 0.58rem 0.7rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, #d9f4e1, white 15%);
  border: 1px solid color-mix(in srgb, #3f8f5a, transparent 45%);
  color: #205436;
  font-weight: 700;
}

.submit-validator-summary {
  margin: 0;
  color: var(--ink-soft);
}

.submit-validator-issues {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.submit-validator-issue {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--line), transparent 15%);
  background: color-mix(in srgb, #fff4ed, white 16%);
}

.submit-validator-issue[data-severity="warning"] {
  background: color-mix(in srgb, #fff8de, white 20%);
}

.submit-validator-issue-line,
.submit-validator-issue-detail {
  margin: 0;
}

.submit-validator-issue-line {
  font-size: 0.84rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.submit-validator-issue-detail {
  margin-top: 0.2rem;
}

.note {
  border-left: 5px solid var(--teal);
}

.caspian-note {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed color-mix(in srgb, var(--line), transparent 25%);
  color: var(--teal);
  font-weight: 700;
}

.source-link {
  margin-top: 0.75rem;
}

.source-link a {
  color: var(--accent);
  font-weight: 700;
}

.citation-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

.citation-list a {
  color: var(--accent);
}

.muted {
  color: var(--ink-soft);
}

.spec-doc {
  max-height: 72vh;
  overflow: auto;
  padding-right: 0.5rem;
}

.spec-doc :where(h1, h2, h3, h4) {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 1.25;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
}

.spec-doc h1 {
  margin-top: 0;
  font-size: 2rem;
}

.spec-doc :where(p, li) {
  color: #2d3444;
}

.spec-doc pre {
  background: #f4ecdf;
  border-radius: var(--radius-md);
  border: 1px solid #e2d4bd;
  padding: 0.85rem;
  overflow: auto;
}

.spec-doc code {
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

.site-footer {
  margin-top: 0.95rem;
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.45rem;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.fallback-shell {
  min-height: 100vh;
  display: grid;
  align-content: center;
}

.stagger > * {
  animation: float-up 0.55s ease both;
}

.stagger > *:nth-child(2) {
  animation-delay: 70ms;
}

.stagger > *:nth-child(3) {
  animation-delay: 140ms;
}

.reveal {
  animation: float-up 0.55s ease both;
}

@keyframes float-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-grid,
  .gallery-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .site-shell {
    width: min(1100px, calc(100% - 1rem));
    padding-top: 0.85rem;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .header-meta {
    justify-items: start;
    text-align: left;
  }

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

  .gallery-card {
    grid-template-columns: 1fr;
  }

  .spec-doc {
    max-height: none;
  }
}