:root {
  color-scheme: light dark;
  --bg: #f7f2ed;
  --surface: #ffffff;
  --surface-alt: #f1eae3;
  --text: #1a1a1a;
  --muted: #6a625b;
  --accent: #b24a2b;
  --accent-strong: #8f3b22;
  --heatmap-accent: #3b82f6;
  --border: #e4d9cf;
  --shadow: 0 28px 70px rgba(42, 28, 18, 0.14);
  --glow: rgba(178, 74, 43, 0.22);
  --radius: 22px;
  --max-width: 1120px;
  --font-serif-chic: "Playfair Display", serif;
  --font-sans-chic: "DM Sans", sans-serif;
  --font-serif-pro: "Merriweather", serif;
  --font-sans-pro: "Manrope", sans-serif;
}

@media (min-width: 1280px) {
  :root {
    --max-width: 1240px;
  }
}

@media (min-width: 1440px) {
  :root {
    --max-width: 1320px;
  }
}

@media (min-width: 1680px) {
  :root {
    --max-width: 1400px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans-chic);
  color: var(--text);
  background: radial-gradient(circle at top, #fbf7f2 0%, #f7f2ed 45%, #f0ece7 100%);
  line-height: 1.6;
}

body[data-font="professional"] {
  font-family: var(--font-sans-pro);
}

body[data-font="professional"] h1,
body[data-font="professional"] h2,
body[data-font="professional"] h3,
body[data-font="professional"] .brand-title,
body[data-font="professional"] .feature-header h2,
body[data-font="professional"] .metric-value {
  font-family: var(--font-serif-pro);
}

body[data-theme="dark"] {
  --bg: #141210;
  --surface: #1c1916;
  --surface-alt: #26211d;
  --text: #f6f1ea;
  --muted: #b3a79b;
  --accent: #f2b279;
  --accent-strong: #e79a5a;
  --heatmap-accent: #6ea8ff;
  --border: #2f2a25;
  --glow: rgba(242, 178, 121, 0.24);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  background: radial-gradient(circle at top, #1f1b17 0%, #141210 55%, #0f0d0b 100%);
}

body[data-theme="dark"] .hybrid-header {
  background: rgba(22, 18, 16, 0.9);
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 18px;
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 999px;
}

.skip-link:focus {
  left: 18px;
  z-index: 1000;
}

.hybrid-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 6vw;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.history-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 18px 6vw;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

body[data-theme="dark"] .history-header {
  background: rgba(22, 18, 16, 0.9);
}

.history-brand {
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.history-back {
  justify-self: center;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-back:hover {
  color: var(--text);
}

.history-controls {
  justify-self: end;
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand-link {
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.brand {
  display: grid;
  gap: 4px;
}

.brand-title {
  font-family: var(--font-serif-chic);
  font-size: 1.5rem;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hybrid-nav {
  display: flex;
  gap: 22px;
  font-size: 0.9rem;
  color: var(--muted);
  align-items: center;
}

.hybrid-nav a:hover {
  color: var(--text);
}

.nav-donate {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: 1px solid transparent;
  box-shadow: 0 12px 30px rgba(178, 74, 43, 0.25);
}

.nav-donate:hover {
  background: var(--accent-strong);
  color: #fff;
}

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.theme-toggle,
.font-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
}

.font-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 6vw 80px;
}

.hero {
  display: grid;
  gap: 48px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  padding-top: 30px;
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.hero h1 {
  font-family: var(--font-serif-chic);
  font-size: clamp(2.6rem, 4vw, 3.8rem);
  margin: 10px 0;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.cta-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.btn-primary {
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.btn-disabled {
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.cta-note {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.hero-side {
  display: grid;
  gap: 18px;
}

.hero-media {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.hero-media-image {
  display: block;
  overflow: hidden;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.hero-media-image img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-media-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-card {
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card.callout {
  background: linear-gradient(135deg, rgba(178, 74, 43, 0.1), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(178, 74, 43, 0.25);
  box-shadow: 0 30px 70px var(--glow);
}

.callout-label {
  font-family: var(--font-sans-chic);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.callout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.callout-value {
  font-weight: 600;
}

.callout-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.metrics {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 60px;
  align-items: center;
}

.press-quotes {
  margin-top: 70px;
}

.quote-grid {
  margin-top: 24px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.quote-grid blockquote {
  margin: 0;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.quote-grid cite {
  font-style: normal;
  color: var(--muted);
  font-size: 0.85rem;
}

.metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.metric-card {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.metric-value {
  font-family: var(--font-serif-chic);
  font-weight: 700;
  font-size: 1.2rem;
}

.metric-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.features {
  margin-top: 70px;
}

.feature-header h2 {
  font-family: var(--font-serif-chic);
  margin-bottom: 8px;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.feature-header p {
  color: var(--muted);
  max-width: 520px;
}

.feature-grid {
  margin-top: 28px;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-grid article {
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.page-hero {
  display: grid;
  gap: 16px;
  padding-top: 20px;
}

.history-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 6vw 80px;
}

.history-hero {
  display: grid;
  gap: 12px;
}

.history-hero h1 {
  font-family: var(--font-serif-chic);
  font-size: clamp(2.2rem, 3.6vw, 3rem);
  margin: 0;
}

.history-table-block {
  margin-top: 28px;
}

.page-hero h1 {
  font-family: var(--font-serif-chic);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  margin: 0;
}

.page-lede {
  color: var(--muted);
  max-width: 560px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.release-highlights {
  margin-top: 60px;
}

.release-grid {
  margin-top: 24px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.release-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.release-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.release-table thead th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.release-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.release-table tbody tr:last-child td {
  border-bottom: none;
}

.release-table-date {
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.release-table-version {
  white-space: nowrap;
  font-weight: 600;
}

.release-table-title {
  font-weight: 600;
}

.release-table-notes {
  color: var(--muted);
}

.release-bullets {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
}

.release-details {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  display: grid;
  gap: 6px;
}

.release-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.release-tags {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.timeline-section {
  margin-top: 60px;
}

.timeline-mermaid {
  margin-top: 20px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}

.timeline-mermaid .mermaid {
  min-width: 720px;
}

.release-archive {
  margin-top: 70px;
}

.release-archive.is-hidden {
  display: none;
}

.release-notes {
  margin-top: 24px;
  display: grid;
  gap: 20px;
}

.release-notes[data-release-format="table"] {
  display: block;
  margin-top: 18px;
  padding: 8px 6px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}

.release-note {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.release-note-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.release-note-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.release-archive-note {
  margin-top: 16px;
  color: var(--muted);
}

.release-archive-link {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.release-archive-link:hover {
  color: var(--text);
}

.timeline {
  margin-top: 20px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.timeline-item {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  display: grid;
  gap: 8px;
}

.timeline-year {
  font-weight: 600;
}

.timeline-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-bar {
  height: 8px;
  border-radius: 999px;
  width: calc(var(--strength, 40) * 1%);
  max-width: 100%;
  background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0));
}

.screenshots {
  margin-top: 60px;
}

.screenshot-grid {
  margin-top: 24px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.screenshot-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.shot-image {
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shot-image:hover,
.shot-image:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.shot-img {
  width: 100%;
  height: auto;
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 8, 0.65);
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-panel {
  max-width: min(1100px, 92vw);
  max-height: 85vh;
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.lightbox-image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lightbox-close {
  justify-self: end;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

body[data-theme="light"] .shot-img.is-light,
body[data-theme="dark"] .shot-img.is-dark {
  display: block;
}

.shot-placeholder {
  height: 180px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(178, 74, 43, 0.18), rgba(255, 255, 255, 0.95));
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 12px;
}

.screenshot-caption {
  color: var(--muted);
  font-size: 0.85rem;
}

.privacy-page {
  margin-top: 60px;
}

.privacy-content {
  display: grid;
  gap: 20px;
  max-width: 760px;
}

.privacy-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.seo-copy {
  margin-top: 70px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.seo-copy h2 {
  font-family: var(--font-serif-chic);
  margin-top: 0;
}

.seo-copy p {
  color: var(--muted);
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-links a:hover {
  color: var(--text);
}

.search {
  margin-top: 70px;
  display: grid;
  gap: 16px;
}

.search.search-compact {
  gap: 8px;
}

.search-heatmap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
}

.search-heatmap.is-empty {
  display: none;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0;
}

.search-heatmap.is-unfiltered {
  box-shadow: 0 0 0 2px var(--heatmap-accent);
}

.search-heatmap.is-filtered {
  box-shadow: none;
}

.heatmap-bar {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  height: 55px;
}

.heatmap-bar.is-empty {
  display: none;
}

.heatmap-segment {
  height: 100%;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0;
  cursor: pointer;
  background: transparent;
  line-height: 1;
}

.heatmap-segment.is-active {
  box-shadow: 0 0 0 2px var(--heatmap-accent);
}

.heatmap-segment:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.search-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
}

.search-results {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: none;
  gap: 8px;
}

.search-results.is-open {
  display: grid;
}

.search-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.search-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.search-snippet {
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.search-tags {
  font-size: 0.75rem;
  color: var(--muted);
}

.search-empty {
  font-size: 0.85rem;
  color: var(--muted);
}

.kbd {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
}

.download {
  margin-top: 70px;
}

.download-card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

.donate-code-card {
  border: 1px solid rgba(178, 74, 43, 0.25);
  box-shadow: 0 22px 50px var(--glow);
}

.donate-code-value {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--surface-alt);
  font-weight: 700;
  letter-spacing: 0.14em;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-secondary {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
}

.privacy {
  margin-top: 70px;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.privacy-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 30px 0 50px;
}

.sticky-cta {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: none;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 20;
}

.sticky-cta .btn-secondary {
  padding: 10px 14px;
}

.hero,
.metrics,
.press-quotes,
.features,
.page-hero,
.history-hero,
.release-highlights,
.timeline-section,
.release-archive,
.history-table-block,
.screenshots,
.privacy-page,
.search,
.download,
.privacy,
.site-footer {
  opacity: 0;
  transform: translateY(16px);
}

body.is-loaded .hero,
body.is-loaded .metrics,
body.is-loaded .press-quotes,
body.is-loaded .features,
body.is-loaded .page-hero,
body.is-loaded .history-hero,
body.is-loaded .release-highlights,
body.is-loaded .timeline-section,
body.is-loaded .release-archive,
body.is-loaded .history-table-block,
body.is-loaded .screenshots,
body.is-loaded .privacy-page,
body.is-loaded .search,
body.is-loaded .download,
body.is-loaded .privacy,
body.is-loaded .site-footer {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@media (max-width: 960px) {
  .hybrid-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hybrid-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding-right: 28px;
  }

  .hybrid-nav::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 28px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface));
  }

  .history-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .history-back {
    justify-self: start;
  }

  .history-controls {
    justify-self: start;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .cta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-controls {
    flex-wrap: wrap;
  }

  .sticky-cta {
    display: flex;
  }
}
