/* Wordmark: subset of Dancing Script (SIL OFL 1.1, see fonts/OFL.txt), renamed per the OFL Reserved Font Name clause */
@font-face { font-family: 'Headcalm Script'; src: url('fonts/headcalm-script.woff') format('woff'); font-weight: 600; font-display: swap; }
:root {
  --teal-900: #0b2a2e; --teal-800: #0d3236; --teal-700: #134247; --sage: #4f7d6c; --lav: #6e5f93; --dusk: #8a72a8;
  --cream: #f7ecda; --cream-2: rgba(247, 236, 218, .72); --peach: #f3c48f; --glass: rgba(247, 236, 218, .08);
  --line: rgba(247, 236, 218, .18); --radius: 18px;
  --script: 'Headcalm Script', 'Snell Roundhand', 'Segoe Script', 'Brush Script MT', 'Apple Chancery', 'Lucida Handwriting', cursive;
  --sans: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--teal-900); color: var(--cream); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* full-bleed calming background */
.scene { position: fixed; inset: 0; z-index: -1; background: linear-gradient(170deg, #0d3236 0%, #1d4b4b 30%, #3f6b63 55%, #5d5a86 82%, #6e5f93 100%); overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; animation: drift 38s ease-in-out infinite alternate; }
.g1 { width: 60vmax; height: 40vmax; background: #2f7c74; top: -10vmax; left: -15vmax; }
.g2 { width: 50vmax; height: 50vmax; background: #8a72a8; bottom: -20vmax; right: -15vmax; animation-duration: 46s; }
.g3 { width: 30vmax; height: 30vmax; background: #f3c48f; top: 30%; left: 55%; opacity: .12; animation-duration: 54s; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.12); } }
.ridge { position: absolute; bottom: 0; left: 0; width: 100%; height: 38vh; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; padding-top: max(14px, env(safe-area-inset-top)); background: rgba(11, 42, 46, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.wordmark { font-family: var(--script); font-size: 36px; line-height: 1; color: var(--cream); font-weight: 600; }
.wordmark.small { font-size: 26px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.pill { border: 0; border-radius: 999px; background: var(--cream); color: var(--teal-800); padding: 12px 20px; font-weight: 600; font-size: 16px; box-shadow: 0 6px 18px rgba(0,0,0,.18); transition: transform .3s ease, background .3s; }
.pill:hover { transform: translateY(-1px); background: #fff6e8; }
.burger { width: 44px; height: 40px; border: 0; background: none; display: grid; align-content: center; gap: 7px; padding: 0 4px; }
.burger span { display: block; height: 2.5px; border-radius: 2px; background: var(--cream); }

/* drawer */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(380px, 88vw); z-index: 40; background: linear-gradient(180deg, #0f3539, #2c3f55 70%, #46406a); box-shadow: -10px 0 40px rgba(0,0,0,.35); overflow-y: auto; animation: slideIn .35s ease; }
@keyframes slideIn { from { transform: translateX(100%); } }
.drawer-inner { padding: 18px 22px 40px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-2); margin: 22px 0 8px; font-weight: 600; }
.drawer-link { display: block; padding: 11px 4px; font-size: 18px; border-bottom: 1px solid var(--line); }
.topic-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.topic-links a { padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); font-size: 14px; transition: background .25s; }
.topic-links a:hover, .drawer-link:hover { background: rgba(247,236,218,.14); }
.name-field { display: grid; gap: 6px; font-size: 14px; color: var(--cream-2); }
.name-field input { font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--cream); }
.stats, .source { font-size: 13px; color: var(--cream-2); line-height: 1.5; }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(5, 20, 22, .5); animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } }
.icon-btn { border: 0; background: rgba(247,236,218,.1); width: 40px; height: 40px; border-radius: 50%; font-size: 18px; display: grid; place-items: center; }

/* main */
main { max-width: 1180px; margin: 0 auto; padding: 18px 0 120px; outline: none; animation: fade .5s ease; }
.pad { padding: 0 18px; }
.banner { margin: 14px 18px 26px; display: flex; gap: 18px; align-items: center; padding: 20px 18px; border-radius: 20px; background: rgba(247,236,218,.09); border: 1.5px solid rgba(247,236,218,.2); cursor: pointer; transition: background .3s; }
.banner:hover { background: rgba(247,236,218,.13); }
.banner .badge-ic { flex: 0 0 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--peach), #c9a6e0); display: grid; place-items: center; }
.banner p { margin: 0; font-size: 17px; line-height: 1.5; }
.banner .chev { margin-left: auto; opacity: .6; }
.greeting { font-size: 30px; font-weight: 500; margin: 0 18px 8px; letter-spacing: -.2px; }
.subgreet { margin: 0 18px 20px; color: var(--cream-2); }
.filter { display: flex; gap: 8px; padding: 0 18px 8px; overflow-x: auto; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--glass); color: var(--cream); padding: 8px 16px; border-radius: 999px; font-size: 15px; white-space: nowrap; transition: all .25s; }
.chip[aria-checked="true"], .chip.on { background: var(--cream); color: var(--teal-800); border-color: var(--cream); font-weight: 600; }

/* rows / carousels */
.row { margin: 30px 0 6px; }
.row-head { display: flex; align-items: center; gap: 12px; padding: 0 18px; margin-bottom: 14px; }
.row-head h2 { font-size: 22px; font-weight: 500; margin: 0; flex: 1; }
.arrows { display: flex; gap: 10px; }
.arrow { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(5, 25, 28, .45); font-size: 18px; transition: background .25s, opacity .25s; }
.arrow:hover { background: rgba(5, 25, 28, .7); }
.see-all { font-size: 17px; white-space: nowrap; opacity: .9; }
.track-row { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 18px; padding: 0 18px 6px; scrollbar-width: none; scroll-behavior: smooth; }
.track-row::-webkit-scrollbar, .filter::-webkit-scrollbar { display: none; }
.card { flex: 0 0 min(72vw, 330px); scroll-snap-align: start; cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
.card .art { position: relative; aspect-ratio: 16 / 10.5; border-radius: var(--radius); background-size: cover; background-position: center; box-shadow: 0 10px 28px rgba(0,0,0,.25); overflow: hidden; transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s; }
.card:hover .art, .card:focus-visible .art { transform: translateY(-3px) scale(1.015); box-shadow: 0 16px 34px rgba(0,0,0,.32); }
.card .art .art-title { position: absolute; inset: auto 16px 44px; font-size: 22px; font-family: Georgia, 'Times New Roman', serif; letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 2px 14px rgba(0,0,0,.4); line-height: 1.1; }
.badge { position: absolute; left: 12px; bottom: 12px; display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 999px; background: rgba(5, 22, 25, .55); backdrop-filter: blur(6px); font-size: 13px; font-weight: 600; }
.badge.right { left: auto; right: 12px; }
.meta { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.avatar { flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--teal-800); background: linear-gradient(135deg, var(--cream), var(--peach)); border: 2px solid rgba(247,236,218,.6); }
.meta b { display: block; font-size: 16px; font-weight: 600; }
.meta small { display: block; font-size: 14px; color: var(--cream-2); margin-top: 3px; }
.empty-card { flex: 0 0 min(72vw, 330px); aspect-ratio: 16/10.5; border-radius: var(--radius); border: 1.5px dashed var(--line); display: grid; place-items: center; text-align: center; padding: 20px; color: var(--cream-2); }

/* grid pages */
.page-head { padding: 6px 18px 10px; }
.page-head h1 { font-size: 30px; font-weight: 500; margin: 10px 0 6px; }
.page-head p { color: var(--cream-2); margin: 0 0 14px; line-height: 1.5; }
.back { display: inline-flex; gap: 6px; color: var(--cream-2); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px 18px; padding: 16px 18px; }
.grid .card { flex: initial; }
.topic-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 0 18px; }
.topic-tile { aspect-ratio: 1.6; border-radius: 16px; padding: 14px; display: flex; align-items: flex-end; font-weight: 600; background-size: cover; box-shadow: 0 6px 18px rgba(0,0,0,.2); transition: transform .35s; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.topic-tile:hover { transform: translateY(-2px); }

/* player */
.player { position: fixed; inset: 0; z-index: 50; overflow-y: auto; animation: rise .5s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.player-bg { position: fixed; inset: 0; background-size: cover; background-position: center; filter: saturate(1.1); }
.player-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,30,33,.55), rgba(8,30,33,.78) 55%, rgba(40,34,70,.9)); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.player-inner { position: relative; max-width: 560px; margin: 0 auto; padding: 18px 22px 50px; padding-top: max(18px, env(safe-area-inset-top)); text-align: center; }
.player-top { display: flex; align-items: center; justify-content: space-between; }
.player-topic { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--cream-2); }
.fav.on { color: var(--peach); }
.player h2 { font-size: 30px; font-weight: 500; margin: 22px 0 6px; }
.player-sub { margin: 0 0 18px; color: var(--cream-2); }
.durations { display: inline-flex; gap: 8px; padding: 5px; border-radius: 999px; background: rgba(0,0,0,.2); }
.durations .chip { border: 0; background: none; }
.durations .chip[aria-checked="true"] { background: var(--cream); }
.durations.locked { opacity: .5; pointer-events: none; }
.ring-wrap { position: relative; width: min(74vw, 290px); aspect-ratio: 1; margin: 26px auto 10px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-track { stroke: rgba(247,236,218,.15); }
.ring-fill { stroke: var(--peach); stroke-linecap: round; stroke-dasharray: 628.3; stroke-dashoffset: 628.3; transition: stroke-dashoffset .6s linear; }
.breath { position: absolute; inset: 18%; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, rgba(247,236,218,.42), rgba(143,186,170,.25) 55%, rgba(138,114,168,.2)); box-shadow: 0 0 60px rgba(243,196,143,.18), inset 0 0 30px rgba(247,236,218,.12); transform: scale(.72); transition: transform 4s ease-in-out; font-size: 18px; }
.breath.inhale { transform: scale(1); transition-duration: 4s; }
.breath.exhale { transform: scale(.72); transition-duration: 6s; }
.time { font-variant-numeric: tabular-nums; color: var(--cream-2); margin: 4px 0; }
.caption { min-height: 4.6em; font-size: 19px; line-height: 1.5; margin: 10px auto 14px; max-width: 30em; transition: opacity .8s; }
.caption.dim { opacity: 0; }
.controls { display: flex; justify-content: center; align-items: center; gap: 26px; margin: 6px 0 18px; }
.ctl { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); font-size: 22px; transition: all .25s; }
.ctl.play { width: 78px; height: 78px; background: var(--cream); color: var(--teal-800); font-size: 28px; border: 0; box-shadow: 0 8px 26px rgba(0,0,0,.3); }
.ctl.off { opacity: .45; text-decoration: line-through; }
.slider { display: flex; gap: 12px; align-items: center; justify-content: center; font-size: 14px; color: var(--cream-2); }
.slider input { width: 180px; accent-color: var(--peach); }
.player-desc { color: var(--cream-2); line-height: 1.6; margin-top: 22px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 60; background: var(--cream); color: var(--teal-800); padding: 12px 20px; border-radius: 999px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: rise .4s ease; white-space: nowrap; }

@media (min-width: 760px) {
  .card, .empty-card { flex-basis: 330px; }
  .greeting { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .track-row { scroll-behavior: auto; }
}
