:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5e6678;
  --line: #d9dfeb;
  --paper: #f7f9fd;
  --white: #ffffff;
  --blue: #2463eb;
  --teal: #11a6a3;
  --coral: #ef6f61;
  --gold: #d99a20;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

a { color: inherit; }

.hero {
  min-height: 92vh;
  padding: 24px clamp(18px, 4vw, 64px) 48px;
  background:
    radial-gradient(circle at 82% 16%, rgba(17, 166, 163, 0.18), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 48%, #fff6ef 100%);
}

.nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  max-width: 1120px;
  margin: 0 auto 42px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.94rem;
  padding: 8px 12px;
  border-radius: 8px;
}

.nav a:hover { background: rgba(36, 99, 235, 0.09); color: var(--blue); }

.hero-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  gap: clamp(30px, 6vw, 72px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
}

h1, h2, h3 { line-height: 1.1; margin: 0; }
h1 { font-size: clamp(3rem, 9vw, 6.6rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 18px; }
h3 { font-size: 1.2rem; margin-bottom: 10px; }
p { color: var(--muted); margin: 0 0 16px; }

.hero-copy > p:not(.eyebrow) {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  max-width: 650px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
}
.primary { background: var(--blue); color: white; }
.secondary { border: 1px solid var(--line); background: white; color: var(--ink); }

.hero-visual {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(217, 223, 235, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 34px);
}

.orbit {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / 0.78;
  margin: 0 auto 22px;
}

.atom, .node {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 900;
  box-shadow: inset 0 -8px 16px rgba(0,0,0,0.12), 0 12px 28px rgba(23, 32, 51, 0.16);
}

.atom { position: absolute; width: 86px; height: 86px; }
.oxygen, .o { background: var(--coral); }
.hydrogen, .h { background: var(--teal); }
.c { background: var(--ink); }
.oxygen { left: 50%; top: 42%; transform: translate(-50%, -50%); }
.h-left { left: 11%; top: 62%; }
.h-right { right: 11%; top: 62%; }

.bond {
  position: absolute;
  height: 12px;
  width: 130px;
  background: #93a4bf;
  top: 62%;
  border-radius: 999px;
}
.b-left { left: 28%; transform: rotate(-24deg); }
.b-right { right: 28%; transform: rotate(24deg); }

.electron {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2.3s ease-in-out infinite;
}
.e1 { left: 37%; top: 52%; }
.e2 { left: 43%; top: 61%; animation-delay: 0.25s; }
.e3 { right: 37%; top: 52%; animation-delay: 0.5s; }
.e4 { right: 43%; top: 61%; animation-delay: 0.75s; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.72; }
  50% { transform: scale(1.35); opacity: 1; }
}

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(54px, 8vw, 92px) clamp(18px, 4vw, 28px);
}

.split, .two-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
  gap: 28px;
  align-items: start;
}

.callout, .info-panel, .concept-card, .molecule-card, .quiz, .faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.06);
}

.callout { padding: 24px; border-left: 5px solid var(--teal); }
.callout strong { display: block; margin-bottom: 8px; font-size: 1.15rem; }

.bond-grid, .molecule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.concept-card, .molecule-card, .info-panel { padding: 22px; }

.mini-molecule, .molecule {
  min-height: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  background: #f3f7fb;
  border-radius: 8px;
}

.mini-molecule span, .node {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
}

.mini-molecule i, .double-line {
  display: block;
  width: 60px;
  height: 8px;
  border-radius: 999px;
  background: #8fa0ba;
  position: relative;
}

.mini-molecule.double i, .double-line {
  height: 18px;
  background: linear-gradient(#8fa0ba 0 6px, transparent 6px 12px, #8fa0ba 12px 18px);
}

.mini-molecule.triple i {
  height: 28px;
  background: linear-gradient(#8fa0ba 0 6px, transparent 6px 11px, #8fa0ba 11px 17px, transparent 17px 22px, #8fa0ba 22px 28px);
}

.molecule-card .molecule { min-height: 170px; }
.water-card { transform: none; }
.water-card .l1, .water-card .l2 {
  display: block;
  width: 42px;
  height: 7px;
  background: #8fa0ba;
  border-radius: 999px;
}
.water-card .l1 { transform: rotate(-28deg); }
.water-card .l2 { transform: rotate(28deg); }

table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink); }

.quiz-section { padding-bottom: 70px; }
.quiz { padding: 22px; margin-bottom: 18px; }
.quiz button {
  width: 100%;
  display: block;
  text-align: left;
  border: 1px solid var(--line);
  background: #fbfcff;
  color: var(--ink);
  border-radius: 8px;
  padding: 13px 14px;
  margin: 10px 0;
  font: inherit;
  cursor: pointer;
}
.quiz button:hover, .quiz button.selected { border-color: var(--blue); background: #eef4ff; }
#quiz-result { font-weight: 800; margin-top: 12px; }
.faq { display: grid; gap: 10px; }
.faq details { padding: 16px 18px; }
.faq summary { cursor: pointer; font-weight: 800; }
.faq p { margin: 10px 0 0; }

footer {
  padding: 28px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: white;
}
footer p { margin: 0; }

@media (max-width: 840px) {
  .hero { min-height: auto; }
  .nav { justify-content: flex-start; margin-bottom: 28px; }
  .hero-grid, .split, .two-columns { grid-template-columns: 1fr; }
  .bond-grid, .molecule-grid { grid-template-columns: 1fr; }
  .hero-visual { padding: 18px; }
  .atom { width: 66px; height: 66px; }
  .bond { width: 96px; top: 63%; }
  .b-left { left: 28%; }
  .b-right { right: 28%; }
}

@media (max-width: 480px) {
  .nav a { padding: 7px 9px; }
  .hero-actions .button { width: 100%; }
  .mini-molecule span, .node { width: 48px; height: 48px; flex-basis: 48px; }
  .mini-molecule i, .double-line { width: 40px; }
  th, td { padding: 10px 6px; font-size: 0.86rem; }
}
