/* Night observatory — tokens, reset, typography, sky, header, footer, buttons.
   Contrast checked against --night (#0d0b1a): parchment 14:1, muted 8:1, gold 9:1. */

:root {
  --void: #06050c;
  --night: #0d0b1a;
  --indigo: #171433;
  --violet: #2a2159;
  --glow: rgba(124, 99, 230, .22);

  --parchment: #efe7d3;
  --muted: #b0a9c4;
  --gold: #d9b46c;
  --gold-soft: #f0d79b;
  --gold-deep: #8d6b2d;
  --ember: #e8808f;
  --jade: #8fd6c4;

  --line: rgba(217, 180, 108, .26);
  --line-strong: rgba(217, 180, 108, .6);
  --glass: rgba(18, 15, 38, .72);

  --font-display: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.22, .8, .24, 1);
  --t-fast: 180ms;
  --t-mid: 420ms;
  --t-slow: 900ms;

  --wrap: min(1120px, calc(100% - 2.5rem));
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--void); color: var(--parchment);
  font: 400 1rem/1.7 var(--font-body); overflow-x: hidden; position: relative;
  background-image:
    radial-gradient(1100px 700px at 78% -8%, rgba(88, 62, 190, .34), transparent 62%),
    radial-gradient(900px 600px at -10% 38%, rgba(49, 31, 112, .38), transparent 60%),
    linear-gradient(180deg, var(--night), var(--void) 70%);
  background-attachment: fixed;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, ul, ol { margin-top: 0; }
::selection { background: var(--gold); color: #1a1206; }

/* living sky (drawn by sky.js) + grain */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .9; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.site-header, main, footer, .skip-link { position: relative; z-index: 2; }
.site-header { z-index: 40; }

/* typography */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.08; letter-spacing: -.01em; color: var(--parchment); }
h1 { font-size: clamp(2.7rem, 6.2vw, 5.4rem); }
h2 { font-size: clamp(2rem, 4vw, 3.3rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
em { font-style: italic; color: var(--gold-soft); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem; margin: 0 0 1.25rem; font-size: .72rem; font-weight: 700;
  letter-spacing: .26em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 2.4rem; height: 1px; background: var(--gold); opacity: .7; }
.eyebrow span { display: none; }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.75; color: var(--muted); max-width: 36rem; }
.divider { display: flex; align-items: center; gap: 1rem; color: var(--gold); margin: 2.5rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong)); }
.divider::after { background: linear-gradient(270deg, transparent, var(--line-strong)); }
.divider svg { width: 18px; height: 18px; }

:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 4px; border-radius: 2px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .8rem 1.1rem; background: var(--gold); color: #1a1206; font-weight: 700; }
.skip-link:focus { top: 1rem; }

/* header */
.site-header {
  height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 clamp(1.25rem, 4vw, 3.5rem);
}
.brand { display: inline-flex; align-items: center; gap: .8rem; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: .34em; }
.brand svg { width: 30px; height: 30px; color: var(--gold); }
.main-nav { display: flex; align-items: center; gap: 2.2rem; font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.main-nav a, .all-sections summary { position: relative; padding: .6rem 0; color: var(--muted); transition: color var(--t-fast); cursor: pointer; list-style: none; }
.main-nav a:hover, .all-sections summary:hover, .all-sections[open] summary { color: var(--gold-soft); }
.main-nav a::after, .all-sections summary::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .2rem; height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform var(--t-mid) var(--ease);
}
.main-nav a:hover::after, .all-sections[open] summary::after { transform: scaleX(1); }
.all-sections { position: relative; }
.all-sections summary::-webkit-details-marker { display: none; }
.all-sections-panel {
  position: absolute; right: 0; top: calc(100% + .9rem); width: min(92vw, 600px); max-height: 74vh; overflow: auto;
  display: block; column-count: 2; column-gap: 2.4rem; padding: 1.4rem 1.6rem .6rem;
  background: rgba(13, 11, 26, .97); border: 1px solid var(--line-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .4);
}
.nav-block { break-inside: avoid; margin-bottom: 1.1rem; }
.all-sections-panel a { display: block; padding: .45rem 0; font-size: .95rem; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--parchment); }
.all-sections-panel a::after { display: none; }
.all-sections-panel a:hover { color: var(--gold-soft); }
.nav-group { margin: 0 0 .3rem; font-size: .66rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }

/* buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .9rem; min-height: 52px; padding: .8rem 1.8rem;
  border: 1px solid var(--gold); background: linear-gradient(180deg, #e6c47f, #c79a4b); color: #1a1206; font-weight: 700; font-size: .85rem;
  letter-spacing: .14em; text-transform: uppercase; transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid), filter var(--t-fast);
  box-shadow: 0 0 0 0 rgba(217, 180, 108, .0), 0 10px 30px rgba(0, 0, 0, .35);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(217, 180, 108, .38), 0 14px 34px rgba(0, 0, 0, .4); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: progress; filter: saturate(.5) brightness(.85); transform: none; }
.btn-ghost { background: transparent; color: var(--gold-soft); border-color: var(--line-strong); box-shadow: none; }
.btn-ghost:hover { background: rgba(217, 180, 108, .1); }
.text-link { display: inline-block; padding: .5rem 0; border-bottom: 1px solid var(--line-strong); color: var(--gold-soft); font-weight: 600; transition: border-color var(--t-fast), color var(--t-fast); }
.text-link:hover { border-color: var(--gold-soft); color: var(--parchment); }

/* footer */
footer { margin-top: clamp(4rem, 8vw, 8rem); padding: 2.5rem clamp(1.25rem, 4vw, 3.5rem) 3rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; font-size: .8rem; color: var(--muted); }
footer p { margin: 0; max-width: 40rem; }
footer .brand { font-size: .95rem; }

/* scroll reveal (opacity/transform only) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .main-nav { gap: 0; }
  .main-nav > a { display: none; }
  .all-sections-panel { position: fixed; left: 1rem; right: 1rem; top: calc(var(--header-h) + 4px); width: auto; column-count: 1; }
  footer { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 640px) { .brand { letter-spacing: .16em; font-size: 1rem; gap: .55rem; } .brand svg { width: 26px; height: 26px; } }
.brand span, .all-sections summary { white-space: nowrap; }
@media (max-width: 1280px) and (min-width: 761px) { .site-header { gap: .6rem; } .brand { letter-spacing: .2em; font-size: 1.02rem; } .main-nav { gap: 1.1rem; letter-spacing: .1em; font-size: .72rem; } .header-account { margin-left: .4rem; } }
@media (max-width: 1060px) and (min-width: 761px) { .main-nav > a { display: none; } }
@media (max-width: 520px) { .site-header { gap: .4rem; padding: 0 .9rem; } .brand { letter-spacing: .08em; font-size: .9rem; gap: .4rem; } .brand svg { width: 22px; height: 22px; } .main-nav { letter-spacing: .06em; font-size: .66rem; } .header-account { margin-left: .2rem; letter-spacing: .06em; font-size: .66rem; } }
