:root {
  --bg: #000000;
  --text: #ededed;
  --dim: #8c8c8c;
  --accent: #edeae3;
  --pad: clamp(20px, 3vw, 34px);
  --fs-label: 13px;
  --fs-copy: 14px;
  --ls-label: 0.12em;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ---------------- center stage: 3D mountain mark ---------------- */
.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s ease;
}

#mark {
  width: clamp(150px, 32vmin, 300px);
  height: clamp(150px, 32vmin, 300px);
  display: block;
}

.mark-fallback {
  display: none;
  width: clamp(150px, 30vmin, 280px);
  aspect-ratio: 1.46;
  background: var(--accent);
  clip-path: polygon(6% 80%, 15% 68%, 23% 58%, 29% 63%, 39% 35%, 49% 21%, 55% 43%, 61% 36%, 67% 55%, 72% 65%, 78% 73%, 86% 78%, 94% 80%, 94% 80%);
}

body.no-webgl #mark { display: none; }
body.no-webgl .mark-fallback { display: block; }

/* the mountain stays on home / info / about; only contact clears the center */
body[data-state="contact"] .stage { opacity: 0; }

/* ---------------- live clock ---------------- */
.clock {
  position: fixed;
  top: var(--pad);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: clamp(26px, 6vw, 88px);
  z-index: 3;
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: opacity 0.4s ease;
}
#date { text-align: right; }
#time { text-align: left; }
body[data-state="contact"] .clock { opacity: 0; pointer-events: none; }

/* ---------------- shared zone + link styles ---------------- */
.zone {
  position: fixed;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.link {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: var(--fs-label);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.link:hover { color: #ffffff; }
.link:focus-visible { outline: 1px solid var(--dim); outline-offset: 4px; }

/* ---------------- HOME ---------------- */
.brand-home {
  left: 50%;
  bottom: clamp(28px, 5vh, 54px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.brand {
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: var(--fs-label);
  color: var(--text);
}
body[data-state="home"] .brand-home { opacity: 1; pointer-events: auto; }

/* ---------------- INFO ---------------- */
.info-nav {
  left: var(--pad);
  bottom: var(--pad);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4.5vh, 44px);
  max-width: 360px;
}
.nav-row { display: flex; gap: clamp(20px, 3vw, 40px); }
.tagline {
  margin: 0;
  color: var(--dim);
  font-size: var(--fs-copy);
  line-height: 1.5;
  max-width: 22em;
}
.home-link { align-self: flex-start; }
body[data-state="info"] .info-nav { opacity: 1; pointer-events: auto; }

/* ---------------- ABOUT panel ---------------- */
.panel { left: var(--pad); max-width: 360px; }
.panel-label {
  margin: 0 0 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: var(--fs-label);
  color: var(--text);
}
.panel-copy {
  margin: 0 0 22px;
  color: var(--dim);
  font-size: var(--fs-copy);
  line-height: 1.55;
}
.panel-about { bottom: var(--pad); }
body[data-state="about"] .panel-about { opacity: 1; pointer-events: auto; }

/* ---------------- CONTACT panel ---------------- */
.panel-contact .addr {
  position: fixed;
  top: var(--pad);
  left: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: var(--fs-label);
  color: var(--text);
}
.contact-mid {
  position: fixed;
  left: var(--pad);
  top: 50%;
  transform: translateY(-50%);
}
.contact-mid p { margin: 0; color: var(--dim); font-size: var(--fs-copy); }
.contact-mid a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.contact-mid a:hover { color: #fff; }
.panel-contact > .link { position: fixed; left: var(--pad); bottom: var(--pad); }
body[data-state="contact"] .panel-contact { opacity: 1; pointer-events: auto; }

/* ---------------- responsive ---------------- */
@media (max-width: 700px) {
  .panel,
  .info-nav { max-width: min(360px, calc(100vw - 2 * var(--pad))); }
}

/* ---------------- motion preference ---------------- */
@media (prefers-reduced-motion: reduce) {
  .stage, .clock, .zone { transition: none; }
}
