/* opaix learning style: navy owns the chrome, white owns the content,
   teal marks action and progress. Tokens match opaix.com. */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/poppins-latin-800-normal.woff2") format("woff2");
}

:root {
  --brand-50: #ecfbf7;
  --brand-100: #d2f5ec;
  --brand-200: #a8ebda;
  --brand-300: #6fdcc3;
  --brand-400: #3dcab1;
  --brand-500: #21b89c;
  --brand-600: #149480;
  --brand-700: #137667;
  --brand-800: #155e54;

  --navy: #0a2540;
  --navy-deep: #06182b;
  --navy-soft: #103257;
  --ink: #0a2540;
  --muted: #4b6560;
  --body: #3f5a54;

  --success: #1a7a43;
  --info: #1d4ed8;
  --warning: #9a5b00;
  --danger: #b3261e;

  --surface: #f4f8f7;
  --sunken: #eaf1ef;
  --line: #dbe5e3;

  --slate: #cdd9e8;
  --slate-dim: #93aec4;

  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;

  --shadow: 0 4px 16px -6px rgba(10, 37, 64, 0.16);
  --shadow-lift: 0 18px 40px -18px rgba(10, 37, 64, 0.32);
  --focus: 0 0 0 3px rgba(33, 184, 156, 0.28);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 4.5vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

a { color: var(--brand-700); text-underline-offset: 2px; }
a:hover { color: var(--brand-800); }

:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--brand-500); color: var(--ink); padding: 0.5rem 1rem;
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 1.5rem; } }

/* Chrome ----------------------------------------------------------------- */

.topbar { background: var(--navy); color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.topbar-in {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4rem; flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: #fff; }
.brand img { height: 1.75rem; width: auto; display: block; }
.brand-name {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brand-300); border: 1px solid rgba(111, 220, 195, 0.35);
  border-radius: 999px; padding: 0.1rem 0.6rem; white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.nav a, .nav button {
  font: inherit; font-size: 0.875rem; font-weight: 500; color: rgba(255, 255, 255, 0.82);
  background: transparent; border: 0; cursor: pointer; text-decoration: none;
  padding: 0.45rem 0.7rem; border-radius: var(--radius-sm); white-space: nowrap;
}
.nav a:hover, .nav button:hover, .nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav form { margin: 0; }
.avatar {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px;
  background: var(--brand-300); color: var(--ink); font-size: 0.75rem; font-weight: 800;
}
.nav .who { display: inline-flex; align-items: center; gap: 0.5rem; color: #fff; font-size: 0.875rem; padding-left: 0.5rem; }

.foot {
  background: var(--navy-deep); color: var(--slate-dim); font-size: 0.875rem;
  padding: 2rem 0; margin-top: 4rem;
}
.foot .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; }
.foot a { color: var(--brand-300); }

/* Header bands ------------------------------------------------------------- */

.band-hero {
  position: relative; overflow: hidden; color: var(--slate);
  background: var(--navy-deep) url("../img/network-bg.jpg") center / cover no-repeat;
}
.band-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(10, 37, 64, 0.78) 0%, rgba(10, 37, 64, 0.9) 55%, var(--navy) 100%);
}
.band-hero > .wrap { position: relative; padding-top: 4rem; padding-bottom: 4rem; }
.band-hero h1, .band-hero h2 { color: #fff; }
.band-hero p { color: var(--slate); max-width: 60ch; }

.page-head { background: var(--navy); color: var(--slate); }
.page-head > .wrap { padding-top: 2rem; padding-bottom: 2rem; }
.page-head h1 { color: #fff; font-size: clamp(1.5rem, 3.5vw, 2.125rem); }
.page-head p { color: var(--slate); margin-top: 0.5rem; max-width: 65ch; }

.eyebrow {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--brand-300); margin-bottom: 0.5rem;
}
.content .eyebrow { color: var(--brand-700); }
.text-gradient {
  background: linear-gradient(120deg, #21b89c 0%, #3dcab1 60%, #6fdcc3 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.content { padding-top: 2.5rem; }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
.measure { max-width: 72ch; }
.lede { font-size: 1.0625rem; }
.small { font-size: 0.875rem; }
.muted { color: var(--muted); }

/* Cards -------------------------------------------------------------------- */

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.card > * + * { margin-top: 0.75rem; }
.card-well { background: var(--surface); box-shadow: none; }
.card-lift { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.stat { display: flex; flex-direction: column; gap: 0.125rem; }
.stat b { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat span { font-size: 0.8125rem; color: var(--muted); }

/* Buttons ------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1.3;
  border-radius: var(--radius); padding: 0.7rem 1.25rem; min-height: 2.75rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-accent { background: var(--brand-500); color: var(--ink); }
.btn-accent:hover { background: var(--brand-400); color: var(--ink); }
.btn-primary { background: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-800); color: #fff; }
.btn-secondary { background: #fff; color: var(--brand-700); border-color: var(--brand-600); }
.btn-secondary:hover { background: var(--brand-50); color: var(--brand-800); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }
.btn-onnavy { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.btn-onnavy:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.linklike { font: inherit; background: none; border: 0; padding: 0; color: var(--brand-700); text-decoration: underline; cursor: pointer; }

/* Forms -------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 0.375rem; }
.field label, .legend { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 0.8125rem; color: var(--muted); }
.input, select.input, textarea.input {
  font: inherit; font-size: 0.9375rem; width: 100%;
  padding: 0.65rem 0.875rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
textarea.input { min-height: 9rem; resize: vertical; line-height: 1.6; }
.input:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.choice-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.2s ease;
}
.choice:hover .choice-body { transform: translateY(-2px); box-shadow: var(--shadow); }
.choice input:checked + .choice-body { border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-500); }
.choice input:focus-visible + .choice-body { box-shadow: var(--focus); }
.choice-img {
  height: 6rem; background: linear-gradient(120deg, var(--navy) 0%, var(--navy-soft) 60%, var(--brand-800) 100%);
  background-size: cover; background-position: center;
}
.choice-text { padding: 0.875rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.choice-text strong { font-weight: 600; }
.choice-text span { font-size: 0.8125rem; color: var(--muted); }
.choice[hidden] { display: none; }

.range-row { display: flex; align-items: center; gap: 1rem; }
.range-row input[type="range"] { flex: 1; accent-color: var(--brand-600); min-height: 2.75rem; }
.range-row output {
  min-width: 3.25rem; text-align: center; font-weight: 800; font-size: 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.25rem 0.5rem;
}

details.extra { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
details.extra summary { cursor: pointer; padding: 0.875rem 1.125rem; font-weight: 600; font-size: 0.9375rem; }
details.extra[open] summary { border-bottom: 1px solid var(--line); }
details.extra .extra-body { padding: 1.125rem; display: grid; gap: 0.875rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

/* Feedback ----------------------------------------------------------------- */

.flash { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.flash li {
  border-left: 3px solid var(--info); background: #eef3fe; color: var(--ink);
  padding: 0.75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.9375rem;
}
.flash li.error { border-color: var(--danger); background: #fcefee; }
.flash li.success { border-color: var(--success); background: #edf7f1; }

.note {
  border-left: 3px solid var(--brand-500); background: var(--brand-50);
  padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.9375rem;
}

.pill {
  display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; font-weight: 600;
  padding: 0.2rem 0.625rem; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 999px; background: currentColor; }
.pill-active { background: rgba(33, 184, 156, 0.16); color: var(--brand-800); }
.pill-done { background: rgba(26, 122, 67, 0.12); color: var(--success); }
.pill-due { background: rgba(154, 91, 0, 0.12); color: var(--warning); }
.pill-late { background: rgba(179, 38, 30, 0.12); color: var(--danger); }
.pill-draft { background: var(--sunken); color: var(--muted); }

.bar { height: 0.375rem; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand-500); border-radius: 999px; }
.bar-onnavy { background: rgba(255, 255, 255, 0.12); }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--muted); margin-top: 0.375rem; }
.page-head .progress-meta { color: var(--slate-dim); }

/* Question ----------------------------------------------------------------- */

.question-grid { display: grid; gap: 1.25rem; }
@media (min-width: 60rem) { .question-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }

.term-name { font-size: clamp(1.5rem, 3.5vw, 2.25rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.definition { font-size: 1.0625rem; line-height: 1.7; color: var(--ink); max-width: 68ch; }
.definition-empty { color: var(--muted); font-style: italic; }

.facts { display: grid; gap: 0.5rem 1rem; grid-template-columns: max-content 1fr; font-size: 0.875rem; margin: 0; }
.facts dt { font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.answer-bar { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.answer-bar .btn { min-height: 3.25rem; font-size: 1rem; }
.btn-agree { background: var(--brand-500); color: var(--ink); }
.btn-agree:hover { background: var(--brand-400); }
.btn-disagree { background: #fff; color: var(--danger); border-color: rgba(179, 38, 30, 0.45); }
.btn-disagree:hover { background: #fcefee; }

.option { display: block; position: relative; cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-body {
  display: block; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.125rem 1rem 3rem;
  background: #fff; position: relative; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.option-body::before {
  content: ""; position: absolute; left: 1.125rem; top: 1.25rem; width: 1.125rem; height: 1.125rem;
  border-radius: 999px; border: 2px solid var(--brand-600); background: #fff;
}
.option input:checked + .option-body { border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-500); }
.option input:checked + .option-body::before { background: var(--brand-500); box-shadow: inset 0 0 0 3px #fff; }
.option input:focus-visible + .option-body { box-shadow: var(--focus); }

/* Graph -------------------------------------------------------------------- */

.graph-card { padding: 0; overflow: hidden; }
.graph-card > * + * { margin-top: 0; }
.graph-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.875rem 1.125rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.graph { position: relative; height: 18rem; background: var(--surface); }
@media (min-width: 60rem) { .graph { height: 24rem; } }
.graph-tall { height: min(70vh, 40rem); }
.graph svg { display: block; width: 100%; height: 100%; touch-action: none; }
.graph-tools { position: absolute; right: 0.75rem; top: 0.75rem; display: flex; flex-direction: column; gap: 0.375rem; }
.graph-tools button {
  min-width: 2.25rem; height: 2.25rem; padding: 0 0.375rem; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
.graph-tools button:hover { background: var(--brand-50); }
.graph-tip {
  position: absolute; pointer-events: none; max-width: 18rem; background: var(--navy); color: #fff;
  font-size: 0.8125rem; line-height: 1.5; padding: 0.625rem 0.75rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift); opacity: 0; transition: opacity 0.1s ease;
}
.graph-tip b { display: block; color: var(--brand-300); font-weight: 600; margin-bottom: 0.125rem; }
.legend-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.75rem 1.125rem; font-size: 0.75rem; color: var(--muted); border-top: 1px solid var(--line); }
.legend-row span { display: inline-flex; align-items: center; gap: 0.375rem; }
.key { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 999px; }
.key-focus { background: var(--brand-500); box-shadow: 0 0 0 2px var(--ink); }
.key-class { background: var(--navy-soft); }
.key-data { background: #ffd9a0; border-radius: 0.2rem; }
.key-line { width: 1.25rem; height: 0; border-top: 2px solid var(--brand-700); border-radius: 0; }
.key-dash { width: 1.25rem; height: 0; border-top: 2px dashed var(--muted); border-radius: 0; }
.legend-hint { margin-left: auto; font-style: italic; }
.graph-props { border-top: 1px solid var(--line); padding: 0.75rem 1.125rem; font-size: 0.8125rem; }
.graph-props summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.graph-props ul { list-style: none; margin: 0.625rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.375rem; }
.graph-props li { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.prop-type { font-size: 0.6875rem; padding: 0 0.3rem; border-radius: 0.2rem; background: #ffd9a0; color: #6b3f00; }
.graph-empty { display: grid; place-items: center; height: 100%; padding: 2rem; text-align: center; color: var(--muted); font-size: 0.9375rem; }

/* Lists and tables --------------------------------------------------------- */

.plain { list-style: none; margin: 0; padding: 0; }
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.result-list li { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.125rem; }
.result-list .label { font-weight: 600; }
.result-list .old { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(75, 101, 96, 0.5); }

.search { position: relative; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.25rem); z-index: 20; list-style: none; margin: 0; padding: 0.375rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift);
  max-height: 20rem; overflow-y: auto;
}
.search-results a { display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a:focus { background: var(--brand-50); outline: none; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th { text-align: left; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); padding: 0 0.75rem 0.625rem 0; border-bottom: 1px solid var(--line); }
td { padding: 0.75rem 0.75rem 0.75rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }
tr.me td { background: var(--brand-50); }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.steps li { display: grid; grid-template-columns: 2rem 1fr; gap: 1rem; align-items: start; }
.steps li::before {
  counter-increment: step; content: counter(step); display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 600;
  background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-200);
}
.steps strong { display: block; }

.auth-card { max-width: 28rem; margin: -3rem auto 0; position: relative; }

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

@media print {
  .topbar .nav, .foot, .answer-bar, .graph-tools { display: none; }
  .page-head, .band-hero { background: #fff; color: var(--ink); }
  .page-head h1, .band-hero h1 { color: var(--ink); }
}
