:root {
  --black: #05080b;
  --ink: #f2fbfd;
  --muted: rgba(242, 251, 253, 0.68);
  --faint: rgba(242, 251, 253, 0.42);
  --teal: #0fb6cf;
  --teal-deep: #0891a4;
  --teal-soft: rgba(15, 182, 207, 0.16);
  --gold: #eeb400;
  --gold-bright: #ffe28a;
  --gold-deep: #b8860b;
  --line: rgba(15, 182, 207, 0.22);
  --line-gold: rgba(238, 180, 0, 0.28);
  --panel: rgba(8, 18, 22, 0.72);
  --fear: #e24b4b;
  --fear-mid: #f08a3c;
  --font-display: "Sora", sans-serif;
  --font-body: "Outfit", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--black);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 45% at 50% -8%, rgba(15, 182, 207, 0.28), transparent 60%),
    radial-gradient(ellipse 40% 30% at 85% 15%, rgba(238, 180, 0, 0.1), transparent 55%),
    linear-gradient(180deg, #071317 0%, var(--black) 42%, #030507 100%);
}

.bg-ring {
  position: absolute;
  top: 8%;
  left: 50%;
  width: min(72vw, 680px);
  height: min(72vw, 680px);
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1px solid rgba(238, 180, 0, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(15, 182, 207, 0.08),
    0 0 80px rgba(15, 182, 207, 0.08);
  animation: ring-pulse 8s ease-in-out infinite;
}

.bg-beam {
  position: absolute;
  top: -10%;
  left: 50%;
  width: 2px;
  height: 46vh;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(238, 180, 0, 0.45), transparent);
  opacity: 0.55;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 182, 207, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 182, 207, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 65% 50% at 50% 18%, black, transparent 72%);
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 3.25rem);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-lockup img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.brand-lockup span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar nav {
  display: flex;
  gap: 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.topbar nav a:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  padding: 0.5rem clamp(1.2rem, 4vw, 3.25rem) 4rem;
  min-height: calc(100vh - 4.5rem);
  align-content: center;
}

.hero-stage {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  max-width: 1100px;
}

.logo-stage {
  position: relative;
  width: clamp(150px, 22vw, 240px);
  aspect-ratio: 1;
}

.logo-halo {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 182, 207, 0.28), transparent 68%);
  animation: halo 5.5s ease-in-out infinite;
}

.hero-logo {
  position: relative;
  width: 100%;
  height: auto;
  border-radius: 50%;
  animation: logo-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.55));
}

.hero-copy {
  max-width: 34rem;
}

.brand-name {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 20%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  animation: rise 0.75s ease 0.08s both;
}

.hero-copy h1 {
  margin: 0 0 0.85rem;
  max-width: 15ch;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  animation: rise 0.75s ease 0.14s both;
}

.lede {
  margin: 0 0 1.5rem;
  max-width: 36ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  animation: rise 0.75s ease 0.2s both;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: rise 0.75s ease 0.26s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.3rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #1a1400;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 48%, var(--gold-deep));
}

.btn-secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--teal-soft);
}

.btn-secondary:hover {
  border-color: var(--line-gold);
}

.meter {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  padding: clamp(1.2rem, 3vw, 1.75rem);
  border: 1px solid var(--line-gold);
  border-radius: 24px;
  background:
    linear-gradient(165deg, rgba(15, 182, 207, 0.12), rgba(5, 8, 11, 0.2) 40%, rgba(5, 8, 11, 0.55)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 70px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  animation: rise 0.9s ease 0.22s both;
}

.meter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.meter-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.meter-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.live-pill {
  flex-shrink: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(15, 182, 207, 0.1);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gauge-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.gauge {
  width: min(100%, 440px);
  height: auto;
  overflow: visible;
}

#needle {
  transform-origin: 160px 168px;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-block {
  position: absolute;
  bottom: 7%;
  text-align: center;
}

.score {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(3.3rem, 8vw, 4.6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.classification {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.updated {
  margin: 0.4rem 0 0;
  color: var(--faint);
  font-size: 0.8rem;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
  margin-top: 0.6rem;
  color: var(--faint);
  font-size: 0.68rem;
  text-align: center;
}

.history,
.read {
  padding: 4.25rem clamp(1.2rem, 4vw, 3.25rem);
  border-top: 1px solid var(--line);
}

.section-copy {
  max-width: 34rem;
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-copy h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.section-copy p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.history-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  min-height: 180px;
  max-width: 900px;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.day-bar {
  width: 100%;
  max-width: 52px;
  min-height: 8px;
  border-radius: 8px 8px 3px 3px;
  transform-origin: bottom;
  animation: grow 0.8s ease both;
}

.day-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.day-date {
  color: var(--faint);
  font-size: 0.72rem;
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  max-width: 42rem;
}

.legend li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 0.95rem;
  align-items: start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 18, 22, 0.55);
}

.swatch {
  width: 12px;
  height: 12px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent);
}

.legend strong {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--font-display);
}

.legend p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem clamp(1.2rem, 4vw, 3.25rem) 2.25rem;
  border-top: 1px solid var(--line-gold);
}

.footer p {
  margin: 0;
  max-width: 36rem;
  color: var(--faint);
  font-size: 0.85rem;
  line-height: 1.5;
}

.footer a[target="_blank"] {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.is-loading .score,
.is-loading .classification {
  opacity: 0.45;
}

.error-state .classification {
  color: var(--fear);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logo-in {
  from {
    opacity: 0;
    transform: scale(0.84) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes halo {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes ring-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.9;
    transform: translateX(-50%) scale(1.03);
  }
}

@keyframes grow {
  from {
    opacity: 0;
    transform: scaleY(0.15);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (max-width: 860px) {
  .hero-stage {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-copy h1,
  .lede {
    max-width: 28ch;
  }

  .actions {
    justify-content: center;
  }

  .meter-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .brand-lockup span {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
  }

  .topbar nav {
    gap: 1rem;
    font-size: 0.85rem;
  }

  .scale span:nth-child(2),
  .scale span:nth-child(4) {
    opacity: 0;
  }

  .history-bars {
    gap: 0.4rem;
  }

  .day-date {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    height: 2.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
