/* ==========================================================
   NEO Demo — shared stylesheet
   Brand variables intentionally aligned with nudgeeducation.online
   so the demo reads as one umbrella with the marketing site.
   ========================================================== */

:root {
  /* Brand */
  --teal: #2AB3A0;
  --teal-dark: #1F8A7C;
  --teal-tint: #E6F5F2;
  --navy: #1A2E3B;
  --navy-soft: #243E4E;
  --charcoal: #2C3E50;
  --cream: #F5F1E8;
  --cream-light: #FAF7F0;
  --orange: #E8734A;
  --orange-tint: #FCEFE9;
  --grey: #6B7280;
  --grey-soft: #9CA3AF;
  --line: #E2E8F0;
  --line-soft: #EEF2F6;
  --ink: #1A2E3B;

  /* Cornerstone palette (mapped from brand) */
  --c-connection: #2AB3A0;
  --c-movement:   #E8734A;
  --c-creativity: #8B5CF6;
  --c-reflection: #4A6FA5;
  --c-rest:       #7BA86E;
  --c-nutrition:  #D4A437;

  /* Status colours */
  --ok: #2F7D4E;
  --warn: #B8771F;
  --alert: #B0392E;
  --ok-tint: #E7F2EB;
  --warn-tint: #FBF1DD;
  --alert-tint: #F8E5E2;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --max: 1180px;
  --shadow: 0 1px 2px rgba(26,46,59,.06), 0 8px 24px rgba(26,46,59,.06);
  --shadow-lg: 0 4px 12px rgba(26,46,59,.08), 0 24px 60px rgba(26,46,59,.10);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream-light);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.18;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 3vw + 1rem, 3rem); font-weight: 500; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 1.5vw + 1rem, 2.1rem); }
h3 { font-size: 1.18rem; font-family: var(--font-body); font-weight: 600; color: var(--navy); letter-spacing: -0.005em; }
h4 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; color: var(--charcoal); margin-bottom: .35em; }
p  { margin: 0 0 .9em; }
ul { padding-left: 1.1em; margin: 0 0 .9em; }
ul.clean { list-style: none; padding: 0; }
ul.clean li { position: relative; padding-left: 1.6em; margin-bottom: .55em; }
ul.clean li::before {
  content: "";
  position: absolute;
  left: 0; top: .55em;
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--teal);
  transform: rotate(45deg);
}

.wrap { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }
.wrap-narrow { width: min(820px, 100% - 2.5rem); margin-inline: auto; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: .8rem;
}
.lead { font-size: clamp(1.05rem, .6vw + 1rem, 1.2rem); color: var(--charcoal); }
.muted { color: var(--grey); }
.small { font-size: .88rem; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: .75rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Demo banner ---------- */
.demo-banner {
  background: var(--navy);
  color: #cfe7e2;
  font-size: .82rem;
  text-align: center;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--navy-soft);
}
.demo-banner strong { color: #fff; }
.demo-banner a { color: var(--teal); text-decoration: underline; }

/* ---------- Header ---------- */
header.site {
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--teal);
}
header.site .bar { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 1rem; flex-wrap: wrap; }
.brand {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -.01em;
}
.brand small { font-family: var(--font-body); font-weight: 500; font-size: .76rem; color: var(--teal); letter-spacing: .07em; text-transform: uppercase; }
nav.primary { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
nav.primary a {
  color: #cfe7e2;
  text-decoration: none;
  font-size: .94rem;
  font-weight: 500;
}
nav.primary a:hover { color: #fff; }
nav.primary a.current { color: #fff; border-bottom: 2px solid var(--teal); padding-bottom: 2px; }

/* Persona pill (sub-nav appears on internal pages) */
.persona-strip {
  background: var(--navy-soft);
  color: #cfe7e2;
  font-size: .85rem;
}
.persona-strip .bar {
  display: flex; align-items: center; gap: .8rem; padding: .55rem 0; flex-wrap: wrap;
}
.persona-strip .label { color: var(--teal); letter-spacing: .12em; font-weight: 600; text-transform: uppercase; font-size: .72rem; }
.persona-strip a {
  color: #cfe7e2;
  text-decoration: none;
  padding: .25rem .7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
}
.persona-strip a:hover { color: #fff; border-color: var(--teal-dark); }
.persona-strip a.current {
  background: var(--teal); color: var(--navy); border-color: var(--teal);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-body);
  font-weight: 600;
  padding: .8rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: .98rem;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--teal); color: var(--navy); }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy-soft); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-meet {
  background: #1A73E8; color: #fff; padding: .9rem 1.3rem; font-size: 1.02rem;
}
.btn-meet:hover { background: #1666CB; color: #fff; }
.btn-sm { padding: .45rem .85rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---------- Landing doors ---------- */
.hero {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 3vw, 3rem);
  background:
    radial-gradient(1200px 500px at 80% -20%, rgba(42,179,160,.18), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(232,115,74,.10), transparent 60%),
    var(--cream-light);
}
.doors {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 2rem;
}
.door {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem 1.6rem 1.6rem;
  color: var(--navy);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: var(--shadow);
}
.door:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--teal); color: var(--navy); }
.door .door-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  margin-bottom: 1rem;
  background: var(--teal-tint); color: var(--teal-dark);
  font-size: 1.5rem;
}
.door .door-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin-bottom: .35rem; }
.door .door-desc { color: var(--charcoal); margin-bottom: 1rem; font-size: .96rem; }
.door .door-cta { color: var(--teal-dark); font-weight: 600; font-size: .92rem; }
.door .door-cta::after { content: " →"; }

/* ---------- Page hero (internal pages) ---------- */
.page-hero { padding: 1.8rem 0 1.4rem; background: #fff; border-bottom: 1px solid var(--line); }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.card.tight { padding: 1rem; }
.card h3 { margin-top: 0; }
.card .sub { color: var(--grey); font-size: .9rem; margin-top: -.2rem; margin-bottom: .8rem; }

.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-portfolio { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* dashboard layout (learner / practitioner / commissioner) */
.dash {
  display: grid;
  gap: 1.3rem;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  margin: 1.5rem 0 4rem;
}
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } }

.section-title {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 1.6rem 0 .8rem;
}
.section-title h2 { margin-bottom: 0; }

/* ---------- Now / lesson card ---------- */
.now-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 1.2rem;
}
.now-card .pill { display: inline-block; background: var(--teal); color: var(--navy); padding: .15rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .8rem; }
.now-card h3 { color: #fff; font-family: var(--font-display); font-size: 1.5rem; margin-bottom: .25rem; }
.now-card .meta { color: #cfe7e2; font-size: .92rem; }
@media (max-width: 720px) { .now-card { grid-template-columns: 1fr; } }

/* ---------- Timetable strip (today) ---------- */
.tt {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.tt-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid transparent;
}
.tt-row.now { background: var(--teal-tint); border-color: var(--teal); }
.tt-row.past { opacity: .6; }
.tt-row .time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }
.tt-row .who { color: var(--grey); font-size: .9rem; }
.tt-row .mode {
  font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  background: var(--navy); color: #fff; padding: .15rem .55rem; border-radius: 999px;
}
.tt-row .mode.self { background: var(--cream-light); color: var(--charcoal); border: 1px solid var(--line); }
.tt-row .mode.solo { background: var(--orange-tint); color: var(--orange); }

/* ---------- Week strip ---------- */
.week {
  display: grid; gap: .55rem;
  grid-template-columns: repeat(5, 1fr);
}
.week-day {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .65rem;
}
.week-day.today { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-tint); }
.week-day .dow { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); font-weight: 600; }
.week-day .date { font-family: var(--font-display); font-size: 1.5rem; color: var(--navy); margin: .1rem 0 .4rem; }
.week-day ul { padding: 0; list-style: none; margin: 0; }
.week-day li { font-size: .8rem; color: var(--charcoal); padding: .15rem 0; border-top: 1px dashed var(--line-soft); }
.week-day li:first-child { border-top: 0; }

/* ---------- Mycelial map ---------- */
.mycelial-wrap { position: relative; }
.mycelial-svg {
  width: 100%; height: 460px; border-radius: var(--radius);
  background:
    radial-gradient(circle at 20% 80%, rgba(42,179,160,.06), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(232,115,74,.05), transparent 50%),
    var(--cream);
}
.mycelial-svg .link { stroke: var(--grey-soft); stroke-opacity: .35; fill: none; }
.mycelial-svg .link.highlight { stroke: var(--teal); stroke-opacity: .9; stroke-width: 2; }
.mycelial-svg .node-circle { stroke: #fff; stroke-width: 2; cursor: pointer; transition: r .15s ease; }
.mycelial-svg .node-circle:hover, .mycelial-svg .node-circle.focused { stroke: var(--navy); stroke-width: 3; }
.mycelial-svg .node-label {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--navy);
  pointer-events: none;
  font-weight: 500;
}
.mycelial-svg .node-label.dim { opacity: .35; }

.cornerstone-key {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem;
  margin: .8rem 0 0;
  font-size: .82rem;
}
.cornerstone-key span {
  display: inline-flex; align-items: center; gap: .35rem; color: var(--charcoal);
}
.cornerstone-key i {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}

/* ---------- Resonance Box ---------- */
.resonance {
  border: 1px dashed var(--teal-dark);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  background: #fff;
  position: relative;
}
.resonance::before {
  content: "Resonance";
  position: absolute; top: -.7rem; left: 1rem;
  background: var(--cream-light); padding: 0 .55rem;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal-dark); font-weight: 700;
}
.resonance p { font-style: italic; color: var(--charcoal); margin: 0 0 .4rem; }
.resonance .actions { margin-top: .8rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Artefact tile ---------- */
.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .5rem;
  position: relative;
}
.tile h4 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--navy); margin: 0; }
.tile .meta { font-size: .82rem; color: var(--grey); }
.tile .domain {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.tile .domain i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tile .stats { display: flex; gap: .8rem; font-size: .82rem; color: var(--grey); }
.tile .stats b { color: var(--navy); font-weight: 600; }
.tile .actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.tile .actions button {
  font-family: var(--font-body);
  font-size: .76rem;
  font-weight: 600;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--navy);
  cursor: pointer;
}
.tile .actions button:hover { border-color: var(--teal); }
.tile .actions button.primary { background: var(--teal); border-color: var(--teal); color: var(--navy); }

/* ---------- Caseload / pen-portrait ---------- */
.caseload {
  display: flex; flex-direction: column; gap: .55rem;
}
.case-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: .9rem; align-items: center;
  padding: .65rem .9rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.case-row.active { border-color: var(--teal); background: var(--teal-tint); }
.case-row .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600;
}
.case-row .avatar.theo { background: var(--orange); }
.case-row .avatar.yas  { background: var(--c-creativity); }
.case-row .avatar.maya { background: var(--c-reflection); }
.case-row .name { font-weight: 600; color: var(--navy); }
.case-row .ctx { font-size: .82rem; color: var(--grey); }
.case-row .status {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .2rem .55rem; border-radius: 999px;
  background: var(--ok-tint); color: var(--ok);
}
.case-row .status.warn { background: var(--warn-tint); color: var(--warn); }
.case-row .status.alert { background: var(--alert-tint); color: var(--alert); }

.pen-portrait {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem;
}
.pp-grid { display: grid; gap: .8rem 1.4rem; grid-template-columns: 140px 1fr; font-size: .92rem; }
.pp-grid dt { color: var(--grey); font-weight: 500; }
.pp-grid dd { margin: 0; color: var(--charcoal); }

/* ---------- KPI stat tile ---------- */
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.kpi .label { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); font-weight: 600; }
.kpi .value { font-family: var(--font-display); font-size: 2rem; color: var(--navy); margin: .15rem 0; line-height: 1.1; }
.kpi .delta { font-size: .82rem; }
.kpi .delta.up   { color: var(--ok); }
.kpi .delta.down { color: var(--alert); }

/* ---------- Bar (attendance / engagement) ---------- */
.bar-strip { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; height: 38px; align-items: end; }
.bar-strip .b { background: var(--teal); border-radius: 2px; transition: opacity .15s; }
.bar-strip .b.absent  { background: var(--alert); }
.bar-strip .b.partial { background: var(--warn); }
.bar-strip .b.future  { background: var(--line); }

.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--grey); margin-top: .55rem; }
.legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }

/* ---------- Status chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  padding: .2rem .65rem; border-radius: 999px;
  background: var(--ok-tint); color: var(--ok);
}
.chip.warn  { background: var(--warn-tint);  color: var(--warn); }
.chip.alert { background: var(--alert-tint); color: var(--alert); }
.chip.neutral { background: var(--cream); color: var(--charcoal); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(26,46,59,.55);
  display: none; align-items: center; justify-content: center;
  z-index: 50; padding: 1rem;
}
.modal-back.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  max-width: 640px; width: 100%;
  max-height: 90vh; overflow: auto;
  padding: 1.6rem 1.8rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-top: 0; }
.modal .close {
  position: absolute; top: .8rem; right: .8rem;
  background: transparent; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--grey);
}
.modal pre {
  background: var(--cream-light); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1rem; overflow: auto;
  font-size: .84rem; color: var(--charcoal);
}

/* ---------- Footer ---------- */
footer.site {
  background: var(--navy); color: #cfe7e2; padding: 2rem 0; margin-top: 3rem;
  font-size: .9rem;
}
footer.site a { color: var(--teal); }
footer.site .row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }

/* Utility */
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.gap-sm { gap: .5rem; }
.mt-2 { margin-top: 2rem; }
.mt-1 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center; }
.hide-mobile { }
@media (max-width: 720px) { .hide-mobile { display: none; } }
