:root {
  --guide-bg: var(--fa-white, #F7F5F0);
  --guide-surface: #ffffff;
  --guide-ink: #17202a;
  --guide-muted: #4f5962;
  --guide-line: #d8d3c8;
  --guide-accent: #bc8a38;
  --guide-accent-ink: #17202a;
  --guide-dark: #121a22;
  --guide-shell: 1180px;
  --guide-copy: 760px;
  --guide-gutter: clamp(20px, 4vw, 56px);
  --guide-font: var(--fa-font-body, "Barlow", Arial, sans-serif);
}

body.guide-theme-tray,
body.guide-theme-case {
  --guide-accent: #E56F22;
  --guide-accent-ink: #1B1F20;
  --guide-dark: #1B1F20;
}

body.guide-theme-makeup {
  --guide-accent: #8a315f;
  --guide-accent-ink: #ffffff;
  --guide-dark: #351c2a;
}

body.guide-theme-stitch {
  --guide-accent: #718b55;
  --guide-accent-ink: #17202a;
  --guide-dark: #273020;
}

body.guide-theme-factory {
  --guide-accent: #b88636;
  --guide-accent-ink: #17202a;
  --guide-dark: #17202a;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body.guide-page {
  min-width: 320px;
  margin: 0;
  color: var(--guide-ink);
  background: var(--guide-bg);
  font-family: var(--guide-font);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

.guide-page *,
.guide-page *::before,
.guide-page *::after {
  box-sizing: border-box;
}

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

.guide-page a {
  color: inherit;
}

.guide-page :focus-visible {
  outline: 3px solid color-mix(in srgb, var(--guide-accent) 82%, #ffffff);
  outline-offset: 4px;
}

.guide-skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--guide-dark);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.guide-skip-link:focus {
  transform: translateY(0);
}

.guide-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--guide-line);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 10px 28px rgba(23, 32, 42, .05);
}

.guide-header-inner {
  display: flex;
  width: min(100%, var(--guide-shell));
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0 auto;
  padding: 10px var(--guide-gutter);
}

.guide-brand {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 780;
  letter-spacing: -.02em;
  line-height: 1.1;
  text-decoration: none;
}

.guide-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.guide-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 26px;
}

.guide-header nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  font-size: .92rem;
  font-weight: 680;
  text-decoration: none;
}

.guide-header nav a:hover,
.guide-header nav a:focus-visible,
.guide-header nav a[aria-current="page"] {
  border-color: var(--guide-accent);
}

.guide-main {
  min-height: 70vh;
}

.guide-hero {
  border-bottom: 1px solid var(--guide-line);
  background: var(--guide-bg);
}

.guide-hero-inner {
  display: grid;
  width: min(100%, var(--guide-shell));
  grid-template-columns: minmax(0, 1.02fr) minmax(330px, .98fr);
  align-items: center;
  gap: clamp(42px, 7vw, 96px);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 112px) var(--guide-gutter);
}

.guide-hero-inner.guide-hero-text-only {
  grid-template-columns: minmax(0, 900px);
  justify-content: start;
}

.guide-hero h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.6rem);
  font-weight: 780;
  letter-spacing: -.058em;
  line-height: .98;
}

.guide-deck {
  max-width: 720px;
  margin: 28px 0 0;
  color: #2e3740;
  font-size: clamp(1.08rem, 1.8vw, 1.34rem);
  line-height: 1.58;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 28px 0 0;
  color: var(--guide-muted);
  font-size: .85rem;
  font-weight: 620;
}

.guide-meta span + span::before {
  margin-right: 18px;
  color: var(--guide-accent);
  content: "•";
}

.guide-hero-media,
.guide-figure {
  margin: 0;
}

.guide-hero-media img,
.guide-figure img {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--guide-line) 76%, var(--guide-ink));
  background: var(--guide-dark);
  object-fit: cover;
}

.guide-hero-media img {
  aspect-ratio: 4 / 3;
}

.guide-hero-media figcaption,
.guide-figure figcaption {
  margin-top: 12px;
  color: var(--guide-muted);
  font-size: .82rem;
  line-height: 1.5;
}

.guide-content {
  width: min(100%, var(--guide-shell));
  margin: 0 auto;
  padding: clamp(58px, 8vw, 108px) var(--guide-gutter);
}

.guide-copy {
  max-width: var(--guide-copy);
}

.guide-section + .guide-section {
  margin-top: clamp(64px, 8vw, 104px);
  padding-top: clamp(52px, 6vw, 76px);
  border-top: 1px solid var(--guide-line);
}

.guide-section h2,
.guide-section h3 {
  margin: 0;
  letter-spacing: -.035em;
  line-height: 1.12;
}

.guide-section h2 {
  max-width: 900px;
  font-size: clamp(2.15rem, 4.5vw, 4.2rem);
  font-weight: 770;
}

.guide-section h3 {
  margin-top: 38px;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 740;
}

.guide-section p,
.guide-section ul,
.guide-section ol {
  max-width: var(--guide-copy);
}

.guide-section p {
  margin: 22px 0 0;
}

.guide-section ul,
.guide-section ol {
  margin: 24px 0 0;
  padding-left: 1.35rem;
}

.guide-section li + li {
  margin-top: 12px;
}

.guide-section a:not(.guide-button):not(.guide-card-link) {
  text-decoration-color: color-mix(in srgb, var(--guide-accent) 72%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.guide-section a:not(.guide-button):not(.guide-card-link):hover,
.guide-section a:not(.guide-button):not(.guide-card-link):focus-visible {
  text-decoration-color: var(--guide-accent);
}

.guide-layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .78fr);
  gap: clamp(34px, 6vw, 82px);
  align-items: start;
}

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

.guide-card {
  display: flex;
  min-height: 255px;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(26px, 3vw, 42px);
  background: var(--guide-surface);
}

.guide-card-wide {
  grid-column: 1 / -1;
}

.guide-card h2,
.guide-card h3 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  letter-spacing: -.035em;
  line-height: 1.12;
}

.guide-card p {
  margin: 18px 0 0;
  color: var(--guide-muted);
  font-size: .97rem;
  line-height: 1.55;
}

.guide-card .guide-card-evidence {
  margin-top: 20px;
  color: var(--guide-ink);
  font-size: .78rem;
  font-weight: 680;
}

.guide-card-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--guide-ink);
  font-size: .9rem;
  font-weight: 760;
  text-decoration: none;
}

.guide-card-link::after {
  color: var(--guide-accent);
  content: "→";
  font-size: 1.25rem;
  transition: transform 160ms ease;
}

.guide-card-link:hover::after,
.guide-card-link:focus-visible::after {
  transform: translateX(4px);
}

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

.guide-facts div {
  min-width: 0;
  padding: 24px;
  background: var(--guide-surface);
}

.guide-facts dt {
  color: var(--guide-muted);
  font-size: .76rem;
  font-weight: 720;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.guide-facts dd {
  margin: 8px 0 0;
  font-size: clamp(1.12rem, 2vw, 1.5rem);
  font-weight: 760;
  line-height: 1.15;
}

.guide-callout {
  max-width: 900px;
  margin-top: 34px;
  padding: 24px 28px;
  border-left: 5px solid var(--guide-accent);
  background: color-mix(in srgb, var(--guide-accent) 9%, var(--guide-surface));
}

.guide-callout strong {
  display: block;
  margin-bottom: 6px;
}

.guide-callout p {
  margin: 0;
}

.guide-code {
  max-width: 880px;
  margin: 30px 0 0;
  overflow-x: auto;
  padding: 24px;
  border: 1px solid #303942;
  color: #f7f5f0;
  background: var(--guide-dark);
  font: 600 .92rem/1.75 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.guide-table-wrap {
  max-width: 980px;
  margin-top: 34px;
  overflow-x: auto;
  border: 1px solid var(--guide-line);
  background: var(--guide-surface);
}

.guide-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  text-align: left;
}

.guide-table th,
.guide-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--guide-line);
  vertical-align: top;
}

.guide-table th {
  color: var(--guide-muted);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.guide-table tr:last-child td {
  border-bottom: 0;
}

.guide-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin-top: 38px;
}

.guide-figure img {
  aspect-ratio: 16 / 10;
}

.guide-figure-wide {
  max-width: 980px;
  margin-top: 38px;
}

.guide-checklist {
  display: grid;
  max-width: 980px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 34px 0 0;
  padding: 1px;
  background: var(--guide-line);
  list-style: none;
}

.guide-checklist li,
.guide-section .guide-checklist li + li {
  position: relative;
  margin: 0;
  padding: 22px 24px 22px 56px;
  background: var(--guide-surface);
}

.guide-checklist li::before {
  position: absolute;
  top: 23px;
  left: 24px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--guide-accent);
  content: "";
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.guide-page .guide-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--guide-ink);
  color: #ffffff;
  background: var(--guide-dark);
  font-size: .9rem;
  font-weight: 740;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease;
}

.guide-button:hover,
.guide-button:focus-visible {
  background: color-mix(in srgb, var(--guide-dark) 88%, #ffffff);
  transform: translateY(-2px);
}

.guide-page .guide-button-secondary {
  color: var(--guide-ink);
  background: transparent;
}

.guide-page .guide-button-secondary:hover,
.guide-page .guide-button-secondary:focus-visible {
  background: var(--guide-surface);
}

.guide-related {
  margin-top: clamp(64px, 9vw, 120px);
  padding: clamp(42px, 6vw, 70px);
  color: #ffffff;
  background: var(--guide-dark);
}

.guide-related h2 {
  max-width: 760px;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.guide-related p {
  color: #d9dde0;
}

.guide-related .guide-button {
  border-color: var(--guide-accent);
  color: var(--guide-accent-ink);
  background: var(--guide-accent);
}

.guide-related .guide-button-secondary {
  border-color: #ffffff;
  color: #ffffff;
  background: transparent;
}

@media (max-width: 900px) {
  .guide-header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .guide-header nav {
    width: 100%;
    justify-content: flex-start;
    gap: 2px 22px;
  }

  .guide-hero-inner,
  .guide-layout-two {
    grid-template-columns: 1fr;
  }

  .guide-hero-media {
    max-width: 720px;
  }
}

@media (max-width: 680px) {
  html {
    scroll-padding-top: 140px;
  }

  body.guide-page {
    font-size: 16px;
  }

  .guide-header-inner {
    min-height: 0;
  }

  .guide-brand img {
    width: 44px;
    height: 44px;
  }

  .guide-header nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .guide-header nav a {
    padding: 9px 0;
  }

  .guide-hero-inner {
    gap: 38px;
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .guide-hero h1 {
    font-size: clamp(2.7rem, 13vw, 4.2rem);
  }

  .guide-meta {
    display: grid;
    gap: 3px;
  }

  .guide-meta span + span::before {
    display: none;
  }

  .guide-content {
    padding-top: 52px;
    padding-bottom: 72px;
  }

  .guide-card-grid,
  .guide-facts,
  .guide-figure-grid,
  .guide-checklist {
    grid-template-columns: 1fr;
  }

  .guide-card {
    min-height: 0;
  }

  .guide-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-button {
    width: 100%;
  }

  .guide-related {
    margin-right: calc(var(--guide-gutter) * -1);
    margin-left: calc(var(--guide-gutter) * -1);
    padding-right: var(--guide-gutter);
    padding-left: var(--guide-gutter);
  }
}

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

  .guide-page *,
  .guide-page *::before,
  .guide-page *::after {
    transition-duration: .01ms !important;
  }
}
