/* ===========================================================================
   Stake.Cake — shared styles for the /guides/ content cluster.
   Mirrors the homepage design tokens; adds long-form reading typography.
   =========================================================================== */
:root {
  --bg:            #07090c;
  --bg-2:          #0c1014;
  --surface:       #11161c;
  --surface-2:     #161d25;
  --line:          rgba(255,255,255,0.08);
  --line-strong:   rgba(255,255,255,0.16);
  --text:          #f3f5f7;
  --muted:         #9aa6b2;
  --muted-2:       #6b7785;
  --gold:          #ffa805;
  --gold-soft:     #ffce6b;
  --sol-green:     #14f195;
  --sol-purple:    #9945ff;
  --radius:        18px;
  --radius-sm:     12px;
  --maxw:          1140px;
  --maxw-read:     760px;   /* comfortable measure for long-form prose */
  --shadow:        0 24px 60px -20px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: transparent; color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
::selection { background: var(--gold); color: #0a0a0a; }
img { max-width: 100%; }

/* ---------- Background glow (same two brand blobs as the homepage) ---------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-fx::before, .bg-fx::after { content: ""; position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.40; will-change: transform; }
.bg-fx::before { width: 620px; height: 620px; top: -260px; left: -160px; background: radial-gradient(circle, var(--sol-purple), transparent 65%); animation: bgfx1 46s ease-in-out infinite; }
.bg-fx::after { width: 560px; height: 560px; top: 120px; right: -200px; background: radial-gradient(circle, var(--sol-green), transparent 65%); opacity: 0.24; animation: bgfx2 54s ease-in-out infinite; }
@keyframes bgfx1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(70px,50px) scale(1.12); } }
@keyframes bgfx2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-60px,60px) scale(1.10); } }
@media (prefers-reduced-motion: reduce) { .bg-fx::before, .bg-fx::after { animation: none; } }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }

/* ---------- Header (mirrors homepage) ---------- */
header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(7,9,12,0.72); border-bottom: 1px solid var(--line); }
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: 'Space Grotesk'; font-weight: 700; font-size: 20px; }
.brand-mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line-strong); }
.brand-mark svg { width: 23px; height: 23px; }
.brand span b { color: var(--gold); }
.nav-links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 32px; }
.nav-links a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-tool { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--gold); border: 1px solid rgba(255,168,5,0.45); border-radius: 999px; padding: 6px 14px; transition: background .2s, border-color .2s, color .2s; }
.nav-tool:hover { background: rgba(255,168,5,0.12); border-color: var(--gold); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-family: 'Space Grotesk'; font-weight: 600; font-size: 15px; border: none; border-radius: 999px; padding: 12px 24px; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: #0a0a0a; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); box-shadow: 0 10px 30px -8px rgba(255,168,5,0.5); }
.btn-primary:hover { box-shadow: 0 14px 38px -8px rgba(255,168,5,0.7); transform: translateY(-1px); }
.btn-ghost { color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--gold); }

/* ---------- Breadcrumb ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted-2); margin: 28px 0 0; }
.crumbs a { color: var(--muted); transition: color .2s; }
.crumbs a:hover { color: var(--gold); }
.crumbs .sep { opacity: 0.5; }

/* ---------- Article layout ---------- */
.article { padding: 8px 0 64px; }
.article-head { max-width: var(--maxw-read); margin: 0 auto; padding: 26px 0 8px; }
.article-head h1 { font-size: clamp(30px, 5vw, 46px); margin-bottom: 18px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 13.5px; color: var(--muted-2); }
.article-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.lede { max-width: var(--maxw-read); margin: 22px auto 0; font-size: 19px; color: var(--muted); }

/* Hero illustration */
.fig-hero { max-width: var(--maxw-read); margin: 30px auto 0; padding: 0 24px; }
.fig-hero img { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.fig-hero figcaption { margin-top: 11px; font-size: 13px; color: var(--muted-2); text-align: center; }

/* Table of contents */
.toc { max-width: var(--maxw-read); margin: 34px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px 22px; }
.toc-title { font-family: 'Space Grotesk'; font-weight: 600; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 12px; }
.toc ol { margin: 0; padding-left: 20px; display: grid; gap: 7px; }
.toc a { color: var(--muted); font-size: 15px; transition: color .2s; }
.toc a:hover { color: var(--gold); }

/* Prose */
.prose { max-width: var(--maxw-read); margin: 0 auto; }
.prose h2 { font-size: clamp(23px, 3.4vw, 30px); margin: 48px 0 14px; scroll-margin-top: 90px; }
.prose h3 { font-size: 20px; margin: 30px 0 10px; color: var(--text); scroll-margin-top: 90px; }
.prose p { margin: 0 0 18px; color: var(--muted); font-size: 17px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--sol-green); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .2s; }
.prose a:hover { color: var(--gold); }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 22px; color: var(--muted); font-size: 17px; }
.prose li { margin: 0 0 9px; }
.prose li::marker { color: var(--gold); }
.prose code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--gold-soft); word-break: break-word; }
.prose blockquote { margin: 0 0 22px; padding: 14px 18px; border-left: 3px solid var(--gold); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }
.prose blockquote p { margin: 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

/* Callout box */
.callout { max-width: var(--maxw-read); margin: 0 auto 22px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 18px 20px; position: relative; overflow: hidden; }
.callout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--gold), var(--sol-green)); }
.callout p { margin: 0; color: var(--muted); font-size: 15.5px; }
.callout strong { color: var(--text); }

/* Comparison / data table */
.tbl-wrap { max-width: var(--maxw-read); margin: 0 auto 24px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl th { font-family: 'Space Grotesk'; font-weight: 600; color: var(--text); background: var(--surface-2); }
.tbl td { color: var(--muted); }
.tbl tr:last-child td { border-bottom: none; }

/* Steps */
.steps-list { max-width: var(--maxw-read); margin: 0 auto 24px; counter-reset: step; list-style: none; padding: 0; }
.steps-list > li { position: relative; padding: 18px 18px 18px 64px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.steps-list > li::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #0a0a0a; font-family: 'Space Grotesk'; font-weight: 700; font-size: 15px; }
.steps-list h3 { margin: 2px 0 6px; font-size: 18px; }
.steps-list p { margin: 0; color: var(--muted); font-size: 16px; }

/* In-article CTA */
.cta { max-width: var(--maxw-read); margin: 48px auto 0; text-align: center; background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 28px; box-shadow: var(--shadow); }
.cta h2 { font-size: clamp(24px, 4vw, 32px); margin-bottom: 10px; }
.cta p { color: var(--muted); margin: 0 auto 22px; max-width: 460px; font-size: 16px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Related guides */
.related { max-width: var(--maxw-read); margin: 56px auto 0; }
.related-title { font-size: 20px; margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gcard { position: relative; overflow: hidden; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; transition: transform .2s, border-color .2s, box-shadow .2s; }
.gcard:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.gcard .k { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 9px; }
.gcard h3 { font-size: 17px; margin-bottom: 7px; }
.gcard p { font-size: 14px; color: var(--muted-2); margin: 0; }

/* ---------- Guides hub hero: image with overlaid heading + subtle parallax ---------- */
.ghero { max-width: var(--maxw); margin: 30px auto 0; padding: 0 24px; }
.ghero-inner { position: relative; min-height: 380px; display: flex; align-items: center;
  border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); background: #0a0e13; }
.ghero-img { position: absolute; left: 0; right: 0; top: -15%; width: 100%; height: 130%;
  object-fit: cover; object-position: center; z-index: 0; will-change: transform; }
.ghero-inner::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(7,9,12,0.94) 0%, rgba(7,9,12,0.78) 32%, rgba(7,9,12,0.25) 58%, rgba(7,9,12,0) 92%); }
.ghero-content { position: relative; z-index: 2; padding: 52px 48px; max-width: 580px; }
.ghero-top .ghero-inner { align-items: flex-start; }
.ghero-content .article-meta { margin-top: 16px; }
.ghero-content .eyebrow { margin-bottom: 14px; }
.ghero-content h1 { font-size: clamp(30px, 5vw, 50px); margin: 0 0 16px; }
.ghero-content p { color: var(--muted); font-size: 18px; max-width: 470px; margin: 0; }
@media (max-width: 760px) {
  .ghero-inner { display: block; min-height: 0; }
  .ghero-img { position: relative; top: 0; height: 190px; transform: none !important; object-position: 72% center; }
  .ghero-inner::after { display: none; }
  .ghero-content { padding: 26px 24px; max-width: none; }
}

/* ---------- Guides hub ---------- */
.hub-hero { max-width: var(--maxw-read); margin: 0 auto; padding: 40px 0 8px; text-align: center; }
.hub-hero h1 { font-size: clamp(34px, 6vw, 54px); margin-bottom: 18px; }
.hub-hero p { color: var(--muted); font-size: 19px; max-width: 620px; margin: 0 auto; }
.hub-grid { max-width: var(--maxw); margin: 44px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.hub-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; transition: transform .25s, border-color .25s, box-shadow .25s; overflow: hidden; }
.hub-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--sol-green)); opacity: 0; transition: opacity .25s; }
.hub-card:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.hub-card:hover::after { opacity: 1; }

/* Cursor spotlight: card border glows toward the pointer (matches the homepage) */
.hub-card::before, .gcard::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  z-index: 3; opacity: 0; transition: opacity .3s;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(255,168,5,0.9), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
.hub-card:hover::before, .gcard:hover::before { opacity: 1; }
@media (hover: none) { .hub-card::before, .gcard::before { display: none; } }
.hub-card .k { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.hub-card h2 { font-size: 21px; margin-bottom: 10px; }
.hub-card p { color: var(--muted); font-size: 15px; margin: 0 0 18px; }
.hub-card .more { margin-top: auto; color: var(--sol-green); font-family: 'Space Grotesk'; font-weight: 600; font-size: 14px; }

/* ---------- Footer (mirrors homepage) ---------- */
footer { border-top: 1px solid var(--line); padding: 48px 0 56px; margin-top: 72px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot .brand { font-size: 18px; }
.foot-brand { display: flex; flex-direction: column; align-items: center; }
.foot-brand .brand-tag { margin-top: 12px; font-weight: 500; font-size: 9.5px; letter-spacing: 0.04em; color: var(--muted-2); opacity: 0.7; white-space: nowrap; text-align: center; }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); font-size: 14px; transition: color .2s; }
.foot-links a:hover { color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 920px) { .hub-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
  .nav-links, .nav-actions { display: none; }
  .related-grid, .hub-grid { grid-template-columns: 1fr; }
}
