/* NeuroLearn Home — Accessible, calm, high-contrast, dyslexia-friendly */

:root {
  /* Light theme with a slight purple tint (accessibility-first) */
  --bg: #F7F6FC;              /* very light lavender */
  --surface: #FFFFFF;
  --text: #1B1630;            /* deep indigo for strong contrast */
  --muted: #3B3456;

  --primary: #6B5BD6;         /* calm purple */
  --primary-strong: #5446B3;  /* stronger purple for buttons/links */
  --accent: #5AA6D6;          /* soft blue accent (keeps it calm, not loud) */

  --border: #DDD9EF;          /* lavender-grey border */
  --focus: #FFB000;
  --shadow: 0 8px 26px rgba(27, 22, 48, 0.10);
  --radius: 12px;
  --max: 1120px;

  --step--1: 0.95rem;
  --step-0: 1.05rem;
  --step-1: 1.25rem;
  --step-2: 1.55rem;
  --step-3: 1.95rem;
  --step-4: 2.4rem;
}

/* Dark theme (toggle via html[data-theme="dark"]) */
html[data-theme="dark"] {
  --bg: #0E0C1A;
  --surface: #15122A;
  --text: #F3F1FF;
  --muted: #C8C2E6;

  --primary: #A79BFF;
  --primary-strong: #B8AEFF;
  --accent: #7BC6FF;

  --border: #2B2743;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.40);
  --focus: #FFD24D;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", Arial;
  font-size: var(--step-0);
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  letter-spacing: 0.005em;
  word-spacing: 0.01em;
}

a { color: var(--primary-strong); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }

.container { width: min(var(--max), calc(100% - 2rem)); margin: 0 auto; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--surface);
  border: 2px solid var(--focus);
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 999;
}
.skip-link:focus { top: 0.75rem; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 252, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .site-header {
  background: rgba(14, 12, 26, 0.88);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  line-height: 0;
}
.brand-mark svg { width: 30px; height: 30px; display: block; }
.brand-name { font-weight: 850; line-height: 1.1; }
.brand-tag { font-size: var(--step--1); color: var(--muted); line-height: 1.25; }

.nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: nowrap; }
.nav a,
.nav .theme-toggle {
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav a {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  line-height: 1.2;
}
.nav a[aria-current="page"] {
  background: var(--surface);
  border: 1px solid var(--border);
}
.nav a:hover { background: var(--surface); }
.nav .theme-toggle {
  margin-left: 0.2rem;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  color: var(--text);
}
@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem 1rem;
    gap: 0.4rem;
  }
  .nav.open { display: grid; }
  .nav a,
  .nav .theme-toggle {
    padding: 0.65rem 0.75rem;
  }
  .nav .theme-toggle {
    margin-left: 0;
    width: fit-content;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.92rem 1.05rem;
  border-radius: 10px;
  border: 2px solid transparent;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.btn-primary { color: #fff; background: var(--primary-strong); }
.btn-primary:hover { background: var(--primary); }
.btn-secondary { color: var(--text); background: var(--surface); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); }

.hero { padding: 2.2rem 0 1.1rem; }
.hero-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(1200px 380px at 30% 0%, rgba(31, 138, 112, 0.18), transparent 60%),
    radial-gradient(900px 360px at 80% 10%, rgba(11, 110, 130, 0.18), transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.65rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.2rem;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("illustrations/hero-calm-bg.svg");
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  filter: blur(1px);
  transform: scale(1.05);
  z-index: 0;
}

.hero-panel > * { position: relative; z-index: 1; }

html[data-theme="dark"] .hero-panel::before {
  opacity: 0.10;
  filter: blur(1.2px);
}

@media (max-width: 860px) { .hero-panel { grid-template-columns: 1fr; } }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 12px;
  font-weight: 750;
  color: var(--muted);
}
.kicker svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

html[data-theme="dark"] .kicker {
  background: rgba(21, 18, 42, 0.72);
}

h1 { font-size: clamp(1.85rem, 3.2vw, var(--step-4)); line-height: 1.18; margin: 0.75rem 0 0.4rem; }
.lead { font-size: var(--step-1); color: var(--muted); margin: 0 0 1rem; max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Homepage: slightly larger hero for readability */
.home .hero { padding: 2.6rem 0 1.3rem; }
.home h1 { font-size: clamp(2.05rem, 3.6vw, 2.85rem); line-height: 1.16; }
.home .lead { font-size: clamp(1.28rem, 2.0vw, 1.45rem); }

.hero-aside {
  border: 1px dashed rgba(107, 91, 214, 0.55);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(247, 246, 252, 0.6);
}

html[data-theme="dark"] .hero-aside {
  background: rgba(14, 12, 26, 0.35);
  border-color: rgba(167, 155, 255, 0.55);
}

.section { padding: 1.8rem 0; }
.section h2 { font-size: var(--step-2); margin: 0 0 0.75rem; letter-spacing: 0.002em; }
.section p { margin: 0.5rem 0; max-width: 75ch; }

.grid { display: grid; gap: 1rem; }
.grid.cards { grid-template-columns: repeat(12, 1fr); }

.card {
  grid-column: span 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 6px 18px rgba(11,34,48,0.06);
}
@media (max-width: 980px) { .card { grid-column: span 6; } }
@media (max-width: 600px) { .card { grid-column: span 12; } }
.card h3 { margin: 0.2rem 0 0.35rem; font-size: var(--step-1); }
.card p { margin: 0; color: var(--muted); }

.icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(11, 110, 130, 0.12);
  border: 1px solid rgba(11, 110, 130, 0.24);
}
.icon svg { width: 22px; height: 22px; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(31, 138, 112, 0.10);
  color: var(--muted);
  font-weight: 750;
  font-size: var(--step--1);
}

.badge-soft {
  background: rgba(107, 91, 214, 0.12);
  border-color: rgba(107, 91, 214, 0.28);
  color: var(--text);
}

.nav a.nav-emphasis {
  border: 1px solid rgba(107, 91, 214, 0.35);
  background: rgba(107, 91, 214, 0.10);
}

.nav a.nav-emphasis:hover {
  border-color: rgba(107, 91, 214, 0.55);
}

.nav-badge {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 850;
  background: rgba(31, 138, 112, 0.14);
  border: 1px solid rgba(31, 138, 112, 0.26);
  color: var(--text);
}

.card-figure {
  margin: 0.9rem 0 0;
  padding: 0.8rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .card-figure {
  background: rgba(14, 12, 26, 0.35);
}

.card-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.card-figure figcaption {
  margin-top: 0.55rem;
  font-size: var(--step--1);
  color: var(--muted);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.media-item {
  grid-column: span 6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(11,34,48,0.06);
}

@media (max-width: 980px) { .media-item { grid-column: span 12; } }

.media-item img {
  display: block;
  width: 100%;
  height: auto;
}

.media-item .media-caption {
  padding: 0.9rem 1rem;
}

.media-item .media-caption p {
  margin: 0;
  color: var(--muted);
}

.faq {
  margin-top: 1rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  box-shadow: 0 6px 18px rgba(11,34,48,0.05);
}

.faq details + details { margin-top: 0.75rem; }

.faq summary {
  cursor: pointer;
  font-weight: 850;
}

.faq summary:focus-visible {
  outline: 3px solid rgba(107, 91, 214, 0.55);
  outline-offset: 4px;
  border-radius: 10px;
}

.faq .help { margin-top: 0.65rem; }

.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;
}

.form-success {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid rgba(31, 138, 112, 0.30);
  background: rgba(31, 138, 112, 0.10);
  color: var(--text);
}

.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  border-top: 1px solid var(--border);
  background: rgba(247, 246, 252, 0.88);
  backdrop-filter: blur(10px);
}

html[data-theme="dark"] .sticky-bar {
  background: rgba(12, 10, 22, 0.82);
}

.sticky-bar .sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

body.has-sticky-bar {
  padding-bottom: 5.25rem;
}

@media (max-width: 600px) {
  body.has-sticky-bar { padding-bottom: 6.25rem; }
  .sticky-bar .sticky-inner { flex-direction: column; align-items: stretch; }
  .sticky-bar .sticky-text strong { font-size: var(--step-0); }
}

.sticky-bar .sticky-text {
  min-width: 0;
}

.sticky-bar .sticky-text strong { display: block; }

.sticky-bar .sticky-text span {
  display: block;
  color: var(--muted);
  font-size: var(--step--1);
  margin-top: 0.15rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover { border-color: rgba(107, 91, 214, 0.55); }

.btn-print {
  background: rgba(107, 91, 214, 0.08);
  border-color: rgba(107, 91, 214, 0.22);
}

.btn-print:hover {
  border-color: rgba(107, 91, 214, 0.55);
  background: rgba(107, 91, 214, 0.14);
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
@media (max-width: 780px) { .callout { flex-direction: column; } }

.testimonials {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
.quote {
  grid-column: span 4;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}
@media (max-width: 980px) { .quote { grid-column: span 6; } }
@media (max-width: 600px) { .quote { grid-column: span 12; } }
.quote p { margin: 0 0 0.6rem; color: var(--muted); }

.quote footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-weight: 850;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
}

.quote footer small {
  display: block;
  font-weight: 650;
  color: var(--muted);
  margin-top: 0.1rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(11,34,48,0.06);
}
.table th, .table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.table th { background: rgba(11, 110, 130, 0.08); }
.table tr:last-child td { border-bottom: none; }

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: 0 6px 18px rgba(11,34,48,0.06);
  max-width: 760px;
}
label { font-weight: 800; display: block; margin: 0.9rem 0 0.35rem; }
input, textarea, select {
  width: 100%;
  padding: 0.8rem;
  font: inherit;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
textarea { min-height: 140px; }
.help { color: var(--muted); font-size: var(--step--1); margin: 0.35rem 0 0; }

.notice {
  border-left: 5px solid var(--accent);
  background: rgba(31, 138, 112, 0.08);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.6rem 0;
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }
.small { font-size: var(--step--1); }

hr { border: none; border-top: 1px solid var(--border); margin: 1.2rem 0; }

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

@media print {
  body.has-print-article .site-header,
  body.has-print-article .site-footer,
  body.has-print-article .hero-actions,
  body.has-print-article .section[aria-label="CTA"] {
    display: none !important;
  }

  body.has-print-article {
    background: #fff;
    color: #000;
  }

  body.has-print-article .container {
    max-width: none;
    padding: 0;
  }

  body.has-print-article .section,
  body.has-print-article article.section {
    padding: 0;
  }

  body.has-print-article a {
    color: inherit;
    text-decoration: none;
  }
}
