:root {
  --guide-bg: #f7f6f2;
  --guide-surface: #ffffff;
  --guide-surface-soft: #f0f4f4;
  --guide-text: #172033;
  --guide-muted: #5f6878;
  --guide-border: #d8dcd9;
  --guide-blue: #2563eb;
  --guide-blue-dark: #1d4ed8;
  --guide-button: #2563eb;
  --guide-button-hover: #1d4ed8;
  --guide-shadow: 0 18px 55px rgba(51, 65, 85, 0.10), 0 2px 7px rgba(51, 65, 85, 0.05);
}

html[data-theme="dark"],
html.dark {
  --guide-bg: #0f172a;
  --guide-surface: #0f1b30;
  --guide-surface-soft: #14223a;
  --guide-text: #f8fafc;
  --guide-muted: #aeb8c8;
  --guide-border: #334155;
  --guide-blue: #60a5fa;
  --guide-blue-dark: #3b82f6;
  --guide-shadow: 0 20px 58px rgba(0, 0, 0, 0.24);
}

.guide-page {
  background: var(--guide-bg);
  color: var(--guide-text);
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  border-radius: 0.5rem;
  background: var(--guide-text);
  color: var(--guide-bg);
  padding: 0.7rem 1rem;
  font-weight: 700;
}

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

.guide-shell {
  width: min(calc(100% - 3rem), 76rem);
  margin-inline: auto;
}

.guide-header {
  border-bottom: 1px solid color-mix(in srgb, var(--guide-border) 78%, transparent);
  background: color-mix(in srgb, var(--guide-bg) 90%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.guide-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 3rem), 80rem);
  min-height: 4.75rem;
  margin-inline: auto;
  gap: 1.5rem;
}

.guide-page-nav { display: flex; align-items: center; gap: 1.5rem; }
.guide-page-nav a { color: var(--guide-muted); font-size: 0.9rem; font-weight: 700; transition: color 160ms ease; }
.guide-page-nav a:hover { color: var(--guide-blue); }
.guide-page .account-actions > a:first-child { color: var(--guide-text); }

.guide-hero {
  position: relative;
  overflow: hidden;
  padding: 9.5rem 0 5.5rem;
  background:
    radial-gradient(circle at 82% 22%, rgba(37, 99, 235, 0.14), transparent 28rem),
    linear-gradient(180deg, color-mix(in srgb, var(--guide-surface-soft) 78%, transparent), var(--guide-bg));
}

.guide-hero::after {
  content: "";
  position: absolute;
  width: 24rem;
  height: 24rem;
  left: -10rem;
  bottom: -15rem;
  border: 1px solid color-mix(in srgb, var(--guide-blue) 20%, transparent);
  border-radius: 50%;
}

.guide-hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(19rem, 0.85fr); align-items: center; gap: 5rem; }
.guide-kicker { margin: 0 0 0.9rem; color: var(--guide-blue); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.guide-hero h1 { max-width: 18ch; margin: 0; font-size: calc(3rem - 1pt); font-weight: 800; line-height: 1.18; letter-spacing: normal; }
.guide-lead { max-width: 42rem; margin: 1.4rem 0 0; color: var(--guide-muted); font-size: 1.12rem; line-height: 1.75; }
.guide-actions, .guide-cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 2rem; }
.guide-primary-action, .guide-secondary-action { display: inline-flex; min-height: 3rem; align-items: center; justify-content: center; border-radius: 0.7rem; padding: 0.75rem 1.25rem; font-weight: 800; transition: transform 160ms ease, background 160ms ease, border-color 160ms ease; }
.guide-primary-action { background: var(--guide-button); color: #fff; box-shadow: 0 12px 30px rgba(37, 99, 235, 0.24); }
.guide-primary-action:hover { background: var(--guide-button-hover); transform: translateY(-1px); }
.guide-secondary-action { border: 1px solid var(--guide-border); background: var(--guide-surface); color: var(--guide-text); }
.guide-secondary-action:hover { border-color: var(--guide-blue); transform: translateY(-1px); }
.comparison-card a { color: var(--guide-blue); font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }

.quick-specs { overflow: hidden; border: 1px solid var(--guide-border); border-radius: 1.25rem; background: color-mix(in srgb, var(--guide-surface) 92%, transparent); box-shadow: var(--guide-shadow); }
.quick-specs > div { display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.35rem; }
.quick-specs > div + div { border-top: 1px solid var(--guide-border); }
.quick-specs span { display: grid; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--guide-blue) 12%, transparent); color: var(--guide-blue); font-size: 0.72rem; font-weight: 900; }
.quick-specs p { margin: 0; }
.quick-specs strong, .quick-specs small { display: block; }
.quick-specs strong { font-size: 0.98rem; }
.quick-specs small { margin-top: 0.12rem; color: var(--guide-muted); font-size: 0.8rem; }

.guide-section { padding: 5.75rem 0; scroll-margin-top: 4.5rem; }
.guide-section-heading { max-width: 45rem; margin-bottom: 2.5rem; }
.guide-section h2, .guide-final-cta h2 { margin: 0; font-size: clamp(1.65rem, 2.25vw, 2rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.025em; }
.guide-section-heading > p:last-child, .safety-copy > p:last-child, .guide-cta-panel > div > p:last-child { margin: 0.9rem 0 0; color: var(--guide-muted); line-height: 1.7; }

.examples-section { background: var(--guide-surface); }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }
.example-card { overflow: hidden; border: 1px solid var(--guide-border); border-radius: 1.25rem; background: var(--guide-bg); box-shadow: 0 12px 36px rgba(33, 52, 81, 0.07); }
.example-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.1rem; }
.example-card-heading strong { color: var(--guide-muted); font-size: 0.78rem; }
.example-grade { border-radius: 999px; padding: 0.32rem 0.66rem; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.example-good .example-grade { background: #dcfce7; color: #166534; }
.example-moderate .example-grade { background: #fef3c7; color: #92400e; }
.example-bad .example-grade { background: #fee2e2; color: #991b1b; }
.guide-video-frame { position: relative; overflow: hidden; aspect-ratio: 9 / 16; margin-inline: auto; background: #020617; }
.guide-video-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.guide-video-play { position: absolute; inset: 50% auto auto 50%; display: grid; width: 4.25rem; height: 4.25rem; place-items: center; transform: translate(-50%, -50%); border: 1px solid rgba(255,255,255,.55); border-radius: 50%; background: rgba(5, 13, 27, .68); color: white; font-size: 1.35rem; box-shadow: 0 10px 28px rgba(0,0,0,.3); transition: transform 160ms ease, opacity 160ms ease; }
.guide-video-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.guide-video-play span { margin-left: .16rem; }
.guide-video-frame.is-playing .guide-video-play { opacity: 0; }
.guide-video-frame.is-playing:hover .guide-video-play, .guide-video-frame.is-playing .guide-video-play:focus-visible { opacity: 1; }
.video-duration, .video-muted { position: absolute; bottom: 0.8rem; border-radius: 999px; background: rgba(2, 6, 23, .74); color: #fff; padding: .28rem .55rem; font-size: .68rem; font-weight: 800; backdrop-filter: blur(6px); }
.video-duration { right: .75rem; }
.video-muted { left: .75rem; }
.example-copy { padding: 1.35rem; }
.example-copy h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.example-copy > p { min-height: 6.3rem; margin: .7rem 0 0; color: var(--guide-muted); font-size: .9rem; line-height: 1.6; }
.example-copy ul { display: grid; gap: .55rem; margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--guide-border); list-style: none; }
.example-copy li { position: relative; padding-left: 1.1rem; color: var(--guide-muted); font-size: .82rem; }
.example-copy li::before { content: ""; position: absolute; top: .48rem; left: 0; width: .38rem; height: .38rem; border-radius: 50%; background: var(--guide-blue); }
.example-good { border-top: 3px solid #22c55e; }
.example-moderate { border-top: 3px solid #f59e0b; }
.example-bad { border-top: 3px solid #ef4444; }

.sound-note { display: flex; align-items: flex-start; gap: 1rem; margin-top: 1.5rem; border: 1px solid color-mix(in srgb, var(--guide-blue) 26%, var(--guide-border)); border-radius: 1rem; background: color-mix(in srgb, var(--guide-blue) 7%, var(--guide-surface)); padding: 1.15rem 1.3rem; }
.sound-note > span { display: grid; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--guide-blue); color: #fff; }
.sound-note strong { display: block; font-size: .92rem; }
.sound-note p { margin: .3rem 0 0; color: var(--guide-muted); font-size: .86rem; line-height: 1.55; }

.checklist-section { background: var(--guide-bg); }
.comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.comparison-card { overflow: hidden; border: 1px solid var(--guide-border); border-radius: 1.25rem; background: var(--guide-surface); box-shadow: var(--guide-shadow); }
.comparison-heading { display: flex; align-items: center; gap: .8rem; padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--guide-border); }
.comparison-heading span { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; color: white; font-weight: 900; }
.works-card .comparison-heading span { background: #16a34a; }
.avoid-card .comparison-heading span { background: #dc2626; }
.comparison-heading h3 { margin: 0; font-size: 1.12rem; font-weight: 800; }
.comparison-card ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.comparison-card li { position: relative; padding: 1.05rem 1.35rem 1.05rem 3.1rem; }
.comparison-card li + li { border-top: 1px solid var(--guide-border); }
.comparison-card li::before { position: absolute; left: 1.4rem; top: 1.25rem; font-weight: 900; }
.works-card li::before { content: "✓"; color: #16a34a; }
.avoid-card li::before { content: "×"; color: #dc2626; }
.comparison-card strong, .comparison-card span { display: block; }
.comparison-card strong { font-size: .9rem; }
.comparison-card li span { margin-top: .25rem; color: var(--guide-muted); font-size: .82rem; line-height: 1.55; }

.safety-section { background: var(--guide-surface); }
.safety-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4rem; align-items: start; }
.safety-rules { overflow: hidden; border: 1px solid var(--guide-border); border-radius: 1.25rem; background: var(--guide-bg); }
.safety-rules > div { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; }
.safety-rules > div + div { border-top: 1px solid var(--guide-border); }
.safety-rules span { color: var(--guide-blue); font-size: .7rem; font-weight: 900; letter-spacing: .08em; }
.safety-rules p { margin: 0; color: var(--guide-muted); font-size: .88rem; line-height: 1.55; }
.safety-rules strong { display: block; margin-bottom: .2rem; color: var(--guide-text); }

.guide-final-cta { padding: 5rem 0; background: var(--guide-bg); }
.guide-cta-panel { display: flex; align-items: center; justify-content: space-between; gap: 3rem; border: 1px solid var(--guide-border); border-radius: 1.4rem; background: var(--guide-surface); padding: 2.5rem; box-shadow: var(--guide-shadow); }
.guide-cta-panel > div:first-child { max-width: 42rem; }
.guide-cta-actions { flex: 0 0 auto; margin-top: 0; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 520ms ease, transform 520ms ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .guide-page-nav { display: none; }
  .guide-hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .quick-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-specs > div + div { border-top: 0; }
  .quick-specs > div:nth-child(n+3) { border-top: 1px solid var(--guide-border); }
  .quick-specs > div:nth-child(even) { border-left: 1px solid var(--guide-border); }
  .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .example-card:last-child { grid-column: 1 / -1; width: calc(50% - .625rem); margin-inline: auto; }
  .safety-grid { grid-template-columns: 1fr; gap: 2rem; }
  .guide-cta-panel { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  .guide-shell, .guide-header-inner { width: min(calc(100% - 2rem), 76rem); }
  .guide-header-inner { min-height: 4.25rem; gap: .7rem; }
  .account-actions > a:first-child { display: none; }
  .account-actions > a:nth-child(2) { padding: .55rem .7rem; font-size: .78rem; }
  .guide-hero { padding: 7.5rem 0 4rem; }
  .guide-hero h1 { font-size: 2.25rem; }
  .guide-lead { font-size: 1rem; }
  .quick-specs { display: block; }
  .quick-specs > div:nth-child(n) { border-left: 0; }
  .quick-specs > div + div { border-top: 1px solid var(--guide-border); }
  .guide-section { padding: 4.2rem 0; }
  .example-grid, .comparison-grid { grid-template-columns: 1fr; }
  .example-card:last-child { grid-column: auto; width: auto; }
  .example-copy > p { min-height: 0; }
  .guide-video-frame { max-height: 72vh; }
  .sound-note { flex-direction: column; }
  .guide-cta-panel { padding: 1.5rem; }
  .guide-cta-actions, .guide-cta-actions a { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .guide-primary-action, .guide-secondary-action, .guide-video-play { transition: none; }
}
