:root {
  color-scheme: dark;
  --ink: #f9f2df;
  --muted: #d7cfbb;
  --gold: #f3cf86;
  --clarity: 0;
  --clarity-duration: 1200ms;
  --logo-opacity: 0;
  --topbar-height: 80px;
  --lokta-texture: url('/assets/journey/lokta-paper.webp');
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.questionnaire[data-enlighten-me] { min-height: 100dvh; color: var(--ink); font: 16px/1.55 system-ui, sans-serif; }
.topbar {
  position: relative; z-index: 4; width: min(100% - 40px, 1120px); min-height: var(--topbar-height); margin: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.topbar img {
  display: block; width: clamp(120px, 36vw, 172px); height: auto;
  opacity: var(--logo-opacity); transition: opacity var(--clarity-duration) ease;
}
@media (prefers-reduced-motion: reduce) { .topbar img { transition: none; } }
.sound, .text-button, .primary, .choice {
  min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px;
  font: inherit; color: inherit; cursor: pointer; touch-action: manipulation;
}
.topbar .sound {
  display: grid; place-items: center; flex: 0 0 44px; height: 44px;
  padding: 0; border: 0; background: transparent; color: var(--muted);
  border-radius: 50%;
}
.sound span { display: block; position: relative; font: 22px/1 Georgia, serif; }
.sound[aria-pressed=false] span::after {
  content: ''; position: absolute; inset: 50% -3px auto;
  height: 1.5px; background: currentColor; transform: rotate(-45deg);
}
.text-button { color: var(--gold); background: transparent; padding-inline: 8px; }
.text-button:hover { color: #ffe8ad; text-decoration: underline; }
.primary { color: #211a10; background: var(--gold); font-weight: 650; }
.primary:hover { background: #ffe1a0; }
.primary:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid #fff3bd; outline-offset: 3px; }
h1:focus-visible { outline: none; }

#stage { min-height: calc(100dvh - 80px); display: grid; align-items: start; justify-items: center; padding: 10px 20px 36px; }
.panel {
  width: min(100%, 550px); margin-block: clamp(4px, 4vh, 34px); padding: clamp(19px, 5vw, 35px);
  border: 1px solid #c9b98a46; border-radius: 19px;
  background: linear-gradient(158deg, #20271cf5, #101710f5); box-shadow: 0 16px 70px #080a0873;
}
.opening { align-self: center; text-align: center; max-width: 500px; }
.panel h1 { margin: 0 0 14px; color: var(--ink); font: 400 clamp(1.7rem, 5vw, 2.45rem)/1.13 Georgia, serif; text-wrap: pretty; }
[data-enlighten-me] .panel p { margin: 0 0 14px; }
.panel .primary, .panel .text-button { margin-top: 5px; }
.question-arrival :is(h1, .options) { animation: question-arrival 2s ease both; }
@keyframes question-arrival { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .question-arrival :is(h1, .options) { animation: none; } }
.note { color: var(--muted); font-size: .85rem; }
.panel p.note:last-child { margin: 12px 0 0; }
.question-top { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 12px; margin-bottom: 20px; }
.question-top .text-button { margin: 0; }
.question-top span { color: var(--muted); text-align: right; font-size: .84rem; font-variant-numeric: tabular-nums; }
progress { grid-column: 1 / -1; appearance: none; width: 100%; height: 4px; background: #a3997460; border: 0; border-radius: 10px; overflow: hidden; }
progress::-webkit-progress-bar { background: #a3997460; }
progress::-webkit-progress-value { background: var(--gold); }
progress::-moz-progress-bar { background: var(--gold); }
.options { display: grid; gap: 7px; }
.choice { text-align: left; background: #e8e1c10b; border-color: #d1c29860; }
.choice:hover, .choice.previous { background: #e8e1c121; border-color: #e1bc73; }
.choice[aria-pressed] { display: flex; align-items: center; gap: 10px; }
.choice[aria-pressed]::before { content: ''; width: 15px; height: 15px; border-radius: 3px; border: 1px solid #dfcfac; flex: 0 0 auto; }
.choice[aria-pressed=true] { border-color: var(--gold); background: #b48c332e; }
.choice[aria-pressed=true]::before { background: var(--gold); box-shadow: inset 0 0 0 2px #262419; }
.question-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.option-note:not(:empty), .custom { display: block; margin-top: 10px; color: var(--muted); font-size: .85rem; }
.option-note:empty { margin: 0; }
.custom :is(input, textarea) { display: block; width: 100%; margin-top: 5px; padding: 10px; border: 1px solid #d1c29890; border-radius: 7px; background: #111811; color: var(--ink); font: inherit; }
.dialogue-back { margin-bottom: 6px; }
.guide { display: flex; align-items: center; gap: 12px; margin: 3px 0 15px; color: var(--gold); font-size: .88rem; }
.lines { color: var(--ink); font: clamp(1.14rem, 4vw, 1.36rem)/1.43 Georgia, serif; border-radius: 5px; }
.lines[role=button] { cursor: pointer; }
.lines p { margin-bottom: 10px; }
.journal-panel { padding: 0; border: 0; box-shadow: none; }
.journal-panel .em-world { z-index: 2; background: transparent; --portal-scale: 17; --portal-open-radius: 150vmax; }
.journal-panel .em-world-intro { z-index: 2; }
.journal-panel .em-world-book { width: min(62vw, 265px, 39vh); height: auto; aspect-ratio: 2/3; }
.journal-panel .em-world-cover-front { padding: 0; display: block; }
.journal-panel .em-world-welcome { font: clamp(1.4rem, 4vw, 2rem) Georgia, serif; }
.journal-panel [data-revealed=true]:not(.em-world-arriving) .em-world-welcome { visibility: hidden; }
.em-world-cover-front .em-library-book { width: 100%; height: 100%; padding: 0; }
.em-world-cover-front .em-custom-cover-face { display: block; width: 100%; height: 100%; object-fit: contain; }
.journal-panel .skip-reveal { position: fixed; z-index: 3; right: 20px; bottom: 20px; color: #fff3d4; background: #181c17ee; padding-inline: 16px; }
.offer { align-self: center; text-align: center; }
.offer .text-button { display: block; margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 420px) {
  :root { --topbar-height: 66px; }
  .topbar { width: calc(100% - 30px); }
  #stage { min-height: calc(100dvh - 66px); padding-inline: 12px; }
  .choice { padding-inline: 11px; }
}

/* The journal's Lokta stock, softened for reading on the forest backdrop. */
.lokta {
  --ink: #392e22;
  --muted: #655848;
  --gold: #6a4b20;
  color: var(--ink);
  background: linear-gradient(#f3e9cfde, #f3e9cfde), var(--lokta-texture) center / 540px, #f3e9cf;
  border-color: #c7b789;
  border-radius: 9px;
}

.lokta .choice { background: #fffaf163; border-color: #a68e68; }
.lokta .choice:hover, .lokta .choice.previous { background: #fff9e8; border-color: #866335; }
.lokta .choice[aria-pressed]::before { border-color: #866335; }
.lokta .choice[aria-pressed=true] { background: #e6d3aa; border-color: #866335; }
.lokta .choice[aria-pressed=true]::before { background: #6a4b20; box-shadow: inset 0 0 0 2px #f7edda; }
.lokta .text-button:hover { color: #4c3420; }
.lokta .primary { background: #edcc8c; }
.lokta .primary:hover { background: #e6bf77; }
.lokta .custom :is(input, textarea) { background: #fff9eb; border-color: #a68e68; }
.lokta progress, .lokta progress::-webkit-progress-bar { background-color: #d7c6a9; }
.lokta progress::-webkit-progress-value { background: #806037; }
.lokta progress::-moz-progress-bar { background: #806037; }
[data-enlighten-me] .lokta button:focus-visible { outline-color: #835f31; }

.wisdom-open .topbar .sound { visibility: hidden; }
.wisdom { align-self: center; padding: clamp(24px, 7vw, 48px); border: 0; background: none; box-shadow: none; }
.wisdom .em-home-persona { margin: 0 0 24px; }
[data-enlighten-me] .wisdom .em-home-wisdom { margin: 0 auto 28px; max-width: 24ch; font-size: clamp(1.45rem, 5vw, 2rem); line-height: 1.45; text-wrap: balance; }
.wisdom .em-home-opening:before { inset: -85px -30px -65px; }
[data-enlighten-me] .wisdom blockquote:focus-visible { outline: none; }

.preferred-name-form .custom { margin-bottom: 10px; }
.preferred-name-form .text-button { margin-left: 12px; }
.local-checkout {
  width: min(440px, calc(100vw - 32px)); padding: clamp(18px, 5vw, 30px);
  border: 1px solid #c7b789; border-radius: 12px; color: #392e22; background: #f3e9cf;
}
.local-checkout::backdrop { background: #101510b8; }
[data-enlighten-me] .local-checkout h1 { color: inherit; }
.local-checkout .text-button { color: #6a4b20; }

/* Keep modal content and its backdrop below the existing brand position. */
.questionnaire[data-enlighten-me] :is(dialog.em-plus-preview, dialog.local-checkout)[open] {
  inset-block-start: var(--topbar-height);
  max-height: calc(100dvh - var(--topbar-height) - 24px);
}
.questionnaire :is(dialog.em-plus-preview, dialog.local-checkout)[open]::backdrop {
  clip-path: inset(var(--topbar-height) 0 0);
}

.offer { max-width: 500px; }
[data-enlighten-me] .offer .offer-subheadline { margin-bottom: 0; }
.offer-practices {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; max-width: 320px; margin: 20px auto; padding: 0; list-style: none;
}
.offer-practices li {
  display: grid; justify-items: center; gap: 3px; color: var(--muted); font-size: .82rem;
}
.offer-practice-icon { position: relative; display: grid; place-items: center; width: 30px; height: 30px; color: var(--gold); }
.offer-practice-icon svg { width: 26px; height: 26px; }
.offer-practice-icon .em-breath-ring { transform: none; }
[data-enlighten-me] .offer .offer-support { margin: 0 auto; max-width: 34ch; color: var(--muted); font: italic 1rem/1.5 Georgia, serif; }
[data-enlighten-me] .offer .em-first-path-decline {
  width: auto; margin: 0 auto; padding-inline: 16px;
  color: var(--muted); background: transparent; border: 0; text-decoration: underline;
  text-underline-offset: .2em;
}

[data-enlighten-me] .journal-panel .em-world[data-opening=ink] {
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
[data-enlighten-me] .journal-panel .em-world[data-offer-visible=true] { overflow-y: auto; }
[data-enlighten-me] .journal-panel .em-world[data-opening=ink] .em-world-intro {
  display: grid;
  grid-template-areas: "journal offer";
  grid-template-columns: minmax(0, 270px) minmax(0, 460px);
  place-content: center;
  align-items: center;
  gap: clamp(24px, 6vw, 88px);
  padding: calc(var(--topbar-height) + 22px) 20px 24px;
}
.journal-panel .em-world[data-opening=ink] .em-world-book {
  grid-area: journal;
  width: min(100%, 265px, 39vh);
}
.journal-panel .em-world[data-opening=ink] .em-world-welcome {
  grid-area: offer;
  inset: auto;
  place-self: center;
  margin: 0;
}
.journal-panel .cinematic-offer {
  --ink: #f9f2df;
  color: var(--ink);
  font: 16px/1.55 system-ui, sans-serif;
  grid-area: offer;
  margin: 0;
  visibility: hidden;
  opacity: 0;
  transition: opacity 2s ease;
}
.journal-panel [data-offer-visible=true] .cinematic-offer { visibility: visible; opacity: 1; }
.journal-panel .cinematic-offer .em-first-path-offer { animation: none; }

@media (max-width: 700px) {
  [data-enlighten-me] .journal-panel .em-world[data-opening=ink] .em-world-intro {
    grid-template-areas: "journal" "offer";
    grid-template-columns: minmax(0, 460px);
    gap: clamp(15px, 3vh, 25px);
    padding: calc(var(--topbar-height) + 14px) 12px 20px;
  }
  .journal-panel .em-world[data-opening=ink] .em-world-book { width: min(51vw, 190px, 26vh); }
  .journal-panel .cinematic-offer { padding: clamp(16px, 4vw, 26px); }
}
@media (prefers-reduced-motion: reduce) {
  .journal-panel .cinematic-offer { transition: none; }
}

.preview-sanctuary {
  width: min(100%, 980px);
  padding: clamp(12px, 3vw, 25px);
}
.preview-sanctuary .em-main { min-width: 0; padding: 0; }
.preview-sanctuary > .text-button { margin-bottom: 12px; }

[data-enlighten-me] .em-plus-preview-final .em-plus-gift-decline {
  width: auto; margin: 0 auto; padding-inline: 16px;
  color: #4c4434; background: transparent; border: 0; text-decoration: underline;
  text-underline-offset: .2em;
}

[data-enlighten-me] .cinematic-offer .offer-outcome:focus {outline:none;}
[data-enlighten-me] .cinematic-offer .offer-outcome {font-weight:normal; font:clamp(1.1rem, 3.8vw, 1.4rem)/1.45 Georgia,serif; color:#fff7e7; max-width:37ch; margin:0 auto 1rem; text-wrap:pretty;}
[data-enlighten-me] .cinematic-offer .em-first-path-pricing {margin:0 auto .65rem; line-height:1.45;}
[data-enlighten-me] .cinematic-offer .em-first-path-pricing strong {display:block;font-size:1.06rem;color:#fff7e7;}
[data-enlighten-me] .cinematic-offer .em-first-path-terms {font-size:1rem;color:#efe9dc;margin:.25rem auto 0;}
[data-enlighten-me] .cinematic-offer .em-first-path-offer>button:last-child {min-height:44px;}
