.brand-guide-page {
  color-scheme: dark;
}

[data-theme="light"] .brand-guide-page {
  color-scheme: light;
}

.brand-guide-page .theme-switch {
  min-height: 44px;
}

.guide-skip-link {
  position: fixed;
  z-index: 50;
  top: 12px;
  left: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bg-surface);
  transform: translateY(-150%);
}

.guide-skip-link:focus {
  transform: none;
}

.guide-hero {
  padding-block: clamp(40px, 7vw, 88px);
  border-bottom: 1px solid var(--line-strong);
  background: radial-gradient(ellipse at 80% 15%, var(--accent-soft), transparent 60%);
}

.guide-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 6vw, 88px);
}

.guide-heading h1 {
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 5.1vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-wrap: balance;
  word-break: keep-all;
}

.guide-heading p {
  max-width: 36rem;
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.75;
  word-break: keep-all;
}

.guide-download {
  height: auto;
  min-height: 48px;
  padding-block: 9px;
}

.guide-hero-art {
  display: grid;
  min-height: 220px;
  aspect-ratio: 1.5;
  padding: clamp(22px, 4vw, 44px);
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% 35%, var(--accent-soft), transparent 66%), var(--bg-surface);
}

.guide-icon {
  display: block;
  width: min(100%, 164px);
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22%;
  box-shadow: var(--card-shadow);
}

.guide-icon--light,
[data-theme="light"] .guide-icon--dark {
  display: none;
}

[data-theme="light"] .guide-icon--light {
  display: block;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(165px, 0.55fr) minmax(0, 2fr);
  gap: clamp(24px, 5vw, 72px);
  padding-block: clamp(28px, 5vw, 64px) clamp(48px, 7vw, 88px);
}

.guide-toc {
  position: sticky;
  top: 94px;
  align-self: start;
  padding: 14px 18px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.guide-toc p {
  margin: 2px 0 8px;
  font-weight: 700;
}

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

.guide-toc a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding-block: 5px;
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.35;
  word-break: keep-all;
}

.guide-toc a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.guide-content {
  min-width: 0;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.guide-content,
.guide-content :is(h2, h3) {
  scroll-margin-top: 88px;
}

.guide-content :is(h2, h3, strong) {
  color: var(--text-primary);
}

.guide-content h2 {
  margin: 46px 0 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line-strong);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.guide-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.guide-content h3 {
  margin: 26px 0 12px;
  font-size: 1.16rem;
}

.guide-content :is(p, ul, ol, table) {
  margin: 0 0 16px;
}

.guide-content :is(ul, ol) {
  padding-inline-start: 1.3em;
}

.guide-content li + li {
  margin-top: 6px;
}

.guide-content a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.guide-content a:hover {
  text-decoration-thickness: 2px;
}

.guide-content code {
  padding: 0.1em 0.25em;
  border-radius: 4px;
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text-primary);
}

.guide-content table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  font-size: 0.94rem;
  line-height: 1.5;
}

.guide-content :is(th, td) {
  padding: 11px clamp(8px, 2vw, 16px);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.guide-content th {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.guide-content th:first-child {
  width: 36%;
}

.guide-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}

@media (max-width: 740px) {
  .guide-hero-grid,
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-hero-art {
    display: none;
  }

  .guide-toc {
    position: static;
  }

  .guide-toc ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
  }

  .guide-toc a {
    min-height: 44px;
  }

  .guide-content table {
    font-size: 0.86rem;
  }
}
