/* ═══════════════════════════════════════════════════
   Quietstead — The Practice of Quiet
   Palette (Visual Identity 02):
   Parchment #DCC9A3 · Walnut #5B412C · Ink #23201C
   Quietstead Green #2F4F46 · Candle Gold #C89A3D · Moonlit Blue #304C74
   ═══════════════════════════════════════════════════ */

:root {
  --parchment: #DCC9A3;
  --walnut: #5B412C;
  --ink: #23201C;
  --ink-deep: #14120F;
  --green: #2F4F46;
  --gold: #C89A3D;
  --gold-bright: #E8C06A;
  --blue: #304C74;
  --serif: "EB Garamond", Georgia, serif;
  --display: "Cinzel", "EB Garamond", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink-deep);
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }

/* crest PNG has a dark background — lighten-blend melts it into the page,
   and a radial mask erases the square edges */
.blend-crest {
  mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 70%);
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 70%);
}

/* ── film grain ── */
.grain {
  position: fixed; inset: -100%;
  pointer-events: none; z-index: 90; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 10% { transform: translate(-5%,-8%); }
  30% { transform: translate(3%,-12%); } 50% { transform: translate(8%,4%); }
  70% { transform: translate(-9%,6%); } 90% { transform: translate(4%,9%); }
}

/* ── loader ── */
#loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ink-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem;
}
.loader-crest { width: 110px; animation: crestPulse 2.4s ease-in-out infinite; }
@keyframes crestPulse { 50% { opacity: .8; transform: scale(1.03); } }
.loader-line { font-style: italic; color: var(--gold); letter-spacing: .06em; opacity: .9; }
#loader { transition: opacity 1.2s ease; }
#loader.done { opacity: 0; pointer-events: none; }

/* ── nav ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2rem;
  background: linear-gradient(rgba(20,18,15,.92), rgba(20,18,15,0));
  transition: background .5s, backdrop-filter .5s;
}
#nav.scrolled { background: rgba(20,18,15,.88); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(200,154,61,.15); }
.nav-brand { display: flex; align-items: center; gap: .7rem; font-family: var(--display); letter-spacing: .18em; text-transform: uppercase; font-size: .95rem; color: var(--parchment); }
.nav-crest { width: 34px; }
#nav nav { display: flex; gap: 1.8rem; }
#nav nav a {
  color: var(--parchment); font-size: .95rem; letter-spacing: .08em; opacity: .8;
  position: relative; transition: opacity .3s, color .3s;
}
#nav nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
  background: var(--gold); transition: width .35s ease;
}
#nav nav a:hover { opacity: 1; color: var(--gold-bright); }
#nav nav a:hover::after { width: 100%; }
.nav-cta {
  border: 1px solid rgba(200,154,61,.55); padding: .45rem 1.1rem; border-radius: 2px;
  font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; font-family: var(--display);
  transition: background .3s, box-shadow .3s, color .3s;
}
.nav-cta:hover { background: rgba(200,154,61,.12); box-shadow: 0 0 18px rgba(200,154,61,.25); color: var(--gold-bright); }

/* ── hero ── */
#hero { position: relative; height: 100vh; min-height: 640px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 2.4s ease;
}
.hero-media video.is-active { opacity: 1; z-index: 1; }
#dust { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hero-veil {
  position: absolute; inset: 0; z-index: 2;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(20,18,15,0) 0%, rgba(20,18,15,.55) 75%, rgba(20,18,15,.92) 100%),
    linear-gradient(rgba(20,18,15,.35), rgba(20,18,15,.25) 55%, var(--ink-deep) 100%);
}
.hero-content { position: relative; z-index: 4; text-align: center; padding: 0 1.5rem; }
.hero-kicker {
  font-family: var(--display); font-size: .85rem; letter-spacing: .5em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.4rem; text-shadow: 0 0 22px rgba(200,154,61,.5);
}
.hero-title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(3rem, 11vw, 8.5rem);
  letter-spacing: .14em; text-transform: uppercase; line-height: 1;
  color: var(--parchment);
  text-shadow: 0 2px 40px rgba(0,0,0,.8), 0 0 80px rgba(200,154,61,.25);
}
.hero-title span { display: inline-block; }
.hero-rule {
  width: 220px; height: 1px; margin: 1.6rem auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 12px rgba(200,154,61,.6);
}
.hero-sub { font-size: clamp(1.05rem, 2.2vw, 1.35rem); font-style: italic; opacity: .92; margin-bottom: 2.4rem; text-shadow: 0 1px 14px rgba(0,0,0,.9); }
.hero-btn {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--display); letter-spacing: .18em; text-transform: uppercase; font-size: .9rem;
  color: var(--gold-bright);
  border: 1px solid rgba(200,154,61,.6); border-radius: 2px;
  padding: .95rem 2.2rem;
  background: rgba(20,18,15,.35);
  transition: background .35s, box-shadow .35s, transform .35s;
}
.hero-btn:hover { background: rgba(200,154,61,.14); box-shadow: 0 0 34px rgba(200,154,61,.35), inset 0 0 18px rgba(200,154,61,.12); transform: translateY(-2px); }
.btn-flame {
  width: 7px; height: 11px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 80%, #fff2c9, var(--gold) 55%, transparent 75%);
  box-shadow: 0 0 10px 2px rgba(232,192,106,.8);
  animation: flame 1.6s ease-in-out infinite;
}
@keyframes flame {
  0%,100% { transform: scaleY(1) translateY(0); opacity: .95; }
  35% { transform: scaleY(1.25) translateY(-1px); opacity: 1; }
  60% { transform: scaleY(.9) scaleX(1.1); opacity: .85; }
}
.scroll-cue {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  z-index: 4; display: flex; flex-direction: column; align-items: center; gap: .6rem;
}
.cue-text { font-family: var(--display); font-size: .68rem; letter-spacing: .45em; text-transform: uppercase; color: var(--gold); opacity: .8; }
.cue-line { width: 1px; height: 56px; background: linear-gradient(var(--gold), transparent); animation: cue 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ── shared section bits ── */
section { position: relative; }
.section-kicker {
  font-family: var(--display); font-size: .8rem; letter-spacing: .5em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 2.2rem;
}
h2 { font-family: var(--display); font-weight: 500; font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1.25; color: var(--parchment); margin-bottom: 1.6rem; }

/* ── promise ── */
#promise {
  padding: clamp(6rem, 14vh, 10rem) 1.5rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(48,76,116,.16), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(47,79,70,.18), transparent 60%),
    var(--ink-deep);
  text-align: center;
}
.promise-inner { max-width: 760px; margin: 0 auto; }
.promise-line { font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.65; margin-bottom: 2.4rem; color: rgba(220,201,163,.92); }
.promise-emph { font-style: italic; color: var(--gold-bright); }

/* ── rooms ── */
#rooms { background: var(--ink); padding-top: clamp(5rem, 12vh, 8rem); }
.rooms-intro { text-align: center; padding: 0 1.5rem 3.5rem; }
.rooms-track { display: flex; flex-direction: column; }
.room { position: relative; height: 92vh; min-height: 560px; overflow: hidden; }
.room-img { position: absolute; inset: 0; }
.room-img img { width: 100%; height: 115%; object-fit: cover; will-change: transform; }
.room::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(20,18,15,.55), transparent 30%, transparent 55%, rgba(20,18,15,.82));
}
.room-label {
  position: absolute; z-index: 2; bottom: clamp(2.5rem, 8vh, 5rem); left: clamp(1.5rem, 7vw, 6rem);
  max-width: 480px;
}
.room-emotion {
  font-family: var(--display); font-size: clamp(2.2rem, 6vw, 4rem); letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold-bright); line-height: 1;
  text-shadow: 0 0 30px rgba(200,154,61,.45), 0 2px 20px rgba(0,0,0,.9);
  margin-bottom: .8rem;
}
.room-label h3 { font-family: var(--display); font-weight: 500; font-size: 1.25rem; letter-spacing: .12em; text-transform: uppercase; color: var(--parchment); margin-bottom: .6rem; }
.room-label p:last-child { font-style: italic; color: rgba(220,201,163,.88); text-shadow: 0 1px 10px rgba(0,0,0,.9); }
.rooms-measure { text-align: center; padding: 4.5rem 1.5rem; font-size: 1.35rem; color: rgba(220,201,163,.85); }
.rooms-measure em { color: var(--gold-bright); }

/* ── grounds ── */
#grounds { height: 110vh; min-height: 680px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.grounds-bg {
  position: absolute; inset: -12% 0;
  background: url("../assets/moonlit-path.webp") center / cover no-repeat;
  will-change: transform;
}
#grounds::after { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--ink) 0%, rgba(20,18,15,.25) 22%, rgba(20,18,15,.35) 70%, var(--ink-deep) 100%); }
#stars { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.grounds-content { position: relative; z-index: 3; text-align: center; padding: 0 1.5rem; max-width: 820px; }
#grounds blockquote {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2rem, 5.5vw, 4rem); line-height: 1.3; color: var(--parchment);
  text-shadow: 0 2px 34px rgba(0,0,0,.95), 0 0 60px rgba(48,76,116,.5);
  margin-bottom: 1.8rem;
}
.grounds-sub { font-style: italic; font-size: 1.15rem; color: rgba(220,201,163,.9); text-shadow: 0 1px 12px rgba(0,0,0,.95); }

/* ── music ── */
#music {
  padding: clamp(6rem, 14vh, 10rem) 1.5rem;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(47,79,70,.25), transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(48,76,116,.18), transparent 55%),
    var(--ink-deep);
}
.music-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.music-lead { max-width: 640px; margin: 0 auto 3.5rem; font-size: 1.2rem; color: rgba(220,201,163,.9); }
.music-lead em { color: var(--gold-bright); }
.shelves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-bottom: 3.2rem; }
.shelf {
  border: 1px solid rgba(200,154,61,.22); border-radius: 3px;
  background: linear-gradient(rgba(47,79,70,.14), rgba(20,18,15,.5));
  padding: 2rem 1.5rem;
  transition: border-color .4s, box-shadow .4s, transform .4s;
}
.shelf:hover { border-color: rgba(200,154,61,.55); box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 24px rgba(200,154,61,.12); transform: translateY(-4px); }
.shelf h4 { font-family: var(--display); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; font-size: 1.05rem; color: var(--gold-bright); margin-bottom: .8rem; }
.shelf p { font-size: 1rem; font-style: italic; color: rgba(220,201,163,.85); }
.shelves-note { font-style: italic; font-size: .98rem; color: rgba(220,201,163,.6); margin: -1.6rem 0 3rem; }
.music-btn { margin-top: .5rem; }

/* ── practice ── */
#practice {
  padding: clamp(6rem, 14vh, 10rem) 1.5rem;
  background: linear-gradient(var(--ink-deep), var(--ink));
  border-top: 1px solid rgba(200,154,61,.12);
}
.practice-inner { max-width: 980px; margin: 0 auto; text-align: center; }
.practice-lead { max-width: 680px; margin: 0 auto 3.5rem; font-size: 1.2rem; color: rgba(220,201,163,.9); }
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.door {
  border: 1px solid rgba(220,201,163,.16); border-radius: 3px;
  padding: 2.4rem 1.6rem; color: var(--parchment);
  background: rgba(20,18,15,.45);
  transition: border-color .4s, box-shadow .4s, transform .4s;
}
.door h3 { font-family: var(--display); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-size: 1.2rem; margin-bottom: .7rem; }
.door p:last-child { font-size: .98rem; font-style: italic; color: rgba(220,201,163,.8); }
.door-state { font-family: var(--display); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; margin-bottom: 1.1rem; color: rgba(220,201,163,.55); }
.door-open { border-color: rgba(200,154,61,.5); box-shadow: inset 0 0 40px rgba(200,154,61,.06); }
.door-open .door-state { color: var(--gold-bright); text-shadow: 0 0 14px rgba(200,154,61,.5); }
.door-open:hover { transform: translateY(-5px); box-shadow: 0 12px 44px rgba(0,0,0,.55), 0 0 30px rgba(200,154,61,.18); }
.door-closed { opacity: .68; }

/* ── footer ── */
footer {
  text-align: center; padding: 5rem 1.5rem 3rem;
  background: var(--ink);
  border-top: 1px solid rgba(200,154,61,.14);
}
.footer-crest { width: 84px; margin: 0 auto 1.4rem; }
.footer-line { font-style: italic; color: var(--gold); margin-bottom: 1.6rem; letter-spacing: .04em; }
.footer-links { display: flex; justify-content: center; gap: .9rem; margin-bottom: 2rem; }
.footer-links a { color: rgba(220,201,163,.85); transition: color .3s; }
.footer-links a:hover { color: var(--gold-bright); }
.footer-links span { color: rgba(220,201,163,.35); }
.footer-copy { font-size: .85rem; color: rgba(220,201,163,.45); }

/* ── responsive ── */
@media (max-width: 860px) {
  #nav nav { display: none; }
  .shelves, .doors { grid-template-columns: 1fr; }
  .room { height: 72vh; min-height: 460px; }
  .room-label { left: 1.5rem; right: 1.5rem; }
}

/* ── reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .cue-line, .btn-flame, .loader-crest { animation: none !important; }
  #dust, #stars { display: none; }
}
