/* ==========================================================
   Lunar Haven — design tokens
   ========================================================== */
@font-face {
  font-family: "Montserrat"; src: url("/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}
:root {
  --plaster: #f3f5f8;      /* the wall, in moonlight */
  --paper: #fbfcfd;
  --shade: #e1e6ee;
  --line: #d3d9e3;
  --ink: #161d35;          /* midnight */
  --ink-soft: #525b75;
  --night: #161f3b;
  --night-soft: #b9c3da;
  --champagne: #ecd6a8;

  --font: "Montserrat", system-ui, "Segoe UI", sans-serif;
  --display: clamp(2.7rem, 5.5vw, 5rem);
  --title: clamp(2.1rem, 4.6vw, 4rem);
  --lede: clamp(1.02rem, 1.35vw, 1.2rem);
  --section: clamp(88px, 12vw, 176px);
  --gutter: clamp(22px, 5vw, 64px);
  --max: 1280px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--plaster); color: var(--ink); font: 400 1rem/1.7 var(--font); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
main:focus { outline: none; }
svg, img, canvas { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 300; line-height: 1.08; letter-spacing: -.035em; margin: 0; text-wrap: balance; }
h1 { font-size: var(--display); }
h2 { font-size: var(--title); }
b { font-weight: 500; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.lede { font-size: var(--lede); line-height: 1.65; color: var(--ink-soft); max-width: 34em; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 100; background: var(--ink); color: #fff; padding: 12px 20px; }
.skip:focus { top: 12px; }

/* Buttons: the pill is shared with Hush Studio */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 52px; padding: .8rem 1.7rem; border-radius: 99px; border: 1px solid transparent; font-weight: 500; font-size: .96rem; line-height: 1.3; transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--accent, #33467a); }
.btn-light { background: #fff3dd; color: #2a1a0e; }
.btn-light:hover { background: #fff; }
.btn-line { border-color: currentColor; }
.btn-line:hover { background: var(--ink); color: #fff; }
.arrow { display: inline-block; transition: transform .35s var(--ease); }
a:hover > .arrow, a:hover .dir-go .arrow { transform: translateX(5px); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--plaster); border-bottom: 1px solid transparent; transition: border-color .3s; }
.site-header.scrolled { border-color: var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); }
.wordmark { font-size: 1.4rem; font-weight: 300; letter-spacing: -.03em; line-height: 1; }
.wordmark b { font-weight: 600; }
.brand small { font-size: .66rem; letter-spacing: .04em; color: var(--ink-soft); padding-left: .75rem; border-left: 1px solid var(--line); line-height: 1.7; }
.mark { flex: none; }
.site-nav { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 36px); }
.site-nav a:not(.btn) { font-size: .93rem; color: var(--ink-soft); padding: 12px 0; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 8px) / 0 1px no-repeat; transition: color .25s, background-size .35s var(--ease); }
.site-nav a:not(.btn):hover, .site-nav [aria-current] { color: var(--ink) !important; background-size: 100% 1px !important; }
.site-nav .btn { min-height: 44px; padding: .55rem 1.3rem; font-size: .9rem; }
.menu-toggle { display: none; width: 48px; height: 48px; margin-right: -12px; padding: 0; background: none; border: 0; color: inherit; position: relative; cursor: pointer; }
.menu-toggle i { position: absolute; left: 12px; right: 12px; top: 19px; height: 1.5px; background: currentColor; transition: transform .35s var(--ease); }
.menu-toggle i + i { top: 28px; }
.open .menu-toggle i { transform: translateY(4.5px) rotate(45deg); }
.open .menu-toggle i + i { transform: translateY(-4.5px) rotate(-45deg); }

/* Hero */
.hero { position: relative; height: clamp(640px, calc(100svh - 76px), 980px); background: var(--plaster); overflow: hidden; }
.room { position: absolute; inset: 0; }
.room canvas, .room img { width: 100%; height: 100%; object-fit: cover; }
.room canvas { touch-action: pan-y; cursor: grab; }
.room canvas:active { cursor: grabbing; }
.room img { position: absolute; inset: 0; object-position: 75% 100%; }
.hero-copy { position: relative; padding-top: clamp(36px, 8.5vh, 92px); pointer-events: none; }
.hero-copy > * { pointer-events: auto; max-width: fit-content; }
.hero-copy .lede { max-width: 25em; margin: 1.6rem 0 2rem; }
.moon-control { position: absolute; z-index: 2; bottom: clamp(20px, 4vh, 44px); left: 47%; right: max(var(--gutter), calc((100% - var(--max)) / 2)); }
.moon-control input { -webkit-appearance: none; appearance: none; display: block; width: calc(100% + 30px); height: 44px; margin: 0 -15px; background: linear-gradient(rgba(22,29,53,.4) 0 0) center / calc(100% - 30px) 1px no-repeat; cursor: grab; }
.hero:not(.ready) input { visibility: hidden; }
.moon-control input:active { cursor: grabbing; }
.moon-control input:focus-visible { outline-offset: 0; }
.moon-control input::-webkit-slider-runnable-track { height: 1px; }
.moon-control input::-moz-range-track { height: 1px; background: none; }
.moon-control input::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -14.5px; border-radius: 50%; border: 1px solid var(--ink); background: #fff8e8; box-shadow: inset -7px -2px 0 var(--champagne); }
.moon-control input::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--ink); background: #fff8e8; box-shadow: inset -7px -2px 0 var(--champagne); }
.doors { display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.doors a { display: block; text-align: center; padding: 4px 4px 8px; font-size: .86rem; line-height: 1.5; color: #414a64; transition: color .4s; }
.doors b, .doors span { display: block; }
.doors a.lit, .doors a:hover { color: var(--ink); }
.doors a.lit b { font-weight: 600; }

/* Software */
.software-head { padding-block: var(--section) clamp(64px, 8vw, 112px); display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: end; }
.software-head .lede { margin: 0; }
.chapter { grid-template-columns: minmax(0, 1fr); position: relative; overflow: hidden; isolation: isolate; }
.chapter-art { position: absolute; z-index: -1; }
.chapter-floor { position: absolute; inset: 78% 0 0; z-index: -2; }
.art { width: 100%; height: 100%; overflow: visible; }
.chapter-name { font-weight: 500; font-size: 1.05rem; color: var(--accent); margin-bottom: .9rem; }
.chapter h3 { font-size: clamp(2.5rem, 5.4vw, 4.9rem); }
.chapter-summary { font-size: var(--lede); margin: 1.3rem 0 1.4rem; max-width: 26em; }
.status { font-size: .9rem; line-height: 1.6; max-width: 30em; margin-bottom: 1.9rem; }

.chapter-panorama { background: #f1e8f7; padding-top: clamp(72px, 9vw, 128px); }
.chapter-panorama .wrap { order: -1; }
.chapter-panorama { display: flex; flex-direction: column; }
.chapter-panorama .chapter-art { position: static; height: clamp(340px, 38vw, 600px); margin-top: clamp(16px, 3vw, 40px); }
.chapter-panorama .chapter-copy { display: grid; grid-template-columns: 1.15fr 1fr; column-gap: clamp(24px, 5vw, 80px); }
.chapter-panorama .chapter-name { grid-column: 1 / -1; }
.chapter-panorama h3 { grid-row: 2 / span 3; }
.chapter-panorama .chapter-summary { margin-top: .4rem; }
.chapter-panorama .btn { justify-self: start; }

.chapter-oculus { background: #1b1513; color: #fdf1de; min-height: 860px; display: grid; align-items: center; padding-block: 72px 264px; --accent: #f0b767 !important; }
.chapter-oculus .chapter-floor { inset: 74.5% 0 0; background: #2b211c; }
.chapter-oculus .chapter-art { left: 0; top: 0; bottom: 0; width: 58%; }
.chapter-oculus .art { width: auto; height: 100%; margin-left: auto; margin-right: 4%; }
.chapter-oculus .chapter-copy { margin-left: 60%; }
.chapter-oculus .chapter-summary, .chapter-oculus .status { color: #e3d2bb; }

.chapter-threshold, .chapter-plain { background: #eaf1e8; min-height: 860px; display: grid; align-items: center; padding-block: 96px; }
.chapter-threshold .chapter-floor, .chapter-plain .chapter-floor { inset: 80.2% 0 0; background: #c4d5c2; }
.chapter-threshold .chapter-art, .chapter-plain .chapter-art { right: 5%; top: 0; bottom: 0; width: 46%; }
.chapter-threshold .art, .chapter-plain .art { width: auto; height: 100%; margin-inline: auto; }
.chapter-threshold .chapter-copy, .chapter-plain .chapter-copy { max-width: 46%; }
.chapter-plain { background: color-mix(in srgb, var(--tint) 45%, var(--plaster)); }
.chapter-plain .chapter-floor { inset: 76.7% 0 0; background: color-mix(in srgb, var(--accent) 16%, var(--shade)); }

/* Philosophy */
.philosophy { padding-block: var(--section); background: var(--paper); }
.philosophy h2 { font-size: clamp(2.5rem, 6.6vw, 6.1rem); line-height: 1.02; letter-spacing: -.045em; max-width: 11em; }
.philosophy-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(40px, 7vw, 112px); margin-top: clamp(48px, 7vw, 104px); }
.letter { font-size: clamp(1.08rem, 1.5vw, 1.32rem); line-height: 1.7; max-width: 30em; }
.beliefs > div { padding: 1.35rem 0; border-top: 1px solid var(--line); }
.beliefs > div:last-child { border-bottom: 1px solid var(--line); }
dt { font-weight: 500; }
dd { color: var(--ink-soft); }

/* Better together */
.together { background: var(--night); color: #f5f3ee; padding-block: var(--section); overflow: hidden; }
.together .lede { color: var(--night-soft); margin: 0; }
.together-head { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.thread-wrap { margin: clamp(56px, 8vw, 120px) 0 clamp(48px, 6vw, 88px); }
.thread { width: 100vw; margin-left: calc(50% - 50vw); color: var(--champagne); overflow: visible; }
.thread path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.thread-wrap.armed .thread path { stroke-dashoffset: 1; }
.thread-wrap.armed.in .thread path { stroke-dashoffset: 0; transition: stroke-dashoffset 3.6s cubic-bezier(.45,.1,.3,1) .2s; }
.thread-steps { position: relative; width: 100vw; margin: 8px 0 0 calc(50% - 50vw); height: 3.6rem; }
.thread-steps li { position: absolute; transform: translateX(-50%); text-align: center; font-size: .92rem; color: var(--night-soft); width: max-content; max-width: 30vw; }
.thread-steps li:nth-child(1) { left: 19.6%; } .thread-steps li:nth-child(2) { left: 50%; } .thread-steps li:nth-child(3) { left: 80.4%; }
.thread-steps b { display: block; color: #fff; }
.horizon { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 5vw, 80px); border-top: 1px solid rgba(255,255,255,.2); padding-top: 2rem; }
.horizon h3 { font-size: 1.35rem; letter-spacing: -.02em; font-weight: 400; margin-bottom: .7rem; }
.horizon p { color: var(--night-soft); max-width: 30em; margin: 0; }

/* Growing */
.growing { padding-block: var(--section) clamp(72px, 9vw, 128px); }
.growing-head { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: end; }
.growing-head .lede { margin: 0; }
.elevation-wrap { margin: clamp(40px, 5vw, 72px) 0 clamp(32px, 4vw, 56px); }
.elevation { width: 100%; height: auto; }
.directory li { border-bottom: 1px solid var(--line); }
.directory a { display: grid; grid-template-columns: 56px 1fr 2fr auto; gap: 24px; align-items: center; padding: 22px 0; color: var(--ink); }
.glyph { width: 44px; height: 44px; color: var(--accent); }
.dir-name { font-size: 1.5rem; font-weight: 300; letter-spacing: -.03em; }
.dir-status { font-size: .92rem; color: var(--ink-soft); }
.dir-status b { display: block; color: var(--ink); }
.dir-go { font-size: .92rem; font-weight: 500; }
.directory a:hover .dir-go, .directory a:hover .dir-name { color: var(--accent); }

/* Inner pages */
.page-hero { position: relative; overflow: hidden; min-height: 560px; display: grid; align-items: center; isolation: isolate; background: linear-gradient(var(--plaster) 71.4%, #c9d1df 71.4%, #dce1ea); padding-block: 56px; }
.product-hero { background: linear-gradient(color-mix(in srgb, var(--tint) 40%, var(--plaster)) 71.4%, color-mix(in srgb, var(--accent) 24%, #dfe3ea) 71.4%); }
.page-art { position: absolute; z-index: -1; right: max(0px, calc((100% - var(--max)) / 2 - 60px)); top: 0; height: 100%; aspect-ratio: 1; }
.page-hero-copy { max-width: 56%; margin-top: -120px; }
.page-hero h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); }
.page-hero .lede { margin: 1.3rem 0 1.8rem; max-width: 27em; }
.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 6vw, 96px); align-items: start; }
.two-col.page-section { grid-template-columns: 1fr 1.4fr; padding-block: clamp(48px, 6vw, 88px); }
.page-section + .page-section::before { content: ""; grid-column: 1 / -1; border-top: 1px solid var(--line); margin-bottom: clamp(20px, 3vw, 48px); }
.page-section + .page-section { padding-top: 0; }
.page-section h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
.prose { font-size: 1.08rem; max-width: 34em; }
.prose a { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.product-body { padding-block: clamp(64px, 8vw, 112px); background: var(--paper); }
.product-body .prose { font-size: clamp(1.1rem, 1.5vw, 1.3rem); }
.facts > div, .plain-list li { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.facts dd b { color: var(--accent); }
.facts + .btn, .coming { margin-top: 1rem; }
.coming { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.plain-list li { display: flex; justify-content: space-between; gap: 24px; }
.plain-list a { font-weight: 500; }
.plain-list span:last-child { color: var(--ink-soft); }
.next-rooms { padding-block: clamp(56px, 7vw, 96px); }
.next-rooms h2 { font-size: 1.5rem; margin-bottom: 1.4rem; }
.next-rooms ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0 clamp(28px, 6vw, 96px); }
.next-rooms a { display: grid; grid-template-columns: 56px 1fr; align-items: center; column-gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.next-rooms .glyph { grid-row: span 2; }
.next-rooms b { font-size: 1.15rem; transition: color .3s; }
.next-rooms a:hover b { color: var(--accent); }
.next-rooms span { color: var(--ink-soft); }

/* Footer */
.site-footer { background: var(--shade); padding: clamp(56px, 6vw, 88px) 0 36px; }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand p { margin-top: 1.3rem; color: var(--ink-soft); max-width: 22em; }
.footer-grid h2 { font-size: .95rem; font-weight: 500; letter-spacing: 0; margin-bottom: .7rem; }
.footer-grid li a { display: inline-block; padding: 5px 0; color: var(--ink-soft); }
.footer-grid li a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; margin-top: 56px; padding-top: 22px; border-top: 1px solid #c3ccd9; font-size: .88rem; color: var(--ink-soft); }

/* Reveal: armed only once script has run */
.reveal.armed:not(.in):not(.thread-wrap) { opacity: 0; transform: translateY(18px); }
.reveal.armed.in:not(.thread-wrap) { transition: opacity .9s var(--ease), transform .9s var(--ease); }

/* Tablet */
@media (max-width: 1000px) {
  .hero { height: auto; display: flex; flex-direction: column; background: linear-gradient(var(--plaster), #f3f5f8); }
  .hero-copy { padding-block: clamp(36px, 7vw, 72px) 8px; }
  .hero-copy .lede { max-width: 32em; }
  .room { position: relative; inset: auto; height: clamp(430px, 66vw, 600px); order: 2; }
  .moon-control { left: var(--gutter); right: var(--gutter); bottom: 14px; }
  .chapter-oculus, .chapter-threshold, .chapter-plain { min-height: 0; padding-block: 0 72px; }
  .chapter-oculus .chapter-art, .chapter-threshold .chapter-art, .chapter-plain .chapter-art { position: relative; inset: auto; left: auto; right: auto; width: 100%; height: clamp(440px, 84vw, 680px); }
  .chapter-oculus .art, .chapter-threshold .art, .chapter-plain .art { margin-inline: auto; }
  .chapter-oculus .chapter-art { margin-top: 24px; }
  .chapter-oculus .chapter-floor { inset: calc(24px + clamp(440px, 84vw, 680px) * .744) 0 0; }
  .chapter-threshold .chapter-floor { inset: calc(clamp(440px, 84vw, 680px) * .802) 0 0; }
  .chapter-plain .chapter-floor { inset: calc(clamp(440px, 84vw, 680px) * .767) 0 0; }
  .chapter-oculus .chapter-copy { margin-left: 0; padding-top: 32px; }
  .chapter-threshold .chapter-copy, .chapter-plain .chapter-copy { max-width: none; padding-top: 32px; }
  .directory a { grid-template-columns: 56px 1fr auto; }
  .dir-status { grid-column: 2 / -1; grid-row: 2; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 32px; background: var(--plaster); border-bottom: 1px solid var(--line); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .3s, visibility .3s, transform .35s var(--ease); }
  .open .site-nav { opacity: 1; visibility: visible; transform: none; }
  .site-nav a:not(.btn) { font-size: 1.35rem; font-weight: 300; color: var(--ink); padding: 15px 0; border-bottom: 1px solid var(--line); background: none; }
  .site-nav .btn { min-height: 52px; margin-top: 24px; }
  .software-head, .together-head, .growing-head, .philosophy-grid, .horizon, .chapter-panorama .chapter-copy, .two-col, .two-col.page-section { grid-template-columns: minmax(0, 1fr); }
  .chapter-panorama h3 { grid-row: auto; margin-bottom: 1rem; }
}
/* Phone */
@media (max-width: 600px) {
  .brand small { font-size: .62rem; padding-left: .6rem; }
  .brand { gap: .6rem; } .wordmark { font-size: 1.22rem; }
  .doors { font-size: .8rem; } .doors a { font-size: .78rem; padding-inline: 2px; }
  .doors span { display: none; } .doors a { padding-block: 10px 12px; }
  .room { height: min(440px, 62svh); min-height: 380px; }
  .moon-control { bottom: 4px; }
  .btn { width: 100%; }
  .chapter-art .art { max-width: none; }
  .thread path { stroke-width: 3.6; }
  .thread-steps { width: auto; height: auto; margin: 32px 0 0; display: grid; gap: 1.1rem; }
  .thread-steps li { position: static; transform: none; text-align: left; max-width: none; }
  .elevation-wrap { margin-inline: calc(var(--gutter) * -1); }
  .directory a { grid-template-columns: 48px 1fr; gap: 6px 16px; }
  .dir-go { grid-column: 2; }
  .page-hero { min-height: 0; padding-block: 40px 250px; background: linear-gradient(var(--plaster) calc(100% - 92px), #c9d1df calc(100% - 92px)); }
  .product-hero { background: linear-gradient(color-mix(in srgb, var(--tint) 40%, var(--plaster)) calc(100% - 92px), color-mix(in srgb, var(--accent) 24%, #dfe3ea) calc(100% - 92px)); }
  .page-art { top: auto; bottom: 0; height: 322px; right: -20px; }
  .page-hero-copy { max-width: none; margin: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal.armed { opacity: 1 !important; transform: none !important; }
  .thread-wrap.armed .thread path { stroke-dashoffset: 0; }
}
