/* Guide pages. One stylesheet for every guide.
   Same paper, ink and type as the landing page (landing.css).
   Handwriting (Kalam) is the annotation layer: labels, notes, dates, sign-offs.
   Reading text is Inter. Headings are Fraunces. */

:root {
  --paper: #fdfbf6;
  --paper-deep: #f7f1e6;
  --white: #ffffff;
  --ink: #1e293b;
  --ink-2: #434c5e;
  --muted: #667085;
  --accent: #547a95;
  --accent-deep: #45657c;
  --accent-soft: #e8eef3;
  --sand: #a79277;
  --sand-deep: #7a6650;
  --sand-soft: #eadbc8;
  --note: #fbf2cf;
  --warn: #8f4a2c;
  --warn-soft: #fbece4;
  --line: rgba(30, 41, 59, 0.1);
  --line-strong: rgba(30, 41, 59, 0.18);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Kalam", "Segoe Print", "Bradley Hand", cursive;

  --shadow-sm: 0 1px 2px rgba(30, 41, 59, 0.04), 0 6px 16px -6px rgba(30, 41, 59, 0.08);
  --shadow-md: 0 2px 4px rgba(30, 41, 59, 0.04), 0 22px 44px -18px rgba(30, 41, 59, 0.22);
  --shadow-lg: 0 2px 6px rgba(30, 41, 59, 0.06), 0 40px 80px -32px rgba(30, 41, 59, 0.42);

  --squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8c14-6 27-6 40-2s26 4 38 0 24-5 38-1' fill='none' stroke='%23A79277' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-9' fill='none' stroke='%2345657C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 9V6.5a4 4 0 0 1 8 0V9' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3Crect x='4.5' y='9' width='11' height='8' rx='2' fill='%23000'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body.g-page {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

.g-page img {
  display: block;
  max-width: 100%;
  height: auto;
}

.g-page [hidden] {
  display: none !important;
}

:where(.g-page) fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

:where(.g-page) legend {
  padding: 0;
}

.g-page ::selection {
  background: var(--sand-soft);
}

.g-page :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.g-page [id] {
  scroll-margin-top: 92px;
}

.g-skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10010;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.g-skip:focus {
  transform: none;
}

.g-print-only {
  display: none;
}

/* ---------- Page layout ---------- */

.g-main {
  position: relative;
  width: min(100% - 40px, 720px);
  margin-inline: auto;
  padding: 26px 0 72px;
}

/* Soft glows behind the hero. Painted as a page background so they can never
   widen the page on phones. */
body.g-page {
  background-image:
    radial-gradient(closest-side at 78% 30%, rgba(234, 219, 200, 0.62), rgba(234, 219, 200, 0)),
    radial-gradient(closest-side at 16% 60%, rgba(84, 122, 149, 0.1), rgba(84, 122, 149, 0));
  background-repeat: no-repeat;
  background-position: center -60px;
  background-size: min(1100px, 150vw) 620px;
}

.g-toc {
  display: none;
}

@media (min-width: 1100px) {
  .g-main {
    display: grid;
    grid-template-columns: 208px minmax(0, 720px);
    column-gap: 72px;
    justify-content: center;
    width: min(100% - 64px, 1000px);
    padding-top: 44px;
  }

  .g-main > * {
    grid-column: 2;
  }

  .g-toc {
    display: block;
    grid-column: 1;
    grid-row: 1 / span 4;
    position: sticky;
    top: 92px;
    align-self: start;
    max-height: calc(100vh - 116px);
    overflow-y: auto;
    padding: 6px 4px 12px 0;
    scrollbar-width: thin;
  }
}

@media (min-width: 1320px) {
  .g-main {
    grid-template-columns: 208px minmax(0, 720px) 208px;
    column-gap: 56px;
    width: min(100% - 64px, 1248px);
  }
}

/* ---------- Hero ---------- */

.g-hero {
  padding: 8px 0 34px;
}

.g-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted);
}

.g-crumbs a {
  color: var(--accent-deep);
  text-decoration: none;
}

.g-crumbs a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.g-crumbs__sep {
  color: var(--sand);
}

.g-crumbs__stage {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.g-crumbs__num {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--sand-deep);
}

.g-hero__kicker {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.g-hero__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 7.4vw, 3.7rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

.g-hero__title .g-word {
  display: inline-block;
}

.g-scribble {
  background-image: var(--squiggle);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.2em;
  padding-bottom: 0.1em;
}

.g-hero__sub {
  max-width: 34rem;
  margin: 16px 0 0;
  font-family: var(--hand);
  font-size: clamp(1.25rem, 3.4vw, 1.5rem);
  line-height: 1.35;
  color: var(--sand-deep);
}

.g-hero__sub .g-mark {
  color: var(--ink);
}

.g-hero__by {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-2);
}

.g-hero__by::before {
  content: "";
  flex: none;
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--sand-soft) url("/assets/simran-harvard.jpg") 57.5% 56.5% / 520% auto no-repeat;
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-sm);
}

.g-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.g-hero__meta li {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

/* ---------- Sections and reading text ----------
   Reading styles apply inside sections and inside loose blocks that sit
   directly in the flow (a "Start here" note, a link menu). They never reach
   the unlock card (#sim-gate), which is also a child of the flow.
   :where() keeps these rules easy for components to override. */

.g-flow {
  min-width: 0;
}

.g-section {
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

/* Loose blocks above the first section ("Start here" note, link menu, photo) */
.g-flow > .g-note,
.g-flow > .g-card,
.g-flow > .g-figure {
  margin-top: 0;
  margin-bottom: 36px;
}

.g-flow > p {
  margin: 0 0 1.05em;
}

.g-flow > p:last-of-type {
  margin-bottom: 28px;
}

/* Keeps a floated margin note inside its own section */
.g-section::after {
  content: "";
  display: block;
  clear: both;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) > :first-child {
  margin-top: 0;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) > :last-child {
  margin-bottom: 0;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) h2 {
  position: relative;
  margin: 0 0 18px;
  padding-top: 20px;
  font-family: var(--serif);
  font-size: clamp(1.62rem, 4.6vw, 2.15rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.022em;
  color: var(--ink);
  text-wrap: balance;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 8px;
  background: var(--squiggle) 0 50% / 100% 100% no-repeat;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) h3 {
  margin: 30px 0 10px;
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) h4 {
  margin: 24px 0 8px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) p {
  margin: 0 0 1.05em;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) strong {
  font-weight: 600;
  color: var(--ink);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: rgba(69, 101, 124, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) a:hover {
  text-decoration-color: currentColor;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) ul,
:where(.g-section, .g-flow > :not(section, #sim-gate)) ol {
  margin: 0 0 1.15em;
  padding: 0;
  list-style: none;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) li {
  position: relative;
  margin: 0 0 0.55em;
  padding-left: 1.55em;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) li:last-child {
  margin-bottom: 0;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) ul > li::before {
  content: "";
  position: absolute;
  left: 0.3em;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sand);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) ol {
  counter-reset: g-ol;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) ol > li {
  counter-increment: g-ol;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) ol > li::before {
  content: counter(g-ol) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--accent-deep);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) li > ul,
:where(.g-section, .g-flow > :not(section, #sim-gate)) li > ol {
  margin: 0.5em 0 0;
}

/* Text helpers */

.g-lede {
  font-size: 1.14em;
  line-height: 1.62;
  color: var(--ink);
}

.g-intro {
  max-width: 40rem;
  color: var(--ink-2);
}

.g-center {
  text-align: center;
}

.g-center.g-intro,
.g-center .g-intro {
  margin-inline: auto;
}

.g-muted {
  color: var(--muted);
}

.g-small {
  font-size: 0.9em;
}

.g-hand {
  font-family: var(--hand);
  font-size: 1.2em;
  line-height: 1.4;
  color: var(--ink);
}

.g-hand--lg {
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  line-height: 1.3;
}

.g-hand--accent {
  color: var(--accent-deep);
}

.g-mark {
  padding: 0.05em 0.3em;
  border-radius: 0.7em 0.25em 0.8em 0.3em;
  background: linear-gradient(
    102deg,
    rgba(234, 219, 200, 0) 0.9%,
    rgba(234, 219, 200, 0.95) 2.6%,
    rgba(234, 219, 200, 0.78) 96%,
    rgba(234, 219, 200, 0) 98.5%
  );
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.g-mark--blue {
  background: linear-gradient(
    102deg,
    rgba(84, 122, 149, 0) 0.9%,
    rgba(84, 122, 149, 0.26) 2.6%,
    rgba(84, 122, 149, 0.2) 96%,
    rgba(84, 122, 149, 0) 98.5%
  );
}

.g-eyebrow + h2,
.g-eyebrow + h3,
.g-eyebrow + h4 {
  margin-top: 0 !important;
}

.g-hand em,
.g-sticky em,
.g-margin em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.g-eyebrow {
  margin: 0 0 6px !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.g-fineprint {
  font-size: 13.5px;
  font-style: italic;
  line-height: 1.55;
  color: var(--muted);
}

.g-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 11px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--accent-deep);
}

.g-pill--ink {
  background: var(--ink);
  color: #fff;
}

.g-pill--sand {
  background: var(--sand-soft);
  color: var(--sand-deep);
}

.g-pill--hand {
  min-height: 30px;
  padding: 5px 14px 3px;
  font-family: var(--hand);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

/* ---------- Lists ---------- */

:where(.g-section, .g-flow > :not(section, #sim-gate)) ul.g-checks > li::before {
  left: 0;
  top: 0.32em;
  width: 1.05em;
  height: 1.05em;
  border-radius: 0;
  background: var(--tick) center / contain no-repeat;
}

/* Label and detail rows, for lists like "Target: ..." */
:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-kv {
  border-top: 1px solid var(--line);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-kv > li {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-kv > li::before {
  content: none;
}

/* Numbered steps. Use on <ol>. Add g-steps--typed when the numbers are
   written in the text and wrapped in .g-steps__n. */
:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-steps {
  display: grid;
  gap: 14px;
  counter-reset: g-step;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-steps > li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  margin: 0;
  padding: 0;
  counter-increment: g-step;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-steps > li::before,
.g-steps__n {
  content: counter(g-step);
  position: static;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-steps--typed > li::before {
  content: none;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-steps--hand > li::before,
.g-steps--hand .g-steps__n {
  background: transparent;
  border: 1.5px solid var(--sand);
  font-family: var(--hand);
  font-size: 17px;
  font-weight: 700;
  color: var(--sand-deep);
  padding-top: 2px;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-steps > li > :last-child {
  margin-bottom: 0;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-steps h3,
:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-steps h4 {
  margin-top: 4px;
}

/* Reading-path rows built by a guide's own script (link plus a short note) */
.g-path__link {
  font-weight: 600;
}

.g-path__note {
  display: block;
  margin-top: 2px;
  font-size: 0.92em;
  line-height: 1.5;
  color: var(--muted);
}

/* Big link rows, for "read next" lists */
:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-links {
  border-top: 1px solid var(--line);
  text-align: left;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-links > li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-links > li::before {
  content: none;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 2px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-links a::after {
  content: "\2192";
  flex: none;
  color: var(--accent-deep);
  transition: transform 0.2s ease;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-links a:hover {
  color: var(--accent-deep);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-links a:hover::after {
  transform: translateX(4px);
}

/* ---------- Cards and grids ---------- */

.g-card {
  position: relative;
  margin: 0 0 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.g-card > :first-child {
  margin-top: 0;
}

.g-card > :last-child {
  margin-bottom: 0;
}

.g-card--soft {
  background: var(--paper-deep);
  box-shadow: none;
}

.g-card--accent {
  border-left: 3px solid var(--accent-deep);
}

.g-card--dashed {
  border: 1.5px dashed rgba(167, 146, 119, 0.75);
  box-shadow: none;
}

.g-card--ink {
  border-color: transparent;
  background: var(--ink);
  color: rgba(245, 241, 232, 0.86);
}

.g-card--ink h3,
.g-card--ink h4,
.g-card--ink strong {
  color: #fff;
}

.g-card--ink a {
  color: var(--sand-soft);
}

.g-card--center {
  text-align: center;
}

.g-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 8px;
}

.g-card__head > * {
  margin: 0 !important;
}

.g-card__lead {
  font-style: italic;
  color: var(--muted);
}

@media (hover: hover) {
  .g-card:not(.g-card--ink):not(.g-card--soft)::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
      260px circle at var(--mx, 50%) var(--my, 50%),
      rgba(234, 219, 200, 0.42),
      rgba(234, 219, 200, 0) 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  .g-card:hover::after {
    opacity: 1;
  }

  .g-card > * {
    position: relative;
    z-index: 1;
  }
}

.g-grid {
  display: grid;
  gap: 16px;
  margin: 0 0 18px;
}

.g-grid > * {
  margin: 0;
  min-width: 0;
}

@media (min-width: 640px) {
  .g-grid--2,
  .g-grid--3,
  .g-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  .g-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .g-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Text beside a figure */
.g-split {
  display: grid;
  gap: 24px;
  align-items: center;
  margin: 0 0 18px;
}

.g-split > * {
  min-width: 0;
  margin: 0;
}

@media (min-width: 760px) {
  .g-split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 32px;
  }

  .g-split--top {
    align-items: start;
  }
}

/* Stat tiles */
.g-stat > :first-child {
  margin-top: 0 !important;
}

.g-stat > :last-child {
  margin-bottom: 0 !important;
}

.g-stat {
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: center;
}

.g-stat__value {
  margin: 0 !important;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.g-stat__label {
  margin: 6px 0 0 !important;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- Notes ---------- */

/* Callout. Optional <p class="g-note__label"> for wording the guide already has. */
.g-note {
  position: relative;
  margin: 22px 0;
  padding: 16px 20px 16px 22px;
  border-radius: 4px 16px 16px 4px;
  border-left: 3px solid var(--sand);
  background: rgba(234, 219, 200, 0.36);
  color: var(--ink-2);
}

.g-note > :first-child {
  margin-top: 0;
}

.g-note > :last-child {
  margin-bottom: 0;
}

.g-note__label {
  margin: 0 0 4px !important;
  font-family: var(--hand);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sand-deep);
}

.g-note--key {
  border-left-color: var(--accent-deep);
  background: var(--accent-soft);
}

.g-note--key .g-note__label {
  color: var(--accent-deep);
}

.g-note--warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.g-note--warn .g-note__label {
  color: var(--warn);
}

/* Sticky note, for one short personal line */
.g-sticky {
  position: relative;
  width: fit-content;
  max-width: min(100%, 30rem);
  margin: 30px auto;
  padding: 22px 26px 18px;
  background: var(--note);
  box-shadow: 0 1px 1px rgba(30, 41, 59, 0.1), 0 16px 28px -16px rgba(30, 41, 59, 0.45);
  transform: rotate(-1.2deg);
  font-family: var(--hand);
  font-size: 1.22rem;
  line-height: 1.4;
  color: var(--ink);
  text-align: center;
}

.g-sticky::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 92px;
  height: 22px;
  background: rgba(167, 146, 119, 0.4);
  transform: translateX(-50%) rotate(1.6deg);
}

.g-sticky > * {
  margin: 0 !important;
}

.g-sticky > * + * {
  margin-top: 0.45em !important;
}

.g-sticky--right {
  transform: rotate(1.1deg);
}

/* Margin note. Sits in the right margin on wide screens, inline elsewhere. */
.g-margin {
  margin: 20px 0;
  padding-left: 16px;
  border-left: 2px solid var(--sand);
  font-family: var(--hand);
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--sand-deep);
}

.g-margin > * {
  margin: 0 !important;
}

@media (min-width: 1320px) {
  .g-margin {
    float: right;
    clear: right;
    width: 200px;
    margin: 4px -256px 16px 0;
    padding: 0 0 0 14px;
    font-size: 1.04rem;
    transform: rotate(-1deg);
  }

  .g-margin::before {
    content: "";
    position: absolute;
    left: -42px;
    top: 10px;
    width: 34px;
    height: 12px;
    background: var(--squiggle) center / 100% 100% no-repeat;
    transform: rotate(-8deg);
  }

  .g-margin {
    position: relative;
  }
}

/* Pull quote */
.g-quote {
  margin: 28px 0;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--sand);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.42;
  color: var(--ink);
}

.g-quote > * {
  margin: 0 !important;
}

.g-quote > * + * {
  margin-top: 0.6em !important;
}

/* ---------- Timeline ---------- */

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-timeline {
  position: relative;
  margin: 26px 0;
  padding: 0;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 0;
  border-left: 1.5px dashed rgba(167, 146, 119, 0.8);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-timeline > li {
  position: relative;
  margin: 0;
  padding: 0 0 26px 36px;
  counter-increment: none;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-timeline > li:last-child {
  padding-bottom: 0;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-timeline > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 15px;
  height: 15px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--accent-deep);
  box-shadow: 0 0 0 1.5px var(--accent-deep);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-timeline > li.is-key::before {
  background: var(--sand-deep);
  box-shadow: 0 0 0 1.5px var(--sand-deep), 0 0 0 6px rgba(167, 146, 119, 0.25);
}

.g-timeline__when {
  display: block;
  margin: 0 0 2px;
  font-family: var(--hand);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sand-deep);
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-timeline h3,
:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-timeline h4 {
  margin: 0 0 6px;
}

:where(.g-section, .g-flow > :not(section, #sim-gate)) .g-timeline > li > :last-child {
  margin-bottom: 0;
}

.g-card .g-timeline > li::before,
.g-card--soft .g-timeline > li::before {
  border-color: #fff;
}

.g-card--soft .g-timeline > li::before {
  border-color: var(--paper-deep);
}

/* Chips joined by arrows: A → B → C */
.g-flowline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
}

.g-flowline > * {
  margin: 0;
}

.g-center .g-flowline,
.g-flowline.g-center {
  justify-content: center;
}

.g-flowline__step {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.g-flowline__step.is-goal {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.g-flowline__arrow {
  font-size: 18px;
  line-height: 1;
  color: var(--sand);
}

/* ---------- Figures ---------- */

.g-figure {
  position: relative;
  margin: 28px auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.g-figure::before,
.g-figure::after {
  content: "";
  position: absolute;
  top: -10px;
  z-index: 2;
  width: 74px;
  height: 22px;
  background: rgba(167, 146, 119, 0.38);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}

.g-figure::before {
  left: 18px;
  transform: rotate(-4deg);
}

.g-figure::after {
  right: 18px;
  transform: rotate(3deg);
}

.g-figure img {
  width: 100%;
  border-radius: 8px;
}

.g-figure figcaption {
  padding: 10px 6px 4px;
  font-family: var(--hand);
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--sand-deep);
  text-align: center;
}

.g-figure--sm {
  max-width: 440px;
}

.g-figure--md {
  max-width: 580px;
}

.g-figure--plain::before,
.g-figure--plain::after {
  content: none;
}

.g-figure.is-zoomable img {
  cursor: zoom-in;
}

.g-split .g-figure {
  margin: 0 auto;
}

.g-zoom {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.g-zoom[open] {
  display: grid;
  place-items: center;
  animation: g-fade 0.2s ease both;
}

.g-zoom::backdrop {
  background: rgba(15, 23, 42, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.g-zoom img {
  max-width: 100%;
  max-height: calc(100dvh - 40px);
  width: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  cursor: zoom-out;
  animation: g-pop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.g-zoom__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

@keyframes g-fade {
  from {
    opacity: 0;
  }
}

@keyframes g-pop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

/* ---------- Tables ---------- */

.g-table-wrap {
  position: relative;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left / 44px 100% no-repeat local,
    linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right / 44px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(30, 41, 59, 0.16), rgba(30, 41, 59, 0)) left / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(30, 41, 59, 0.16), rgba(30, 41, 59, 0)) right / 14px 100% no-repeat scroll,
    #fff;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.g-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
}

.g-table-wrap th,
.g-table-wrap td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.g-table-wrap thead th {
  border-bottom: 1px solid var(--line-strong);
  background: rgba(247, 241, 230, 0.75);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--sand-deep);
  white-space: nowrap;
}

.g-table-wrap tbody th {
  font-weight: 600;
  color: var(--ink);
}

.g-table-wrap tbody tr:last-child > * {
  border-bottom: 0;
}

.g-table-wrap tbody tr:hover > * {
  background-color: rgba(247, 241, 230, 0.45);
}

.g-table-wrap tr.is-hl > * {
  background-color: rgba(232, 238, 243, 0.7);
}

.g-table-wrap tr.is-total > * {
  border-top: 1.5px solid var(--line-strong);
  background-color: rgba(247, 241, 230, 0.75);
  font-weight: 600;
  color: var(--ink);
}

.g-table-wrap .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.g-table--wide {
  min-width: 640px;
}

.g-table--xwide {
  min-width: 860px;
}

/* On a laptop the text column is wide enough. Fit it, no sideways scroll. */
@media (min-width: 900px) {
  .g-table--xwide {
    min-width: 100%;
  }
}

.g-table--compact th,
.g-table--compact td {
  padding: 9px 12px;
  font-size: 13.5px;
}

/* Drops the third column on phones, for a table whose own note says so */
@media (max-width: 639px) {
  .g-table--drop-3 :is(th, td):nth-child(3) {
    display: none;
  }

  .g-table--drop-3.g-table--xwide {
    min-width: 520px;
  }
}

.g-table-hint {
  display: none;
  margin: -14px 0 22px;
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--sand-deep);
  text-align: center;
}

.g-table-wrap.is-scrollable + .g-table-hint {
  display: block;
}

/* Break out of the text column on wide screens (big tables, wide figures) */
@media (min-width: 1320px) {
  .g-wide {
    width: calc(100% + 264px);
    max-width: none;
  }
}

/* ---------- Message and email templates ---------- */

.g-template {
  position: relative;
  margin: 18px 0;
  padding: 20px 22px 20px 26px;
  border: 1px solid var(--line);
  border-radius: 6px 14px 14px 6px;
  background:
    linear-gradient(to right, transparent 13px, rgba(200, 123, 102, 0.45) 13px, rgba(200, 123, 102, 0.45) 14px, transparent 14px),
    #fff;
  box-shadow: var(--shadow-sm);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
}

.g-template > :first-child {
  margin-top: 0;
}

.g-template > :last-child {
  margin-bottom: 0;
}

.g-template.has-copy {
  padding-top: 46px;
}

.g-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.g-copy:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.g-copy.is-done {
  border-color: var(--accent-deep);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

/* ---------- Accordion, tabs, choices, buttons ---------- */

.g-acc {
  border-top: 1px solid var(--line);
}

.g-acc:last-of-type {
  border-bottom: 1px solid var(--line);
}

.g-acc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  list-style: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.g-acc > summary::-webkit-details-marker {
  display: none;
}

.g-acc > summary::after {
  content: "+";
  flex: none;
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  color: var(--accent-deep);
  transition: transform 0.2s ease;
}

.g-acc[open] > summary::after {
  transform: rotate(45deg);
}

.g-acc > summary > * {
  margin: 0 !important;
  font: inherit;
  color: inherit;
}

.g-acc__body {
  padding: 0 0 18px;
}

.g-acc__body > :first-child {
  margin-top: 0;
}

.g-acc__body > :last-child {
  margin-bottom: 0;
}

.g-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.g-tab,
.g-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.g-tab:hover,
.g-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.g-tab[aria-selected="true"],
.g-tab.is-active,
.g-choice input:checked + .g-chip {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.g-choice {
  display: inline-flex;
}

.g-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.g-choice input:focus-visible + .g-chip {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.g-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 22px;
}

.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.g-btn:hover {
  background: #0f172a;
  transform: translateY(-1px);
}

.g-btn svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.g-btn--ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink) !important;
}

.g-btn--ghost:hover {
  border-color: var(--ink);
  background: #fff;
}

.g-btn--sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.g-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.g-center .g-actions,
.g-actions.g-center {
  justify-content: center;
}

.g-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Newsletter block and sign-off ---------- */

.g-newsletter {
  text-align: center;
}

.g-newsletter h2 {
  padding-top: 0;
}

.g-newsletter h2::before {
  content: none;
}

.g-newsletter > p {
  max-width: 34rem;
  margin-inline: auto;
}

.g-embed {
  max-width: 520px;
  margin: 22px auto 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.g-embed + p {
  margin-top: 14px;
}

.g-embed iframe {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-height: 230px;
  max-height: 520px;
  margin: 0;
  border: 0;
  border-radius: 12px !important;
  background: transparent;
}

.g-signoff {
  padding: 44px 0 8px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.g-signoff p {
  margin: 0 0 6px;
}

.g-signoff__name {
  font-family: var(--hand);
  font-size: clamp(1.45rem, 4.4vw, 1.8rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.g-signoff__handle {
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--sand-deep);
}

.g-signoff .g-fineprint {
  max-width: 34rem;
  margin: 14px auto 0;
}

/* ---------- Contents rail (wide screens) ---------- */

.g-toc__title {
  margin: 0 0 10px 14px;
  font-family: var(--hand);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sand-deep);
}

.g-toc__list {
  position: relative;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line-strong);
  list-style: none;
}

.g-toc__marker {
  position: absolute;
  left: -1.5px;
  top: 0;
  width: 2px;
  height: 20px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.g-toc__list a {
  display: block;
  padding: 6px 0 6px 14px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.g-toc__list a:hover {
  color: var(--ink);
}

.g-toc__list a.is-active {
  font-weight: 600;
  color: var(--ink);
}

.g-toc__list a.is-locked,
.g-sheet__list a.is-locked {
  color: rgba(102, 112, 133, 0.72);
}

.g-toc__list a.is-locked::after,
.g-sheet__list a.is-locked::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 6px;
  vertical-align: -1px;
  background: currentColor;
  -webkit-mask: var(--lock) center / contain no-repeat;
  mask: var(--lock) center / contain no-repeat;
  opacity: 0.7;
}

.g-toc__all {
  display: inline-block;
  margin: 18px 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
}

.g-toc__all:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Reading progress, contents dock and sheet (small screens) ---------- */

.g-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10004;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.g-progress__bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, var(--sand), var(--accent-deep));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.g-dock {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  height: 46px;
  padding: 0 16px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px -12px rgba(30, 41, 59, 0.7);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, 24px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.g-dock.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.g-dock__ring {
  flex: none;
  width: 30px;
  height: 30px;
  transform: rotate(-90deg);
}

.g-dock__ring circle {
  fill: none;
  stroke-width: 3;
}

.g-dock__ring circle:first-child {
  stroke: rgba(255, 255, 255, 0.2);
}

.g-dock__ring circle:last-child {
  stroke: var(--sand-soft);
  stroke-linecap: round;
  stroke-dasharray: 75.4;
  stroke-dashoffset: 75.4;
}

.g-dock__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-dock__chev {
  flex: none;
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

@media (min-width: 1100px) {
  .g-dock {
    display: none;
  }
}

.g-sheet {
  width: 100%;
  max-width: 560px;
  max-height: min(78vh, 640px);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 -20px 60px -20px rgba(15, 23, 42, 0.5);
  overflow: hidden;
}

.g-sheet[open] {
  display: flex;
  flex-direction: column;
  animation: g-sheet-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.g-sheet::backdrop {
  background: rgba(15, 23, 42, 0.45);
  animation: g-fade 0.2s ease both;
}

@keyframes g-sheet-up {
  from {
    transform: translateY(100%);
  }
}

.g-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}

.g-sheet__title {
  margin: 0;
  font-family: var(--hand);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--sand-deep);
}

.g-sheet__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.07);
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.g-sheet__list {
  margin: 0;
  padding: 0 20px calc(20px + env(safe-area-inset-bottom));
  list-style: none;
  overflow-y: auto;
}

.g-sheet__list a {
  display: block;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
}

.g-sheet__list li:first-child a {
  border-top: 0;
}

.g-sheet__list a.is-active {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- End of guide ---------- */

.g-end {
  padding: 40px 0 0;
}

.sim-locked .g-end {
  display: none;
}

.g-letter {
  margin: 0 0 28px;
  padding: 30px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper-deep);
  text-align: center;
}

.g-letter__kicker {
  margin: 0 0 4px;
  font-family: var(--hand);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sand-deep);
}

.g-letter__title {
  margin: 0 auto 8px;
  max-width: 22ch;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.6vw, 1.75rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}

.g-letter__text {
  margin: 0 auto;
  max-width: 34rem;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.g-letter .g-embed {
  margin-top: 18px;
}

.g-letter .g-embed iframe {
  height: 300px;
}

.g-letter .g-fineprint {
  margin: 12px 0 0;
}

.g-next {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 26px 28px;
  border-radius: 22px;
  background: var(--ink);
  color: rgba(245, 241, 232, 0.82);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.g-next::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(84, 122, 149, 0.5), rgba(84, 122, 149, 0));
  pointer-events: none;
}

.g-next > * {
  position: relative;
}

.g-next:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.g-next__label {
  font-family: var(--hand);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sand-soft);
}

.g-next__title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4.4vw, 1.95rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
}

.g-next__promise {
  max-width: 34rem;
  font-size: 15.5px;
  line-height: 1.5;
}

.g-next__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
}

.g-next__go svg {
  transition: transform 0.2s ease;
}

.g-next:hover .g-next__go svg {
  transform: translateX(4px);
}

.g-end__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.g-end__row a,
.g-end__row button {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
  cursor: pointer;
}

.g-end__row a:hover,
.g-end__row button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Motion ---------- */

.js .g-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .g-reveal.is-in {
  opacity: 1;
  transform: none;
}

.js .g-hero__title .g-word {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(0.18em);
  animation: g-word 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 70ms + 60ms);
}

@keyframes g-word {
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

.js .g-hero__title .g-word.g-scribble {
  background-size: 0% 0.2em;
  animation:
    g-word 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards,
    g-scribble 0.7s cubic-bezier(0.3, 0.7, 0.2, 1) forwards;
  animation-delay:
    calc(var(--i, 0) * 70ms + 60ms),
    calc(var(--i, 0) * 70ms + 520ms);
}

@keyframes g-scribble {
  to {
    background-size: 100% 0.2em;
  }
}

#sim-nav {
  transition: transform 0.3s ease;
}

#sim-nav.is-tucked {
  transform: translateY(-100%);
}

@media (prefers-reduced-motion: reduce) {
  .js .g-reveal,
  .js .g-hero__title .g-word {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
    animation: none;
  }

  .js .g-hero__title .g-word.g-scribble {
    background-size: 100% 0.2em;
    animation: none;
  }

  #sim-nav,
  .g-dock,
  .g-toc__marker,
  .g-next,
  .g-btn {
    transition: none;
  }

  .g-sheet[open],
  .g-zoom[open],
  .g-zoom img {
    animation: none;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  body.g-page {
    font-size: 16.5px;
  }

  .g-section {
    padding: 36px 0;
  }

  .g-card {
    padding: 18px 18px;
    border-radius: 16px;
  }

  .g-table-wrap {
    margin-inline: -20px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .g-table-wrap th,
  .g-table-wrap td {
    padding: 11px 14px;
  }

  .g-table-wrap th:first-child,
  .g-table-wrap td:first-child {
    padding-left: 20px;
  }

  .g-figure {
    padding: 6px;
  }

  .g-figure::before,
  .g-figure::after {
    width: 58px;
    height: 18px;
  }

  .g-next {
    padding: 22px 22px;
  }

  .g-actions .g-btn {
    flex: 1 1 100%;
  }
}

/* ---------- Handwritten reading text ----------
   The guide text is set in Kalam, like a notebook. Kalam runs small next to
   Inter, so it gets a larger size. Things you scan rather than read (tables,
   templates to copy, labels, buttons, the unlock card) stay in Inter. */

.g-flow {
  font-family: var(--hand);
  font-size: 19.5px;
  line-height: 1.6;
  color: var(--ink);
}

.g-flow em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--sand);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.g-flow strong,
.g-flow b {
  font-weight: 700;
}

/* With all text handwritten, the hand accents stand out by colour and size */
.g-flow .g-hand {
  font-size: 1.12em;
  color: var(--accent-deep);
}

.g-flow :is(.g-table-wrap, .g-template, .g-eyebrow, .g-fineprint, .g-stat__label, .g-pill:not(.g-pill--hand), .g-btn, .g-chip, .g-copy, .g-tab, .g-embed, #sim-gate) {
  font-family: var(--sans);
}

.g-flow :is(.g-table-wrap, .g-template) {
  font-size: 15px;
  line-height: 1.6;
}

.g-flow .g-fineprint {
  font-size: 13.5px;
}

#sim-gate {
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- Watermark ----------
   A faint diagonal mark over the whole guide. Light enough to read through,
   but it shows up in screenshots. Clicks pass through it. */

body.g-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260'%3E%3Ctext x='210' y='130' text-anchor='middle' transform='rotate(-28 210 130)' font-family='Georgia, serif' font-style='italic' font-size='19' fill='%231E293B'%3Esim.explains %C2%B7 Dr. Simran Narula%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
  opacity: 0.05;
  pointer-events: none;
}

/* ---------- Read online only ----------
   Text in the guide cannot be selected, and pictures cannot be dragged out.
   Templates and form fields stay selectable so they still work. */

.g-flow {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.g-flow :is(.g-template, input, textarea, select, #sim-gate) {
  -webkit-user-select: text;
  user-select: text;
}

.g-flow img {
  -webkit-user-drag: none;
  pointer-events: auto;
}

.g-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10050;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.g-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Print ----------
   Guides are read online. Printing or "Save as PDF" gives one page that
   points back to the site instead of the guide. */

.g-print-note {
  display: none;
}

@media print {
  body.g-page > * {
    display: none !important;
  }

  body.g-page::after {
    display: none;
  }

  body.g-page {
    background: #fff;
    background-image: none;
  }

  body.g-page > .g-print-note {
    display: block !important;
    margin: 30vh auto 0;
    max-width: 30rem;
    font-family: var(--sans);
    font-size: 13pt;
    line-height: 1.6;
    color: #1e293b;
    text-align: center;
  }

  .g-print-note strong {
    display: block;
    margin-bottom: 8pt;
    font-family: var(--serif);
    font-size: 20pt;
    font-weight: 500;
  }
}

/* Page-to-page cross-fade, matching the landing page. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: g-vt-out 0.22s ease both;
  }

  ::view-transition-new(root) {
    animation: g-vt-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  @keyframes g-vt-out {
    to {
      opacity: 0;
    }
  }

  @keyframes g-vt-in {
    from {
      opacity: 0;
      translate: 0 14px;
    }
  }
}
