/* ============================================================
   AAII — Afghanistan Artificial Intelligence Institute
   Design system: "The Loom"
   Lapis lazuli · Herat saffron · undyed wool · knot-grid structure
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* Colour */
  --lapis-950: #040d24;
  --lapis-900: #001848;   /* sampled from the logo */
  --lapis-800: #0a2a6b;
  --lapis-700: #16357e;
  --lapis-500: #2b58c7;
  --lapis-200: #b9c8ee;
  --saffron:   #e8a521;
  --bronze:    #a87848;   /* sampled from the logo */
  --saffron-d: #b87d0c;
  --pomegranate: #b23a2e;
  --wool:      #e4e2d6;
  --wool-dk:   #cfccbb;
  --bone:      #f3f3ee;
  --ink:       #0d1526;
  --ink-60:    #4a5568;
  --ink-40:    #6b7280;
  --white:     #ffffff;

  --link:       var(--lapis-700);
  --link-hover: var(--lapis-500);

  /* Fixed light text/icon color for content sitting on the navy accent
     sections (.hero, .section--dark, .card--dark, footer, chat header…).
     Those backgrounds never change with the theme, so this shouldn't either —
     unlike --bone/--white below, which ARE page-background/surface tokens
     and do get redefined for dark mode. */
  --on-dark:        #f3f3ee;
  --on-dark-strong: #ffffff;

  --header-bg: rgba(243, 243, 238, .86);

  --chip-beginner-bg: #e7f0e6;     --chip-beginner-bd: #c3ddc0;     --chip-beginner-fg: #2f5c2b;
  --chip-intermediate-bg: #fdf0d8; --chip-intermediate-bd: #ecd39a; --chip-intermediate-fg: #8a5f08;
  --chip-advanced-bg: #f6e0dd;     --chip-advanced-bd: #e2b3ad;     --chip-advanced-fg: #8c2d22;
  --note-ok-bg: #eaf5e9;  --note-ok-bd: #a9d3a5;  --note-ok-fg: #24571f;
  --note-err-bg: #f9ebe9; --note-err-bd: #e2b3ad; --note-err-fg: #7d2419;

  /* Type */
  --f-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --t-xs:   0.75rem;
  --t-sm:   0.875rem;
  --t-base: 1rem;
  --t-lg:   1.125rem;
  --t-xl:   clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --t-2xl:  clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --t-3xl:  clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  --t-4xl:  clamp(2.5rem, 1.6rem + 4.2vw, 5.25rem);

  /* Space & shape */
  --gap: 1.5rem;
  --pad-block: clamp(3.5rem, 7vw, 7rem);
  --wrap: 74rem;
  --wrap-narrow: 46rem;
  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 18px;
  --knot: 9px;

  --ring: 0 0 0 3px rgba(232, 165, 33, 0.55);
  --shadow-1: 0 1px 2px rgba(10, 22, 51, .06), 0 6px 20px rgba(10, 22, 51, .06);
  --shadow-2: 0 2px 4px rgba(10, 22, 51, .08), 0 18px 44px rgba(10, 22, 51, .12);
}

/* ---------- 1b. Dark mode ----------
   .section--dark / .card--dark / .hero / .pagehead / .site-footer already use
   the lapis-900/950 navy and stay as-is — they're deliberately the "richer"
   accent tier. Everything else (page background, cards, chips, links) gets a
   neutral dark surface here so the navy sections keep standing out.
   Applies automatically via prefers-color-scheme, or explicitly once the
   visitor picks a theme with the toggle (data-theme, saved to localStorage). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --wool: #1a1d24; --wool-dk: #2e333d; --bone: #101216; --white: #22262f; --ink: #f1f1ee; --ink-60: #b7bcc7; --ink-40: #8a909c; --link: var(--lapis-200); --link-hover: #dbe4f8; --shadow-1: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .35); --shadow-2: 0 2px 4px rgba(0, 0, 0, .55), 0 18px 44px rgba(0, 0, 0, .4); --chip-beginner-bg: #182a1a; --chip-beginner-bd: #2e4a33; --chip-beginner-fg: #8fd18f; --chip-intermediate-bg: #2e2610; --chip-intermediate-bd: #4a3c1a; --chip-intermediate-fg: #e0b64f; --chip-advanced-bg: #2e1917; --chip-advanced-bd: #4a2622; --chip-advanced-fg: #e08b80; --note-ok-bg: #16261a; --note-ok-bd: #2f4a33; --note-ok-fg: #8fd18f; --note-err-bg: #2b1917; --note-err-bd: #4a2622; --note-err-fg: #e08b80; --header-bg: rgba(16, 18, 22, .86); }
}
:root[data-theme="dark"] { --wool: #1a1d24; --wool-dk: #2e333d; --bone: #101216; --white: #22262f; --ink: #f1f1ee; --ink-60: #b7bcc7; --ink-40: #8a909c; --link: var(--lapis-200); --link-hover: #dbe4f8; --shadow-1: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .35); --shadow-2: 0 2px 4px rgba(0, 0, 0, .55), 0 18px 44px rgba(0, 0, 0, .4); --chip-beginner-bg: #182a1a; --chip-beginner-bd: #2e4a33; --chip-beginner-fg: #8fd18f; --chip-intermediate-bg: #2e2610; --chip-intermediate-bd: #4a3c1a; --chip-intermediate-fg: #e0b64f; --chip-advanced-bg: #2e1917; --chip-advanced-bd: #4a2622; --chip-advanced-fg: #e08b80; --note-ok-bg: #16261a; --note-ok-bd: #2f4a33; --note-ok-fg: #8fd18f; --note-err-bg: #2b1917; --note-err-bd: #4a2622; --note-err-fg: #e08b80; --header-bg: rgba(16, 18, 22, .86); }

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  overflow-x: hidden;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
ul, ol { padding-inline-start: 1.15rem; }
hr { border: 0; border-top: 1px solid var(--wool-dk); margin: 2rem 0; }


/* ---------- 3. Typography ---------- */
.display {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1.display { font-size: var(--t-4xl); }
h2.display { font-size: var(--t-3xl); }
h3.display { font-size: var(--t-2xl); }
h2, h3, h4 { line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin: 0 0 .85rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: var(--knot); height: var(--knot);
  background: var(--saffron);
  border-radius: 2px;
  flex: none;
}
.on-dark .eyebrow { color: var(--lapis-200); }
.lead { font-size: var(--t-lg); color: var(--ink-60); max-width: 60ch; }
.on-dark .lead { color: #c9d5f2; }
.small { font-size: var(--t-sm); color: var(--ink-40); }
.mono { font-family: var(--f-mono); font-size: var(--t-sm); letter-spacing: .02em; }

/* ---------- 4. Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.15rem, 4vw, 2.5rem); }
.wrap--narrow { max-width: var(--wrap-narrow); }
.section { padding-block: var(--pad-block); }
.section--tight { padding-block: clamp(2.25rem, 4vw, 3.5rem); }
.section--wool { background: var(--wool); }
.section--dark { background: var(--lapis-900); color: var(--on-dark); }
.section--dark h2, .section--dark h3 { color: var(--on-dark-strong); }
.section__head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }

.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-sidebar { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 900px) { .g-3, .g-4, .g-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .g-2, .g-3, .g-4, .g-sidebar { grid-template-columns: minmax(0, 1fr); } }

.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.center { text-align: center; margin-inline: auto; }
.skip {
  position: absolute; inset-inline-start: 1rem; top: -3rem; z-index: 200;
  background: var(--saffron); color: var(--ink); padding: .6rem 1rem;
  border-radius: var(--r-sm); font-weight: 600; transition: top .18s;
}
.skip:focus { top: 1rem; }

/* ---------- 5. Knot band (structural divider) ---------- */
.knotband {
  height: 14px;
  background-image:
    linear-gradient(90deg, var(--saffron) 0 9px, transparent 9px 100%),
    linear-gradient(90deg, var(--lapis-700) 0 9px, transparent 9px 100%);
  background-size: 54px 9px, 18px 9px;
  background-position: 0 3px, 0 3px;
  background-repeat: repeat-x;
  opacity: .9;
}
.knotband--dark { background-color: var(--lapis-950); }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.3rem;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--t-sm);
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--saffron); color: var(--lapis-950); }
.btn--primary:hover { background: #f2b435; color: var(--lapis-950); }
.btn--dark { background: var(--lapis-700); color: var(--on-dark-strong); }
.btn--dark:hover { background: var(--lapis-500); color: var(--on-dark-strong); }
.btn--outline { border-color: currentColor; color: var(--ink); background: transparent; }
.on-dark .btn--outline, .section--dark .btn--outline { color: var(--on-dark); }
.on-dark .btn--outline:hover, .section--dark .btn--outline:hover { background: rgba(255,255,255,.09); color: var(--on-dark-strong); }
.btn--outline:hover { background: rgba(13,21,38,.06); color: var(--ink); }
.btn--sm { padding: .5rem .9rem; font-size: var(--t-xs); }
.btn__arrow { transition: transform .16s ease; }
html[dir="rtl"] .btn__arrow { transform: scaleX(-1); }
.btn:hover .btn__arrow { transform: translateX(3px); }
html[dir="rtl"] .btn:hover .btn__arrow { transform: scaleX(-1) translateX(3px); }

/* ---------- 7. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wool-dk);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); flex: none; }
.brand__logo { height: 46px; width: auto; }
.site-footer .brand__logo { height: 58px; }
@media (max-width: 560px) { .brand__logo { height: 38px; } }
.nav { display: flex; align-items: center; gap: .15rem; }
.nav a {
  padding: .5rem .62rem; border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: 500; color: var(--ink-60);
  text-decoration: none; white-space: nowrap;
}
.nav a:hover { color: var(--lapis-700); background: rgba(22,53,126,.07); }
.nav a[aria-current="page"] { color: var(--lapis-800); font-weight: 600; box-shadow: inset 0 -2px 0 var(--saffron); }
.header__tools { display: flex; align-items: center; gap: .5rem; flex: none; }

.theme-toggle {
  display: grid; place-items: center; background: transparent; color: var(--ink);
  border: 1px solid var(--wool-dk); border-radius: var(--r-md);
  width: 36px; height: 36px; padding: 0; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--lapis-500); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.burger { display: none; background: transparent; border: 1px solid var(--wool-dk); border-radius: var(--r-md); padding: .5rem .6rem; cursor: pointer; }
.burger span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 3px 0; transition: transform .2s; }

@media (max-width: 1080px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset-block: 68px auto; inset-inline: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bone); border-bottom: 1px solid var(--wool-dk);
    padding: .5rem clamp(1.15rem, 4vw, 2.5rem) 1.25rem;
    box-shadow: var(--shadow-2);
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .75rem .25rem; border-bottom: 1px solid var(--wool); font-size: var(--t-base); }
}

/* ---------- 8. Hero / loom ---------- */
.hero { position: relative; background: var(--lapis-950); color: var(--on-dark); overflow: hidden; isolation: isolate; }
.hero__loom { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(115% 85% at 15% 12%, rgba(7,16,38,.92) 0%, rgba(7,16,38,.72) 42%, rgba(7,16,38,.35) 72%, rgba(7,16,38,.55) 100%);
}
html[dir="rtl"] .hero::after { background: radial-gradient(115% 85% at 85% 12%, rgba(7,16,38,.92) 0%, rgba(7,16,38,.72) 42%, rgba(7,16,38,.35) 72%, rgba(7,16,38,.55) 100%); }
.hero__inner { position: relative; z-index: 2; padding-block: clamp(4rem, 11vw, 8.5rem); }
.hero__body { max-width: 40rem; }
.hero h1 { color: var(--on-dark-strong); }
.hero h1 em { font-style: normal; color: var(--saffron); }
.hero .lead { margin-top: 1.4rem; font-size: clamp(1.05rem, .98rem + .4vw, 1.3rem); }
.hero__cta { margin-top: 2.2rem; }
.hero__meta {
  margin-top: 3rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .08em;
  text-transform: uppercase; color: var(--lapis-200);
}
.hero__meta span { display: inline-flex; align-items: center; gap: .5rem; }
.hero__meta span::before { content: ""; width: 6px; height: 6px; background: var(--saffron); border-radius: 1px; }
.hero__note {
  position: relative; z-index: 2;
  border-top: 1px solid rgba(185,200,238,.22);
  padding-block: 1rem 1.15rem;
  font-family: var(--f-mono); font-size: var(--t-xs);
  color: var(--lapis-200); line-height: 1.6;
}

/* Compact page hero for interior pages */
.pagehead { background: var(--lapis-900); color: var(--on-dark); position: relative; overflow: hidden; }
.pagehead__loom { position: absolute; inset: 0; opacity: .32; z-index: 0; }
.pagehead__inner { position: relative; z-index: 2; padding-block: clamp(3rem, 7vw, 5rem); }
.pagehead h1 { color: var(--on-dark-strong); font-size: var(--t-3xl); }
.pagehead .lead { margin-top: 1rem; }

/* ---------- 9. Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--wool-dk);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: .7rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.card { text-decoration: none; color: inherit; }
a.card:hover, .card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--lapis-200); }
.card h3 { margin: 0; font-size: var(--t-xl); font-family: var(--f-display); letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-60); font-size: var(--t-sm); }
.card__foot { margin-top: auto; padding-top: .5rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card--dark { background: var(--lapis-800); border-color: var(--lapis-700); color: var(--on-dark); }
.card--dark h3 { color: var(--on-dark-strong); }
.card--dark p { color: #c9d5f2; }
.card--flat { background: transparent; border-color: transparent; padding: 0; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: .3rem .55rem; border-radius: 999px;
  background: var(--wool); color: var(--ink-60); border: 1px solid var(--wool-dk);
  white-space: nowrap;
}
.chip--beginner  { background: var(--chip-beginner-bg); border-color: var(--chip-beginner-bd); color: var(--chip-beginner-fg); }
.chip--intermediate { background: var(--chip-intermediate-bg); border-color: var(--chip-intermediate-bd); color: var(--chip-intermediate-fg); }
.chip--advanced { background: var(--chip-advanced-bg); border-color: var(--chip-advanced-bd); color: var(--chip-advanced-fg); }
.chip--saffron { background: var(--saffron); border-color: var(--saffron-d); color: var(--lapis-950); }

/* Course card */
.course { position: relative; }
.course__code { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ink-40); letter-spacing: .1em; }
.course__meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: var(--t-xs); color: var(--ink-40); font-family: var(--f-mono); }
.course__list { margin: .25rem 0 0; padding-inline-start: 1.1rem; font-size: var(--t-sm); color: var(--ink-60); }
.course__list li { margin-bottom: .2rem; }

/* Video card */
.video {
  position: relative; display: block; text-decoration: none; color: inherit;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--wool-dk); background: var(--white);
}
.video__thumb {
  position: relative; aspect-ratio: 16 / 9;
  background: var(--lapis-900);
  display: grid; place-items: center;
}
.video__thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.video__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video__thumb:has(img)::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(4,13,36,0) 45%, rgba(4,13,36,.6) 100%);
}
.video__play {
  position: relative; z-index: 2;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--saffron); color: var(--lapis-950);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: transform .18s ease;
}
.video:hover .video__play { transform: scale(1.1); }
.video__dur {
  position: absolute; inset-block-end: .6rem; inset-inline-end: .6rem; z-index: 2;
  background: rgba(7,16,38,.85); color: var(--on-dark);
  font-family: var(--f-mono); font-size: 11px; padding: .15rem .4rem; border-radius: var(--r-sm);
}
.video__body { padding: 1rem 1.15rem 1.25rem; }
.video__body h3 { font-size: var(--t-base); font-family: var(--f-body); font-weight: 600; margin: 0 0 .3rem; }

/* "+N more" trigger card, shares .video's card chrome */
.video--more { cursor: pointer; }
.video--more:hover, .video--more:focus-visible { border-color: var(--lapis-500); }
.video--more:focus-visible { outline: none; box-shadow: var(--ring); }
.video__thumb--more { background: var(--wool); }
.video--more__num { font-family: var(--f-display); font-size: var(--t-3xl); font-weight: 700; color: var(--lapis-800); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.5rem; background: rgba(4, 13, 36, .65); }
.modal[hidden] { display: none; }
body.modal-open { overflow: hidden; }
.modal__panel { background: var(--bone); border-radius: var(--r-lg); width: 100%; max-width: 56rem; max-height: min(85vh, 46rem); overflow-y: auto; padding: 1.75rem clamp(1.25rem, 3vw, 2.25rem) 2.25rem; box-shadow: var(--shadow-2); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.modal__title { font-family: var(--f-display); font-size: var(--t-2xl); margin: 0 0 .3rem; letter-spacing: -.01em; }
.modal__sub { margin: 0; color: var(--ink-60); font-size: var(--t-sm); }
.modal__close { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--wool-dk); background: var(--white); font-size: 1.25rem; line-height: 1; cursor: pointer; color: var(--ink); }
.modal__close:hover { background: var(--wool); }
.modal__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 900px) { .modal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .modal__grid { grid-template-columns: minmax(0, 1fr); } }

/* Stat */
.stat { border-inline-start: 3px solid var(--saffron); padding-inline-start: 1rem; }
.stat__num { font-family: var(--f-display); font-size: var(--t-3xl); font-weight: 700; line-height: 1; letter-spacing: -.03em; display: block; }
.stat__label { font-size: var(--t-sm); color: var(--ink-60); margin-top: .4rem; display: block; }
.section--dark .stat__label { color: #c9d5f2; }

/* Testimonial */
.quote {
  background: var(--white); border: 1px solid var(--wool-dk);
  border-radius: var(--r-lg); padding: 1.75rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.quote__text { margin: 0; font-size: var(--t-lg); line-height: 1.5; font-family: var(--f-display); font-weight: 500; letter-spacing: -.01em; }
.quote__who { display: flex; align-items: center; gap: .75rem; margin-top: auto; }
.quote__avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--lapis-800); color: var(--on-dark-strong);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: var(--t-sm); font-weight: 600;
}
.quote__name { font-weight: 600; font-size: var(--t-sm); line-height: 1.3; }
.quote__role { font-size: var(--t-xs); color: var(--ink-40); }

/* Person */
.person { text-align: start; }
.person__photo {
  aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden;
  background: var(--lapis-800); margin-bottom: .85rem;
  display: grid; place-items: center;
}
.person__photo canvas { width: 100%; height: 100%; opacity: .8; }
.person__photo img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { font-size: var(--t-base); font-family: var(--f-body); font-weight: 600; margin: 0; }
.person__role { font-size: var(--t-sm); color: var(--ink-40); }

/* ---------- 10. Progress loom (learning tracker) ---------- */
.tracker { background: var(--white); border: 1px solid var(--wool-dk); border-radius: var(--r-lg); padding: 1.5rem; }
.loombar { display: flex; gap: 3px; flex-wrap: wrap; margin: .9rem 0 .6rem; }
.loombar i {
  width: 14px; height: 14px; border-radius: 2px;
  background: var(--wool); border: 1px solid var(--wool-dk);
  transition: background-color .25s ease, border-color .25s ease;
}
.loombar i[data-done="true"] { background: var(--saffron); border-color: var(--saffron-d); }
.loombar i[data-done="true"]:nth-child(4n) { background: var(--lapis-700); border-color: var(--lapis-800); }

/* ---------- 11. Accordion ---------- */
.acc { border-top: 1px solid var(--wool-dk); }
.acc details { border-bottom: 1px solid var(--wool-dk); }
.acc summary {
  cursor: pointer; padding: 1.15rem .25rem; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-weight: 600; font-size: var(--t-lg);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-family: var(--f-mono); font-size: 1.25rem; color: var(--saffron-d); flex: none; }
.acc details[open] summary::after { content: "–"; }
.acc__body { padding: 0 .25rem 1.35rem; color: var(--ink-60); }
.acc__body > :first-child { margin-top: 0; }

/* ---------- 12. Quiz ---------- */
.quiz { background: var(--white); border: 1px solid var(--wool-dk); border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 2rem); }
.quiz__q { font-size: var(--t-lg); font-weight: 600; margin: 0 0 1rem; }
.quiz__opts { display: grid; gap: .6rem; margin: 0 0 1.1rem; padding: 0; list-style: none; }
.quiz__opt {
  width: 100%; text-align: start; cursor: pointer;
  background: var(--bone); border: 1.5px solid var(--wool-dk);
  border-radius: var(--r-md); padding: .8rem 1rem; font-size: var(--t-sm);
  display: flex; align-items: center; gap: .7rem;
  transition: border-color .15s, background-color .15s;
}
.quiz__opt:hover:not([disabled]) { border-color: var(--lapis-500); background: var(--white); }
.quiz__opt[data-state="correct"] { border-color: var(--note-ok-fg); background: var(--note-ok-bg); }
.quiz__opt[data-state="wrong"] { border-color: var(--pomegranate); background: var(--note-err-bg); }
.quiz__opt[disabled] { cursor: default; }
.quiz__key { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ink-40); flex: none; }
.quiz__fb { font-size: var(--t-sm); min-height: 1.5rem; margin: 0 0 1rem; color: var(--ink-60); }
.quiz__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- 13. Forms ---------- */
.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: var(--t-sm); font-weight: 600; }
.field .hint { font-size: var(--t-xs); color: var(--ink-40); }
.field input, .field select, .field textarea {
  font: inherit; font-size: var(--t-sm);
  padding: .75rem .9rem;
  border: 1.5px solid var(--wool-dk); border-radius: var(--r-md);
  background: var(--white); color: var(--ink);
  width: 100%;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--lapis-500); }
.form-note { font-size: var(--t-sm); padding: .85rem 1rem; border-radius: var(--r-md); display: none; }
.form-note[data-show="true"] { display: block; }
.form-note[data-kind="ok"] { background: var(--note-ok-bg); border: 1px solid var(--note-ok-bd); color: var(--note-ok-fg); }
.form-note[data-kind="err"] { background: var(--note-err-bg); border: 1px solid var(--note-err-bd); color: var(--note-err-fg); }

.newsletter { background: var(--lapis-800); color: var(--on-dark); border-radius: var(--r-lg); padding: clamp(1.5rem, 4vw, 2.75rem); }
.newsletter h2 { color: var(--on-dark-strong); margin-top: 0; }
.newsletter p { color: #c9d5f2; }
.newsletter form { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.newsletter input {
  flex: 1 1 16rem; font: inherit; font-size: var(--t-sm);
  padding: .8rem 1rem; border-radius: var(--r-md);
  border: 1.5px solid rgba(185,200,238,.35);
  background: rgba(255,255,255,.07); color: var(--on-dark-strong);
}
.newsletter input::placeholder { color: rgba(201,213,242,.75); }
.newsletter input:focus { border-color: var(--saffron); background: rgba(255,255,255,.12); }

/* ---------- 14. Lists & tables ---------- */
.linklist { list-style: none; padding: 0; margin: 0; }
.linklist li { border-bottom: 1px solid var(--wool-dk); }
.linklist a {
  display: flex; align-items: baseline; gap: .9rem;
  padding: .95rem .25rem; text-decoration: none; color: inherit;
}
.linklist a:hover { background: rgba(22,53,126,.05); }
.linklist .mono { flex: none; color: var(--ink-40); }
.linklist strong { font-weight: 600; }
.linklist span.desc { color: var(--ink-60); font-size: var(--t-sm); display: block; }

.tablewrap { overflow-x: auto; border: 1px solid var(--wool-dk); border-radius: var(--r-lg); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th, td { text-align: start; padding: .8rem 1rem; border-bottom: 1px solid var(--wool); vertical-align: top; }
th { font-family: var(--f-mono); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-40); background: var(--bone); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- 15. Footer ---------- */
.site-footer { background: var(--lapis-950); color: #c9d5f2; padding-block: clamp(2.75rem, 6vw, 4.5rem) 1.75rem; }
.site-footer h2, .site-footer h3 { color: var(--on-dark-strong); }
.site-footer a { color: #c9d5f2; text-decoration: none; }
.site-footer a:hover { color: var(--saffron); text-decoration: underline; }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 2rem; }
@media (max-width: 860px) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: minmax(0, 1fr); } }
.footer__col h3 { font-size: var(--t-xs); font-family: var(--f-mono); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 1rem; color: var(--lapis-200); }
.footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; font-size: var(--t-sm); }
.socials { display: flex; gap: .5rem; margin-top: 1.25rem; }
.socials a {
  width: 38px; height: 38px; border-radius: var(--r-md);
  border: 1px solid rgba(185,200,238,.25);
  display: grid; place-items: center;
}
.socials a:hover { background: var(--saffron); border-color: var(--saffron); color: var(--lapis-950); }
.socials svg { width: 18px; height: 18px; }
.footer__base {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(185,200,238,.18);
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between;
  font-size: var(--t-xs); font-family: var(--f-mono);
}

/* ---------- 16. Utilities ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
.reveal { opacity: 0; transform: translateY(14px); }
.reveal[data-shown="true"] { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.filterbtn {
  cursor: pointer; background: var(--white); border: 1.5px solid var(--wool-dk);
  border-radius: 999px; padding: .45rem .9rem; font-size: var(--t-sm); color: var(--ink-60);
}
.filterbtn:hover { border-color: var(--lapis-500); color: var(--lapis-700); }
.filterbtn[aria-pressed="true"] { background: var(--lapis-800); border-color: var(--lapis-800); color: var(--on-dark-strong); }
.editable { box-shadow: inset 0 -.45em 0 rgba(232,165,33,.28); }
@media print {
  .site-header, .site-footer, .hero__loom, .pagehead__loom { display: none; }
  body { background: #fff; }
}

/* ---------- 17. Footer brand + late corrections ---------- */
.site-footer .brand { color: var(--on-dark-strong); }
.site-footer .brand__sub { color: var(--lapis-200); }
.site-footer .socials a { color: #c9d5f2; }
.site-footer ul a { text-decoration: none; }
.section--dark .linklist li { border-color: rgba(185, 200, 238, .2); }
.section--dark .linklist a:hover { background: rgba(255, 255, 255, .06); }
.section--dark .linklist .desc { color: #b9c8ee; }
.section--dark .acc details { border-color: rgba(185, 200, 238, .2); }
.section--dark ol, .section--dark ul { color: #c9d5f2; }
.section--dark ol strong, .section--dark ul strong { color: var(--on-dark-strong); }
.section--dark a { color: var(--saffron); }
.card--dark .chip { background: rgba(255, 255, 255, .1); border-color: rgba(185, 200, 238, .3); color: #dbe4f8; }
.card--dark .chip--saffron { background: var(--saffron); border-color: var(--saffron); color: var(--lapis-950); }
.card--dark .chip--beginner { background: #1d4b28; border-color: #2f6b3a; color: #cfe9d2; }
.card--dark .chip--intermediate { background: #5a4207; border-color: #7d5c0c; color: #f6e3b4; }
.card--dark .chip--advanced { background: #5c2019; border-color: #7d2c22; color: #f4cec9; }
.pagehead .lead { max-width: 52ch; }
.hero__meta span::before { border-radius: 1px; }

/* ---------- 18. Pre-launch status ---------- */
.chip--soon {
  background: var(--lapis-900); border-color: var(--lapis-800); color: #dbe4f8;
  letter-spacing: .1em;
}
.card--soon { position: relative; }
.card--soon h3, .card--soon .course__code { color: var(--ink); }
.card--soon p { color: var(--ink-60); }
.card--soon::after {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px;
  background: linear-gradient(90deg, var(--saffron) 0 33%, var(--bronze) 33% 66%, var(--lapis-700) 66%);
  border-start-start-radius: var(--r-lg); border-start-end-radius: var(--r-lg);
}
.step {
  display: flex; gap: 1rem; align-items: baseline;
  padding: 1.1rem 0; border-bottom: 1px solid var(--wool-dk);
}
.step__n {
  font-family: var(--f-mono); font-size: var(--t-sm); font-weight: 600;
  color: var(--saffron-d); flex: none; min-width: 2.25rem;
}
.step__body { flex: 1 1 auto; }
.step__body h3 { font-size: var(--t-lg); margin: 0 0 .2rem; font-family: var(--f-body); font-weight: 600; }
.step__body p { margin: 0; font-size: var(--t-sm); color: var(--ink-60); }
.step .chip { flex: none; align-self: center; }
.section--dark .step { border-color: rgba(185,200,238,.2); }
.section--dark .step__body p { color: #c9d5f2; }
.notice {
  border: 1.5px dashed var(--wool-dk); border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem; background: var(--white);
}
.notice p { margin: 0; }
.section--dark .notice { background: rgba(255,255,255,.05); border-color: rgba(185,200,238,.3); }


/* ---------- 19. Chat widget ---------- */
.chatbot { position: fixed; inset-block-end: 1.25rem; inset-inline-end: 1.25rem; z-index: 90; }
.chatbot__toggle {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--lapis-900); color: var(--on-dark-strong);
  display: grid; place-items: center; box-shadow: var(--shadow-2);
  transition: transform .18s ease;
}
.chatbot__toggle:hover { transform: scale(1.06); }
.chatbot__toggle svg { width: 26px; height: 26px; }
.chatbot__panel {
  position: fixed; inset-block-end: 5.5rem; inset-inline-end: 1.25rem;
  width: min(23rem, calc(100vw - 2.5rem)); height: min(32rem, calc(100vh - 8rem));
  background: var(--white); border: 1px solid var(--wool-dk); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); display: flex; flex-direction: column; overflow: hidden;
  z-index: 90;
}
.chatbot__panel[hidden] { display: none; }
.chatbot__head {
  background: var(--lapis-900); color: var(--on-dark-strong); padding: .9rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex: none;
}
.chatbot__head h3 { margin: 0; font-family: var(--f-display); font-size: var(--t-base); }
.chatbot__head p { margin: .1rem 0 0; font-size: 11px; color: #c9d5f2; }
.chatbot__close {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255,255,255,.12);
  color: var(--on-dark-strong); cursor: pointer; font-size: 1.1rem; line-height: 1; flex: none;
}
.chatbot__close:hover { background: rgba(255,255,255,.22); }
.chatbot__log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .65rem; background: var(--bone); }
.chatbot__msg { max-width: 88%; padding: .55rem .75rem; border-radius: var(--r-md); font-size: var(--t-sm); line-height: 1.5; white-space: pre-wrap; }
.chatbot__msg--bot { align-self: flex-start; background: var(--white); border: 1px solid var(--wool-dk); color: var(--ink); }
.chatbot__msg--user { align-self: flex-end; background: var(--lapis-800); color: var(--on-dark-strong); }
.chatbot__msg--typing { align-self: flex-start; color: var(--ink-40); font-style: italic; }
.chatbot__form { flex: none; display: flex; gap: .5rem; padding: .75rem; border-block-start: 1px solid var(--wool-dk); background: var(--white); }
.chatbot__input {
  flex: 1; border: 1px solid var(--wool-dk); border-radius: var(--r-md); padding: .55rem .7rem;
  font: inherit; font-size: var(--t-sm); resize: none; max-height: 6rem;
}
.chatbot__input:focus { outline: none; box-shadow: var(--ring); border-color: var(--lapis-500); }
.chatbot__send {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--saffron); color: var(--lapis-950); display: grid; place-items: center;
}
.chatbot__send:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) {
  .chatbot, .chatbot__panel { inset-inline-end: .75rem; }
  .chatbot__panel { inset-block-end: 5rem; }
}
