/* My Time — cosmic dark, tokens/starfield/nav/buttons from exam-prep */

:root {
  --bg:         #03040f;
  --bg2:        #080a1c;
  --bg3:        #0d1030;
  --purple:     #8b5cf6;
  --purple-dim: #5b21b6;
  --cyan:       #22d3ee;
  --gold:       #f59e0b;
  --rose:       #f472b6;
  --green:      #34d399;
  --red:        #f87171;
  --red-deep:   #b91c1c;
  --text:       #e2e8f0;
  --muted:      #94a3b8;
  --border:     rgba(139,92,246,0.18);
  --card:       rgba(10,12,35,0.85);
  --unaccounted:#64748b;
  --nav-h:      64px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100%;
}

button, a { font-family: inherit; }
button { touch-action: manipulation; }

/* ── Starfield + nebula (homepage / exam-prep) ── */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.nebula {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.nebula::before,
.nebula::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.nebula::before {
  width: 60vw; height: 60vw;
  top: -20vw; left: -10vw;
  background: radial-gradient(ellipse, rgba(139,92,246,0.12) 0%, transparent 70%);
  animation: nebulaDrift 30s ease-in-out infinite alternate;
}
.nebula::after {
  width: 50vw; height: 50vw;
  bottom: -10vw; right: -5vw;
  background: radial-gradient(ellipse, rgba(34,211,238,0.09) 0%, transparent 70%);
  animation: nebulaDrift 40s ease-in-out infinite alternate-reverse;
}
@keyframes nebulaDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(3vw, 4vh) scale(1.08); }
}

.page { position: relative; z-index: 2; }

/* ── Nav (exam-prep pattern) ── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: var(--nav-h);
  background: rgba(3,4,15,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: Cinzel, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
  display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.7); }
}
.site-nav nav { display: flex; gap: 1.5rem; }
.site-nav nav a {
  font-family: Cinzel, serif;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: none;
}
.site-nav nav a:hover,
.site-nav nav a[aria-current="page"] { color: var(--text); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  border: none;
  background: transparent;
  color: var(--text);
}
.btn:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.btn-primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 0 20px rgba(139,92,246,0.35);
}
.btn-primary:hover {
  background: #7c3aed;
  box-shadow: 0 0 32px rgba(139,92,246,0.55);
  transform: translateY(-1px);
}

/* ── Layout ── */
main.page {
  padding: calc(var(--nav-h) + 2.75rem) 2rem 4rem;
  max-width: 1120px;
  margin: 0 auto;
}

.hero { margin-bottom: 3.25rem; max-width: 40rem; }
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--purple);
  font-weight: 500;
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: Cinzel, serif;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.08;
  background: linear-gradient(135deg, #fff 0%, var(--purple) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.9rem;
}
.lede {
  font-family: "Playfair Display", serif;
  font-style: italic;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
  margin-bottom: 1.15rem;
}
.intro {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 38rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 1.75rem 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 2.25rem;
  /* Keep h2 fully below the fixed 64px .site-nav on scroll-into-view / hash targets */
  scroll-margin-top: var(--nav-h);
}
.panel h2 {
  font-family: Cinzel, serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.panel-lead {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

/* ── Two-column collect grid ── */
/* Freeze-pane style: sits in flow, then sticks under the fixed nav when scrolling the form. */
.duo-heads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.75rem;
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  /* Bleed into panel padding so the sticky bar covers the full card width */
  margin: 0 -1.75rem 1.35rem;
  padding: 0.85rem 1.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 35, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(3, 4, 15, 0.45);
}
.duo-heads span {
  font-family: Cinzel, serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}
.duo-heads .ideal-head { color: var(--cyan); }
.duo-heads .actual-head { color: var(--purple); }

.cat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "qa qi"
    "sa si";
  column-gap: 2.75rem;
  row-gap: 0.55rem;
  padding: 1.05rem 0 1.15rem;
  border-bottom: 1px solid rgba(139,92,246,0.08);
}
.cat:last-of-type { border-bottom: none; }
.q-actual { grid-area: qa; }
.q-ideal  { grid-area: qi; }
.slide-actual { grid-area: sa; }
.slide-ideal  { grid-area: si; }

.q {
  font-size: 0.86rem;
  color: #fff;
  line-height: 1.5;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.q-main {
  font-weight: 700;
  color: #fff;
}
.q-hint {
  font-weight: 400;
  font-size: 0.8rem;
  line-height: 1.45;
}
.q-actual .q-hint {
  color: rgba(167, 139, 250, 0.9); /* purple, matches Actual accents */
}
.q-ideal .q-hint {
  color: rgba(103, 232, 249, 0.78); /* light cyan */
}
.mobile-col {
  display: none;
  font-family: Cinzel, serif;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.q-actual .mobile-col { color: var(--purple); }
.q-ideal .mobile-col { color: var(--cyan); }

.slide-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  min-height: 1.25rem;
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(226,232,240,0.22);
  box-shadow: 0 0 0 1px rgba(3,4,15,0.6);
}
.swatch.sleep {
  background: #0b1220;
  border-color: rgba(226,232,240,0.35);
}
.slide-meta label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1;
}
.slide-meta output {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  min-width: 2.4rem;
  text-align: right;
}
.slide-meta .unit {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 7.5rem;
  white-space: nowrap;
}

/* Range — cosmic, not OS grey */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--track-fill, var(--purple)) 0 var(--pct, 0%),
    rgba(139, 92, 246, 0.16) var(--pct, 0%) 100%
  );
}
input[type="range"].ideal-range::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    var(--cyan) 0 var(--pct, 0%),
    rgba(34, 211, 238, 0.14) var(--pct, 0%) 100%
  );
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
}
input[type="range"].ideal-range::-moz-range-track {
  background: rgba(34, 211, 238, 0.14);
}
input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--purple);
}
input[type="range"].ideal-range::-moz-range-progress {
  background: var(--cyan);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid var(--purple);
  box-shadow: 0 0 12px rgba(139,92,246,0.5);
  margin-top: -6px;
}
input[type="range"].ideal-range::-webkit-slider-thumb {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(34,211,238,0.45);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid var(--purple);
  box-shadow: 0 0 12px rgba(139,92,246,0.5);
}
input[type="range"].ideal-range::-moz-range-thumb {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(34,211,238,0.45);
}

.collect-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.75rem;
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  align-items: start;
}
.hours-sum {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hours-sum strong { font-weight: 600; color: #fff; }
.warn {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #fca5a5;
  line-height: 1.45;
}
.warn.show { display: block; }

.cta-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ── Results pies ── */
.pies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.75rem;
  align-items: start;
}
.pie-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.pie-wrap svg { width: min(100%, 280px); height: auto; }
.pie-caption {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.3em;
}
.pie-caption.over { color: #fca5a5; }

.legend {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: minmax(8rem, 1.2fr) 1fr 1fr;
  column-gap: 2.75rem;
  row-gap: 0.45rem;
  align-items: center;
  font-size: 0.82rem;
}
.legend-head {
  font-family: Cinzel, serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.2rem;
}
.legend-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.legend-val {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ── Analysis bars ── */
.bar-scale {
  display: grid;
  grid-template-columns: minmax(8rem, 9.5rem) 1fr;
  column-gap: 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.bar-scale .ticks {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(8rem, 9.5rem) 1fr;
  column-gap: 1rem;
  align-items: center;
  margin: 0.45rem 0;
}
.bar-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
}
.bar-track {
  position: relative;
  height: 28px;
  background: rgba(8,10,28,0.7);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.bar-zero {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(226,232,240,0.45);
  z-index: 2;
}
.bar-fill {
  position: absolute;
  top: 3px; bottom: 3px;
  z-index: 1;
  display: flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0 0.45rem;
  color: #fff;
}
.bar-fill.neg {
  right: 50%;
  background: linear-gradient(90deg, var(--red-deep), var(--red));
  justify-content: flex-start;
  border-radius: 3px 0 0 3px;
}
.bar-fill.pos {
  left: 50%;
  background: linear-gradient(90deg, var(--green), #059669);
  justify-content: flex-end;
  border-radius: 0 3px 3px 0;
}
.bar-fill.zero {
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

/* ── Suggestions ── */
.advice-grid {
  display: grid;
  gap: 1rem;
}
.advice-card {
  background: rgba(8,10,28,0.55);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.15rem 1.25rem;
}
.advice-card.lead {
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.07);
}
.advice-kicker {
  font-family: Cinzel, serif;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 0.4rem;
}
.advice-card p {
  font-size: 0.92rem;
  color: rgba(226,232,240,0.9);
  line-height: 1.65;
}
.advice-card p + p { margin-top: 0.65rem; }

/* ── Footer ── */
.site-foot {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  padding: 1.75rem 2rem 2.25rem;
  text-align: center;
}
.site-foot a {
  font-family: Cinzel, serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-decoration: none;
}
.site-foot a:hover { color: var(--text); }

/* ── Responsive: stack each Actual/Ideal pair ── */
@media (max-width: 720px) {
  .site-nav { padding: 0 1rem; }
  main.page { padding: calc(var(--nav-h) + 1.75rem) 1rem 3rem; }
  .panel { padding: 1.2rem 1rem 1.15rem; }
  .duo-heads { display: none; }
  .mobile-col { display: block; }
  .cat {
    grid-template-columns: 1fr;
    grid-template-areas:
      "qa"
      "sa"
      "qi"
      "si";
    row-gap: 0.45rem;
    padding: 1.15rem 0 1.25rem;
  }
  .collect-foot,
  .pies {
    grid-template-columns: 1fr;
    row-gap: 1.25rem;
  }
  .legend {
    grid-template-columns: minmax(7rem, 1.3fr) 1fr 1fr;
    column-gap: 0.75rem;
  }
  .bar-row,
  .bar-scale {
    grid-template-columns: 1fr;
    row-gap: 0.3rem;
  }
  .cta-row { justify-content: stretch; }
  .cta-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .nebula::before,
  .nebula::after,
  .logo-dot { animation: none !important; }
}
