/* 140.6 Guides: an editorial hub, not a documentation card wall. */

body {
  background: var(--bg);
  font-size: 17px;
}

.guides-wrap {
  width: min(1180px, calc(100% - 2 * clamp(18px, 4vw, 56px)));
  margin-inline: auto;
}

.guides-header {
  position: sticky;
  z-index: 40;
  top: 0;
  height: 72px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}

.guides-nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.guides-brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.guides-brand img {
  width: 32px;
  height: 32px;
  display: block;
  border: 1px solid rgba(168, 151, 240, .38);
  border-radius: 8px;
  background: #1a0c3a;
}

.guides-brand span { display: flex; flex-direction: column; line-height: 1; }
.guides-brand strong { font-size: 1.02rem; font-weight: 800; letter-spacing: -.045em; }
.guides-brand small { margin-top: 4px; color: var(--faint); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.guides-nav-links {
  display: flex;
  align-items: center;
  gap: 4px 22px;
}

.guides-nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
}

.guides-nav-links a:hover,
.guides-nav-links a[aria-current="page"] { color: var(--ink); }

.guides-nav-links .guides-download {
  padding: 0 14px;
  border: 1px solid rgba(168, 151, 240, .38);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(115, 88, 216, .14);
}

.guides-page { overflow: clip; }

.guides-hero {
  padding: clamp(72px, 9vw, 116px) 0 42px;
}

.story-topic {
  color: var(--violet-light);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.guides-hero h1 {
  max-width: 900px;
  margin: 0 0 22px;
  font-size: clamp(3rem, 7vw, 5.3rem);
  line-height: .96;
  letter-spacing: -.04em;
}

.guides-hero > p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.topic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.topic-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.topic-nav a:hover {
  border-color: rgba(168, 151, 240, .5);
  background: rgba(115, 88, 216, .14);
  color: var(--ink);
}

.featured-guide {
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(380px, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0b1730;
  color: var(--ink);
  text-decoration: none;
}

.featured-copy {
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(32px, 5vw, 64px);
}

.featured-copy h2 {
  margin: 18px 0 18px;
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.featured-copy p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.58;
}

.featured-copy strong,
.guide-story-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  color: var(--violet-light);
  font-size: .82rem;
  font-weight: 700;
}

.featured-visual {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background: #111a3c;
}

.featured-visual::before { content: none; }

.distance-stack {
  position: absolute;
  z-index: 1;
  left: 9%;
  bottom: 10%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: rgba(244, 245, 247, .66);
  font-size: clamp(1.15rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.distance-stack span:last-child { color: var(--ink); font-size: 1.5em; }

.featured-screen {
  position: absolute;
  right: 6%;
  bottom: -19%;
  width: min(52%, 290px);
  overflow: hidden;
  border: 1px solid rgba(174, 200, 235, .28);
  border-radius: 22px;
}

.featured-screen img { width: 100%; height: auto; display: block; }

.guide-index { padding: clamp(88px, 10vw, 132px) 0; }

.guide-index-head {
  max-width: 760px;
  margin-bottom: 34px;
}

.guide-index-head h2,
.guide-cta h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -.04em;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 42px 18px;
}

.guide-story {
  min-width: 0;
  scroll-margin-top: 104px;
  color: var(--ink);
  text-decoration: none;
}

.guide-story-wide { grid-column: span 7; }
.guide-story-narrow { grid-column: span 5; }
.guide-story-third { grid-column: span 4; }

.guide-cover {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 22, 43, .86);
  transition: border-color .22s ease;
}

.guide-story-third .guide-cover { min-height: 205px; }
.guide-story:hover .guide-cover { border-color: rgba(168, 151, 240, .46); }

.guide-story-copy { padding-top: 20px; }
.guide-story-copy h3 { margin: 9px 0 10px; font-size: clamp(1.35rem, 2.4vw, 2rem); line-height: 1.12; letter-spacing: -.032em; }
.guide-story-third .guide-story-copy h3 { font-size: clamp(1.25rem, 2vw, 1.65rem); }
.guide-story-copy p { max-width: 610px; margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.guide-story-copy strong { margin-top: 18px; }

.guide-cover-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(.82) contrast(1.04);
}

.cover-compare {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  background: #0c0f23;
}

.cover-compare span { width: fit-content; padding: 5px 10px; border: 1px solid rgba(168, 151, 240, .28); border-radius: 999px; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .09em; }
.cover-compare span:nth-child(2) { margin-left: 13%; color: var(--ink); background: rgba(115, 88, 216, .2); }
.cover-compare span:nth-child(3) { margin-left: 4%; }
.cover-compare span:nth-child(4) { margin-left: 19%; color: var(--violet-light); }

.guide-library {
  padding: 0 0 clamp(88px, 10vw, 132px);
}

.guide-library .guide-index-head p {
  max-width: 650px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.guide-shelf {
  min-width: 0;
  scroll-margin-top: 96px;
  padding: clamp(26px, 4vw, 42px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.guide-shelf h3 {
  max-width: 470px;
  margin: 10px 0 28px;
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}

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

.guide-shelf li { border-top: 1px solid var(--line-soft); }

.guide-shelf a {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: .91rem;
  line-height: 1.4;
}

.guide-shelf a span:last-child {
  flex: none;
  color: var(--violet-light);
}

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

.guide-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: clamp(88px, 10vw, 132px);
  padding: clamp(30px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0b1730;
}

.guide-cta p { max-width: 620px; margin: 14px 0 0; color: var(--muted); }
.guide-app-store { flex: none; min-height: 60px; display: inline-flex; align-items: center; border-radius: 10px; }
.guide-app-store img { width: 180px; height: auto; display: block; }

.guides-footer { border-top: 1px solid var(--line-soft); }
.guides-footer-inner { min-height: 132px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 30px 0; }
.guides-footer p { margin: 8px 0 0; color: var(--faint); font-size: .72rem; }
.guides-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; }
.guides-footer nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); font-size: .76rem; text-underline-offset: 4px; }

@media (max-width: 900px) {
  .featured-guide { grid-template-columns: 1fr; }
  .featured-visual { min-height: 360px; }
  .featured-screen { width: 220px; bottom: -34%; }
  .guide-story-wide, .guide-story-narrow, .guide-story-third { grid-column: span 6; }
  .guide-story-third .guide-cover { min-height: 240px; }
}

@media (max-width: 640px) {
  .guides-header { height: 64px; }
  .guides-brand small { display: none; }
  .guides-nav-links { gap: 12px; }
  .guides-nav-links .nav-secondary { display: none; }
  .guides-nav-links a { font-size: .76rem; }
  .guides-nav-links .guides-download { padding-inline: 12px; }
  .guides-hero { padding-top: 58px; }
  .guides-hero h1 { font-size: clamp(2.7rem, 14vw, 4.2rem); }
  .topic-nav { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * clamp(18px, 4vw, 56px)); padding-right: clamp(18px, 4vw, 56px); scrollbar-width: none; }
  .topic-nav::-webkit-scrollbar { display: none; }
  .topic-nav a { flex: none; }
  .featured-guide { min-height: 0; }
  .featured-copy { padding: 30px 24px 34px; }
  .featured-copy h2 { font-size: 2.35rem; }
  .featured-visual { min-height: 310px; }
  .featured-screen { right: 4%; width: 190px; }
  .distance-stack { left: 7%; font-size: 1rem; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); gap: 38px; }
  .guide-story-wide, .guide-story-narrow, .guide-story-third { grid-column: 1; }
  .guide-story-copy h3 { overflow-wrap: anywhere; }
  .guide-cover, .guide-story-third .guide-cover { min-height: 220px; }
  .guide-story-copy h3, .guide-story-third .guide-story-copy h3 { font-size: 1.55rem; }
  .guide-library-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-shelf { padding: 28px 22px; }
  .guide-cta { align-items: flex-start; flex-direction: column; }
  .guides-footer-inner { align-items: flex-start; flex-direction: column; }
  .guides-footer nav { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .topic-nav a, .guide-cover { transition: none; }
}
