:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  --ink: #232035;
  --muted: #575268;
  --accent: #56347a;
  --line: #dcd7e7;
  --paper: #f6f5fa;
  --surface: #fff;
  --band: #efebf6;
  --control-line: #b9acc9;
  --icon-bg: #eee3f7;
  --primary: #56347a;
  --primary-hover: #41245f;
  --on-primary: #fff;
  --focus: #7840a8;
  --hero-glow: #e6daf4;
  --gutter: clamp(16px, 4vw, 56px);
  --header-height: 72px;
  --section-space: clamp(48px, 7vw, 104px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f9f7ff;
  --muted: #dcd2ef;
  --accent: #d5b3ed;
  --line: #40394a;
  --paper: #131222;
  --surface: #201e28;
  --band: #191625;
  --control-line: #746784;
  --icon-bg: #39324a;
  --primary: #d5b3ed;
  --primary-hover: #e7c8fa;
  --on-primary: #251931;
  --focus: #e2bbf8;
  --hero-glow: #30234c;
}

::view-transition {
  pointer-events: none;
}

::view-transition-group(root) {
  animation-duration: 320ms;
  animation-timing-function: ease-in-out;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding-bottom: env(safe-area-inset-bottom); line-height: 1.55; }
a { color: inherit; }
img { display: block; }
section[id], .walkthrough-frame { scroll-margin-top: 24px; }
h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 3;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  transform: translateY(calc(-100% - 12px));
  padding: 8px 14px;
  background: var(--surface);
}
.skip-link:focus { transform: none; }

.shell {
  --inset-start: max(var(--gutter), env(safe-area-inset-left));
  --inset-end: max(var(--gutter), env(safe-area-inset-right));
  width: min(1248px, calc(100% - var(--inset-start) - var(--inset-end)));
  margin-left: max(var(--inset-start), calc((100% - 1248px) / 2));
}
.site-header { padding-top: env(safe-area-inset-top); border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { min-height: var(--header-height); display: flex; align-items: center; gap: clamp(12px, 2.25vw, 28px); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -.045em;
  white-space: nowrap;
  text-decoration: none;
}
.brand img { border-radius: 8px; }
.brand-accent { color: var(--accent); }
.header-inner nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.header-inner nav a, .footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--muted);
}
.header-inner nav a { padding-inline: 12px; border-radius: 8px; }
.header-inner nav a:hover, .footer-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.header-inner nav .nav-download { gap: 8px; color: var(--accent); background: var(--icon-bg); }
.theme-switch:not([hidden]) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-inline-start: auto;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.theme-switch:hover { border-color: var(--accent); }
.theme-switch span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 28px;
  border-radius: 4px;
  font: 1.1rem/1 system-ui, sans-serif;
}
.theme-switch[aria-checked="false"] span:first-child,
.theme-switch[aria-checked="true"] span:last-child {
  background: var(--icon-bg);
  color: var(--accent);
}

.hero-band {
  background: radial-gradient(ellipse at 81% 20%, var(--hero-glow), transparent 62%);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: center;
  gap: clamp(24px, 4vw, 60px);
  padding-block: var(--section-space);
}
.eyebrow {
  color: var(--accent);
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2 { line-height: 1.04; letter-spacing: -.055em; font-weight: 750; text-wrap: balance; }
.keep-together { white-space: nowrap; }
h1 { max-width: 13ch; font-size: clamp(2.75rem, 5.6vw, 5.25rem); margin-block: 16px 22px; }
h1 em { color: var(--accent); font-style: normal; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
.hero-description { color: var(--muted); max-width: 43ch; font-size: clamp(1.05rem, 1.6vw, 1.23rem); text-wrap: pretty; }
.hero-copy > .button { margin-top: 30px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 650;
  font-size: .9rem;
  text-decoration: none;
}
.button-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 3px 7px #2118392b; }
.button-primary:hover { background: var(--primary-hover); }
.button:active { box-shadow: none; }

.walkthrough-frame { display: block; padding: clamp(2px, .45vw, 6px); border: 1px solid var(--control-line); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 42px -20px #21183980; text-decoration: none; }
.walkthrough-frame img { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; }
.walkthrough-frame > span { display: block; padding: 6px 10px; }
.walkthrough-frame:hover > span { text-decoration: underline; }

.section-band { padding-block: var(--section-space); border-block: 1px solid var(--line); background: var(--band); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
}
.feature-card { min-width: 0; padding: clamp(20px, 2.4vw, 32px); background: var(--surface); }
.feature-card h3 { margin: 16px 0 5px; font-size: 1.25rem; letter-spacing: -.025em; }
.feature-card p, .feature-note { color: var(--muted); }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: var(--icon-bg); color: var(--accent); }
.feature-icon i { position: relative; display: block; width: 18px; height: 15px; border: 1.6px solid currentColor; border-radius: 3px; }
.feature-icon i::before, .feature-icon i::after { content: ""; position: absolute; }
.video-icon i::before { top: 3px; left: 5px; border-block: 3px solid transparent; border-left: 5px solid currentColor; }
.image-icon i::before { left: 2px; bottom: 2px; width: 11px; height: 7px; background: currentColor; clip-path: polygon(0 100%, 35% 32%, 54% 60%, 75% 0, 100% 100%); }
.image-icon i::after { left: 3px; top: 2px; width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.pdf-icon i { width: 13px; height: 18px; }
.pdf-icon i::before { left: 2px; right: 2px; top: 7px; height: 4px; border-block: 1px solid currentColor; }
.rename-icon i::before { top: 1px; left: 7px; width: 1px; height: 10px; background: currentColor; }
.rename-icon i::after { top: 1px; left: 5px; width: 5px; height: 10px; border-block: 1px solid currentColor; }
.feature-note { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-top: 22px; font-size: .94rem; }
.text-link { color: var(--accent); font-weight: 650; text-underline-offset: 3px; }
.text-link:hover { text-decoration-thickness: 2px; }

.downloads { border-top: 0; background: var(--paper); }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 16px; align-items: start; }
.download-card { min-width: 0; padding: clamp(20px, 2.4vw, 30px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.download-card h3 { font-size: 1.4rem; letter-spacing: -.025em; }
.download-card p { min-block-size: 2lh; color: var(--muted); font-size: .94rem; }
.download-actions { margin-top: 18px; font-size: .9rem; min-block-size: calc(48px + 10px + 1lh); }
.download-card .button { width: 100%; }
.download-actions > .text-link { display: block; width: fit-content; margin-top: 10px; }
.download-card summary { cursor: pointer; list-style: none; }
.download-card summary::-webkit-details-marker { display: none; }
.download-card summary span { display: inline-block; }
.download-card details[open] summary span { transform: rotate(180deg); }
.package-list { display: grid; padding: 0; margin: 14px 0 0; list-style: none; }
.package-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; padding-block: 10px; border-top: 1px solid var(--line); }
.package-list li > span:first-child { font-size: .88rem; font-weight: 650; }
.package-arches { display: flex; gap: 10px; font-size: .88rem; }
.download-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; font-size: .94rem; }
.download-access { margin-top: 8px; color: var(--muted); font-size: .88rem; }

.site-footer { min-height: 88px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 16px; }
.footer-links { display: flex; gap: 0 20px; flex-wrap: wrap; }

@media (min-width: 741px) and (min-height: 420px) {
  :root { scroll-padding-top: calc(var(--header-height) + env(safe-area-inset-top) + 1px); }
  .site-header { position: sticky; top: 0; z-index: 2; }
}

@media (prefers-reduced-motion: no-preference) {
  :root { scroll-behavior: smooth; }
  :root:has(.skip-link:focus) { scroll-behavior: auto; }

  .walkthrough-frame { animation: hero-appear 480ms cubic-bezier(.2, .65, .3, 1); }
  .button, .theme-switch, .header-inner nav a {
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
  }
  .download-card summary span { transition: transform 180ms ease; }

  @supports selector(details::details-content) and (interpolate-size: allow-keywords) {
    details.download-actions::details-content {
      display: flow-root;
      interpolate-size: allow-keywords;
      block-size: 0;
      opacity: 0;
      overflow: clip;
      overflow-clip-margin: 7px;
      transition: block-size 260ms ease, opacity 180ms ease, content-visibility 260ms allow-discrete;
    }
    details.download-actions[open]::details-content { block-size: auto; opacity: 1; }
  }
}

@keyframes hero-appear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 740px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  h1 { font-size: clamp(2.6rem, 8.5vw, 4rem); }
}

@media (max-width: 620px) {
  .header-inner { gap: 10px; padding-block: 10px; flex-wrap: wrap; }
  .header-inner nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .header-inner nav a { justify-content: center; padding-inline: 4px; text-align: center; }
  .header-inner nav .nav-download { gap: 4px; }
}

@media (max-width: 420px) {
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-copy > .button { width: 100%; }
}

@media (max-width: 360px) {
  .header-inner nav a { font-size: .84rem; }
}
