:root {
  color-scheme: dark;
  --bg: #030814;
  --panel: rgba(9, 18, 35, 0.72);
  --panel-strong: rgba(10, 22, 43, 0.9);
  --border: rgba(170, 210, 255, 0.22);
  --text: #eef7ff;
  --muted: #a8bdd3;
  --soft: #d9ecff;
  --accent: #8fe7d4;
  --accent-2: #78aaff;
  --warning: #ffd479;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: inherit; }
.space {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(80, 130, 220, 0.22), transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(113, 231, 212, 0.12), transparent 22%),
    linear-gradient(180deg, #050d1d 0%, #02040b 70%, #000 100%);
}
.stars, .stars::before, .stars::after {
  position: absolute;
  inset: 0;
  content: "";
  background-repeat: repeat;
  opacity: 0.55;
}
.stars-one {
  background-image: radial-gradient(#fff 0.7px, transparent 0.8px);
  background-size: 80px 80px;
}
.stars-two {
  background-image: radial-gradient(rgba(255,255,255,.75) 0.9px, transparent 1px);
  background-size: 143px 143px;
  transform: translate(20px, 40px);
  opacity: .35;
}
.earth {
  position: absolute;
  width: min(78vw, 1050px);
  height: auto;
  right: max(-13vw, -170px);
  bottom: max(-19vw, -250px);
  z-index: -1;
  filter: saturate(1.08) contrast(1.03) drop-shadow(0 0 90px rgba(84, 162, 255, .25));
  transform-origin: 62% 58%;
  pointer-events: none;
  user-select: none;
}
.glow {
  position: absolute;
  right: -3vw;
  bottom: -12vw;
  width: 65vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(82, 182, 255, 0.16), transparent 62%);
  filter: blur(10px);
}


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.site-header {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.08rem;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
  background: rgba(255,255,255,.06);
}
nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
nav a:hover { color: var(--text); background: rgba(255,255,255,.07); }
main { width: min(1160px, calc(100% - 32px)); margin: 0 auto 56px; }
.hero { min-height: 58vh; display: grid; align-content: center; max-width: 780px; padding: 56px 0 84px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-weight: 800; font-size: .74rem; }
h1, h2, h3 { letter-spacing: -0.045em; line-height: 1.04; margin: 0; }
h1 { font-size: clamp(3rem, 8vw, 6.9rem); max-width: 900px; }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { font-size: 1.18rem; }
.lede { color: var(--soft); font-size: clamp(1.1rem, 2vw, 1.35rem); max-width: 660px; margin: 24px 0 30px; }
.hero-button, button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #02121c;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(103, 206, 230, 0.24);
}
button.secondary { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.035)), var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.calculator-panel { padding: clamp(22px, 4vw, 44px); }
.panel-heading { max-width: 720px; margin-bottom: 30px; }
.panel-heading p, .content-panel p { color: var(--muted); }
.form-section {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid rgba(255,255,255,.1);
}
.form-section p { color: var(--muted); margin: 10px 0 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label, legend { color: var(--soft); font-weight: 650; font-size: .93rem; }
input[type="number"] {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(0,0,0,.24);
  font: inherit;
}
input:focus { outline: 2px solid rgba(143, 231, 212, .55); outline-offset: 2px; }
fieldset { margin: 0; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; padding: 16px; }
fieldset label { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline-options { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.inline-options legend { width: 100%; margin-bottom: 8px; }
.inline-options label { padding: 6px 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.1); }
.results-panel { margin-top: 26px; padding: clamp(24px, 4vw, 42px); display: grid; grid-template-columns: .9fr 1.1fr; gap: 34px; }
.hidden { display: none !important; }
.result-number { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 850; letter-spacing: -0.06em; line-height: .96; }
.result-number small { display: block; font-size: 1rem; letter-spacing: 0; color: var(--muted); margin-top: 10px; }
.result-sub { color: var(--soft); margin-top: 12px; font-weight: 700; }
.grade-badge {
  margin-top: 22px;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.2);
  font-size: 2rem;
  font-weight: 900;
  background: rgba(143, 231, 212, .11);
}
.grade-message { color: var(--soft); font-size: 1.05rem; }
.breakdown { display: grid; gap: 10px; margin-top: 18px; }
.breakdown-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.09); color: var(--muted); }
.breakdown-row strong { color: var(--text); }
.mini-grade { min-width: 38px; text-align: center; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 4px 8px; color: var(--accent); font-weight: 800; }
.page-main { min-height: 66vh; display: grid; align-items: center; }
.content-panel { max-width: 860px; padding: clamp(28px, 5vw, 58px); }
.content-panel h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); margin-bottom: 22px; }
.content-panel p { font-size: 1.08rem; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 32px 0; }
.method-grid article { border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 18px; background: rgba(0,0,0,.16); }
.note { border-left: 3px solid var(--accent); padding-left: 16px; }
footer { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 42px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .92rem; }
@media (max-width: 820px) {
  .site-header, footer { align-items: flex-start; flex-direction: column; }
  .hero { min-height: auto; padding: 36px 0 56px; }
  .form-section, .results-panel { grid-template-columns: 1fr; }
  .field-grid, .choice-grid, .method-grid { grid-template-columns: 1fr; }
  .earth { width: 130vw; right: -58vw; bottom: -18vw; opacity: .72; }
}
