/* The guides: the index (/guides/) and every guide article. Loaded after each page's own
   <style>, so it restyles them without touching their content. Pairs with js/guides.v1.js. v2: the accent is ice blue, not gold.
   Same ground, type and ice blue accent as the main site. */
:root{
  --ice: #c6d6ff; --ice-deep: #8fa9e0;
  --muted: rgba(236,241,248,0.74); --dim: rgba(236,241,248,0.58); --line: rgba(255,255,255,0.09);
  --card: linear-gradient(180deg, rgba(186,208,255,0.055), rgba(186,208,255,0.015));
  --card-line: rgba(186,208,255,0.15);
}
body{ font-size: 16.5px; line-height: 1.72; }
/* a soft light over the top of every guide */
body::before{
  content: ""; position: absolute; inset: 0 0 auto; height: 620px; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 100% at 50% 0%, rgba(186,208,255,0.09), transparent 70%),
              radial-gradient(30% 60% at 78% 0%, rgba(198,214,255,0.06), transparent 70%);
}
.wrap{ position: relative; z-index: 1; padding-top: 22px; }
a:hover{ color: #fff; }

/* ---------- header ---------- */
.g-head{
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 0 72px; padding: 10px 10px 10px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.09); background: rgba(12,16,22,0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.g-head .top{ margin: 0; }
.g-nav{ display: flex; align-items: center; gap: 4px; }
.g-nav a{ padding: 8px 12px; border-radius: 999px; font-size: 13.5px; color: var(--muted); text-decoration: none; }
.g-nav a:hover{ color: #fff; background: rgba(255,255,255,0.06); }
.g-nav a[aria-current="page"]{ color: #fff; }
.g-nav .g-book{ margin-left: 6px; padding: 9px 16px; background: #fff; color: #0b0f14; font-weight: 500; }
.g-nav .g-book:hover{ background: #e9eef6; color: #0b0f14; }
@media (max-width: 620px){
  .g-head{ margin-bottom: 52px; padding-left: 14px; }
  .g-nav a:not(.g-book):not(.g-keep){ display: none; }
  .top span{ display: none; }
}

/* ---------- article head ---------- */
.g-eyebrow{ display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.g-eyebrow a{ color: var(--ice); text-decoration: none; }
.g-eyebrow a:hover{ color: #fff; }
.g-eyebrow i{ width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }
h1{ font-size: clamp(36px, 6.4vw, 58px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 500; margin-bottom: 18px; }
h1 em{ color: var(--ice); font-size: 1.06em; letter-spacing: -0.02em; }
.updated{ font-size: 13.5px; margin-bottom: 34px; }
.lede{ font-size: 19.5px; line-height: 1.6; color: rgba(244,247,252,0.88); margin-bottom: 30px; padding-left: 20px; border-left: 2px solid var(--ice); }

/* ---------- body ---------- */
h2{
  font-size: clamp(22px, 2.6vw, 27px); line-height: 1.2; font-weight: 500; letter-spacing: -0.025em;
  margin: 64px 0 16px; padding-top: 30px; border-top: 0; scroll-margin-top: 28px;
}
h2::before{ content: ""; display: block; width: 28px; height: 2px; margin-bottom: 18px; border-radius: 2px; background: var(--ice); }
h2:first-of-type{ padding-top: 0; }
h3{ font-size: 17.5px; font-weight: 500; margin: 30px 0 10px; color: #fff; }
p, li{ color: var(--muted); }
strong{ color: #fff; }
ul, ol{ padding-left: 22px; }
li::marker{ color: var(--ice-deep); }
p a, li a, td a{ text-decoration: underline; text-decoration-color: rgba(198,214,255,0.45); text-underline-offset: 3px; }
p a:hover, li a:hover, td a:hover{ text-decoration-color: var(--ice); }

/* the "in short" list and the sources: cards */
.quick{
  list-style: none; padding: 8px 22px; margin: 14px 0 28px; border-radius: 18px;
  border: 1px solid var(--card-line); background: var(--card); counter-reset: q;
}
.quick li{ position: relative; margin: 0; padding: 14px 0 14px 40px; border-bottom: 1px solid var(--line); counter-increment: q; }
.quick li:last-child{ border-bottom: 0; }
.quick li::before{
  content: counter(q); position: absolute; left: 0; top: 14px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #0b0f14; background: var(--ice);
}
.sources{ list-style: none; padding: 6px 20px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.02); }
.sources li{ font-size: 14px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sources li:last-child{ border-bottom: 0; }

/* tables: a card, the header row lifted, our column in ice blue */
.table-wrap{ margin: 20px 0 30px; border-radius: 18px; border: 1px solid var(--card-line); background: var(--card); }
.table-wrap table{ margin: 0; font-size: 14.5px; }
.table-wrap th, .table-wrap td{ padding: 13px 16px; }
.table-wrap thead th{ background: rgba(255,255,255,0.03); color: var(--dim); }
.table-wrap tbody tr:last-child > *{ border-bottom: 0; }
.table-wrap tbody tr:hover > *{ background: rgba(255,255,255,0.02); }
td.ours, th.ours{ color: var(--ice); background: rgba(198,214,255,0.05); }
thead th.ours{ color: var(--ice); }

/* questions */
details{ margin: 0 0 10px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.02); transition: border-color .2s ease, background .2s ease; }
details:hover{ border-color: rgba(255,255,255,0.16); }
details[open]{ border-color: rgba(198,214,255,0.3); background: rgba(198,214,255,0.03); }
summary{ font-size: 16px; }
summary::after{ color: var(--ice); font-size: 18px; line-height: 1; }

.cta{ padding: 12px 20px; border-radius: 999px; border: 0; background: #fff; color: #0b0f14; font-weight: 500; transition: background .2s ease; }
.cta:hover{ background: #e9eef6; color: #0b0f14; }

/* ---------- in this guide ---------- */
details.g-toc{ margin: 0 0 40px; padding: 0; border-color: var(--line); background: rgba(255,255,255,0.02); }
details.g-toc summary{ padding: 14px 18px; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
details.g-toc[open]{ border-color: var(--line); background: rgba(255,255,255,0.02); }
details.g-toc[open] summary{ border-bottom: 1px solid var(--line); }
.g-toc ol, .g-rail ol{ list-style: none; padding: 10px 18px 14px; margin: 0; }
.g-toc li, .g-rail li{ margin: 0; }
.g-toc a, .g-rail a{ display: block; padding: 6px 0; font-size: 14.5px; line-height: 1.4; color: var(--muted); text-decoration: none; }
.g-toc a:hover, .g-rail a:hover{ color: #fff; }
.g-rail{ display: none; }
@media (min-width: 1280px){
  details.g-toc{ display: none; }
  .g-rail{
    display: block; position: fixed; top: 120px; width: 220px; left: calc(50% - 360px - 268px);
    max-height: calc(100vh - 160px); overflow: auto; opacity: 0; transform: translateY(8px);
    transition: opacity .4s ease, transform .4s ease;
  }
  .g-rail.is-on{ opacity: 1; transform: none; }
  .g-rail b{ display: block; margin-bottom: 8px; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
  .g-rail ol{ padding: 0; border-left: 1px solid var(--line); }
  .g-rail a{ padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13.5px; color: var(--dim); }
  .g-rail a.is-here{ color: #fff; border-left-color: var(--ice); }
}

/* ---------- reading progress ---------- */
.g-progress{ position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 50; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--ice-deep), var(--ice)); }

/* ---------- the close: a call to action and more guides ---------- */
.g-close{
  position: relative; overflow: hidden; margin: 64px 0 18px; padding: 34px 32px; border-radius: 24px;
  border: 1px solid rgba(198,214,255,0.24);
  background: radial-gradient(80% 120% at 100% 0%, rgba(198,214,255,0.12), transparent 60%), linear-gradient(180deg, rgba(186,208,255,0.06), rgba(186,208,255,0.015));
}
.g-close small{ display: block; margin-bottom: 10px; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ice); }
.g-close h2{ margin: 0 0 10px; padding: 0; font-size: clamp(24px, 3vw, 30px); }
.g-close h2::before{ content: none; }
.g-close h2 em{ font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; color: var(--ice); font-size: 1.06em; }
.g-close p{ max-width: 520px; margin-bottom: 22px; }
.g-btns{ display: flex; flex-wrap: wrap; gap: 10px; }
.g-btns a{ display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; font-size: 14.5px; font-weight: 500; text-decoration: none; }
.g-btns .g-solid{ background: #fff; color: #0b0f14; }
.g-btns .g-solid:hover{ background: #e9eef6; color: #0b0f14; }
.g-btns .g-ghost{ border: 1px solid rgba(255,255,255,0.22); color: #fff; }
.g-btns .g-ghost:hover{ border-color: #fff; }
.further{ border-top: 0; padding-top: 0; margin-top: 26px; font-size: 15px; }

.g-more{ margin-top: 56px; }
.g-more > b{ display: block; margin-bottom: 16px; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.g-more ul{ list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.g-more li{ margin: 0; }
@media (max-width: 720px){ .g-more ul{ grid-template-columns: 1fr; } .g-close{ padding: 28px 22px; } }

/* ---------- a guide card (index and "keep reading") ---------- */
.g-card{
  position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%;
  padding: 20px 20px 18px; border-radius: 18px; text-decoration: none; color: inherit;
  border: 1px solid var(--card-line); background: var(--card);
  transition: transform .3s cubic-bezier(0.16,1,0.3,1), border-color .25s ease, background .25s ease;
}
.g-card:hover{ transform: translateY(-3px); border-color: rgba(198,214,255,0.4); background: linear-gradient(180deg, rgba(198,214,255,0.07), rgba(186,208,255,0.015)); color: inherit; }
.g-card:focus-visible{ outline: 2px solid var(--ice); outline-offset: 3px; }
.g-tag{ align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 11px; line-height: 1.6; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tc, var(--ice)); background: color-mix(in srgb, var(--tc, #c6d6ff) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tc, #c6d6ff) 30%, transparent); }
.g-card strong{ font-size: 17px; line-height: 1.3; font-weight: 500; letter-spacing: -0.015em; color: #fff; }
.g-desc{ font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.g-time{ margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--dim); }
.g-time::after{ content: "\2192"; color: var(--ice); transition: transform .25s ease; }
.g-card:hover .g-time::after{ transform: translateX(4px); }
[data-topic="earning"]{ --tc: #8fe0c0; }
[data-topic="selling"]{ --tc: #f2a3bf; }
[data-topic="app"]{ --tc: #b4a6ff; }

/* ---------- the index ---------- */
.g-index .wrap{ max-width: 1080px; }
.g-index h1{ max-width: 760px; }
.g-index .lede{ max-width: 680px; }
.g-filter{ display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 20px; }
.g-filter button{
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13.5px;
  color: var(--muted); background: transparent; border: 1px solid rgba(255,255,255,0.14);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.g-filter button:hover{ color: #fff; border-color: rgba(255,255,255,0.3); }
.g-filter button[aria-pressed="true"]{ color: #0b0f14; background: #fff; border-color: #fff; }
.g-filter button:focus-visible{ outline: 2px solid var(--ice); outline-offset: 3px; }
ul.guides{ list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
ul.guides li{ margin: 0; padding: 0; border: 0; color: inherit; }
ul.guides a strong{ font-size: 17px; }
ul.guides li[hidden]{ display: none; }
ul.guides li.g-lead{ grid-column: span 2; grid-row: span 2; }
.g-lead .g-card{ padding: 30px; justify-content: flex-end; overflow: hidden; background: radial-gradient(90% 90% at 100% 0%, rgba(198,214,255,0.12), transparent 60%), var(--card); }
/* the footer's halftone, printed into the lead card: ice blue dots that thin out towards the copy */
.g-lead .g-card::before{
  content: ""; position: absolute; inset: 0 0 38% 0; pointer-events: none;
  background: radial-gradient(circle, rgba(198,214,255,0.55) 1.3px, transparent 1.6px) 0 0 / 14px 14px;
  -webkit-mask: radial-gradient(85% 100% at 85% 0%, #000 0%, rgba(0,0,0,.5) 45%, transparent 80%);
  mask: radial-gradient(85% 100% at 85% 0%, #000 0%, rgba(0,0,0,.5) 45%, transparent 80%);
  transition: opacity .3s ease; opacity: .8;
}
.g-lead .g-card:hover::before{ opacity: 1; }
.g-lead .g-card > *{ position: relative; }
@media (min-width: 961px){ ul.guides li.g-lead ~ li:last-child{ grid-column: span 2; } }
@media (max-width: 600px){
  .table-wrap table{ font-size: 13.5px; }
  .table-wrap th, .table-wrap td{ padding: 11px 10px; }
  .table-wrap th:first-child, .table-wrap td:first-child{ padding-left: 14px; }
}
.g-lead .g-card strong{ font-size: clamp(26px, 3vw, 36px); line-height: 1.12; letter-spacing: -0.03em; }
.g-lead .g-desc{ font-size: 16px; max-width: 460px; }
.g-lead .g-time{ flex: none; margin-top: 12px; }
@media (max-width: 960px){ ul.guides{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px){ ul.guides{ grid-template-columns: 1fr; } ul.guides li.g-lead{ grid-column: auto; grid-row: auto; } .g-lead .g-card{ padding: 24px; } }

.foot{ margin-top: 64px; font-size: 13.5px; }

@media (prefers-reduced-motion: reduce){
  .g-card, .g-card:hover, .g-rail, .g-time::after{ transition: none; transform: none; }
}
