/*
  /guides, second pass (Rolf, 19 Nov): an editorial learning center, curated
  rather than catalogued. Inspired by Intercom's Learning Center and Stripe
  Guides, drawn in our brand: light paper and deep ink, the four guides, the
  app tints, and original drawings in the brand's line finish (round strokes,
  the mark's solid square as the one accent).
*/

.gx h1,
.gx h2,
.gx h3 {
  margin: 0;
}

.gx-kicker {
  display: block;
  margin: 0 0 12px;
  color: var(--c-green);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gx-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

/* 1. Masthead. */
.gx-mast {
  padding: clamp(48px, 7vw, 104px) 0 clamp(56px, 6vw, 88px);
}

.gx-mast__head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  padding-bottom: clamp(32px, 4vw, 56px);
  border-bottom: 1px solid var(--line-lit);
}

.gx-mast__head h1 {
  grid-column: 1 / 3;
  padding: 0 var(--inset);
  font-size: clamp(56px, 9vw, 136px);
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.gx-mast__head p {
  grid-column: 3 / 5;
  max-width: 30em;
  margin: 0;
  padding: 0 var(--inset);
  color: var(--ink-2);
  font-size: clamp(17px, 1.4vw, 19.5px);
  line-height: 1.5;
}

/* The lead story: a deep ink plate with its own drawing, and the newest three beside it. */
.gx-lead {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: clamp(32px, 4vw, 48px);
}

.gx-lead__story {
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  margin: 0 var(--inset);
  overflow: hidden;
  border-radius: var(--r-l);
  background: var(--c-ink-ground);
  color: var(--c-white);
  text-decoration: none;
  box-shadow: 0 40px 80px -48px rgba(16, 44, 54, 0.7);
}

.gx-lead__art {
  --acc: var(--c-lime);
  display: block;
  padding: clamp(24px, 3vw, 40px);
  color: var(--c-jade);
}

.gx-lead__art svg {
  display: block;
  width: 100%;
  height: auto;
  transition: transform var(--t-3) var(--ease);
}

.gx-lead__story:hover .gx-lead__art svg {
  transform: translateX(6px);
}

.gx-lead__say {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(28px, 3vw, 44px) clamp(24px, 3vw, 44px) clamp(28px, 3vw, 44px) 0;
}

.gx-lead__say .gx-kicker {
  margin: 0;
  color: var(--c-jade);
}

.gx-lead__say b {
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.gx-lead__rest {
  color: var(--c-white);
  font-size: clamp(17px, 1.4vw, 19px);
  font-weight: 500;
  line-height: 1.35;
}

.gx-lead__dek {
  color: var(--c-mist);
  font-size: 15.5px;
  line-height: 1.55;
}

.gx-lead__say .gx-meta {
  margin-top: 6px;
  color: var(--c-mist);
}

.gx-new {
  grid-column: 4 / 5;
  padding: 4px var(--inset) 0;
}

.gx-new ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: n;
}

.gx-new li {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-lit);
  counter-increment: n;
}

.gx-new li::before {
  content: none;
}

.gx-new a {
  display: grid;
  gap: 6px;
  padding: 16px 0;
  color: var(--ink);
  text-decoration: none;
}

.gx-new b {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.gx-new a:hover b {
  color: var(--c-green);
}

.gx-new__all {
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-lit);
  font-size: 14px;
}

.gx-new__all a {
  color: var(--c-green);
}

/* 2. The topic bar. */
.gx-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
}

.gx-bar ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 10px var(--inset);
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.gx-bar li {
  flex: none;
  margin: 0;
  padding: 0;
}

.gx-bar li::before {
  content: none;
}

.gx-bar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}

.gx-bar a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: var(--c-ink);
}

.gx-bar a[data-tone="it"]::before { background: var(--c-green); }
.gx-bar a[data-tone="rr"]::before { background: var(--c-cobalt); }
.gx-bar a[data-tone="md"]::before { background: var(--c-jade-600); }

.gx-bar a span {
  color: var(--ink-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.gx-bar a:hover {
  background: var(--c-cloud);
}

.gx-bar a[aria-current="true"] {
  background: var(--c-ink);
  color: var(--c-white);
}

.gx-bar a[aria-current="true"] span {
  color: var(--c-mist);
}

/* 3. Chapters. */
.gx-ch {
  padding: clamp(72px, 8vw, 120px) 0;
  scroll-margin-top: 56px;
}

.gx-ch + .gx-ch {
  border-top: 1px solid var(--line);
}

.gx-ch__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.gx-ch__side {
  grid-column: 1 / 3;
  position: sticky;
  top: 88px;
  padding: 0 var(--inset);
}

.gx-ch--flip .gx-ch__side {
  grid-column: 3 / 5;
  grid-row: 1;
}

.gx-ch--flip .gx-read {
  grid-column: 1 / 3;
  grid-row: 1;
}

.gx-ch__side h2 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.gx-ch__lede {
  max-width: 26em;
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.55;
}

.gx-plate {
  margin-top: 32px;
  padding: clamp(16px, 2.4vw, 32px);
  border-radius: var(--r-l);
}

.gx-plate svg {
  display: block;
  width: 100%;
  height: auto;
}

.gx-ch--it .gx-plate { --acc: var(--c-green); background: var(--c-green-50); box-shadow: inset 0 0 0 1px var(--c-green-100); color: var(--c-green-800); }
.gx-ch--rr .gx-plate { --acc: var(--c-cobalt); background: var(--c-cobalt-50); box-shadow: inset 0 0 0 1px var(--c-cobalt-100); color: var(--c-cobalt-800); }
.gx-ch--md .gx-plate { --acc: var(--c-jade-600); background: var(--c-jade-50); box-shadow: inset 0 0 0 1px var(--c-jade-100); color: var(--c-jade-800); }

.gx-ch--it .gx-kicker { color: var(--c-green); }
.gx-ch--rr .gx-kicker { color: var(--c-cobalt-600); }
.gx-ch--md .gx-kicker { color: var(--c-jade-700); }

/* The reading order. */
.gx-read {
  grid-column: 3 / 5;
  margin: 0;
  padding: 0 var(--inset);
  list-style: none;
  counter-reset: g;
}

.gx-read li {
  margin: 0;
  padding: 0;
  counter-increment: g;
}

.gx-read li::before {
  content: none;
}

.gx-read li + li {
  border-top: 1px solid var(--line);
}

.gx-read a {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 6px 14px;
  padding: 22px 0;
  color: var(--ink);
  text-decoration: none;
}

.gx-read a::before {
  content: counter(g, decimal-leading-zero);
  grid-row: 1 / 5;
  padding-top: 3px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.gx-read strong {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.012em;
  transition: color var(--t-1) var(--ease);
}

.gx-read a:hover strong {
  color: var(--c-green);
}

.gx-read__say {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* The first guide in a chapter: a little more room, and a badge. */
.gx-read__first a {
  padding: 26px 24px;
  margin: 0 -24px 8px;
  border-radius: var(--r-l);
  background: var(--c-white);
  box-shadow: inset 0 0 0 1px var(--line-lit), 0 24px 48px -36px rgba(16, 44, 54, 0.4);
}

.gx-read__first strong {
  font-size: 21px;
  letter-spacing: -0.02em;
}

.gx-read__first .gx-read__say {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.gx-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--r-tag);
  background: var(--c-ink);
  color: var(--c-white);
  font-size: 12.5px;
  font-weight: 600;
}

.gx-read__first + li {
  border-top: 0;
}

/* 4. Comparisons, on deep ink. */
.gx-cmp {
  padding: clamp(72px, 8vw, 120px) 0;
  background: var(--c-ink-ground);
  scroll-margin-top: 56px;
}

.gx-cmp .guides i {
  border-color: rgba(255, 255, 255, 0.06);
}

.gx-cmp__head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
}

.gx-cmp__head > div:first-child {
  grid-column: 1 / 3;
  padding: 0 var(--inset);
}

.gx-cmp .gx-kicker {
  color: var(--c-jade);
}

.gx-cmp h2 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.gx-cmp__head p {
  max-width: 26em;
  margin: 16px 0 0;
  color: var(--c-mist);
  font-size: 17px;
  line-height: 1.55;
}

.gx-cmp__art {
  --acc: var(--c-lime);
  grid-column: 3 / 5;
  max-width: 380px;
  justify-self: end;
  padding: 0 var(--inset);
  color: var(--c-jade);
}

.gx-cmp__art svg {
  display: block;
  width: 100%;
  height: auto;
}

.gx-cmp__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: clamp(40px, 5vw, 64px) 0 0;
  padding: 0 var(--inset);
  list-style: none;
}

.gx-cmp__list li {
  margin: 0;
  padding: 0;
}

.gx-cmp__list li::before {
  content: none;
}

.gx-cmp__list a {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 24px;
  border-radius: var(--r-l);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: var(--c-white);
  text-decoration: none;
  transition: background var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease);
}

.gx-cmp__list a:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--c-jade);
}

.gx-cmp__list strong {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.32;
}

.gx-cmp__list .gx-read__say {
  flex: 1;
  color: var(--c-mist);
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.gx-cmp__list .gx-meta {
  color: var(--c-mist);
}

/* 5. The other places to learn. */
.gx-else {
  padding: clamp(56px, 6vw, 88px) 0;
}

.gx-else .frame {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gx-else__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 var(--inset);
  padding-top: 18px;
  border-top: 2px solid var(--c-ink);
  color: var(--ink);
  text-decoration: none;
}

.gx-else__item b {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.gx-else__item b::after {
  content: " →";
  color: var(--c-green);
  transition: margin var(--t-1) var(--ease);
}

.gx-else__item:hover b::after {
  margin-left: 4px;
}

.gx-else__item > span:last-child {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
}

/* Tablet. */
@media (max-width: 1023px) {
  .gx-mast__head h1,
  .gx-mast__head p,
  .gx-lead__story,
  .gx-new,
  .gx-ch__side,
  .gx-read,
  .gx-ch--flip .gx-ch__side,
  .gx-ch--flip .gx-read,
  .gx-cmp__head > div:first-child,
  .gx-cmp__art {
    grid-column: 1 / 5;
  }

  .gx-ch--flip .gx-read {
    grid-row: 2;
  }

  .gx-mast__head p {
    margin-top: 20px;
  }

  .gx-new {
    margin-top: 32px;
  }

  .gx-ch__side {
    position: static;
    margin-bottom: 24px;
  }

  .gx-plate {
    max-width: 520px;
  }

  .gx-cmp__art {
    justify-self: start;
    max-width: 320px;
    margin-top: 24px;
  }

  .gx-cmp__list,
  .gx-else .frame {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gx-else .frame {
    gap: 28px;
  }
}

/* Phone. */
@media (max-width: 719px) {
  .gx-lead__story {
    grid-template-columns: 1fr;
  }

  .gx-lead__say {
    padding: 0 22px 26px;
  }

  .gx-read__first a {
    margin: 0 -14px 8px;
    padding: 22px 14px;
  }

  .gx-read a {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px 10px;
  }
}

.gx-lead__say b {
  color: var(--c-white);
}

.gx-lead__rest {
  display: block;
}

.gx-lead__rest::first-letter {
  text-transform: uppercase;
}

@media (max-width: 1023px) {
  .gx-read__first a {
    margin: 0 0 8px;
    padding: 22px 18px;
  }
}

/* ---------------------------------------------------------------------------
   Third pass (Rolf, 19 Nov): a stronger lead, no repeats, tighter rhythm.
   --------------------------------------------------------------------------- */
.gx-mast {
  padding: clamp(40px, 5.5vw, 80px) 0 clamp(44px, 5vw, 72px);
}

.gx-mast__head {
  padding-bottom: clamp(28px, 3.4vw, 44px);
}

/* The lead, full width: kicker, title, subtitle, description, then the meta and a call. */
.gx-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  margin: clamp(28px, 3.4vw, 44px) var(--inset) 0;
  overflow: hidden;
  border-radius: var(--r-l);
  background: var(--c-ink-ground);
  color: var(--c-white);
  text-decoration: none;
  box-shadow: 0 40px 80px -48px rgba(16, 44, 54, 0.7);
}

.gx-lead__say {
  display: flex;
  flex-direction: column;
  padding: clamp(32px, 4vw, 64px);
}

.gx-lead__say .gx-kicker {
  margin: 0 0 20px;
  color: var(--c-jade);
}

.gx-lead__title {
  color: var(--c-white);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.gx-lead__rest {
  display: block;
  margin-top: 14px;
  color: var(--c-jade);
  font-size: clamp(19px, 1.7vw, 24px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.gx-lead__rest::first-letter {
  text-transform: uppercase;
}

.gx-lead__dek {
  max-width: 32em;
  margin-top: 22px;
  color: var(--c-mist);
  font-size: 16.5px;
  line-height: 1.6;
}

.gx-lead__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.gx-lead__foot .gx-meta {
  color: var(--c-mist);
}

.gx-lead__go {
  color: var(--c-white);
  font-size: 15px;
  font-weight: 600;
}

.gx-lead__go::after {
  content: " →";
  color: var(--c-jade);
  transition: margin var(--t-1) var(--ease);
}

.gx-lead:hover .gx-lead__go::after {
  margin-left: 4px;
}

.gx-lead__art {
  --acc: var(--c-lime);
  display: block;
  padding: clamp(24px, 3vw, 48px) clamp(24px, 3vw, 48px) clamp(24px, 3vw, 48px) 0;
  color: var(--c-jade);
}

.gx-lead__art svg {
  display: block;
  width: 100%;
  height: auto;
  transition: transform var(--t-3) var(--ease);
}

.gx-lead:hover .gx-lead__art svg {
  transform: translateX(6px);
}

/* Topics: tighter rhythm, the drawing a touch smaller. */
.gx-ch {
  padding: clamp(56px, 6vw, 92px) 0;
}

.gx-ch__side h2 {
  font-size: clamp(30px, 3.2vw, 46px);
}

.gx-ch__lede {
  margin-top: 12px;
}

.gx-plate {
  max-width: 460px;
  margin-top: 24px;
}

.gx-read a {
  padding: 18px 0;
}

.gx-read li:first-child a {
  padding-top: 4px;
}

.gx-read__say {
  display: block;
  -webkit-line-clamp: none;
  line-clamp: none;
  overflow: visible;
}

.gx-cmp {
  padding: clamp(56px, 6vw, 92px) 0;
}

.gx-cmp__list {
  margin-top: clamp(32px, 4vw, 48px);
}

.gx-cmp__list .gx-read__say {
  display: block;
}

.gx-else {
  padding: clamp(48px, 5vw, 72px) 0;
}

@media (max-width: 1023px) {
  .gx-lead {
    grid-template-columns: 1fr;
  }

  .gx-lead__art {
    order: -1;
    max-width: 520px;
    padding: 28px 28px 0;
  }
}
