:root {
  --bg: #ece4d6;
  --bg-soft: #f5efe5;
  --paper: rgba(250, 246, 239, 0.78);
  --line: rgba(64, 58, 46, 0.18);
  --line-strong: rgba(64, 58, 46, 0.3);
  --text: #232019;
  --muted: #625b4f;
  --accent: #383229;
  --accent-soft: rgba(56, 50, 41, 0.08);
  --image-filter: saturate(0.58) sepia(0.1) hue-rotate(-8deg) contrast(0.95);
  --svg-sky: var(--bg);
  --svg-ground-1: #d8cfbf;
  --svg-ground-2: #c6b9a2;
  --svg-stone-1: #a59782;
  --svg-stone-2: #8f8472;
  --svg-stone-3: #9d907a;
  --svg-line-1: #bfb19a;
  --svg-line-2: #c6b9a2;
  --max: 1040px;
}

html[data-theme="paper"] {
  --bg: #f7f4ed;
  --bg-soft: #fffdfa;
  --paper: rgba(255, 255, 255, 0.92);
  --line: rgba(87, 79, 69, 0.1);
  --line-strong: rgba(87, 79, 69, 0.22);
  --text: #1f1c17;
  --muted: #746c61;
  --accent: #2d2924;
  --accent-soft: rgba(45, 41, 36, 0.06);
  --image-filter: grayscale(0.1) brightness(1.03) contrast(0.92);
  --svg-sky: var(--bg);
  --svg-ground-1: #ddd6ca;
  --svg-ground-2: #cbc2b2;
  --svg-stone-1: #aea496;
  --svg-stone-2: #8f8679;
  --svg-stone-3: #a1998a;
  --svg-line-1: #cfc3b2;
  --svg-line-2: #d6cbbe;
}

html[data-theme="stone"] {
  --bg: #d8dbd7;
  --bg-soft: #edf0ec;
  --paper: rgba(243, 246, 243, 0.8);
  --line: rgba(53, 60, 58, 0.18);
  --line-strong: rgba(53, 60, 58, 0.3);
  --text: #1d2422;
  --muted: #5c6662;
  --accent: #2a3330;
  --accent-soft: rgba(42, 51, 48, 0.08);
  --image-filter: grayscale(0.2) hue-rotate(12deg) saturate(0.62) contrast(0.94);
  --svg-sky: var(--bg);
  --svg-ground-1: #c8cdc9;
  --svg-ground-2: #b1b8b4;
  --svg-stone-1: #7f8b87;
  --svg-stone-2: #6d7874;
  --svg-stone-3: #8d9893;
  --svg-line-1: #a6b1ad;
  --svg-line-2: #b5bfbb;
}

html[data-theme="night"] {
  --bg: #131313;
  --bg-soft: #1d1c1a;
  --paper: rgba(33, 31, 28, 0.9);
  --line: rgba(226, 215, 194, 0.11);
  --line-strong: rgba(226, 215, 194, 0.22);
  --text: #efe6d6;
  --muted: #bcaf97;
  --accent: #e7d8bf;
  --accent-soft: rgba(231, 216, 191, 0.1);
  --image-filter: grayscale(0.38) brightness(0.68) contrast(1.08) sepia(0.18);
  --svg-sky: var(--bg);
  --svg-ground-1: #342d27;
  --svg-ground-2: #453c33;
  --svg-stone-1: #8d7a65;
  --svg-stone-2: #a38e77;
  --svg-stone-3: #b39d85;
  --svg-line-1: #6b5d4e;
  --svg-line-2: #7a6b5a;
}

html[data-theme="ash"] {
  --bg: #e6e5e2;
  --bg-soft: #f3f2ef;
  --paper: rgba(249, 249, 247, 0.82);
  --line: rgba(68, 67, 70, 0.14);
  --line-strong: rgba(68, 67, 70, 0.25);
  --text: #232427;
  --muted: #676a70;
  --accent: #36383d;
  --accent-soft: rgba(54, 56, 61, 0.08);
  --image-filter: grayscale(0.42) brightness(0.98) contrast(0.92);
  --svg-sky: var(--bg);
  --svg-ground-1: #d0d0d0;
  --svg-ground-2: #bbbbbd;
  --svg-stone-1: #83858b;
  --svg-stone-2: #6e7177;
  --svg-stone-3: #989aa0;
  --svg-line-1: #b5b6ba;
  --svg-line-2: #c0c1c6;
}

html[data-theme="clay"] {
  --bg: #e8ddd4;
  --bg-soft: #f4ece6;
  --paper: rgba(249, 242, 236, 0.84);
  --line: rgba(92, 62, 49, 0.13);
  --line-strong: rgba(92, 62, 49, 0.24);
  --text: #2e201a;
  --muted: #7a6258;
  --accent: #6c4a3e;
  --accent-soft: rgba(108, 74, 62, 0.08);
  --image-filter: sepia(0.28) saturate(0.74) hue-rotate(-10deg) contrast(0.95);
  --svg-sky: var(--bg);
  --svg-ground-1: #d7c2b2;
  --svg-ground-2: #c2a692;
  --svg-stone-1: #9f7667;
  --svg-stone-2: #875f52;
  --svg-stone-3: #b08979;
  --svg-line-1: #c0a28e;
  --svg-line-2: #c9ae9b;
}

html[data-theme="mist"] {
  --bg: #dde5e8;
  --bg-soft: #eef3f4;
  --paper: rgba(247, 250, 250, 0.82);
  --line: rgba(58, 74, 79, 0.12);
  --line-strong: rgba(58, 74, 79, 0.22);
  --text: #203035;
  --muted: #607277;
  --accent: #345058;
  --accent-soft: rgba(52, 80, 88, 0.08);
  --image-filter: grayscale(0.18) hue-rotate(22deg) saturate(0.72) brightness(1.02);
  --svg-sky: var(--bg);
  --svg-ground-1: #c8d6d8;
  --svg-ground-2: #b1c2c5;
  --svg-stone-1: #6f8b90;
  --svg-stone-2: #5c767a;
  --svg-stone-3: #87a1a6;
  --svg-line-1: #a7bcc0;
  --svg-line-2: #b7cbcf;
}

html[data-theme="ember"] {
  --bg: #221a18;
  --bg-soft: #302320;
  --paper: rgba(46, 35, 31, 0.88);
  --line: rgba(229, 197, 168, 0.12);
  --line-strong: rgba(229, 197, 168, 0.22);
  --text: #f1dfcf;
  --muted: #c4a893;
  --accent: #d38a60;
  --accent-soft: rgba(211, 138, 96, 0.12);
  --image-filter: sepia(0.32) saturate(0.82) brightness(0.82) contrast(1.02);
  --svg-sky: var(--bg);
  --svg-ground-1: #53382d;
  --svg-ground-2: #6d4a3a;
  --svg-stone-1: #b06f53;
  --svg-stone-2: #8d5a44;
  --svg-stone-3: #ca855f;
  --svg-line-1: #8f654f;
  --svg-line-2: #a7775c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  line-height: 1.7;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0)) 0 0 / 100% 100%,
    var(--bg);
  transition: background-color 180ms ease, color 180ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black, rgba(0, 0, 0, 0.35));
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, white 8%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-strong);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.site-header .shell {
  display: grid;
  grid-template-columns: 1fr minmax(0, 2fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
}

.header-tools {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
}

.brand {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font: 700 0.72rem/1 "Segoe UI", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark::before {
  content: "◇";
  font-size: 0.8rem;
}

.brand-title {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.04rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 0.25rem;
}

.nav a {
  padding: 0.45rem 0.55rem;
  text-decoration: none;
  color: var(--muted);
  font: 600 0.9rem/1.1 "Segoe UI", sans-serif;
}

.nav a.active,
.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
  background: var(--accent-soft);
}

.theme-switcher {
  display: grid;
  justify-items: end;
  gap: 0.2rem;
  color: var(--muted);
  font: 600 0.65rem/1 "Segoe UI", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.theme-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 0.16rem;
  border: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent 30%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 78%, transparent 22%);
}

.theme-button {
  padding: 0.34rem 0.55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 0.74rem/1 "Segoe UI", sans-serif;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.theme-button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg-soft);
}

.theme-button:hover,
.theme-button:focus-visible {
  background: var(--accent-soft);
  color: var(--text);
}

.theme-button:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--accent) 45%, transparent 55%);
  outline-offset: 1px;
}

main {
  padding: 2rem 0 4rem;
}

.hero,
.split,
.gallery,
.footer-block {
  display: grid;
  gap: 1.5rem;
}

.hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  padding: 1.2rem 0 2.4rem;
}

.eyebrow,
.mini-label {
  display: inline-block;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font: 700 0.72rem/1.1 "Segoe UI", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  line-height: 1.08;
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  max-width: 10ch;
  font-size: clamp(2.5rem, 5.4vw, 4.8rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
  max-width: 65ch;
}

.lead {
  max-width: 42rem;
  font-size: 1.16rem;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  text-decoration: none;
  font: 700 0.92rem/1 "Segoe UI", sans-serif;
}

.button {
  background: var(--accent);
  color: var(--bg-soft);
}

.button-secondary {
  background: transparent;
}

.hero-copy,
.hero-side,
.section,
.footer-box {
  position: relative;
}

.hero-copy::before,
.hero-side::before,
.section::before,
.footer-box::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.hero-copy,
.hero-side,
.section,
.footer-box {
  padding-top: 1.1rem;
}

.hero-side,
.image-break,
.split > *,
.link-list li,
.qa-list li {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.section {
  padding-bottom: 2.2rem;
}

.section-head {
  max-width: 42rem;
  margin-bottom: 1rem;
}

.section-head h2,
.section > h1,
.section > h2 {
  max-width: 18ch;
}

.plain-list,
.steps,
.qa-list,
.link-list,
.subnav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qa-list,
.link-list,
.subnav-list {
  display: grid;
  gap: 0.95rem;
}

.plain-list li,
.steps li,
.qa-list li,
.link-list li,
.subnav-list li {
  padding: 0.85rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.plain-list li:first-child,
.steps li:first-child,
.qa-list li:first-child,
.link-list li:first-child,
.subnav-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.steps strong,
.qa-list strong,
.link-list strong,
.subnav-list strong {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 1.02rem;
}

.split {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.6rem 2rem;
}

.split > * {
  position: relative;
  padding: 1rem 1rem 0;
  background: transparent;
  border-radius: 0.75rem;
}

.split > *::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-top: 0;
}

.split > *:nth-child(even) {
  background: color-mix(in srgb, var(--bg-soft) 70%, white 30%);
}

.split > *:nth-child(odd) {
  background: color-mix(in srgb, var(--paper) 75%, transparent 25%);
}

.link-list li,
.qa-list li {
  padding: 0.95rem 0.9rem;
  border-radius: 0.75rem;
}

.subnav-list li {
  padding: 0.95rem 0.9rem;
  border-radius: 0.75rem;
}

.link-list li:nth-child(even),
.qa-list li:nth-child(even) {
  background: color-mix(in srgb, var(--bg-soft) 72%, white 28%);
}

.link-list li:nth-child(odd),
.qa-list li:nth-child(odd) {
  background: color-mix(in srgb, var(--paper) 78%, transparent 22%);
}

.subnav-list li:nth-child(even) {
  background: color-mix(in srgb, var(--bg-soft) 72%, white 28%);
}

.subnav-list li:nth-child(odd) {
  background: color-mix(in srgb, var(--paper) 78%, transparent 22%);
}

.prose {
  max-width: 52rem;
}

.prose h2,
.prose h3 {
  max-width: none;
  margin-top: 1.8rem;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  max-width: 44rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--paper) 82%, transparent 18%);
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.image-break {
  margin: 0 0 2rem;
  background: var(--paper);
  border: 1px solid rgba(64, 58, 46, 0.1);
}

.image-break img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  filter: var(--image-filter);
}

.image-break svg {
  width: 100%;
  height: auto;
  display: block;
}

.image-break svg .sky { fill: var(--svg-sky); }
.image-break svg .ground-1 { fill: var(--svg-ground-1); }
.image-break svg .ground-2 { fill: var(--svg-ground-2); }
.image-break svg .stone-1 { fill: var(--svg-stone-1); }
.image-break svg .stone-2 { fill: var(--svg-stone-2); }
.image-break svg .stone-3 { fill: var(--svg-stone-3); }
.image-break svg .line-1 { stroke: var(--svg-line-1); }
.image-break svg .line-2 { stroke: var(--svg-line-2); }

.image-break figcaption {
  padding: 0.65rem 0.8rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.symbol-line {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font: 700 0.78rem/1 "Segoe UI", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.symbol-line::before,
.symbol-line::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--line-strong);
}

.footer-block {
  padding-bottom: 2rem;
}

@media (max-width: 920px) {
  .site-header .shell,
  .hero,
  .split {
    grid-template-columns: 1fr;
  }

  .header-tools {
    justify-items: stretch;
    gap: 0.6rem;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: auto;
  }

  .nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(calc(100% - 1rem), var(--max));
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

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

  .theme-switcher {
    display: grid;
    gap: 0.35rem;
    justify-items: start;
  }

  .theme-switcher span {
    font-size: 0.62rem;
  }

  .theme-buttons {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .theme-buttons::-webkit-scrollbar {
    display: none;
  }

  .theme-button {
    width: auto;
    flex: 0 0 auto;
  }

  .split {
    gap: 0.85rem;
  }

  .split > * {
    padding: 0.9rem 0.85rem 0.1rem;
  }

  .link-list li,
  .qa-list li {
    padding: 0.8rem 0.75rem;
  }
}
