:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --text: #edf0e9;
  --muted: #a4b8b8;
  --soft: #92aaa9;
  --accent: #c1d6c6;
  --accent-ink: #253e36;
  --panel: rgba(15, 32, 38, .77);
  --border: rgba(194, 215, 210, .19);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #101f28; }
body { margin: 0; min-height: 100svh; color: var(--text); overflow-x: hidden; }
button, textarea, a { -webkit-tap-highlight-color: transparent; }
button, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
::selection { color: #f6f7ed; background: #476d6d; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.world { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(ellipse at 70% 28%, #335059 0, #142d38 45%, #101e26 80%); }
#scenery { display: block; width: 100%; height: 100%; }
.world-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 17, 24, .24), transparent 34%, rgba(3, 13, 17, .05) 70%, rgba(3, 12, 16, .6)); }
.grain { position: absolute; inset: -100%; width: 300%; height: 300%; pointer-events: none; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E"); }

.site-header { display: flex; align-items: center; justify-content: space-between; max-width: 1600px; margin: auto; padding: 31px 48px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 23px; letter-spacing: -.8px; font-weight: 560; }
.brand-domain { color: #acbfba; font-weight: 350; }
.brand-mark { width: 32px; height: 34px; display: grid; place-items: center; color: #c9dbc8; }
.brand-mark .icon { width: 28px; height: 28px; stroke-width: 1.2; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.text-button { padding: 8px 0; border: 0; background: none; font-size: 14px; color: #bbcac6; transition: color .2s; }
.text-button:hover { color: #f0f5e8; }
.header-divider { height: 17px; width: 1px; background: rgba(192, 211, 202, .2); }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; background: none; border: 1px solid var(--border); border-radius: 50%; color: #c2cec5; transition: background .2s; }
.icon-button:hover { background: rgba(202, 221, 206, .1); }
.icon-button .icon { width: 16px; height: 16px; }

.dream-space { max-width: 760px; padding: 41px 28px 68px; margin: auto; text-align: center; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0; font-size: 11px; font-weight: 500; line-height: 1.5; letter-spacing: 2.8px; color: #b6c8c0; }
.eyebrow > span { width: 25px; height: 1px; background: #849f96; opacity: .6; }
h1 { margin: 23px 0 20px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(52px, 5.8vw, 78px); line-height: 1.06; letter-spacing: -3.2px; text-shadow: 0 3px 40px rgba(9, 23, 31, .3); }
h1 em { font-weight: 400; color: #c9decf; }
.intro-copy { color: #b7c8c5; font-size: 16px; letter-spacing: .15px; line-height: 1.6; margin: 0; }
.dream-composer { margin-top: 37px; border: 1px solid var(--border); border-radius: 19px; background: var(--panel); text-align: left; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 20px 70px -20px rgba(0, 7, 14, .35), inset 0 1px rgba(230, 247, 235, .025); overflow: hidden; transition: border-color .3s, box-shadow .3s, background 1.8s; }
.dream-composer:focus-within { border-color: rgba(182, 214, 199, .43); box-shadow: 0 20px 75px -20px rgba(0, 7, 14, .35), 0 0 0 3px rgba(185, 218, 198, .035); }
.composer-heading { display: flex; align-items: center; justify-content: space-between; padding: 23px 25px 0; gap: 10px; height: 48px; }
.composer-heading label { display: inline-flex; align-items: center; gap: 10px; color: #d3ded7; font-size: 14px; font-weight: 450; }
.composer-heading label .icon { width: 17px; height: 17px; color: #afc9b9; }
.clear-button { display: grid; place-items: center; background: transparent; border: 0; width: 30px; height: 30px; color: var(--muted); border-radius: 7px; }
.clear-button:hover { background: rgba(170, 201, 188, .1); color: #ecf1e7; }
.clear-button .icon { width: 16px; height: 16px; }
#dream-input { display: block; width: calc(100% - 50px); height: 114px; min-height: 114px; max-height: 260px; margin: 19px 25px 12px; padding: 0; resize: vertical; outline: none; border: none; border-radius: 0; background: none; color: #e6eee6; font-size: 17px; line-height: 1.75; caret-color: #c4decb; scrollbar-width: thin; scrollbar-color: #536d6b transparent; }
#dream-input::placeholder { color: #8ca4a6; opacity: 1; }
.composer-bottom { min-height: 24px; display: flex; align-items: center; justify-content: space-between; padding: 0 25px 15px; gap: 12px; }
.writing-hint { display: inline-flex; align-items: center; gap: 8px; color: #96b0ab; font-size: 12px; line-height: 1.5; margin: 0; }
.live-dot { height: 5px; width: 5px; border-radius: 50%; background: #9dc0aa; box-shadow: 0 0 8px #8ecca955; flex-shrink: 0; }
.character-count { font-size: 11px; font-variant-numeric: tabular-nums; color: #a4b8b8; white-space: nowrap; }
.composer-footer { padding: 14px 18px 14px 25px; border-top: 1px solid rgba(168, 201, 191, .1); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(9, 25, 30, .2); }
.privacy-note { display: inline-flex; align-items: center; gap: 7px; padding: 5px 0; border: 0; background: none; font-size: 14px; color: #b6cbc1; text-decoration: underline; text-underline-offset: 4px; }
.privacy-note:hover { color: #edf0e9; }
.privacy-note .icon { width: 14px; height: 14px; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; background: #c7d9c9; border: 1px solid #d5e4d3; color: #253d34; border-radius: 9px; padding: 12px 18px; font-size: 14px; font-weight: 550; line-height: 1.3; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); transition: background .2s, transform .2s, opacity .2s; }
.primary-button .icon { width: 16px; height: 16px; }
.primary-button:not(:disabled):hover { background: #dbe8d5; transform: translateY(-1px); }
.primary-button:disabled { opacity: .5; }
.inspiration { margin-top: 26px; }
.inspiration p { margin: 0 0 13px; font-size: 12px; line-height: 1.6; color: #9fb3b1; }
.inspiration p span { color: #c3d0c7; }
.example-list { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.example-button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid rgba(177, 205, 194, .19); border-radius: 30px; background: rgba(19, 39, 43, .52); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #b9ccc2; font-size: 13px; line-height: 1.3; transition: background .2s, border-color .2s, color .2s, transform .2s; }
.example-button .icon { width: 16px; height: 16px; stroke-width: 1.3; }
.example-button:hover { background: rgba(82, 110, 97, .35); border-color: rgba(177, 205, 194, .45); color: #eef4e6; transform: translateY(-2px); }
.example-button[aria-pressed="true"] { color: #e5eee0; border-color: #a6c1af77; background: #728c7730; }
.scene-caption { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 47px; font-size: 12px; letter-spacing: .5px; color: #bbcec5; text-shadow: 0 2px 8px #06141c; min-height: 20px; }
.scene-caption .icon { width: 15px; height: 15px; opacity: .75; }
.caption-line { width: 35px; height: 1px; background: linear-gradient(90deg, transparent, #b6cbb555); }
.caption-line:last-child { transform: rotate(180deg); }
.site-footer { display: flex; justify-content: center; align-items: center; gap: 24px; padding: 19px 48px 25px; max-width: 1600px; margin: auto; font-size: 11px; letter-spacing: .2px; color: #9db4ae; }
@media (min-height: 940px) and (min-width: 761px) { .dream-space { padding-top: 65px; padding-bottom: 90px; } .site-footer { position: absolute; bottom: 0; left: 0; right: 0; } }

body[data-mood="dark"] { --panel: rgba(17, 24, 39, .82); --border: rgba(168, 181, 207, .24); }
body[data-mood="warm"] { --panel: rgba(28, 38, 40, .79); --border: rgba(224, 214, 181, .28); }
body[data-mood="wonder"] { --panel: rgba(25, 30, 48, .79); --border: rgba(198, 196, 221, .23); }
.intro, .dream-composer, .inspiration, .scene-caption { animation: arrive 1s both; }
.dream-composer { animation-delay: .12s; }
.inspiration { animation-delay: .22s; }
.scene-caption { animation-delay: .32s; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.immersion { position: fixed; inset: 0; z-index: 4; padding: 34px 48px; display: flex; justify-content: center; align-items: flex-end; background: linear-gradient(180deg, transparent 50%, rgba(5, 15, 23, .6)); }
.return-button { position: absolute; top: 34px; right: 48px; border: 1px solid #c8d6ca44; border-radius: 28px; background: #142a30b3; backdrop-filter: blur(15px); color: #e1eade; padding: 12px 18px; display: inline-flex; align-items: center; gap: 9px; font-size: 14px; }
.return-button .icon { width: 17px; height: 17px; }
.return-button:hover { background: #2c4547de; }
.immersion-story { text-align: center; max-width: 720px; margin: 0 0 6vh; animation: arrive 1.4s both; }
.immersion-story .eyebrow { color: #cfdbd0; }
#dream-excerpt { font-family: Georgia, "Times New Roman", serif; font-size: clamp(24px, 3vw, 38px); line-height: 1.5; font-weight: 400; text-shadow: 0 3px 20px #0008; margin: 20px 0 25px; overflow-wrap: anywhere; }
.immersion-hint { color: #b9c9bd; font-size: 13px; letter-spacing: .3px; }
body.is-immersed .site-header, body.is-immersed main, body.is-immersed .site-footer { visibility: hidden; }
body.is-immersed { overflow: hidden; }
body.is-immersed .world-shade { opacity: .5; }

dialog { padding: 43px 38px 35px; max-width: 480px; width: calc(100% - 36px); max-height: calc(100svh - 40px); border: 1px solid #a9c5b83d; border-radius: 22px; background: #152c32; color: #d0ded5; box-shadow: 0 30px 100px #0006; }
dialog::backdrop { background: rgba(4, 13, 22, .65); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dialog-close { position: absolute; top: 18px; right: 18px; }
.about-moon { display: block; margin-bottom: 20px; color: #bfd5be; text-align: center; }
.about-moon .icon { width: 36px; height: 36px; stroke-width: 1; }
dialog .eyebrow { font-size: 11px; }
dialog h2 { font: 400 35px/1.2 Georgia, serif; text-align: center; letter-spacing: -.8px; margin: 18px 0 25px; color: #edf1e8; }
dialog > p:not(.eyebrow) { font-size: 15px; line-height: 1.75; margin: 0 0 16px; }
dialog > .primary-button { width: 100%; }
.noscript-note { position: fixed; inset: auto 16px 16px; text-align: center; background: #1b323b; border: 1px solid #aac3b6; padding: 20px; border-radius: 12px; }

@media (min-width: 1600px) { .dream-space { padding-top: 70px; } }
@media (max-width: 760px) {
  .site-header { padding: 24px; }
  .brand { font-size: 21px; }
  .header-actions { gap: 17px; }
  .dream-space { padding: 45px 24px 40px; }
  h1 { font-size: 64px; letter-spacing: -2.7px; }
  .dream-composer { margin-top: 32px; }
  .site-footer { padding: 22px 24px; font-size: 11px; }
  .scene-caption { margin-top: 35px; }
  .immersion { padding: 25px; }
  .return-button { top: 25px; right: 25px; }
}
@media (max-width: 480px) {
  .site-header { padding: 20px; }
  .brand { font-size: 20px; gap: 7px; }
  .brand-mark { width: 28px; }
  .brand-mark .icon { width: 25px; height: 25px; }
  .header-actions { gap: 13px; }
  .header-divider { display: none; }
  .text-button { font-size: 12px; }
  .icon-button { width: 32px; height: 32px; }
  .dream-space { padding: 33px 18px 33px; }
  .eyebrow { letter-spacing: 1.8px; font-size: 10px; gap: 9px; }
  .eyebrow > span { width: 15px; }
  h1 { font-size: 55px; margin-top: 22px; margin-bottom: 18px; }
  .intro-copy { font-size: 14px; }
  .dream-composer { margin-top: 29px; border-radius: 15px; }
  .composer-heading { padding: 20px 19px 0; }
  .composer-heading label { font-size: 13px; gap: 7px; }
  #dream-input { width: calc(100% - 38px); margin: 17px 19px 12px; font-size: 16px; height: 132px; }
  .composer-bottom { padding: 0 19px 15px; gap: 5px; }
  .writing-hint { font-size: 11px; gap: 6px; }
  .character-count { font-size: 10px; }
  .composer-footer { padding: 13px 15px; gap: 9px; }
  .privacy-note { font-size: 10px; gap: 4px; max-width: 115px; line-height: 1.5; }
  .privacy-note .icon { width: 12px; height: 12px; }
  .primary-button { padding: 12px 13px; font-size: 12px; gap: 7px; }
  .inspiration { margin-top: 24px; }
  .inspiration p { font-size: 11px; }
  .example-list { gap: 7px; max-width: 360px; margin: auto; }
  .example-button { font-size: 12px; padding: 9px 12px; min-height: 38px; }
  .site-footer { padding: 17px 20px 24px; font-size: 10px; gap: 16px; }
  .site-footer > span:first-child { line-height: 1.6; }
  .scene-caption { font-size: 11px; margin-top: 29px; gap: 9px; }
  dialog { padding: 38px 25px 26px; }
  dialog > .primary-button { font-size: 14px; }
}
/* Small screens retain comfortable type and touch targets. */
.eyebrow { font-size: 12px; }
.example-button { font-size: 14px; min-height: 42px; }
.writing-hint { font-size: 13px; }
.character-count, .site-footer { font-size: 12px; }
.inspiration p { font-size: 14px; }
dialog .eyebrow { font-size: 12px; }
@media (max-width: 480px) {
  .eyebrow { font-size: 12px; letter-spacing: 1.2px; gap: 7px; }
  .eyebrow > span { width: 10px; }
  .text-button, .composer-heading label { font-size: 14px; }
  .intro-copy { font-size: 16px; }
  .composer-footer { flex-direction: column-reverse; gap: 11px; }
  .composer-footer .primary-button { width: 100%; font-size: 14px; }
  .privacy-note { font-size: 14px; max-width: none; }
  .writing-hint { font-size: 12px; }
  .character-count { font-size: 12px; }
  .inspiration p { font-size: 13px; }
  .example-button { font-size: 14px; min-height: 42px; }
  .scene-caption, .site-footer { font-size: 12px; }
  .site-footer { flex-direction: column; gap: 8px; padding-top: 5px; }
}
@media (max-width: 360px) {
  h1 { font-size: 45px; letter-spacing: -2px; }
  .text-button { font-size: 13px; }
  .header-actions { gap: 8px; }
  .brand { font-size: 18px; }
  .composer-bottom { align-items: flex-start; }
  .writing-hint { max-width: 175px; }
  .character-count { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

.composer-actions { display: flex; align-items: center; gap: 14px; }
.scene-button { background: none; border: 0; padding: 10px 0; font-size: 13px; color: #b6c8bc; white-space: nowrap; }
.scene-button:hover:not(:disabled) { color: #f0f3e7; }
.scene-button:disabled { opacity: .4; }
.interpretation-card { margin-top: 24px; padding: 28px 28px 22px; background: rgba(15, 32, 38, .9); border: 1px solid var(--border); border-radius: 19px; text-align: left; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 15px 65px #04151c33; scroll-margin-top: 30px; }
.interpretation-heading { display: flex; gap: 15px; align-items: center; margin-bottom: 22px; }
.interpretation-heading > div { flex: 1; }
.interpretation-cancel { align-self: flex-start; font-size: 13px; padding: 3px 0 8px; text-decoration: underline; text-underline-offset: 4px; }
.interpretation-mark { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid #c5d6bd33; border-radius: 50%; color: #c4d6bc; flex-shrink: 0; }
.interpretation-mark .icon { width: 23px; height: 23px; }
.interpretation-heading .eyebrow { justify-content: flex-start; font-size: 12px; letter-spacing: 1.8px; color: #a7c0ad; }
.interpretation-heading h2 { margin: 7px 0 0; font: 400 26px/1.2 Georgia, serif; color: #e8eee1; letter-spacing: -.5px; }
.interpretation-text { font-size: 16px; line-height: 1.85; color: #d3ded5; overflow-wrap: anywhere; }
.interpretation-text:empty { display: none; }
.interpretation-prose p { margin: 0 0 16px; white-space: pre-wrap; }
.interpretation-prose p:last-child { margin-bottom: 0; }
.interpretation-symbols { margin-top: 25px; padding-top: 22px; border-top: 1px solid #b9d1c02b; }
.interpretation-symbols h3 { margin: 0 0 15px; color: #e3ebdb; font: 400 21px/1.3 Georgia, serif; }
.interpretation-symbols dl { display: grid; gap: 10px; margin: 0; }
.interpretation-symbol { min-width: 0; padding: 14px 17px; border: 1px solid #b9d1c018; border-radius: 12px; background: #d4e4cb06; }
.interpretation-symbol dt { margin: 0 0 4px; color: #dfe9d5; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.interpretation-symbol dd { margin: 0; color: #bbcec1; font-size: 1rem; line-height: 1.75; white-space: pre-wrap; }
.interpretation-verification { margin: 14px 0; min-width: 0; }
.interpretation-progress { display: flex; align-items: center; gap: 11px; color: #b9cbbd; font-size: 14px; line-height: 1.6; margin-bottom: 10px; }
.breathing-light { width: 8px; height: 8px; border-radius: 50%; background: #c2d7b8; box-shadow: 0 0 15px #bcd9ad80; animation: breathe 2s ease-in-out infinite; flex-shrink: 0; }
@keyframes breathe { 50% { opacity: .3; box-shadow: 0 0 5px #bcd9ad40; } }
.interpretation-toolbar { display: flex; align-items: center; gap: 18px; justify-content: space-between; margin-top: 17px; min-height: 28px; }
#interpretation-status { color: #a6bcb0; font-size: 12px; line-height: 1.5; }
.interpretation-toolbar .text-button { padding: 4px 0; text-decoration: underline; text-underline-offset: 4px; }
.interpretation-footnote { margin: 16px 0 0; padding-top: 17px; border-top: 1px solid #b9d1c01c; font-size: 12px; line-height: 1.7; color: #a4b8ac; }
.interpretation-error { color: #e6c6b5; border-left: 2px solid #d2a88f; padding: 0 0 0 12px; font-size: 14px; line-height: 1.7; }
body.has-interpretation .site-footer { position: static; }
body.has-scene-preview .site-footer { position: static; }
.scene-feedback { width: 100%; max-width: 704px; margin: 10px auto 0; text-align: left; }
#scene-ai-status { margin: 0; padding: 0 4px; color: #afc4bb; font-size: .875rem; line-height: 1.6; }
#scene-ai-status:empty { display: none; }
.scene-feedback .interpretation-verification { margin: 10px 0; }
.scene-preview { margin-top: 16px; padding-top: 18px; border-top: 1px solid #aec8b12b; }
.scene-preview .eyebrow { justify-content: flex-start; margin: 0 0 12px; }
.scene-preview > p:not(.eyebrow) { margin: 0 0 16px; font-size: 14px; line-height: 1.7; color: #c1d1c6; }
.scene-preview-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) {
  body[data-scene="field"] .immersion, body[data-scene="interior"] .immersion, body[data-scene="surreal"] .immersion { align-items: flex-start; }
  body[data-scene="field"] .immersion-story, body[data-scene="interior"] .immersion-story, body[data-scene="surreal"] .immersion-story { margin: 15vh 0 0; }
  body[data-scene="field"] #dream-excerpt, body[data-scene="interior"] #dream-excerpt, body[data-scene="surreal"] #dream-excerpt { font-size: 22px; }
}
@media (max-width: 480px) {
  .scene-preview-buttons { flex-direction: column; align-items: stretch; }
  .scene-preview-buttons button { justify-content: center; }
}
@media (max-width: 760px) {
  .composer-footer { flex-wrap: wrap; }
  .composer-actions { flex: 1; justify-content: flex-end; gap: 13px; }
}
@media (max-width: 480px) {
  .composer-footer { flex-direction: column-reverse; }
  .composer-actions { width: 100%; flex-direction: column-reverse; gap: 4px; }
  .composer-actions .primary-button { width: 100%; }
  .scene-button { padding: 9px; font-size: 14px; }
  .interpretation-card { padding: 23px 20px 20px; border-radius: 15px; }
  .interpretation-heading { gap: 11px; }
  .interpretation-heading h2 { font-size: 23px; }
  .interpretation-symbols { margin-top: 21px; padding-top: 19px; }
  .interpretation-symbol { padding: 12px 14px; }
  .interpretation-heading .eyebrow { font-size: 12px; letter-spacing: 1px; }
  .interpretation-mark { width: 36px; height: 36px; }
  .interpretation-mark .icon { width: 20px; height: 20px; }
}
