/* نَجْم — base: reset, typography, shared patterns (opener, buttons, const-list, eyepiece), header, sticky bar, footer.
   Values come from tokens.css only. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 8px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--sand); color: var(--ink-2);
  font-family: var(--font-text); font-size: var(--t-md); line-height: var(--lh-text);
  overflow-x: clip; -webkit-font-smoothing: antialiased;
}
img, video, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 100; display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: 16px; border-radius: var(--r-ctl); background: var(--sand-2); color: var(--ink); font-weight: 600; translate: 0 -200%; }
.skip-link:focus-visible { translate: 0 0; }

/* ── type ── */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; line-height: var(--lh-display); color: var(--ink); text-wrap: balance; word-spacing: .12em; }
.h2 { font-size: var(--d-h2); }
.h3 { font-size: var(--t-xl); font-weight: 600; }
p, li, dd { text-wrap: pretty; }
.lead { font-size: var(--t-md); color: var(--ink-2); max-inline-size: var(--measure); }
.small { font-size: var(--t-sm); }
.on-night { background: var(--night); color: var(--star-2); }
.on-night h1, .on-night h2, .on-night h3 { color: var(--star); }
.on-night .lead { color: var(--star-2); }
.on-sand { background: var(--sand); }
.on-surface { background: var(--sand-2); }

/* ── layout ── */
.wrap { inline-size: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.sec { padding-block: var(--sec-pad); position: relative; }
.sec-head { display: grid; gap: 14px; margin-block-end: clamp(32px, 5vw, 56px); }
.sec-head--center { justify-items: center; text-align: center; }
.sec-head--center .lead { margin-inline: auto; }

/* ── signature: four-point star glyph (inline SVG <svg class="star4"><use href="#star4"/></svg>) ── */
.star4 { inline-size: 1em; block-size: 1em; fill: currentColor; flex: none; }

/* section opener: a moment in the night */
.opener { display: inline-flex; align-items: center; gap: 10px; font-size: var(--t-sm); font-weight: 500; color: var(--ochre); }
.opener .star4 { inline-size: 10px; block-size: 10px; }
.on-night .opener { color: var(--gold); }

/* constellation list: items joined by a hairline, a star at each item */
.const-list { position: relative; display: grid; gap: 22px; }
.const-list > li { position: relative; padding-inline-start: 34px; }
.const-list > li::before {
  content: ""; position: absolute; inset-inline-start: 6px; inset-block-start: .62em; inline-size: 12px; block-size: 12px;
  background: var(--ochre); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.const-list > li:not(:last-child)::after {
  content: ""; position: absolute; inset-inline-start: 11.5px; inset-block-start: calc(.62em + 16px); block-size: calc(100% - 6px);
  border-inline-start: 1px solid var(--line);
}
.on-night .const-list > li::before { background: var(--gold); }
.on-night .const-list > li:not(:last-child)::after { border-color: var(--line-night); }

/* artefact frame: the telescope aperture */
.eyepiece { position: relative; overflow: hidden; border-radius: var(--r-card); background: var(--night); }
.eyepiece img { inline-size: 100%; block-size: 100%; object-fit: cover; }

/* ── buttons & links ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-block-size: 52px; padding-inline: 28px;
  border: 0; border-radius: var(--r-pill); background: var(--ember); color: var(--ember-ink);
  font-family: var(--font-text); font-size: var(--t-md); font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 10px 30px -10px rgba(240, 122, 58, .6);
  transition: background-color .2s ease, translate .2s var(--ease-out), scale .15s ease;
}
.btn-primary:hover { background: var(--ember-hover); translate: 0 -1px; }
.btn-primary:active { translate: 0 0; scale: .98; }
.btn-primary:focus-visible { outline: 3px solid var(--focus-sand); outline-offset: 3px; }
.on-night .btn-primary:focus-visible, .hero .btn-primary:focus-visible { outline-color: var(--focus-night); }
.link-2 {
  display: inline-flex; align-items: center; min-block-size: 44px; gap: 8px; font-size: var(--t-sm); font-weight: 500;
  color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px;
}
.on-night .link-2, .hero .link-2 { color: var(--star); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--focus-sand); outline-offset: 3px; border-radius: 6px; }
.on-night a:focus-visible, .on-night button:focus-visible, .on-night input:focus-visible, .hero a:focus-visible, .hero button:focus-visible,
.site-header a:focus-visible, .site-header button:focus-visible, .sticky-bar a:focus-visible { outline-color: var(--focus-night); }
.skip-link:focus-visible { outline-color: var(--focus-night); outline-offset: 0; box-shadow: 0 0 0 6px var(--night); }
.price-line { font-size: var(--t-sm); font-weight: 500; }
.price-line b { font-weight: 600; color: var(--gold); }
.on-sand .price-line b, .on-surface .price-line b { color: var(--ochre); }

/* ── header ── */
.site-header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 50; block-size: var(--header-h);
  display: flex; align-items: center; color: var(--star);
  transition: background-color .35s ease, color .35s ease, box-shadow .35s ease;
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: var(--t-xl); line-height: 1.5; text-decoration: none; color: inherit; min-block-size: 44px; }
.wordmark .star4 { inline-size: 14px; block-size: 14px; color: var(--gold); }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: 12px; font-size: var(--t-sm); font-weight: 500; text-decoration: none; color: inherit; opacity: .86; }
.nav a:hover { opacity: 1; }
/* the slot keeps its width so the nav never jumps when the header CTA hides (one primary CTA per screen) */
.header-cta-slot { display: flex; justify-content: flex-end; min-inline-size: 132px; }
.header-cta { min-block-size: 44px; padding-inline: 20px; font-size: var(--t-sm); animation: fade-in .3s ease both; }
.header-cta[data-hidden] { display: none; }
.site-header[data-solid] { background: rgba(251, 247, 240, .94); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.site-header[data-solid] .wordmark .star4 { color: var(--ochre); }
.site-header[data-solid] a:focus-visible, .site-header[data-solid] button:focus-visible { outline-color: var(--focus-sand); }
.site-header[data-night] { background: rgba(10, 11, 20, .9); color: var(--star); box-shadow: 0 1px 0 var(--line-night); }
.menu-btn { display: none !important; margin-inline-start: auto; min-block-size: 44px; min-inline-size: 44px; border: 1px solid currentColor; border-radius: var(--r-pill); background: transparent; color: inherit; font-size: var(--t-sm); padding-inline: 16px; cursor: pointer; }
.menu-panel { position: fixed; inset: var(--header-h) 0 auto 0; z-index: 49; background: var(--sand-2); color: var(--ink); padding: 16px var(--gutter) 24px; box-shadow: 0 20px 40px -20px rgba(10, 11, 20, .35); display: grid; gap: 4px; }
.menu-panel[hidden] { display: none; }
.menu-panel a { display: flex; align-items: center; min-block-size: 48px; font-size: var(--t-lg); font-weight: 500; text-decoration: none; border-block-end: 1px solid var(--line); }
@media (max-width: 860px) {
  .js .nav { display: none; }
  .js .menu-btn { display: inline-flex !important; align-items: center; }
  .nav { flex-wrap: wrap; gap: 0; }
  .nav a { padding-inline: 8px; }
  .site-header .wrap { gap: 10px; }
  .header-cta { padding-inline: 16px; }
}

@keyframes fade-in { from { opacity: 0; } }

/* ── mobile sticky bar ── */
.sticky-bar {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 40; display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: rgba(18, 21, 39, .96); color: var(--star-2);
  box-shadow: 0 -1px 0 var(--line-night); translate: 0 110%; transition: translate .4s var(--ease-out);
}
.sticky-bar[data-show] { translate: 0 0; }
.sticky-bar .price-line { color: var(--star-2); }
.sticky-bar .btn-primary { min-block-size: 48px; padding-inline: 22px; }
.sticky-bar .btn-primary { white-space: nowrap; flex: none; }
@media (max-width: 760px) {
  .sticky-bar { display: flex; } .header-cta-slot { display: none; }
  html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) { .sticky-bar .incl { display: none; } }

/* ── footer ── */
/* footer on sand: the morning after the dawn section (never two deep grounds in a row) */
.site-footer { background: var(--sand); color: var(--ink-3); padding-block: 48px calc(48px + 76px); font-size: var(--t-sm); }
.site-footer .wrap { display: grid; gap: 20px; }
.site-footer .wordmark { color: var(--ink); }
.site-footer .wordmark .star4 { color: var(--ochre); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.site-footer nav a { display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: 8px; text-decoration: none; color: var(--ink-2); }
@media (min-width: 761px) { .site-footer { padding-block-end: 48px; } .site-footer .wrap { grid-template-columns: 1fr auto; align-items: center; } }

/* ── reduced motion: one global rule; components show their final state ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) { :root { --glass-bg: var(--night-2); } }

/* ── sheet over sheet (round 2): an incoming section slides over the previous one with a rounded top edge;
      the outgoing section's media dims as it leaves (scroll-driven, motion-safe only) ── */
.sheet { position: relative; z-index: var(--z, 1); border-start-start-radius: var(--r-sheet); border-start-end-radius: var(--r-sheet); margin-block-start: calc(-1 * var(--r-sheet)); box-shadow: var(--sh-sheet); }
.sinks { position: relative; }
/* the outgoing section's MEDIA dims as the next sheet slides over it — never text or controls (contrast and
   obstruction stay intact at every scroll position) */
.sheet-dim { position: absolute; inset: 0; z-index: 4; background: var(--night); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .sheet-dim { animation: sheet-dim linear both; animation-timeline: view(); animation-range: exit 10% exit 100%; }
  }
}
@keyframes sheet-dim { to { opacity: .7; } }
.btn-primary:focus-visible { border-radius: var(--r-pill); }
.btn-primary { -webkit-tap-highlight-color: transparent; }
@media (max-width: 860px) { .header-cta-slot { min-inline-size: 0; } }

/* ── no-JS (critic C r3): readable header, no UA video controls, no inert controls ── */
html:not(.js) .site-header { background: var(--night); }
html:not(.js) video { display: none; }
html:not(.js) .guide-chips, html:not(.js) .sky-handle { display: none; }
@media (max-width: 860px) { html:not(.js) .nav { display: none; } }
