:root {
  --ink: #151515;
  --muted: #626262;
  --line: #dedede;
  --soft: #f5f5f3;
  --paper: #ffffff;
  --max: 1180px;
  --reading: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-color: #a8a8a8;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.65rem 0.9rem;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.nav {
  width: min(calc(100% - 2rem), var(--max));
  min-height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.9rem;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  font-weight: 700;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  min-height: 620px;
  padding: 5rem 0;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  font-weight: 760;
  line-height: 1.14;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 820px;
  margin-bottom: 1.5rem;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

h3 {
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  font-size: 1.55rem;
}

h4 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.08rem;
  letter-spacing: -0.015em;
}

p,
ul,
ol {
  margin-top: 0;
  margin-bottom: 1.2rem;
}

.lede {
  max-width: 680px;
  color: #353535;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}

.hero-art {
  width: min(100%, 420px);
  justify-self: end;
  border: 1px solid var(--line);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: #333;
  border-color: #333;
  color: white;
}

.button.secondary {
  background: white;
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.section-heading p {
  max-width: 700px;
  color: var(--muted);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.guide-card {
  min-height: 300px;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: white;
}

.guide-card p {
  color: var(--muted);
}

.guide-card .version {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guide-card h3 {
  margin-top: 0;
  font-size: 1.8rem;
}

.guide-link {
  font-weight: 750;
}

.gallery {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 1rem;
}

.gallery figure {
  margin: 0;
}

.gallery img {
  width: 100%;
  height: 100%;
  min-height: 250px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.gallery figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.video-block {
  max-width: 900px;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.notice {
  margin: 1rem 0 2rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--ink);
  background: var(--soft);
  color: #353535;
}

.notice strong {
  color: var(--ink);
}

.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Guide layout */
.guide-hero {
  max-width: 900px;
  padding: 5rem 0 3.5rem;
}

.guide-hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
}

.guide-hero .lede {
  max-width: 760px;
}

.guide-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, var(--reading));
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding-bottom: 6rem;
}

.toc {
  position: sticky;
  top: 94px;
  padding-top: 0.3rem;
  font-size: 0.84rem;
}

.toc-title {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li {
  margin-bottom: 0.38rem;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
}

.article {
  min-width: 0;
}

.article > section {
  padding: 0 0 4rem;
  margin-bottom: 4rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 92px;
}

.article > section:last-child {
  border-bottom: 0;
}

.article h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

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

.article figure {
  margin: 2rem 0;
}

.article figure img,
.article figure video {
  width: 100%;
  max-height: 560px;
  border: 1px solid var(--line);
  background: var(--soft);
  object-fit: contain;
}

.article figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.media-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.media-pair figure {
  margin: 0;
}

.media-pair img {
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
}

.article .video-frame {
  margin: 1.5rem 0;
}

.steps {
  padding-left: 1.4rem;
}

.steps li {
  padding-left: 0.35rem;
  margin-bottom: 0.8rem;
}

.data-table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.data-table th,
.data-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plain-card {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
}

.plain-card h3,
.plain-card h4 {
  margin-top: 0;
}

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

@media (max-width: 850px) {
  .hero,
  .section-heading,
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 3.5rem 0;
  }

  .hero-art {
    width: min(75%, 360px);
    justify-self: start;
  }

  .toc {
    position: static;
    padding: 1rem;
    border: 1px solid var(--line);
    columns: 2;
  }

  .toc-title {
    column-span: all;
  }

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

  .gallery figure:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.85rem 0;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.78rem;
  }

  .site-header {
    position: static;
  }

  .guide-grid,
  .gallery,
  .media-pair {
    grid-template-columns: 1fr;
  }

  .gallery figure:first-child {
    grid-column: auto;
  }

  .toc {
    columns: 1;
  }

  .guide-hero {
    padding-top: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
