/* ------------------------------------------------------------------
   Hypercube Ventures — "Observatory"
   A private astronomical institution after midnight.
   ------------------------------------------------------------------ */

/* ---------- Fonts (self-hosted, latin subsets) ---------- */

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/instrument-serif-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/instrument-serif-400italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('assets/fonts/inter-var.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/space-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/space-mono-700.woff2') format('woff2');
}

/* ---------- Tokens ---------- */

:root {
  --bg: #05060E;
  --bg-deep: #0A0C18;
  --silver: #AEB8D0;
  --gold: #C8B27C;
  --text: #EDEFF7;
  --text-dim: #7E8699;
  --label: #5C6377;
  --hairline: rgba(174, 184, 208, 0.14);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Space Mono', 'Cascadia Mono', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-color: #1A1F35 transparent;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(200, 178, 124, 0.22);
  color: var(--text);
}

:focus-visible {
  outline: 1px solid var(--silver);
  outline-offset: 4px;
}

img, canvas { display: block; max-width: 100%; }

/* ---------- Atmosphere (nebula wash + grain) ---------- */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(90rem 60rem at 72% -10%, rgba(26, 31, 53, 0.55), transparent 62%),
    radial-gradient(70rem 50rem at 8% 112%, rgba(20, 18, 40, 0.4), transparent 60%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Star canvas ---------- */

#sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

/* ---------- Anchor dots ---------- */

.dots {
  position: fixed;
  right: clamp(1rem, 3vw, 2.2rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
}

.dots a {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.dots a::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(174, 184, 208, 0.32);
  transition: background 0.3s ease, transform 0.3s ease;
}

.dots a:hover::after { background: var(--silver); }

.dots a.active::after {
  background: var(--gold);
  transform: scale(1.5);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
}

#tesseract {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(104vmin, 1020px);
  height: min(104vmin, 1020px);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(0.95rem, 2.1vw, 1.2rem);
  text-transform: uppercase;
  letter-spacing: 0.42em;
  margin-left: 0.42em; /* optically recenter tracked text */
  color: var(--text);
  margin-bottom: 2.2rem;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 5.6vw, 4.1rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h1 em, h2 em {
  font-style: italic;
  font-weight: 400;
}

.hero-sub {
  margin-top: 1.9rem;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

.cue {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, transparent, rgba(174, 184, 208, 0.55));
  animation: cue 3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes cue {
  0%, 100% { transform: translateY(0);   opacity: 0.45; }
  50%      { transform: translateY(10px); opacity: 1; }
}

/* ---------- Panels ---------- */

.panel {
  min-height: 100svh;
  width: min(92%, 620px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(5rem, 16vh, 10rem) 0;
}

.label {
  font-family: var(--mono);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--label);
  margin-bottom: 1.7rem;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 1.6rem;
}

.body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 34em;
}

/* ---------- Coordinates ---------- */

.domains {
  list-style: none;
  counter-reset: dom;
  margin-top: 1.6rem;
}

.domains li {
  counter-increment: dom;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.6vw, 1.65rem);
  line-height: 1.2;
  padding: 1.05rem 0.15rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.domains li:last-child {
  border-bottom: 1px solid var(--hairline);
}

.domains li::before {
  content: counter(dom, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--label);
  transform: translateY(-0.28em);
}

.aside {
  margin-top: 2.1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--text-dim);
}

/* ---------- Footer ---------- */

footer {
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
}

.geometry {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--label);
  margin-bottom: 1.1rem;
}

.legal {
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--label);
}

/* ---------- Reveals ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .dots { display: none; }
}

@media (max-width: 640px) {
  .panel { min-height: 88svh; }
  .wordmark { letter-spacing: 0.38em; margin-left: 0.38em; }
  .domains li { gap: 1rem; }
  #tesseract { opacity: 0.85; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cue { animation: none; }
}
