/* Psilocybin.solutions design system
   Layout: open editorial column on a cool "spore print" chalk ground; one bold moment (mycelium hero),
   everything else quiet. Accents come from the mushroom itself: the cobalt of bruised psilocybin
   flesh and the caramel gold of a cubensis cap. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --sunk: #eaeff7;
  --ink: #0f1b2d;
  --muted: #56667d;
  --line: #d9e1ec;
  --bruise: #2546d6;
  --bruise-soft: #e3e9ff;
  --cap: #e7a03a;
  --cap-soft: #fdf0dc;
  --cap-ink: #7a4706;
  --good: #1d7a55;
  --good-soft: #def3ea;
  --warn: #9a5b00;
  --warn-soft: #fff2d9;
  --display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;
  --step-4: clamp(2.4rem, 5vw, 3.6rem);
  --step-5: clamp(2.7rem, 7vw, 5.2rem);
  --radius: 14px;
  --wrap: 1180px;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1120; --surface: #111a2d; --sunk: #16213a; --ink: #edf1f8; --muted: #9aa8bd; --line: #24314c;
    --bruise: #8aa2ff; --bruise-soft: #1b2650; --cap: #f2b658; --cap-soft: #2e2413; --cap-ink: #f6cd8b;
    --good: #5fd3a2; --good-soft: #12301f; --warn: #f2b658; --warn-soft: #2e2413; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1120; --surface: #111a2d; --sunk: #16213a; --ink: #edf1f8; --muted: #9aa8bd; --line: #24314c;
  --bruise: #8aa2ff; --bruise-soft: #1b2650; --cap: #f2b658; --cap-soft: #2e2413; --cap-ink: #f6cd8b;
  --good: #5fd3a2; --good-soft: #12301f; --warn: #f2b658; --warn-soft: #2e2413; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-0)/1.65 var(--body); }
img, svg, canvas { max-width: 100%; }
a { color: var(--bruise); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cap); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.2; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.eyebrow { font: 500 0.78rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 1.2rem; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--bruise); font-weight: 400; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 8px 12px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--sunk); }
.nav .btn { margin-left: 6px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 8px 12px; font: 600 0.9rem var(--body); cursor: pointer; }
@media (max-width: 780px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
  .nav.open { display: flex; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 12px 20px; font: 600 0.98rem/1 var(--body); text-decoration: none; border: 1.5px solid transparent; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--bruise); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0a1120; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0a1120; } }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.nav a.btn-primary { color: #fff; padding: 10px 16px; }
.nav a.btn-primary:hover { background: var(--bruise); }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 64px); align-items: end; padding-block: clamp(56px, 9vw, 110px) clamp(48px, 7vw, 84px); }
.hero h1 { font-size: var(--step-5); }
.hero h1 em { font-style: normal; color: var(--bruise); position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.04em; height: 0.16em; background: var(--cap); border-radius: 99px; z-index: -1; opacity: .85; }
.hero .lede { font-size: var(--step-1); color: var(--muted); max-width: 40ch; margin-top: 22px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.molecule { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: 0 20px 50px -30px rgba(15, 27, 45, .35); }
.molecule svg { display: block; width: 100%; height: auto; }
.molecule dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; font: 0.85rem/1.4 var(--mono); }
.molecule dt { color: var(--muted); }
.molecule dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; align-items: start; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--line); }
.stat { padding: 26px var(--gutter) 24px; border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font: 400 var(--step-3)/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { display: block; color: var(--muted); font-size: var(--step--1); margin-top: 8px; line-height: 1.45; }
.stat a { color: inherit; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:nth-child(2) { border-right: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 12px; max-width: 760px; margin-bottom: 36px; }
.section-head h2 { font-size: var(--step-4); }
.section-head p:not(.eyebrow) { color: var(--muted); font-size: var(--step-1); }

/* Evidence ladder */
.ladder { display: grid; gap: 14px; }
.tier { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.tier:first-child { border-top: 0; }
.tier h3 { font-size: var(--step-2); margin-top: 8px; }
.tier p.note { color: var(--muted); font-size: var(--step--1); margin-top: 8px; }
.conditions { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.condition { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 6px; min-width: 0; }
.condition b { font-weight: 700; }
.condition span { color: var(--muted); font-size: var(--step--1); line-height: 1.5; }
.condition a { font-weight: 600; font-size: var(--step--1); }
@media (max-width: 720px) { .tier { grid-template-columns: 1fr; gap: 12px; } }

.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 0.74rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; width: fit-content; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-strong { background: var(--good-soft); color: var(--good); }
.chip-mid { background: var(--bruise-soft); color: var(--bruise); }
.chip-early { background: var(--warn-soft); color: var(--warn); }

/* Split feature */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.split h2 { font-size: var(--step-4); }
.split p:not(.eyebrow) { color: var(--muted); margin-top: 16px; font-size: var(--step-1); }
.split .btn { margin-top: 26px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(s); font: 400 1.5rem/1 var(--display); color: var(--bruise); }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* Legal states */
.states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.state { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.state .abbr { font: 400 2.6rem/1 var(--display); color: var(--bruise); }
.state h3 { font-size: var(--step-1); font-family: var(--body); font-weight: 700; }
.state p { color: var(--muted); font-size: var(--step--1); }
.legal-note { margin-top: 18px; color: var(--muted); font-size: var(--step--1); max-width: var(--measure); }
@media (max-width: 860px) { .states { grid-template-columns: 1fr; } }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .15s ease, transform .15s ease; }
.card:hover { border-color: var(--bruise); transform: translateY(-2px); }
.card h3 { font-size: var(--step-1); line-height: 1.25; }
.card p { color: var(--muted); font-size: var(--step--1); }
.card .meta { font: 500 0.75rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }

/* Safety band */
.safety { background: var(--cap-soft); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.safety h2 { font-size: var(--step-3); color: var(--ink); }
.safety p, .safety li { color: var(--ink); }
.safety ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.safety .line { font: 500 0.9rem/1.5 var(--mono); margin-top: 14px; color: var(--cap-ink); }
@media (max-width: 820px) { .safety { grid-template-columns: 1fr; } }

/* FAQ accordion */
.faq { display: grid; gap: 0; max-width: 860px; }
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-weight: 700; font-size: var(--step-1); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.6rem/1 var(--display); color: var(--bruise); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); padding-bottom: 18px; max-width: var(--measure); }

/* Article */
.crumbs { font-size: var(--step--1); color: var(--muted); padding-top: 28px; }
.crumbs a { color: var(--muted); }
.article-head { padding-block: 18px 36px; border-bottom: 1px solid var(--line); }
.article-head h1 { font-size: var(--step-4); max-width: 22ch; margin-top: 14px; }
.article-head .dek { font-size: var(--step-1); color: var(--muted); max-width: 60ch; margin-top: 16px; }
.byline { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 20px; font-size: var(--step--1); color: var(--muted); }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(28px, 5vw, 64px); padding-block: 40px 72px; }
.prose { max-width: var(--measure); min-width: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--step-3); margin-top: 2em; scroll-margin-top: 90px; }
.prose h3 { font-size: var(--step-1); font-family: var(--body); font-weight: 700; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose sup a { font: 600 0.7em var(--mono); text-decoration: none; padding: 0 2px; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--cap); font-family: var(--display); font-size: var(--step-1); }
.answer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.answer .eyebrow { color: var(--bruise); }
.answer p { margin-top: 8px; }
.takeaways { background: var(--bruise-soft); border-radius: var(--radius); padding: 20px 22px; }
.takeaways ul { margin: 10px 0 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 0.74rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--sunk); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--cap); border-radius: 10px; padding: 16px 18px; background: var(--surface); }
.callout b { display: block; margin-bottom: 4px; }
.refs { font-size: var(--step--1); color: var(--muted); padding-left: 1.4em; }
.refs li { scroll-margin-top: 90px; }
.refs li:target { color: var(--ink); background: var(--cap-soft); border-radius: 6px; }
.disclaimer { font-size: var(--step--1); color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; }
.toc { position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); align-self: start; font-size: var(--step--1); display: grid; gap: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; border-left: 2px solid var(--line); }
.toc a { display: block; color: var(--muted); text-decoration: none; padding-left: 14px; margin-left: -2px; border-left: 2px solid transparent; line-height: 1.4; }
.toc a:hover, .toc a.active { color: var(--ink); border-left-color: var(--bruise); }
@media (max-width: 960px) { .article-grid { grid-template-columns: 1fr; } .toc { display: none; } }
.related { border-top: 1px solid var(--line); padding-block: 56px; }
.related h2 { font-size: var(--step-3); margin-bottom: 24px; }

/* Hub */
.hub-head { padding-block: clamp(48px, 7vw, 80px) 32px; }
.hub-head h1 { font-size: var(--step-5); }
.hub-head p:not(.eyebrow) { color: var(--muted); font-size: var(--step-1); max-width: 56ch; margin-top: 16px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 48px 36px; font-size: var(--step--1); color: var(--muted); }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 28px; }
.site-footer h4 { font: 500 0.75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--muted); }
.site-footer .fine { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); max-width: 90ch; }
@media (max-width: 820px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .card { transition: none; } }

/* Sprouting capitals: in H1s, the first capital of each word grows a curling tendril that ends in a mushroom */
.sp { position: relative; }
.sp-svg { position: absolute; overflow: visible; pointer-events: none; color: inherit; max-width: none !important; }
.sp-svg .tendril { fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: sp-draw .9s ease-out both; animation-delay: calc(var(--i) * 120ms + 150ms); }
.sp-svg .shroom { transform-box: fill-box; transform-origin: 50% 100%; animation: sp-pop .45s cubic-bezier(.3,1.7,.5,1) both; animation-delay: calc(var(--i) * 120ms + 900ms); }
.sp-svg .shroom-stem { fill: currentColor; }
.sp-svg .shroom-cap { fill: var(--shroom-red); }
.sp-svg .shroom-spot { fill: #fff !important; }
@keyframes sp-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sp-pop { from { transform: scale(0); } to { transform: scale(1); } }
:root { --stem: #c9b79a; --spot: #fff6e6; --shroom-red: #e0312b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --stem: #d9c8ab; --spot: #fff3dc; --shroom-red: #ff4d43; } }
:root[data-theme="dark"] { --stem: #d9c8ab; --spot: #fff3dc; --shroom-red: #ff4d43; }

/* Growing-mushroom loader */
.shroom-loader { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--step--1); }
.shroom-loader svg { width: 36px; height: 36px; overflow: visible; }
.shroom-loader .soil { stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.shroom-loader .stalk { fill: var(--stem); transform-origin: 18px 32px; animation: loader-stalk 1.6s ease-in-out infinite; }
.shroom-loader .lid { fill: var(--cap); transform-origin: 18px 20px; animation: loader-lid 1.6s ease-in-out infinite; }
@keyframes loader-stalk { 0% { transform: scaleY(0); } 35%, 80% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes loader-lid { 0%, 25% { transform: translateY(12px) scale(0); } 55%, 80% { transform: translateY(0) scale(1); } 100% { transform: translateY(12px) scale(0); } }
@media (prefers-reduced-motion: reduce) {
  .sp-svg .tendril, .sp-svg .shroom { animation: none; }
  .shroom-loader .stalk, .shroom-loader .lid { animation-duration: 3.2s; }
}

/* Hub groups */
.hub-body { display: grid; gap: 48px; padding-bottom: 88px; }
.hub-group { display: grid; gap: 20px; }
.hub-group h2 { font-size: var(--step-3); }

/* Therapist finder */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.finder { padding-bottom: 24px; }
.finder-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.seg { display: inline-flex; background: var(--sunk); border-radius: 999px; padding: 4px; gap: 2px; }
.seg-btn { border: 0; background: transparent; color: var(--muted); font: 600 0.92rem var(--body); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 27, 45, .15); }
.finder-search { flex: 1 1 220px; min-width: 0; }
.finder-search input { width: 100%; font: 400 1rem var(--body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; }
.finder-search input:focus { outline: 3px solid var(--cap); outline-offset: 1px; }
#near-me { cursor: pointer; }
#near-me:disabled { opacity: .6; cursor: progress; }
.finder-status { margin: 18px 2px 10px; font-size: var(--step--1); color: var(--muted); }
.finder .shroom-loader { margin: 4px 2px 14px; }
.providers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.provider { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.provider h2 { font-size: 1.25rem; line-height: 1.25; margin-top: 4px; }
.provider .loc { font-weight: 600; }
.provider .dist { font-weight: 400; color: var(--muted); }
.provider .tags { color: var(--muted); font-size: var(--step--1); }
.provider .links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--step--1); margin-top: 4px; }
.provider .links span { font-variant-numeric: tabular-nums; color: var(--muted); }
.finder-empty { margin-top: 16px; color: var(--muted); }
h1:has(.sp-svg) { padding-top: .75em; }
