/* ==========================================================================
   Baba Computer — stylesheet
   --------------------------------------------------------------------------
   COLOR SCHEME — change these variables to reskin the whole site.
   The palette is drawn from the blue squill (the family logo):
     squill blue  #057fe7   (petals / brand)
     deep blue    #0359a1
     ink          #011c32   (dark background of the flower)
     leaf green   #6aa84f   (the green stripe in the flower's centre)
   To adopt a different scheme, edit only the --brand / --accent / neutral
   values below. Everything else references them.
   ========================================================================== */

:root {
  /* Brand (squill) */
  --brand:        #057fe7;
  --brand-dark:   #0359a1;
  --brand-ink:    #011c32;
  --accent:       #6aa84f;

  /* Neutrals — light mode */
  --bg:           #f6f9fc;
  --surface:      #ffffff;
  --surface-alt:  #eef4fb;
  --border:       #dce6f1;
  --text:         #16222e;
  --muted:        #5a6b7b;

  /* Derived */
  --link:         var(--brand-dark);
  --shadow:       0 1px 2px rgba(1, 28, 50, .06), 0 8px 24px rgba(1, 28, 50, .06);
  --radius:       14px;
  --maxw:         860px;
  --font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark mode — honours system setting and the manual toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0b1620;
    --surface:     #12212e;
    --surface-alt: #16293a;
    --border:      #24384b;
    --text:        #e6eef6;
    --muted:       #9fb2c4;
    --link:        #6bb2f5;
    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg:          #0b1620;
  --surface:     #12212e;
  --surface-alt: #16293a;
  --border:      #24384b;
  --text:        #e6eef6;
  --muted:       #9fb2c4;
  --link:        #6bb2f5;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; color: var(--text); }
h2 {
  font-size: 1.6rem;
  margin-top: 2.6rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--surface-alt);
}
h3 { font-size: 1.2rem; margin-top: 1.8rem; color: var(--brand-dark); }

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  color: var(--text);
}
.nav-brand img { height: 30px; width: auto; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.nav-links a {
  padding: .4rem .75rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: .95rem;
}
.nav-links a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--brand-dark); background: var(--surface-alt); }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  width: 38px; height: 38px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }

/* ------------------------------------------------------- jump-to menu (nav)
   A <details> disclosure: native open/close and keyboard support, no library.
   Must sit after the .nav-links rules above so its link styling wins.        */
.jump { position: relative; }
.jump > summary {
  list-style: none;
  cursor: pointer;
  padding: .4rem .75rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
}
.jump > summary::-webkit-details-marker { display: none; }
.jump > summary:hover { background: var(--surface-alt); color: var(--text); }
.jump[open] > summary { background: var(--surface-alt); color: var(--brand-dark); }
.jump-short { display: none; }

.jump-menu {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: .35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.jump-menu a {
  display: block;
  padding: .45rem .6rem;
  border-radius: 7px;
  color: var(--text);
  font-weight: 500;
  font-size: .95rem;
}
.jump-menu a:hover { background: var(--surface-alt); color: var(--brand-dark); text-decoration: none; }

/* Anchor targets clear the sticky nav instead of hiding beneath it. */
section[id], h2[id], h3[id], .book-feature[id] { scroll-margin-top: 5rem; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------------ layout */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem 5rem; }

/* ------------------------------------------------------------------ hero */
.hero {
  text-align: center;
  padding: 4.75rem 1rem 3rem;
}
.hero h1 {
  font-size: 3.6rem;
  margin: 0 0 .35rem;
  letter-spacing: -1.5px;
  color: var(--brand-dark);
}
.hero .subtitle {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--text);
  margin: 0;
}
.hero-rule {
  display: block;
  width: 68px;
  height: 4px;
  margin: 1.4rem auto;
  border-radius: 4px;
  background: var(--accent);
}
.hero .tagline {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 0 1.75rem;
}

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.9rem;
  margin: 1.6rem 0;
}

/* featured book callout */
.book-feature {
  text-align: center;
  padding: 1.6rem 1.2rem 1.8rem;
  margin: .25rem 0 1.9rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-alt), var(--surface));
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 0 0 .4rem;
}
.feature-title {
  font-size: 1.75rem;
  margin: .1rem 0 .25rem;
  padding: 0;
  border: 0;
  color: var(--text);
}
.feature-sub {
  color: var(--muted);
  font-style: italic;
  font-size: 1.1rem;
  margin: 0 auto 1.3rem;
  max-width: 42ch;
}
.feature-lead {
  margin: 0 auto .9rem;
  max-width: 46ch;
}
.feature-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .7rem;
}
.feature-actions .btn small { font-weight: 500; opacity: .85; }
.feature-alt {
  margin: 1.4rem 0 .6rem;
  font-size: .95rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ lists */
.ministries { list-style: none; padding: 0; }
.ministries li {
  padding: .55rem 0 .55rem 1.6rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.ministries li:last-child { border-bottom: 0; }
.ministries li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.15rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--brand);
  color: #fff;
  padding: .6rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid var(--brand);
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.btn.secondary {
  background: transparent;
  background: color-mix(in srgb, var(--link) 8%, transparent);
  color: var(--link);
  border: 2px solid var(--link);
  padding: .55rem 1.05rem;
}
.btn.secondary:hover {
  background: var(--link);
  color: var(--surface);
  border-color: var(--link);
}

/* download rows */
.dl-list { list-style: none; padding: 0; margin: .5rem 0; }
.dl-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
}
.dl-list li:last-child { border-bottom: 0; }
.dl-icon {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--surface-alt);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.dl-list a { font-weight: 600; }
.dl-list small { color: var(--muted); font-weight: 400; }

audio { width: 100%; margin-top: .6rem; }

/* ------------------------------------------------------------------ footer */
footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  padding: 2rem 1.25rem 3rem;
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 620px) {
  body { font-size: 17px; }
  .hero { padding: 3rem 1rem 2.25rem; }
  .hero h1 { font-size: 2.5rem; }
  .nav-links a { padding: .4rem .5rem; }
  .card { padding: 1.3rem 1.2rem; }
  .jump > summary { padding: .4rem .5rem; }
  .jump-long { display: none; }
  .jump-short { display: inline; }
  /* Anchor to the trigger's right edge so the menu can't run off-screen. */
  .jump-menu { left: auto; right: 0; min-width: 190px; }
}
