@font-face{
  font-family:"Montserrat";
  font-style:normal;
  font-weight:500 700;
  font-display:swap;
  src:url("./fonts/montserrat-latin.woff2") format("woff2");
}
@font-face{
  font-family:"Newsreader";
  font-style:normal;
  font-weight:400 500;
  font-display:swap;
  src:url("./fonts/newsreader-latin.woff2") format("woff2");
}
@font-face{
  font-family:"Newsreader";
  font-style:italic;
  font-weight:400 500;
  font-display:swap;
  src:url("./fonts/newsreader-italic-latin.woff2") format("woff2");
}

:root{
  --release-duration:4s;
  --close-ease:cubic-bezier(.22,.61,.36,1);
  --breath-motion-duration:0s;
  --horizon-y:62dvh;
  --scene-image:url("./ocean-morning.png");
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%}
/* The fixed scene paints the viewport; its underlying document canvas must also cover long captures and overscroll. */
html{background:#203342}
html:has(body[data-mode="night"]){background:#070b20}
body{
  --ink:#29252a;
  --muted:#3d363d;
  --soft:rgba(255,255,255,.8);
  --field:rgba(255,255,255,.58);
  --field-focus:rgba(255,255,255,.82);
  --line:rgba(75,62,69,.23);
  --button:rgba(255,255,255,.78);
  --button-hover:rgba(255,255,255,.94);
  --accent:#ad705b;
  --privacy-ink:#fff;
  --reading-shadow:0 1px 12px rgba(255,255,255,.96),0 1px 2px rgba(255,255,255,.95);
  --footer-shadow:0 1px 7px rgba(30,20,27,.72),0 1px 2px rgba(25,17,23,.9);
  --reading-atmosphere:linear-gradient(to top,rgba(7,16,32,.4),transparent 150px),linear-gradient(to bottom,transparent 5%,rgba(255,245,232,.36) 25%,rgba(255,245,232,.36) 67%,transparent 88%);
  --quiet-control-ink:#f7f7fb;
  --quiet-control-bg:rgba(7,16,32,.64);
  min-height:100dvh;
  overflow-x:hidden;
  position:relative;
  color:var(--ink);
  background:#203342;
  font-family:"Newsreader",Georgia,"Times New Roman",serif;
  transition:background .7s ease,color .5s ease;
}
body[data-mode="night"]{
  --ink:#f3efff;
  --muted:#d8d1eb;
  --soft:rgba(42,39,78,.72);
  --field:rgba(15,18,49,.46);
  --field-focus:rgba(20,23,58,.78);
  --line:rgba(220,214,244,.27);
  --button:rgba(52,49,91,.72);
  --button-hover:rgba(69,64,112,.9);
  --accent:#d6c8ff;
  --privacy-ink:#fff;
  --reading-shadow:0 2px 14px rgba(2,5,22,.94),0 1px 2px rgba(2,5,22,.96);
  --footer-shadow:0 1px 7px rgba(2,5,22,.82),0 1px 2px rgba(2,5,22,.96);
  --reading-atmosphere:linear-gradient(to top,rgba(7,11,32,.45),transparent 160px),linear-gradient(to bottom,rgba(7,11,32,.08),rgba(7,11,32,.70) 22%,rgba(7,11,32,.70) 72%,rgba(7,11,32,.08) 100%);
  background:radial-gradient(circle at 50% 115%,#34305f 0%,#191a43 39%,#0b102b 76%,#070b20 100%);
}
button,input,textarea{font:inherit}
button,a,[role="button"]{cursor:pointer}
button:disabled,input:disabled{cursor:not-allowed}

.ritual-scene{
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    linear-gradient(to bottom,rgba(255,248,240,.12),rgba(79,58,76,.02) 52%,rgba(26,25,42,.18)),
    var(--scene-image) center/cover no-repeat;
  filter:saturate(.82) contrast(.9) brightness(1.05);
  transition:filter .8s ease;
}
body[data-mode="night"] .ritual-scene{
  background:
    linear-gradient(to bottom,rgba(4,8,32,.25),rgba(10,13,45,.27) 52%,rgba(2,6,24,.44)),
    var(--scene-image) center/cover no-repeat;
  filter:saturate(.68) contrast(.98) brightness(.68);
}
.ritual-scene::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(ellipse at 50% 62%,rgba(255,231,202,.18),transparent 36%),
    linear-gradient(115deg,rgba(255,255,255,.07),transparent 38%,rgba(255,255,255,.025) 62%,transparent);
  mix-blend-mode:screen;
}
body[data-mode="night"] .ritual-scene::before{background:radial-gradient(ellipse at 50% 62%,rgba(211,207,255,.14),transparent 36%),linear-gradient(115deg,rgba(221,220,255,.045),transparent 40%,rgba(173,164,236,.03) 64%,transparent)}
.ritual-scene::after{
  content:"";
  position:absolute;
  inset:0;
  opacity:.08;
  background:repeating-radial-gradient(circle at 30% 20%,rgba(255,255,255,.35) 0 .45px,transparent .65px 2.4px);
  mix-blend-mode:soft-light;
}
.water-canvas{
  position:fixed;
  left:0;
  right:0;
  top:var(--horizon-y);
  bottom:0;
  width:100%;
  height:calc(100dvh - var(--horizon-y));
  z-index:0;
  pointer-events:none;
  display:block;
}
#light-rays{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
  pointer-events:none;
  mix-blend-mode:screen;
}

.celestial{
  position:fixed;
  left:50%;
  top:var(--horizon-y);
  width:100vw;
  height:1px;
  translate:-50% 0;
  z-index:0;
  pointer-events:none;
}
.celestial-halo,.celestial-body{
  position:absolute;
  left:50%;
  top:0;
  translate:-50% -50%;
  transform:translate3d(0,0,0) scale(1);
  transform-origin:center;
  transition:transform var(--breath-motion-duration) cubic-bezier(.45,0,.55,1),opacity .8s ease;
  backface-visibility:hidden;
  will-change:transform;
}
.celestial-halo{
  border-radius:50%;
  width:clamp(340px,49vw,760px);
  height:clamp(270px,39vw,600px);
  background:radial-gradient(ellipse at center,rgba(255,243,198,.72) 0%,rgba(255,196,126,.4) 30%,rgba(225,135,122,.2) 55%,transparent 78%);
  filter:blur(24px);
  opacity:.84;
}
.celestial-body{
  width:clamp(210px,27vw,440px);
  aspect-ratio:1;
  --orb-fill:radial-gradient(circle at 44% 40%,#fffef3 0%,#fff8d6 48%,#ffdd9b 76%,#f1ad7e 100%);
  opacity:1;
}
.orb-frame{
  position:absolute;
  left:0;
  width:100%;
  height:50%;
  overflow:hidden;
}
.orb-face{
  top:0;
}
.orb-disc{
  position:absolute;
  left:0;
  top:0;
  width:100%;
  aspect-ratio:1;
  border-radius:50%;
  background:var(--orb-fill);
}
body[data-mode="night"] .celestial-halo{
  width:clamp(320px,44vw,690px);
  height:clamp(270px,39vw,600px);
  background:radial-gradient(ellipse at center,rgba(236,234,255,.45) 0%,rgba(177,169,236,.25) 36%,rgba(75,78,151,.12) 62%,transparent 79%);
  filter:blur(28px);
  opacity:.88;
  translate:-50% calc(-50% - clamp(105px,12.5vw,205px) - 32px);
}
body[data-mode="night"] .celestial-body{
  width:clamp(210px,25vw,410px);
  --orb-fill:radial-gradient(circle at 45% 40%,#fff 0%,#fff 58%,#fafaff 78%,#eeeeff 100%);
  opacity:1;
  translate:-50% calc(-100% - 32px);
}
body[data-mode="night"] .celestial-body .orb-frame{height:100%}
body[data-breath-motion="expanded"] .celestial-halo{transform:translate3d(0,-7px,0) scale(1.075)}

main{
  width:min(900px,calc(100% - 34px));
  min-height:100dvh;
  margin:0 auto;
  padding:clamp(36px,6dvh,64px) 0 clamp(24px,4dvh,44px);
  display:flex;
  flex-direction:column;
  position:relative;
  z-index:1;
}
/* Reading light sits behind the content and fades away for breathing/endings. */
body[data-mode] main::after{
  content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
  background:var(--reading-atmosphere);opacity:0;transition:opacity .6s ease;
}
body:is([data-stage="setup"],[data-stage="journal"]) main::after{opacity:1}
.top{display:flex;align-items:flex-start;justify-content:space-between;gap:28px;padding-bottom:clamp(20px,3dvh,32px)}
h1,.verse-text,.intro,.question,textarea{font-family:"Newsreader",Georgia,"Times New Roman",serif}
h1{margin:0;font-weight:400;font-style:italic;font-size:clamp(2.65rem,6.5vw,4.8rem);line-height:.95;letter-spacing:-.04em}
.top,.verse,.intro{text-shadow:var(--reading-shadow)}
.title-block{min-width:0}
.brand-line{display:flex;align-items:baseline;flex-wrap:wrap;gap:7px 12px;margin-bottom:clamp(24px,3.5dvh,36px)}
.wordmark{color:var(--ink);font:500 italic clamp(1.35rem,2.8vw,1.8rem)/1 "Newsreader",Georgia,serif;letter-spacing:-.025em;text-decoration:none}
.brand-tagline{color:var(--muted);font:600 .58rem/1.2 "Montserrat",Arial,sans-serif;letter-spacing:.11em;text-transform:uppercase}
.eyebrow,.label,.control-label,.date{
  font-family:"Montserrat",Arial,sans-serif;
  text-transform:uppercase;
  letter-spacing:.15em;
  font-weight:600;
  color:var(--muted);
}
.eyebrow{font-size:.66rem;margin:0 0 12px}
.mode-switch{
  display:inline-flex;
  gap:4px;
  padding:4px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--button);
  backdrop-filter:blur(12px);
}
.mode-button{
  min-height:38px;
  border:0;
  border-radius:999px;
  padding:8px 12px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:var(--muted);
  background:transparent;
  font:600 .7rem/1 "Montserrat",Arial,sans-serif;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.mode-button[aria-pressed="true"]{color:var(--ink);background:var(--field-focus);box-shadow:0 1px 8px rgba(20,18,34,.09)}
.mode-button:disabled{opacity:.55}
.mode-icon{width:14px;height:14px}

.verse{max-width:720px;margin:clamp(14px,2.5dvh,24px) 0 6px;padding:clamp(8px,1.4dvh,12px) 0 clamp(10px,1.8dvh,16px);outline:none}
.verse .label{font-size:.63rem;margin-bottom:8px}
.verse-text{font-size:clamp(1.04rem,1.65vw,1.18rem);line-height:1.5;margin:0}
.verse-ref{font:600 .66rem/1.4 "Montserrat",Arial,sans-serif;color:var(--muted);margin-top:7px;letter-spacing:.03em}
.intro{margin:clamp(8px,1.5dvh,15px) 0 clamp(10px,2dvh,18px);font-size:1.07rem;line-height:1.55;max-width:680px}
.date{display:block;font-size:.62rem;letter-spacing:.08em;margin-bottom:5px}
.ritual-controls{
  display:grid;
  grid-template-columns:minmax(0,360px);
  justify-content:center;
  align-items:end;
  gap:12px;
  margin-bottom:clamp(13px,2.4dvh,22px);
}
.breath-picker{width:100%;grid-column:1;min-width:0;margin:0;padding:0;border:0}
.breath-picker legend{width:100%;box-sizing:border-box;text-align:center;padding:0;margin-bottom:8px;font:600 .62rem/1.3 "Montserrat",Arial,sans-serif;letter-spacing:.13em;text-transform:uppercase;color:var(--muted);text-shadow:var(--reading-shadow)}
.breath-options{position:relative;display:flex;flex-wrap:nowrap;gap:0;width:100%;max-width:100%;height:56px;box-sizing:border-box;padding:3px;border:1px solid #58454f;border-radius:999px;background:#fff;isolation:isolate;touch-action:pan-y}
.breath-options::before{content:"";position:absolute;inset:3px auto 3px 3px;width:calc(50% - 3px);border-radius:999px;background:#58454f;transition:transform 350ms ease-in-out;z-index:-1}
.breath-options:has(input[value="extended"]:checked)::before{transform:translateX(100%)}
body[data-mode="night"] .breath-options::before{background:#586382}
.breath-option{position:relative;display:block;flex:1;min-width:0}
.breath-option input{position:absolute;opacity:0;pointer-events:none}
.breath-option span{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;height:48px;min-height:48px;box-sizing:border-box;padding:0;border:0;border-radius:999px;background:transparent;color:#29252a;font:400 16px/23px "Newsreader",Georgia,serif;text-shadow:none;cursor:pointer;transition:color 350ms ease-in-out}
.breath-option small{font:400 13px/18px "Newsreader",Georgia,serif;letter-spacing:0;text-transform:none;opacity:1}
.breath-option input:checked+span{color:#fff}
.breath-option input:focus-visible+span{outline:2px solid var(--accent);outline-offset:5px}
.breath-options:has(input:disabled){opacity:.6}
.breath-option input:disabled+span{cursor:not-allowed}
.primary-action{
  min-height:44px;
  flex:0 0 auto;
  border:1px solid var(--line);
  border-radius:999px;
  padding:11px 16px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--ink);
  background:var(--button);
  backdrop-filter:blur(9px);
  font-size:1rem;
  transition:background .2s ease,border-color .2s ease,transform .2s ease;
}
#start-breath{grid-column:1;justify-self:stretch;justify-content:center;box-sizing:border-box;width:100%;height:48px;min-height:48px;padding:10px 16px;text-align:center}
.primary-action:hover{background:var(--button-hover);border-color:color-mix(in srgb,var(--accent) 52%,transparent);transform:translateY(-1px)}
.primary-action:focus-visible,.secondary-action:focus-visible,.prompt-refresh:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.secondary-action{
  min-height:44px;
  border:1px solid color-mix(in srgb,var(--line) 72%,transparent);
  border-radius:999px;
  padding:10px 15px;
  color:var(--privacy-ink);
  background:rgba(30,22,30,.22);
  text-shadow:var(--footer-shadow);
  backdrop-filter:blur(9px);
  font:600 .68rem/1.2 "Montserrat",Arial,sans-serif;
  letter-spacing:.07em;
  text-transform:uppercase;
  transition:background .2s ease,border-color .2s ease,transform .2s ease;
}
.secondary-action:hover{background:rgba(30,22,30,.38);border-color:color-mix(in srgb,var(--accent) 52%,transparent);transform:translateY(-1px)}
.action-icon{width:15px;height:15px;flex:0 0 auto}

.breath-display{
  min-height:84px;
  margin:clamp(10px,2dvh,20px) 0 clamp(14px,2.5dvh,24px);
  display:none;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  text-align:center;
}
.breath-readout{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  min-width:142px;
  padding:11px 18px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--ink);
  background:var(--button);
  backdrop-filter:blur(14px);
}
.breath-primary{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-height:14px;
  font:600 .72rem/1 "Montserrat",Arial,sans-serif;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.breath-time{min-width:1ch;font-variant-numeric:tabular-nums}
.breath-sequence-note{font-size:.7rem;line-height:1;color:var(--muted);letter-spacing:.025em}
.breath-time.cue-step{animation:cueSettle .72s cubic-bezier(.22,.61,.36,1)}
.breath-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);transform:scale(.72);transform-origin:center;opacity:.55;transition:transform var(--breath-motion-duration) cubic-bezier(.45,0,.55,1),opacity var(--breath-motion-duration) cubic-bezier(.45,0,.55,1);will-change:transform,opacity}
body[data-breath-motion="expanded"] .breath-dot{transform:scale(1.44);opacity:1}
.skip-opening{
  display:none;
  min-height:44px;
  padding:8px 12px;
  border:0;
  color:var(--muted);
  background:transparent;
  font:500 .72rem/1.2 "Montserrat",Arial,sans-serif;
  letter-spacing:.03em;
  text-decoration:underline;
  text-decoration-color:color-mix(in srgb,var(--muted) 45%,transparent);
  text-underline-offset:4px;
}
.skip-opening:hover{color:var(--ink);text-decoration-color:currentColor}
.skip-opening:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:999px}

body[data-stage="opening"] .skip-opening{display:inline-flex;align-items:center;justify-content:center}

.journal{margin-top:2px}
.journal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(9px,1.4dvh,13px)}
body[data-mode="night"] .journal-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.card{background:var(--soft);border:1px solid rgba(255,255,255,.06);border-radius:18px;padding:clamp(15px,2dvh,20px);min-width:0;backdrop-filter:blur(14px)}
.card .label{font-size:.65rem;margin-bottom:8px}
.question{font-size:1.04rem;line-height:1.4;margin-bottom:9px;min-height:2.8em}
.prompt-refresh{
  width:36px;
  height:36px;
  margin:0 0 9px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  border-radius:50%;
  color:var(--ink);
  background:var(--button);
}
.prompt-refresh:hover{background:var(--button-hover)}
.write-field{position:relative;overflow:hidden;border-radius:12px}
.write-icon{position:absolute;left:12px;top:13px;width:15px;height:15px;color:var(--ink);opacity:.72;pointer-events:none;z-index:1}
textarea{
  width:100%;
  min-height:clamp(62px,8dvh,76px);
  resize:vertical;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px 10px 36px;
  background:var(--field);
  color:var(--ink);
  font-size:1rem;
  line-height:1.45;
  outline:none;
  transition:border-color .2s ease,background .2s ease,box-shadow .2s ease;
}
textarea:hover{border-color:color-mix(in srgb,var(--accent) 46%,transparent);background:var(--field-focus)}
textarea:focus{border-color:color-mix(in srgb,var(--accent) 65%,transparent);background:var(--field-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 2%,transparent)}
textarea::placeholder{color:var(--muted);opacity:.8;font-style:italic}
.journal-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:clamp(13px,2dvh,20px)}

.site-footer{position:relative;display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:auto;padding:clamp(13px,2dvh,22px) 2px 0;font-size:.78rem;line-height:1.45;color:var(--privacy-ink);text-shadow:var(--footer-shadow)}
.site-footer p{margin:0}
.site-footer a{color:inherit;text-underline-offset:3px;text-decoration-thickness:1px}
.site-footer a,.site-footer summary{background:rgba(7,16,32,.25);border-radius:4px}
.footer-links{display:flex;align-items:center;flex-wrap:wrap;gap:15px}
.about-practice{position:relative}
.about-practice summary{list-style:none;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;cursor:pointer}
.about-practice summary::-webkit-details-marker{display:none}
.about-copy{position:absolute;right:0;bottom:calc(100% + 12px);z-index:8;width:min(450px,calc(100vw - 34px));padding:16px 18px;border:1px solid var(--line);border-radius:16px;color:var(--ink);background:var(--field-focus);box-shadow:0 14px 38px rgba(18,13,21,.2);text-shadow:none;backdrop-filter:blur(16px);font-size:.92rem;line-height:1.55}
.about-copy p+p{margin-top:10px}
.confirmation-dialog{
  width:min(440px,calc(100% - 34px));
  margin:auto;
  padding:0;
  border:1px solid var(--line);
  border-radius:20px;
  color:var(--ink);
  background:var(--field-focus);
  box-shadow:0 24px 70px rgba(18,13,21,.32);
  backdrop-filter:blur(20px);
}
.confirmation-dialog::backdrop{background:rgba(17,13,20,.48);backdrop-filter:blur(5px)}
.confirmation-card{padding:26px}
.confirmation-brand{margin:0 0 18px;color:var(--muted);font:600 .64rem/1.2 "Montserrat",Arial,sans-serif;letter-spacing:.15em;text-transform:uppercase}
.confirmation-card h2{margin:0 0 10px;font:400 italic 2rem/1.05 "Newsreader",Georgia,serif;letter-spacing:-.025em}
.confirmation-card>p:last-of-type{margin:0;color:var(--muted);font-size:.96rem;line-height:1.55}
.confirmation-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:9px;margin-top:24px}
.confirmation-action{min-height:44px;border:1px solid var(--line);border-radius:999px;padding:10px 15px;color:var(--ink);background:var(--button);font:600 .68rem/1.2 "Montserrat",Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase}
.confirmation-action:hover{background:var(--button-hover)}
.confirmation-action:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.confirmation-action-danger{border-color:transparent;color:#fff;background:#6a4050}
.confirmation-action-danger:hover{background:#7a495c}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
[hidden]{display:none!important}

body[data-stage="opening"] .ritual-controls{display:none}
body[data-stage="opening"] .intro{visibility:hidden}
body[data-stage="journal"] #start-breath{display:none}
body[data-stage="releasing"] .top,
body[data-stage="releasing"] .intro,
body[data-stage="releasing"] .ritual-controls,
body[data-stage="releasing"] .journal,
body[data-stage="releasing"] .site-footer{animation:releasePage var(--release-duration) var(--close-ease) forwards;pointer-events:none}
.closing-cue{position:absolute;left:0;z-index:4;display:flex;flex-direction:column;gap:5px;opacity:0;visibility:hidden;color:var(--ink);text-shadow:var(--reading-shadow);pointer-events:none}
.closing-cue .label{font-size:.62rem}
.closing-cue-copy{font-size:1.04rem;line-height:1.35}
body[data-stage="releasing"] .closing-cue{visibility:visible;animation:closingCue 1.5s ease .9s forwards}
body[data-stage="releasing"] .verse,body[data-stage="closing"] .verse{position:relative;z-index:3}
body[data-stage="releasing"] .verse-text,body[data-stage="closing"] .verse-text,body[data-stage="complete"] .verse-text{text-shadow:0 1px 18px rgba(255,255,255,.3)}
body[data-mode="night"][data-stage="releasing"] .verse-text,
body[data-mode="night"][data-stage="closing"] .verse-text,
body[data-mode="night"][data-stage="complete"] .verse-text{text-shadow:0 2px 18px rgba(2,5,22,.9)}
body[data-mode="night"][data-stage="releasing"] .verse,
body[data-mode="night"][data-stage="closing"] .verse,
body[data-mode="night"][data-stage="complete"] .verse{
  position:fixed;
  top:calc(var(--horizon-y) + 12px);
  left:50%;
  width:min(720px,calc(100% - 34px));
  max-width:720px;
  margin:0;
  padding:12px 16px 13px;
  translate:-50% 0;
  border:1px solid rgba(220,214,244,.2);
  border-radius:16px;
  background:linear-gradient(135deg,rgba(5,8,29,.86),rgba(18,19,57,.76));
  box-shadow:0 14px 38px rgba(2,5,22,.2);
  backdrop-filter:blur(5px);
}
body[data-mode="night"][data-stage="releasing"] .closing-cue{
  position:fixed;
  left:50%;
  top:var(--closing-content-top);
  width:min(720px,calc(100% - 34px));
  translate:-50% 0;
}

body[data-stage="releasing"] textarea{resize:none}
body[data-stage="closing"] .intro,
body[data-stage="closing"] .ritual-controls,
body[data-stage="closing"] .journal,
body[data-stage="closing"] .site-footer{display:none}
body[data-stage="closing"] .top,
body[data-stage="complete"] .top{visibility:hidden;pointer-events:none}
body[data-stage="closing"] main{justify-content:flex-start}
body[data-stage="closing"] .verse{align-self:stretch;text-align:left;max-width:720px}

body[data-stage="complete"] .intro,
body[data-stage="complete"] .ritual-controls,
body[data-stage="complete"] .breath-display,
body[data-stage="complete"] .journal,
body[data-stage="complete"] .site-footer{display:none}
body[data-stage="complete"] main{justify-content:flex-start}
body[data-stage="complete"] .verse{align-self:stretch;text-align:left;max-width:720px}
@keyframes releasePage{0%{opacity:1}100%{opacity:0;visibility:hidden}}
@keyframes closingCue{0%{opacity:0}100%{opacity:1}}
@keyframes cueSettle{0%{opacity:.76;transform:translateY(1px)}100%{opacity:1;transform:translateY(0)}}

@media(min-width:651px) and (max-height:820px){
  main{height:100dvh;min-height:0;padding:16px 0 18px}
  .top{padding-bottom:5px}h1{font-size:clamp(2.5rem,7dvh,3.8rem)}
  .verse{margin:4px 0 2px;padding:2px 0 4px}.verse-text{font-size:1rem;line-height:1.35}.verse-ref{margin-top:4px}
  .intro{margin:5px 0 8px;font-size:.98rem;line-height:1.35}.date{margin-bottom:3px}
  .ritual-controls{margin-bottom:9px}.breath-picker legend{margin-bottom:5px}.primary-action{min-height:38px;padding:8px 13px}
  .journal-grid{gap:8px}.card{padding:12px;border-radius:15px}.card .label{margin-bottom:5px}.question{font-size:.96rem;line-height:1.3;margin-bottom:6px;min-height:2.6em}.prompt-refresh{width:32px;height:32px;margin-bottom:6px}
  textarea{min-height:52px;padding:8px 10px 8px 33px;font-size:.94rem;line-height:1.35}.write-icon{left:10px;top:10px}
  .journal-actions{margin-top:8px}.site-footer{padding-top:8px;font-size:.72rem}
  .breath-display{min-height:64px;margin:7px 0 10px}
}

@media(max-width:650px),(hover:none) and (pointer:coarse){
  .ritual-scene{background:var(--scene-image) center/cover no-repeat;filter:none}
  body[data-mode="night"] .ritual-scene{background:linear-gradient(to bottom,rgba(4,8,32,.25),rgba(10,13,45,.27) 52%,rgba(2,6,24,.44)),var(--scene-image) center/cover no-repeat;filter:none}
  .ritual-scene::before,.ritual-scene::after{display:none}
  #light-rays,.celestial-halo{display:none}
  body[data-mode="morning"][data-breath-motion="expanded"] .celestial-body{transform:scale(1.075)}
}

@media(max-width:650px),(max-height:500px) and (pointer:coarse){
  main{width:100%;height:auto;min-height:100dvh;padding-top:max(38px,env(safe-area-inset-top));padding-right:max(17px,env(safe-area-inset-right));padding-bottom:max(28px,env(safe-area-inset-bottom));padding-left:max(17px,env(safe-area-inset-left))}
  .celestial{top:var(--horizon-y);width:100vw;height:1px}
  .celestial-halo{width:min(92vw,360px);height:min(72vw,290px);filter:blur(18px)}
  body[data-mode="night"] .celestial-halo{width:min(92vw,360px);height:min(72vw,290px);filter:blur(18px);translate:-50% calc(-50% - min(29vw,115px) - 26px)}
  .celestial-body,body[data-mode="night"] .celestial-body{width:min(58vw,230px)}
  body[data-mode="night"] .celestial-body{translate:-50% calc(-100% - 26px)}
  .top{align-items:flex-start;flex-direction:column;gap:26px;padding-bottom:18px}
  .mode-switch{align-self:stretch;display:grid;grid-template-columns:1fr 1fr}
  .mode-button{justify-content:center;min-height:44px}
  .verse{margin:18px 0 8px;padding:10px 0 14px}.intro{margin:20px 0 24px}
  .primary-action{width:100%;justify-content:center;min-height:48px}
  .journal-grid,body[data-mode="night"] .journal-grid{grid-template-columns:1fr;gap:13px}.card{display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-areas:"label refresh" "question question" "field field";column-gap:10px;padding:21px}.card .label{grid-area:label;align-self:center;margin-bottom:0}.question{grid-area:question;min-height:0;margin:11px 0 13px}.write-field{grid-area:field}textarea{min-height:84px}.prompt-refresh{grid-area:refresh;width:44px;height:44px;margin:0;justify-self:end}
  .journal-actions{display:grid;grid-template-columns:1fr;gap:9px;margin-top:16px}.journal-actions .primary-action,.journal-actions .secondary-action{width:100%;justify-content:center}.site-footer{align-items:flex-start;flex-direction:column;gap:7px;margin-top:22px;padding-top:12px}.footer-links{width:100%;justify-content:space-between}.about-copy{left:0;right:auto}
  .confirmation-card{padding:22px}.confirmation-actions{display:grid;grid-template-columns:1fr}.confirmation-action{width:100%}
  .breath-display{min-height:96px;margin:14px 0 20px}.breath-readout{min-height:48px}
  body[data-mode="night"][data-stage="releasing"] .verse,
  body[data-mode="night"][data-stage="closing"] .verse,
  body[data-mode="night"][data-stage="complete"] .verse{top:calc(var(--horizon-y) + 7px);width:calc(100% - 24px);padding:9px 12px 10px;border-radius:14px}
  body[data-mode="night"][data-stage="releasing"] .verse-text,
  body[data-mode="night"][data-stage="closing"] .verse-text,
  body[data-mode="night"][data-stage="complete"] .verse-text{font-size:.94rem;line-height:1.32}
  body[data-mode="night"][data-stage="releasing"] .verse .label,
  body[data-mode="night"][data-stage="closing"] .verse .label,
  body[data-mode="night"][data-stage="complete"] .verse .label{margin-bottom:5px}
  body[data-mode="night"][data-stage="releasing"] .verse-ref,
  body[data-mode="night"][data-stage="closing"] .verse-ref,
  body[data-mode="night"][data-stage="complete"] .verse-ref{margin-top:4px}
  body[data-mode="night"][data-stage="releasing"] .closing-cue{display:flex!important;width:calc(100% - 24px)}
  body[data-mode="night"][data-stage="closing"] .breath-display{width:calc(100% - 24px);min-height:72px}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
  .celestial-body,.celestial-halo,.breath-dot{transform:none!important}
  .closing-cue{display:none!important}
}
@media print{body{background:#fff!important;color:#222!important}.celestial,.ritual-scene,.water-canvas,#light-rays,.mode-switch,.ritual-controls,.breath-display,.journal-actions,.site-footer,.closing-cue,main::after{display:none!important}main{padding:20px;width:100%}.card{background:#f7f4ef!important;color:#222!important}}

/* Preserve small-label contrast on iOS WebKit. */
@supports (-webkit-touch-callout:none){
  .eyebrow,.label,.control-label,.date,.brand-tagline,.breath-picker legend{text-shadow:none}
}

@media(prefers-reduced-motion:reduce){.breath-options::before,.breath-option span{transition:none}}

/* Keep the morning verse anchored when the faded journal leaves layout. */
body[data-mode="morning"][data-stage="closing"] .verse,
body[data-mode="morning"][data-stage="complete"] .verse{
  position:fixed;top:var(--settled-verse-top);left:var(--settled-verse-left);
  width:var(--settled-verse-width);box-sizing:border-box;margin:0;
}


/* Keep celestial fills opaque when WebKit composites clipped moving layers. */
.orb-disc{background-color:#fff8d6;background-image:var(--orb-fill)}
body[data-mode="night"] .orb-disc{background-color:#fff}
@supports (-webkit-touch-callout:none){
  .celestial{isolation:isolate}
  .celestial-body{isolation:isolate;will-change:auto}
  .orb-disc{-webkit-backface-visibility:hidden;backface-visibility:hidden}
}

.skip-setup{grid-column:1;justify-self:center;min-height:44px;padding:8px 16px;border:0;border-radius:999px;background:var(--quiet-control-bg);color:var(--quiet-control-ink);text-shadow:var(--footer-shadow);font:inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.skip-setup:hover{color:#fff}
.skip-setup:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:8px}
body:not([data-stage="setup"]) .skip-setup{display:none}

/* Mobile morning closing stays in document flow, independent of scroll snapshots. */
@media(max-width:650px),(hover:none) and (pointer:coarse){
  body[data-mode="morning"]:is([data-stage="releasing"],[data-stage="closing"],[data-stage="complete"]) main{justify-content:flex-start}
  body[data-mode="morning"]:is([data-stage="releasing"],[data-stage="closing"],[data-stage="complete"]) .top{display:none}
  body[data-mode="morning"]:is([data-stage="releasing"],[data-stage="closing"],[data-stage="complete"]) .verse{
    position:relative;top:auto;left:auto;width:100%;max-width:720px;box-sizing:border-box;
    margin:0 0 12px;padding:16px;border-radius:16px;background:rgba(255,248,239,.94);
    color:#29252a;text-shadow:none;
  }
  body[data-mode="morning"]:is([data-stage="releasing"],[data-stage="closing"],[data-stage="complete"]) .verse-text{text-shadow:none}
  body[data-mode="morning"][data-stage="closing"] .breath-display{position:relative;top:auto;left:auto;width:100%;margin:0}
}

.storage-status:empty{display:none}
.storage-status{padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--field-focus);color:var(--ink)}

/* The ocean and celestial body form one quiet breathing guide. */
.breath-readout{border:0;background:none;backdrop-filter:none;border-radius:0;padding:0;min-width:0}
.scene-palm{position:absolute;left:50%;top:8px;translate:-50% 0;width:min(clamp(210px,27vw,440px),calc((100dvh - var(--horizon-y) - 24px)*1.5));height:auto;overflow:visible;fill:#edf4ee;opacity:.82;--palm-open:0;transform-origin:50% 87%;transform:scale(calc(.92 + var(--palm-open)*.12));pointer-events:none}
.scene-palm .palm-upper{transform:translateY(calc(var(--palm-open)*-5px));transform-origin:center}
.scene-palm .palm-lower{transform-origin:75px 87px;transform:scaleY(calc(.94 + var(--palm-open)*.06))}
body[data-mode="night"] .scene-palm{fill:#e2e9f4;opacity:.78}
.breath-primary{border:0;background:none;box-shadow:none;padding:0;animation:none!important}
.breath-time,.breath-sequence-note{display:none!important}
.breath-display{min-height:32px!important}
@media(prefers-reduced-motion:reduce){.scene-palm,.scene-palm *{transform:none!important}}

/* Scripture has a reading stage and a separate, unhurried water-side ending. */
body[data-mode] main{height:auto;min-height:100dvh}
body[data-mode] .verse{position:relative;inset:auto;translate:none;width:100%;max-width:62ch;
  max-height:none;overflow:visible;align-self:start;margin:18px 0;padding:16px 0;
  border:0;border-radius:0;box-shadow:none;backdrop-filter:none;background:none;
  text-align:left;color:var(--ink);isolation:isolate;
  transition:opacity .65s ease,visibility 0s linear;
}
body[data-mode] .verse-text{font-size:clamp(1.15rem,1.65vw,1.4rem);line-height:1.55;text-shadow:none;-webkit-text-stroke:0}
body[data-mode] .verse :is(.label,.verse-ref){color:var(--muted);text-shadow:none;-webkit-text-stroke:0}
body[data-mode][data-stage="complete"] .verse::before{content:"";position:absolute;inset:-40px -12px;mask-image:linear-gradient(to bottom,transparent,#000 35px,#000 calc(100% - 35px),transparent);z-index:-1;pointer-events:none;
  background:linear-gradient(to right,transparent,rgba(255,248,240,.86) 2%,rgba(255,248,240,.86) 98%,transparent)}
body[data-mode="night"][data-stage="complete"] .verse::before{background:linear-gradient(to right,transparent,rgba(7,11,32,.78) 2%,rgba(7,11,32,.78) 98%,transparent)}
body[data-mode]:is([data-stage="opening"],[data-stage="releasing"],[data-stage="closing"]) .verse{
  opacity:0;visibility:hidden;pointer-events:none;transition-delay:0s,.65s;
}

/* Keep visibility discrete: WebKit can retain hidden across reversed transitions. */
body[data-mode] .scene-palm{opacity:0;visibility:hidden;transition:opacity .65s ease,visibility 0s linear .65s}
body[data-mode]:is([data-stage="opening"],[data-stage="closing"]) .scene-palm{opacity:.82;visibility:visible;transition-delay:0s,0s}
body[data-mode][data-stage="complete"] main{display:grid;grid-template-columns:minmax(0,1fr);align-content:start;
  padding-top:calc(var(--horizon-y) + 30px);padding-bottom:max(32px,env(safe-area-inset-bottom));
}
body[data-mode][data-stage="complete"] .top{display:none}
body[data-mode][data-stage="complete"] .verse{position:relative;inset:auto;translate:none;max-height:none;overflow:visible;justify-self:center;align-self:start;text-align:center;
  --reading-shadow:var(--footer-shadow);
  width:min(62ch,100%);margin:0;padding:16px 8px;color:#f3efff;
  animation:scriptureReturn .9s ease both;
}
body[data-mode][data-stage="complete"] .verse :is(.label,.verse-ref){color:#f3efff}
body[data-mode][data-stage="complete"] .verse::before{inset:-40px -12px;
  background:linear-gradient(to right,transparent,rgba(7,11,32,.75) 2%,rgba(7,11,32,.75) 98%,transparent)}
body[data-mode] .closing-cue{display:none!important}
@keyframes scriptureReturn{from{opacity:0}to{opacity:1}}
@media(min-width:1100px) and (min-height:650px){
  body:is([data-stage="setup"],[data-stage="journal"]) .verse{max-width:46ch}
  body:is([data-stage="setup"],[data-stage="journal"]) .intro{max-width:46ch}
  body[data-stage="setup"] .ritual-controls{width:min(360px,100%);justify-content:stretch}
}
@media(max-width:650px),(max-height:500px){
  body[data-mode] main{height:auto;min-height:100dvh}
  body[data-mode] .verse{margin:16px 0 24px;padding:12px 0}
  body[data-mode] .verse-text{font-size:1.15rem;line-height:1.55}
  body[data-mode][data-stage="complete"] main{padding-top:calc(var(--horizon-y) + 24px)}
  body[data-mode][data-stage="complete"] .verse{margin:0;padding:12px 4px}
}
@media(prefers-reduced-motion:reduce){body[data-mode] .verse,body[data-mode] .scene-palm{transition:none;animation:none}body[data-mode] main::after{transition:none}}

body[data-mode][data-stage] .verse{max-height:none;overflow:visible}

body[data-mode][data-stage="complete"] main{padding-top:0}
body[data-mode][data-stage="complete"] main::before{content:"";display:block;height:calc(var(--horizon-y) + 24px);grid-column:1}

body[data-mode][data-stage="complete"] .verse{background:none;border:0;border-radius:0;box-shadow:none;backdrop-filter:none}
body[data-mode][data-stage="complete"] .verse-text{font-size:clamp(1.15rem,1.65vw,1.4rem);line-height:1.55;text-shadow:none}

/* Celestial cue geometry is shared by both breathing sequences. */
.celestial-body .breath-readout{display:none;position:absolute;left:50%;top:25%;translate:-50% -50%;width:max-content;max-width:90%;min-height:0;padding:0;border:0;background:none;backdrop-filter:none;z-index:2;pointer-events:none}
body[data-mode="night"] .celestial-body .breath-readout{top:50%}
body:is([data-stage="opening"],[data-stage="closing"]) .celestial-body .breath-readout{display:flex}
.celestial-body .breath-primary{font:600 clamp(18px,2vw,22px)/1.4 "Montserrat",Arial,sans-serif;color:#273544;letter-spacing:.10em;text-shadow:none;animation:none}
body[data-mode][data-stage] .breath-display{position:fixed;top:auto;bottom:max(16px,env(safe-area-inset-bottom));left:50%;translate:-50% 0;width:max-content;max-width:90vw;height:auto;min-height:44px!important;margin:0;z-index:5;pointer-events:auto}
body:is([data-stage="opening"],[data-stage="closing"]) .breath-display{display:flex}
body:is([data-stage="opening"],[data-stage="closing"]) .skip-opening{display:inline-flex;color:var(--quiet-control-ink);background:var(--quiet-control-bg);border-radius:999px;font-size:.65rem;font-weight:500;letter-spacing:.02em;text-decoration:none;text-shadow:var(--footer-shadow);align-items:center;justify-content:center;pointer-events:auto}
body:is([data-stage="opening"],[data-stage="closing"]) .site-footer{display:none}
@media(max-width:650px),(max-height:500px) and (pointer:coarse){
  main{padding-top:max(20px,env(safe-area-inset-top))}
  .brand-line{margin-bottom:16px}.top{gap:14px;padding-bottom:8px}
  .intro{margin:8px 0 10px}
  body[data-mode] .verse{margin:8px 0 16px;padding:8px 0}
  .site-footer{margin-top:auto;padding-top:24px;padding-bottom:env(safe-area-inset-bottom)}
}

.skip-opening:hover,.skip-opening:focus-visible{color:#fff;text-decoration:underline;text-underline-offset:4px}

/* Keep night scripture legible against moving moonlight. */
body[data-mode="night"][data-stage] .verse-text{text-shadow:0 1px 2px rgba(2,5,22,.95),0 2px 8px rgba(2,5,22,.7)}

.ocean-controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;margin:4px 0 16px;font:500 .7rem/1.4 "Montserrat",Arial,sans-serif;color:var(--privacy-ink);text-shadow:var(--footer-shadow)}
.ocean-controls button{min-height:44px;padding:8px;border:0;border-radius:999px;background:var(--quiet-control-bg);color:var(--quiet-control-ink);font:inherit;text-shadow:inherit}
.ocean-controls button[aria-pressed="true"]{text-decoration:underline;text-underline-offset:4px}
#ocean-settings{display:inline-flex;align-items:center;gap:8px}
#ocean-volume{width:90px;min-height:44px;accent-color:var(--accent)}
.ocean-controls button:focus-visible,#ocean-volume:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
body:is([data-stage="opening"],[data-stage="closing"]) .ocean-controls{position:fixed;bottom:max(68px,calc(env(safe-area-inset-bottom) + 60px));left:50%;translate:-50% 0;width:max-content;max-width:95vw;margin:0;z-index:5;color:#e4e9ee;text-shadow:var(--footer-shadow)}
body:is([data-stage="releasing"],[data-stage="complete"]) .ocean-controls{display:none}

@media(max-height:500px) and (orientation:landscape){
  body[data-mode="morning"]{--reading-atmosphere:linear-gradient(to top,rgba(7,16,32,.4),transparent 80px),linear-gradient(to bottom,rgba(255,245,232,.12),rgba(255,245,232,.66) 38%,rgba(255,245,232,.66) 100%)}
  body[data-mode="morning"]:is([data-stage="setup"],[data-stage="journal"]) :is(.verse-ref,.breath-picker legend){color:var(--ink)}
  body:is([data-stage="opening"],[data-stage="closing"]) .ocean-controls{top:8px;bottom:auto;left:auto;right:8px;translate:none;max-width:42vw;font-size:.65rem}
}

/* Dissolve between counts without moving the celestial cue. */
.celestial-body .breath-primary{flex-direction:column;gap:6px;letter-spacing:0}
.celestial-body #breath-phase{font:600 12px/1.3 "Montserrat",Arial,sans-serif;letter-spacing:.12em}
.celestial-body .breath-time{display:grid!important;grid-template-columns:1fr;min-width:2ch;font:400 clamp(38px,5vw,52px)/1 "Newsreader",Georgia,serif;font-variant-numeric:tabular-nums}
.breath-time>span{grid-area:1 / 1;text-align:center}
.count-previous{pointer-events:none}

#ocean-panel{display:inline-flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px}
body[data-stage="journal"] .ritual-controls{display:none}
.journal-actions>.ocean-controls{margin:0;flex:1 1 auto;justify-content:flex-start}
.journal-actions #ocean-disclosure{white-space:nowrap}
@media(max-width:650px){.journal-actions>.ocean-controls{justify-content:center;min-width:0}}

#ocean-toggle{display:inline-flex;align-items:center;gap:6px}
.ocean-icon{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* Keep the moon unobstructed while mobile opening breaths run. */
@media(max-width:650px),(hover:none) and (pointer:coarse){
  body[data-stage="opening"] .mode-switch{visibility:hidden;pointer-events:none}
}
