:root {
  --panel-w: 340px;
  --ink: #dfe6ff;
  --ink-dim: #9aa6d6;
  --accent: #f0c987; /* satellite gold */
}

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

html, body { height: 100%; overflow: hidden; }

body {
  /* dark blue night sky, lighter toward the horizon */
  background: linear-gradient(
    180deg,
    #171e42 0%,
    #1b2450 40%,
    #26346a 78%,
    #33447b 100%
  );
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* subtle film grain over the sky */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  1 0 0 0 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

#sky {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

/* ---------- Skill labels ---------- */

#labels { position: fixed; inset: 0; pointer-events: none; }

.label { position: absolute; left: 0; top: 0; }

.label span {
  display: block;
  white-space: nowrap;
  font-size: clamp(13px, 1.15vw, 17px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--c) 65%, white);
  text-shadow: 0 0 14px color-mix(in srgb, var(--c) 55%, transparent);
  opacity: 0;
  filter: blur(4px);
  transform: translate(var(--tx, 14px), calc(var(--ty, 8px) + 8px));
  transition: opacity 0.9s ease, transform 0.9s ease, filter 0.9s ease;
}

.label.left span { --tx: calc(-100% - 14px); }

.label.visible span {
  opacity: 1;
  filter: none;
  transform: translate(var(--tx, 14px), var(--ty, 8px));
}

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

.hero {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34vh;               /* constellation owns the upper 2/3 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-align: center;
  pointer-events: none;
  z-index: 5;
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
}

.hero > * { opacity: 0; animation: hero-in 1.6s ease forwards; }
/* whole sequence starts after a 2s pause, then staggers */
.hero-title    { animation-delay: 2.0s; }
.hero-rule     { animation-delay: 2.4s; }
.hero-subtitle { animation-delay: 2.7s; }
.hero-meta     { animation-delay: 3.1s; }

.hero-title {
  font-size: clamp(38px, 6.2vw, 92px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.005em;
  color: #f4f1ea;
  text-shadow: 0 0 28px rgba(255, 244, 220, 0.28);
}

.hero-rule {
  display: block;
  width: clamp(90px, 12vw, 190px);
  height: 1px;
  margin: clamp(10px, 1.6vh, 18px) 0 clamp(12px, 2vh, 22px);
  background: linear-gradient(90deg, transparent, rgba(240, 201, 135, 0.85), transparent);
}

.hero-subtitle {
  font-size: clamp(18px, 2.3vw, 34px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.35;
  color: #cfd6f2;
}

.hero-meta {
  margin-top: clamp(14px, 2.4vh, 26px);
  font-family: "Inter", system-ui, sans-serif;
  font-size: clamp(11px, 0.9vw, 14px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(8px); filter: blur(3px); }
  to   { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero > * { animation: none; opacity: 1; }
}

/* ---------- Settings button ---------- */

.settings-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 28, 66, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.4s ease, background 0.2s ease, opacity 0.3s ease;
}
.settings-toggle:hover { background: rgba(40, 54, 112, 0.7); transform: rotate(60deg); }
.settings-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.panel-open .settings-toggle { opacity: 0; pointer-events: none; }

/* ---------- Settings panel ---------- */

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(var(--panel-w), 100vw);
  display: flex;
  flex-direction: column;
  background: rgba(14, 20, 50, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 0.8, 0.3, 1);
  z-index: 30;
  visibility: hidden;
}
body.panel-open .settings-panel { transform: none; visibility: visible; }

.settings-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 12px;
}
.settings-panel h2 { font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }

.icon-btn {
  background: none;
  border: 0;
  color: var(--ink-dim);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
}
.icon-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }

.settings-body { flex: 1; overflow-y: auto; padding: 4px 22px 16px; }

.group-title {
  margin: 22px 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.row { display: block; margin: 14px 0; }
.row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  margin-bottom: 8px;
}
.row-head output {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-size: 13px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(240, 201, 135, 0.7);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(240, 201, 135, 0.7);
  cursor: pointer;
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

.settings-panel footer {
  display: flex;
  gap: 10px;
  padding: 16px 22px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn {
  flex: 1;
  padding: 11px 14px;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn.primary { background: var(--accent); color: #1b2250; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: rgba(255, 255, 255, 0.22); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
