/* Elemental Success site pages (home, sim library, terms). The palette and
   fonts are the sims' own, so moving between a page and a sim feels like one place. */
:root {
  color-scheme: light;
  --bg: #F3F7FA;
  --bg-2: #E8F0F5;
  --panel: #FFFFFF;
  --ink: #0F172A;
  --ink-2: #44546A;
  --ink-3: #6B7A92;
  --line: #DCE5EE;
  --teal: #0E7490;
  --teal-bright: #0891B2;
  --teal-soft: #E1F3F8;
  --amber: #D97706;
  --amber-ink: #8A4B06;
  --amber-soft: #FFF4DE;
  --hero-1: #0B1F2E;
  --hero-2: #12344A;
  --shadow: 0 1px 2px rgba(12, 45, 72, .06), 0 8px 24px rgba(12, 45, 72, .08);
  --shadow-lift: 0 2px 4px rgba(12, 45, 72, .08), 0 18px 40px rgba(12, 45, 72, .14);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 16px;
  --wrap: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1420; --bg-2: #0F1B2A; --panel: #13202F;
    --ink: #E6EEF6; --ink-2: #A9B8CB; --ink-3: #8193AA; --line: #24364B;
    --teal: #5CC8E8; --teal-bright: #38BDF8; --teal-soft: #14303F;
    --amber: #F6A93B; --amber-ink: #FFD28A; --amber-soft: #3A2A10;
    --hero-1: #07111B; --hero-2: #0E2638;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1420; --bg-2: #0F1B2A; --panel: #13202F;
  --ink: #E6EEF6; --ink-2: #A9B8CB; --ink-3: #8193AA; --line: #24364B;
  --teal: #5CC8E8; --teal-bright: #38BDF8; --teal-soft: #14303F;
  --amber: #F6A93B; --amber-ink: #FFD28A; --amber-soft: #3A2A10;
  --hero-1: #07111B; --hero-2: #0E2638;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal-bright); }
:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -.012em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--amber-ink);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--amber); border-radius: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  font: 600 15.5px/1 var(--sans); text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--amber); color: #1B1205; box-shadow: 0 6px 18px rgba(217, 119, 6, .28); }
.btn-primary:hover { color: #1B1205; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(217, 119, 6, .34); }
.btn-ghost { color: #E6EEF6; border: 1px solid rgba(230, 238, 246, .28); background: rgba(255, 255, 255, .04); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .1); }

/* Hero (home) */
.hero {
  position: relative; overflow: hidden; color: #E6EEF6;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(56, 189, 248, .22), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(246, 169, 59, .16), transparent 60%),
    linear-gradient(160deg, var(--hero-1), var(--hero-2));
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(148, 197, 230, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 197, 230, .07) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
}
.hero .wrap { position: relative; z-index: 1; display: grid; gap: 36px; padding-top: 56px; padding-bottom: 64px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.1fr .9fr; padding-top: 88px; padding-bottom: 96px; } }
.hero .eyebrow { color: #FFD28A; }
.hero h1 { font-size: clamp(36px, 5vw, 62px); margin: 18px 0 18px; color: #fff; }
.hero h1 em { font-style: normal; color: #FFD28A; }
.hero .lede { font-size: clamp(17px, 2.1vw, 19.5px); color: #B9C8D8; max-width: 34em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero .proof { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 28px 0 0; padding: 0; list-style: none; color: #9FB2C6; font-size: 14.5px; }
.hero .proof li { display: inline-flex; align-items: center; gap: 7px; }
.hero .proof svg { width: 16px; height: 16px; color: #5CC8E8; }

/* The potential-energy well illustration */
.well {
  position: relative; border-radius: 22px; padding: 18px 18px 12px;
  background: linear-gradient(180deg, rgba(19, 32, 47, .9), rgba(11, 20, 32, .92));
  border: 1px solid rgba(148, 197, 230, .16);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.well-head { display: flex; justify-content: space-between; align-items: center; font: 500 12.5px/1 var(--mono); color: #7E8EA5; margin-bottom: 10px; }
.well-head b { color: #E6EEF6; font-weight: 600; }
.well svg { display: block; width: 100%; height: auto; }
.well .readout { display: flex; gap: 18px; font: 500 13px/1 var(--mono); color: #A9B8CB; padding: 10px 2px 4px; }
.well .readout span b { color: #FFD28A; font-weight: 600; }
.atom-l, .atom-r { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .atom-r { animation: approach 6s ease-in-out infinite; }
  .tracer { animation: trace 6s ease-in-out infinite; }
}
@keyframes approach {
  0%, 8% { transform: translateX(150px); }
  55%, 70% { transform: translateX(0); }
  62% { transform: translateX(-6px); }
  66% { transform: translateX(4px); }
  100% { transform: translateX(150px); }
}
@keyframes trace {
  0%, 8% { offset-distance: 100%; }
  55%, 70% { offset-distance: 38%; }
  100% { offset-distance: 100%; }
}

/* Sections */
.section { padding: 72px 0; }
.section-tight { padding: 56px 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(28px, 4vw, 38px); margin-top: 12px; }
.section-head p { color: var(--ink-2); margin-top: 12px; }

/* Tool cards (home) */
.tools { display: grid; gap: 20px; }
@media (min-width: 860px) { .tools { grid-template-columns: repeat(3, 1fr); } }
.tool {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 22px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--teal) 40%, var(--line)); }
.tool .icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px;
  background: var(--teal-soft); color: var(--teal);
}
.tool .icon svg { width: 26px; height: 26px; }
.tool.amber .icon { background: var(--amber-soft); color: var(--amber); }
.tool h3 { font-size: 23px; }
.tool .kicker { font: 600 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 8px 0 12px; }
.tool p { color: var(--ink-2); font-size: 16px; }
.tool ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.tool li { display: flex; gap: 8px; }
.tool li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: .62em; border-radius: 50%; background: var(--amber); }
.tool .go { margin-top: auto; padding-top: 22px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--teal); }
.tool .go svg { width: 18px; height: 18px; transition: transform .18s ease; }
.tool:hover .go svg { transform: translateX(3px); }

/* Promises */
.promises { display: grid; gap: 16px; }
@media (min-width: 760px) { .promises { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.promise { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.promise .dot { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--teal); }
.promise .dot svg { width: 20px; height: 20px; }
.promise h3 { font: 600 17px/1.3 var(--sans); letter-spacing: 0; }
.promise p { color: var(--ink-2); font-size: 15.5px; margin-top: 4px; }
.band { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* About */
.about { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .about { grid-template-columns: 1.2fr .8fr; gap: 56px; } }
.about h2 { font-size: clamp(28px, 4vw, 38px); margin: 12px 0 16px; }
.about p + p { margin-top: 14px; }
.about p { color: var(--ink-2); }
.quote {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  font: 600 21px/1.4 var(--serif); color: var(--ink);
}
.quote small { display: block; margin-top: 14px; font: 500 14px/1.4 var(--sans); color: var(--ink-3); }

/* Page header (inner pages) */
.page-head { padding: 52px 0 28px; }
.page-head h1 { font-size: clamp(34px, 5vw, 50px); margin-top: 14px; }
.page-head p { color: var(--ink-2); margin-top: 14px; max-width: 40em; font-size: 18px; }

/* Sim library */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 8px; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  font: 500 14.5px/1 var(--sans); padding: 10px 16px; border-radius: 999px; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { font-family: var(--mono); font-size: 12.5px; opacity: .7; margin-left: 4px; }
.group { padding: 30px 0 8px; }
.group[hidden] { display: none; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.group-head h2 { font-size: 24px; }
.group-head .course { font: 600 12px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--amber-ink); background: var(--amber-soft); padding: 6px 9px; border-radius: 6px; }
.group-head .sub { color: var(--ink-3); font-size: 15px; }
.sims { display: grid; gap: 16px; }
@media (min-width: 640px) { .sims { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .sims { grid-template-columns: repeat(3, 1fr); } }
.sim {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 20px 18px;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.sim:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--teal) 40%, var(--line)); }
.sim .topic { align-self: flex-start; font: 600 12px/1 var(--mono); color: var(--teal); background: var(--teal-soft); padding: 6px 9px; border-radius: 6px; }
.sim h3 { font-size: 20px; }
.sim p { color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
.sim .go { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; color: var(--teal); }
.sim .go svg { width: 16px; height: 16px; transition: transform .18s ease; }
.sim:hover .go svg { transform: translateX(3px); }
.note {
  margin: 40px 0 0; padding: 18px 20px; border-radius: 14px; background: var(--panel); border: 1px dashed var(--line);
  color: var(--ink-2); font-size: 15.5px;
}

/* Prose (terms) */
.prose { max-width: 720px; padding-bottom: 64px; }
.prose h2 { font-size: 26px; margin: 40px 0 12px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 20px; margin: 10px 0 0; display: grid; gap: 6px; }
.prose strong { color: var(--ink); }
.card-note { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-top: 18px; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0 48px; margin-top: 24px; font-size: 14.5px; color: var(--ink-3); }
.foot .cols { display: grid; gap: 24px; }
@media (min-width: 760px) { .foot .cols { grid-template-columns: 1.4fr 1fr; gap: 48px; } }
.foot .brand { display: inline-flex; align-items: center; gap: 10px; font: 600 18px/1 var(--serif); color: var(--ink); margin-bottom: 12px; }
.foot .brand svg { width: 28px; height: 28px; }
.foot p + p { margin-top: 8px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot nav a { color: var(--ink-2); text-decoration: none; }
.foot nav a:hover { color: var(--teal); }
.foot .legal { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
