:root {
  --paper: #fafaff;
  --mist: #f5f3ff;
  --ink: #1f2937;
  --muted: #4b5563;
  --rule: #e5e7f3;
  --accent: #4f46e5;
  --wash: #ede9fe;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14181d;
    --mist: #1b2128;
    --ink: #e7e6e1;
    --muted: #adb5c0;
    --rule: #3e4853;
    --accent: #aec4ff;
    --wash: #244a9a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}

main, header, footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--accent); }
a:focus-visible, main:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute;
  left: -999px;
  min-height: 44px;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 3; background: var(--paper); padding: .5rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.brand img { width: 3rem; height: 3rem; border-radius: 22%; }
.brand span { font-size: 1.25rem; font-weight: 700; }
nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
nav a { display: inline-flex; align-items: center; min-height: 44px; }
nav a[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration-thickness: 2px; }

.intro, .details { max-width: 44rem; margin-inline: auto; }
.details p a { display: inline-flex; align-items: center; min-height: 44px; }
.intro { padding-block: 3rem 2rem; }
.intro-icon { display: block; width: 6rem; height: 6rem; border-radius: 22%; }
.legal { max-width: 49rem; }

h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; margin: 1.5rem 0 1rem; }
h2 {
  font-size: 1.25rem;
  margin: 2.25rem 0 .5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
h3 { font-size: 1.05rem; margin: 1.5rem 0 .25rem; }
p, ul, dl { margin: .5rem 0; }
.lead { font-size: 1.15rem; color: var(--muted); }

.button {
  display: inline-block;
  margin: 1rem 0;
  padding: .65rem 1.25rem;
  background: var(--accent);
  color: var(--paper);
  border-radius: .5rem;
  font-weight: 600;
  text-decoration: none;
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.shots figure { min-width: 0; margin: 0; }
.shots img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: .5rem; }
.shots figcaption { color: var(--muted); margin-top: .75rem; text-align: center; }

.features { padding: 0; list-style: none; }
.features li { padding: .75rem 0 .75rem 1rem; border-left: 3px solid var(--wash); margin: .25rem 0; }
.features strong { display: block; }

.updated, .note { color: var(--muted); }

table { width: 100%; border-collapse: collapse; margin: .75rem 0; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .5rem .5rem .5rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; }
.table-wrap { overflow-x: auto; }
code { background: var(--mist); padding: .05rem .3rem; border-radius: .25rem; font-size: .9em; }

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}
footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

@media (max-width: 600px) {
  .site-header { position: sticky; top: 0; z-index: 2; }
  .intro { padding-block: 2rem 1rem; }
  .shots { grid-template-columns: 1fr; gap: 2rem; }
  .shots figure { width: min(100%, 20rem); justify-self: center; }

  .screen-story.is-pinned { --story-height: calc(100vh - var(--story-top)); height: calc(var(--story-height) * 5); }
  .is-pinned .shots { position: sticky; top: var(--story-top); height: var(--story-height); margin: 0; padding-block: 1rem; gap: 0; }
  .is-pinned figure { grid-area: 1 / 1; align-self: center; width: min(20rem, 100%, calc((var(--story-height) - var(--story-caption-height) - 48px) * .45)); opacity: 0; visibility: hidden; transition: opacity 160ms ease-out; }
  .is-pinned figure.is-current { opacity: 1; visibility: visible; }
}

@supports (height: 100svh) {
  .screen-story.is-pinned { --story-height: calc(100svh - var(--story-top)); }
}

@media (prefers-reduced-motion: reduce) {
  .is-pinned figure { transition: none; }
}
