/* Depth of Anesthesia: one stylesheet for every page.
   The podcast cover's teal-to-black gradient and the tinted Ether Dome open each page; episodes are squares of artwork. */
:root {
  --teal: #155b6f;         /* cover gradient start */
  --abyss: #08161b;        /* cover gradient end */
  --slate: #344a53;
  --plum: #654b69;
  --ember: #f59433;        /* the site's orange accent */
  --on-dark: #eef4f6;
  --on-dark-dim: #a9c0c7;
  --bg: #eff4f5;
  --surface: #ffffff;
  --soft: #eff4f5;
  --fg: #22343b;
  --fg-dim: #5a6f77;
  --rule: #d3dfe2;
  --link: #155b6f;
  --font-display: "Bodoni Moda", Didot, "Bodoni 72", Georgia, serif;
  --font-title: "PT Serif", Georgia, serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-tile: "Outfit", "Avenir Next", system-ui, sans-serif;
  --dome: url("/images/ether-dome.jpg");
  --net: url("/images/constellation.svg");
  --wrap: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1c22; --surface: #11262d; --soft: #132930; --fg: #e4ecee; --fg-dim: #9db2b9; --rule: #24404a; --link: #7cc6d8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 1rem/1.6 var(--font-body); }
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h3 { font-family: var(--font-title); font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -3rem; z-index: 20; background: #fff; color: var(--teal); padding: .5rem .9rem; border-radius: 6px; font-weight: 600; }
.skip:focus { top: 1rem; }
section { padding-block: clamp(3rem, 7vw, 5rem); }

/* Dark band over the tinted Ether Dome, used at the top of every page */
.band { background: linear-gradient(180deg, var(--teal), var(--abyss)); color: var(--on-dark); position: relative; overflow: hidden; isolation: isolate; }
.band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--dome) 58% 70% / cover no-repeat; filter: grayscale(1) contrast(1.15); mix-blend-mode: luminosity; opacity: .42; }
.band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 70% 55% at 50% 30%, rgba(8,22,27,.55), transparent 70%), linear-gradient(180deg, rgba(8,22,27,.15), rgba(8,22,27,.55)); }
.band.quiet::before { opacity: .3; }
.band.quiet::after { background: linear-gradient(90deg, rgba(8,22,27,.35), rgba(8,22,27,.7)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--teal); }
.band > .wrap { position: relative; z-index: 1; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-style: italic; font-size: 1.5rem; text-decoration: none; display: flex; align-items: center; gap: .65rem; }
.brand img { width: 38px; height: 38px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; flex-wrap: wrap; }
.nav ul a { text-decoration: none; color: var(--on-dark-dim); font-size: .92rem; }
.nav ul a:hover, .nav ul a[aria-current="page"] { color: var(--on-dark); }

.listen { display: flex; gap: .7rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: .55rem; padding: .72rem 1.15rem; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, filter .15s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-play { background: #fff; color: var(--teal); }
.btn-spotify { background: #1db954; color: #000; }
.btn-apple { background: #9933cc; color: #fff; }

/* Homepage: centered headline, then a phone standing on the dome floor between syringes and vials */
.hero { text-align: center; padding-block: clamp(2rem, 5vw, 3.5rem) 0; }
.hero h1 { font: 700 clamp(2.4rem, 5.6vw, 4.3rem)/1.08 var(--font-title); letter-spacing: -.01em; max-width: 13em; margin-inline: auto; text-shadow: 0 2px 24px rgba(8,22,27,.6); }
.hero p.lede { color: #c9dade; font-size: 1.125rem; max-width: 36rem; margin: 1.1rem auto 1.6rem; text-shadow: 0 1px 12px rgba(8,22,27,.8); }
.hero .listen { justify-content: center; }
.stage { --pw: clamp(190px, 19vw, 236px); position: relative; height: calc(var(--pw) * 2.17 + 1.5rem); margin-top: clamp(2rem, 4vw, 3rem); }
#shelf { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; display: block; }
.phone { position: absolute; left: 50%; bottom: .75rem; transform: translateX(-50%); width: var(--pw); aspect-ratio: 9 / 19.5; border-radius: calc(var(--pw) * .17); background: #0a0e10; padding: calc(var(--pw) * .035); box-shadow: 0 0 0 2px #33444b, 0 40px 80px -20px rgba(0,0,0,.75); }
.screen { height: 100%; border-radius: calc(var(--pw) * .14); overflow: hidden; background: linear-gradient(180deg, #1d5463, #0a1b21 62%); color: #fff; padding: calc(var(--pw) * .05) calc(var(--pw) * .065); display: flex; flex-direction: column; gap: calc(var(--pw) * .04); text-align: left; }
.status { display: flex; justify-content: space-between; align-items: center; font: 600 .72rem var(--font-body); }
.island { width: 34%; height: calc(var(--pw) * .085); border-radius: 999px; background: #000; }
.status .bat { width: 22px; height: 10px; border: 1.5px solid #fff; border-radius: 3px; position: relative; }
.status .bat::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; background: #fff; border-radius: 1px; }
.screen .art { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; display: block; object-fit: cover; box-shadow: 0 12px 30px -10px rgba(0,0,0,.7); }
.screen .ep { font: 600 .7rem var(--font-tile); color: var(--ember); }
.screen h2 { font: 700 calc(var(--pw) * .058)/1.25 var(--font-title); margin: .15rem 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.screen .show { font-size: .72rem; color: #a9c0c7; }
.screen h2 a { text-decoration: none; }
.screen h2 a:hover { text-decoration: underline; }
.screen .times { font-size: .62rem; margin-top: .25rem; }
.ctrls { display: flex; justify-content: center; align-items: center; gap: calc(var(--pw) * .08); }
.ctrls button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; display: grid; place-items: center; }
.ctrls .play { width: calc(var(--pw) * .2); height: calc(var(--pw) * .2); border-radius: 50%; background: #fff; color: var(--teal); transition: transform .15s ease; }
.ctrls .play:hover { transform: scale(1.06); }
.ctrls .play svg { width: calc(var(--pw) * .085); height: calc(var(--pw) * .085); }

/* In-page player: play/pause, a draggable progress bar with times, skip back and forward, and speed */
.pp .i-pause, .playing .pp .i-play { display: none; }
.playing .pp .i-pause { display: inline; }
.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 0; background: transparent; cursor: pointer; display: block; }
.seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #fff var(--p, 0%), rgba(255,255,255,.22) var(--p, 0%)); }
.seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); }
.seek::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; border: 0; }
.seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.times { display: flex; justify-content: space-between; font: 500 .75rem var(--font-body); color: var(--on-dark-dim); font-variant-numeric: tabular-nums; }
.eplayer { display: flex; align-items: center; gap: .6rem; background: rgba(8,22,27,.5); border: 1px solid rgba(238,244,246,.16); border-radius: 999px; padding: .45rem .9rem .45rem .45rem; max-width: 34rem; margin-bottom: 1rem; }
.eplayer .pp { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--teal); display: grid; place-items: center; cursor: pointer; transition: transform .15s ease; }
.eplayer .pp:hover { transform: scale(1.05); }
.eplayer .track { flex: 1; min-width: 0; }
.eplayer .times { margin-top: .1rem; }
.eplayer .back, .eplayer .fwd, .eplayer .speed { flex: none; background: none; border: 0; color: var(--on-dark); cursor: pointer; padding: .3rem; border-radius: 8px; }
.eplayer .back:hover, .eplayer .fwd:hover, .eplayer .speed:hover { background: rgba(238,244,246,.1); }
.eplayer .speed { font: 700 .82rem var(--font-tile); min-width: 2.7rem; }
.failed .times::after { content: "Couldn't load the audio. Try Spotify or Apple Podcasts."; color: var(--ember); }
.also { color: var(--on-dark-dim); font-size: .85rem; margin: 0 0 .5rem; }

/* The wall: every episode is a square of artwork */
#episodes { background: var(--surface); border-bottom: 1px solid var(--rule); }
.section-title { font: 700 clamp(1.8rem, 3.6vw, 2.6rem)/1.15 var(--font-title); margin-bottom: 1.25rem; }
/* Scrolls sideways only; the grey line is drawn inside the row so the underline never makes it scroll up and down */
.tabs { display: flex; gap: 1.4rem; margin-bottom: 1.5rem; box-shadow: inset 0 -1px 0 var(--rule); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; white-space: nowrap; font: 600 .95rem var(--font-body); background: none; border: 0; padding: .55rem 0; color: var(--fg-dim); cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-pressed="true"] { color: var(--fg); border-color: var(--ember); }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.tile { display: block; text-decoration: none; aspect-ratio: 1; max-width: 100%; border-radius: 12px; overflow: hidden; position: relative; color: #fff; background: var(--tile-bg, var(--teal)); isolation: isolate; transition: transform .18s ease, box-shadow .18s ease; }
.tile:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 14px 28px -12px rgba(8,22,27,.55); }
.tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8,22,27,0) 30%, rgba(8,22,27,.88) 100%); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -3; background: var(--net) center / 220px repeat; opacity: .9; }
.tile .ill { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.tile .q { position: absolute; inset: auto 8% 9% 8%; font: 800 clamp(1rem, 1.55vw, 1.22rem)/1.15 var(--font-tile); letter-spacing: -.01em; }
.tile .when { position: absolute; top: 7%; right: 7%; font: 600 .72rem var(--font-tile); background: rgba(8,22,27,.55); padding: .15rem .5rem; border-radius: 999px; }
.tile[hidden] { display: none; }
.t-airway { --tile-bg: #155b6f; } .t-drugs { --tile-bg: #344a53; } .t-pain { --tile-bg: #5b4870; } .t-monitor { --tile-bg: #0e3440; }
.t-preop { --tile-bg: #654b69; } .t-ob { --tile-bg: #7a4e5e; } .t-icu { --tile-bg: #1d4f5c; } .t-special { --tile-bg: #f59433; }

/* Hosts and writing */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.split h2 { font: 700 clamp(1.5rem, 3vw, 1.9rem)/1.2 var(--font-title); margin-bottom: 1.5rem; }
.hosts { display: grid; gap: 1.75rem; }
.host { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.mark { width: 3.5rem; height: 3.5rem; border-radius: 12px; background: var(--teal) var(--net) center / 220px; color: #fff; display: grid; place-items: center; font: 800 1.15rem var(--font-tile); }
.host h3 { font-size: 1.15rem; }
.host p { color: var(--fg-dim); margin: .3rem 0 0; font-size: .95rem; }
.writing { list-style: none; margin: 0; padding: 0; display: grid; }
.writing li { border-top: 1px solid var(--rule); }
.writing li:last-child { border-bottom: 1px solid var(--rule); }
.writing a { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; text-decoration: none; }
.writing a:hover strong { text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: 4px; }
.writing strong { font-family: var(--font-title); font-size: 1.08rem; display: block; }
.writing span { color: var(--fg-dim); font-size: .9rem; }
.writing .date { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Episode and post pages: artwork and title in the band, then one reading column */
.ep-head { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4rem); }
.page-head { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4rem); max-width: 46rem; }
.art-box { aspect-ratio: 1; border-radius: 18px; overflow: hidden; position: relative; background: var(--tile-bg, var(--teal)); box-shadow: 0 30px 60px -24px rgba(0,0,0,.7); }
.art-box::before { content: ""; position: absolute; inset: 0; background: var(--net) center / 220px repeat; opacity: .9; }
.art-box svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.badge { display: inline-flex; gap: .5rem; align-items: center; font: 600 .85rem var(--font-tile); background: rgba(238,244,246,.12); padding: .25rem .75rem; border-radius: 999px; }
.badge .dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--ember); }
.ep-head h1, .page-head h1 { font: 700 clamp(2rem, 4.4vw, 3.3rem)/1.1 var(--font-title); margin: .9rem 0 .8rem; }
.ep-head .sum, .page-head .sum { color: var(--on-dark-dim); font-size: 1.1rem; max-width: 40rem; margin: 0 0 1.5rem; }
.tags { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: 1.25rem; }
.tags span { font: 600 .8rem var(--font-tile); color: var(--on-dark); background: rgba(238,244,246,.1); border: 1px solid rgba(238,244,246,.2); padding: .2rem .65rem; border-radius: 6px; }
main.reading { background: var(--surface); }
.col { max-width: 46rem; }
.block { padding-block: clamp(2rem, 5vw, 3rem); border-bottom: 1px solid var(--rule); }
.block:last-child { border-bottom: 0; }
.block h2 { font: 700 clamp(1.4rem, 3vw, 1.8rem)/1.2 var(--font-title); margin-bottom: 1.1rem; }
.block p { margin: 0 0 .8rem; }
.claims { list-style: none; counter-reset: c; margin: 0; padding: 0; display: grid; gap: .85rem; }
.claims li { counter-increment: c; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: .9rem; align-items: start; background: var(--soft); border-radius: 12px; padding: 1rem 1.1rem; }
.claims li::before { content: counter(c); width: 2.6rem; height: 2.6rem; border-radius: 10px; display: grid; place-items: center; background: var(--teal); color: #fff; font: 800 1.1rem var(--font-tile); }
.claims p { margin: .35rem 0 0; font-family: var(--font-title); font-size: 1.08rem; line-height: 1.45; }
.guests { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.guest { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: .9rem; align-items: start; padding: 1.1rem; border: 1px solid var(--rule); border-radius: 14px; }
.guest .mark { width: 3.25rem; height: 3.25rem; font-size: 1.05rem; }
.guest h3 { font-size: 1.08rem; line-height: 1.3; }
.guest .role { color: var(--link); font-size: .88rem; font-weight: 600; margin-top: .15rem; }
.refs { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 1rem; }
.refs li { counter-increment: r; display: grid; grid-template-columns: 1.8rem minmax(0, 1fr); gap: .6rem; }
.refs li::before { content: counter(r); font: 800 .95rem var(--font-tile); color: var(--fg-dim); padding-top: .1rem; }
.refs .rt { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.refs .rl { display: flex; gap: .9rem; margin-top: .2rem; font-size: .88rem; }
.refs a, .links a, .block a:not(.btn) { color: var(--link); font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }
.block h3 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
.block h3:first-of-type { margin-top: 0; }
.links { margin: 0; padding-left: 1.2rem; }
/* Transcript: collapsed until opened */
.transcript summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary h2 { margin: 0; }
.transcript summary span { color: var(--link); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.transcript summary span::after { content: " ▾"; }
.transcript[open] summary span::after { content: " ▴"; }
.transcript[open] summary span { font-size: 0; }
.transcript[open] summary span::before { content: "Hide transcript"; font-size: .95rem; }
.t-note { margin: 1rem 0 0; padding: .75rem 1rem; background: var(--soft); border-radius: 10px; color: var(--fg-dim); font-size: .92rem; }
.t-body { margin-top: 1.25rem; font-size: 1rem; line-height: 1.7; }
.t-body p { margin: 0 0 1rem; }
.t-body .who { display: block; font: 700 .85rem var(--font-tile); color: var(--link); margin-bottom: .15rem; }
.credit { color: var(--fg-dim); font-size: .95rem; }
.credit p { margin: 0 0 .4rem; }
blockquote { margin: 0; padding: 1rem 1.25rem; background: var(--soft); border-radius: 12px; font-family: var(--font-title); font-size: 1.08rem; }
.figure { margin: 0; }
.figure img { display: block; border-radius: 12px; border: 1px solid var(--rule); }
.email { font: 700 1.25rem var(--font-title); }

.more { background: var(--soft); border-top: 1px solid var(--rule); padding-block: clamp(2.5rem, 6vw, 4rem); }
.pn { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.pn a { display: grid; gap: .3rem; padding: 1rem 1.2rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--rule); text-decoration: none; }
.pn a:hover { border-color: var(--fg-dim); }
.pn .k { color: var(--fg-dim); font: 600 .82rem var(--font-tile); }
.pn .x { font: 700 1.02rem/1.35 var(--font-title); }
.pn .next { text-align: right; }
.more h2 { font: 700 clamp(1.4rem, 3vw, 1.8rem)/1.2 var(--font-title); margin-bottom: 1.1rem; }

footer { background: linear-gradient(135deg, var(--teal), var(--abyss) 70%); color: var(--on-dark-dim); }
footer .wrap { padding-block: 2.5rem; display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; font-size: .9rem; }
footer .brand { color: var(--on-dark); font-size: 1.25rem; }
footer .brand img { width: 30px; height: 30px; }
footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
footer a { color: var(--on-dark); text-decoration: none; }
footer nav a:hover { color: var(--ember); }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile .q { font-size: 1.05rem; }
}
@media (max-width: 860px) {
  .split, .ep-head { grid-template-columns: minmax(0, 1fr); }
  .art-box { max-width: 17rem; }
  .more .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .tile .q { font-size: .84rem; }
}
@media (max-width: 560px) {
  .eplayer { gap: .35rem; padding-right: .5rem; }
  .eplayer .back, .eplayer .fwd { padding: .15rem; }
  .stage { --pw: 170px; }
  .screen .show { display: none; }
  .nav ul { gap: 1rem; }
  .writing a { flex-direction: column; gap: .2rem; }
  .art-box { max-width: 13rem; }
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn .next { text-align: left; }
  .claims li { grid-template-columns: 2.2rem minmax(0, 1fr); padding: .9rem; }
  .claims li::before { width: 2.2rem; height: 2.2rem; }
}
@media (max-width: 420px) {
  .tile { aspect-ratio: 4 / 5; }
  .tile .q { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .tile, .ctrls .play, .eplayer .pp { transition: none; }
  .tile:hover, .btn:hover { transform: none; }
}
