/* ============================================================
   AI for Humans - styles
   Palette & type from AIFH-visual-guidelines.md
   ============================================================ */

:root {
  --cream:      #F7F6F2;
  --navy:       #1F344D;
  --blue:       #3E78B2;
  --blue-dark:  #2f5d8c;
  --ink:        #4C4C4C;
  --blue-soft:  #DCE8F2;
  --sage:       #8A9A87;
  --line:       #e4e0d8;
  --surface:    #ffffff;
  --good:       #4f7a4a;

  --font-display: 'Abel', system-ui, sans-serif;
  --font-body:    'Afacad', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius: 12px;
  --maxw: 1120px;
  --shadow: 0 1px 2px rgba(31,52,77,.05), 0 10px 30px rgba(31,52,77,.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: .005em;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue); font-weight: 500;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--navy); color: #fff;
  border: none; border-radius: 999px;
  padding: 13px 26px; font-size: 16px; font-weight: 500;
  font-family: var(--font-body); cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.btn:hover { background: #16283c; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); }
.btn.primary:hover { background: var(--blue-dark); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.ghost:hover { background: rgba(31,52,77,.05); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,246,242,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.logo:hover { text-decoration: none; }
.logo .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--navy); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-size: 15px; }
.logo .word { font-family: var(--font-display); font-size: 21px; letter-spacing: .01em; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { font-family: var(--font-display); font-size: 17px; color: var(--navy); }
.site-nav .np { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--blue); text-transform: uppercase; }

/* ---------- site banner (top of home) ---------- */
.site-banner { background: var(--cream); padding: 14px 0 0; }
.site-banner img {
  display: block; width: 100%; height: auto;
  max-width: 1180px; margin: 0 auto;
  border-radius: 12px;
}
@media (max-width: 700px) { .site-banner { padding-top: 8px; } .site-banner img { border-radius: 8px; } }

/* ---------- curved photo banner ---------- */
.curve-band { position: relative; background: var(--cream); overflow: hidden; }
.curve-band .strip {
  display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 14px;
  padding: 6px 0 0;
}
.curve-band .strip figure { margin: 0; height: 300px; border-radius: 10px; overflow: hidden; background: var(--blue-soft); }
.curve-band .strip img { width: 100%; height: 100%; object-fit: cover; }
.curve-band.arc .strip {
  -webkit-mask: radial-gradient(120% 90% at 50% -12%, #000 60%, transparent 61%);
          mask: radial-gradient(120% 90% at 50% -12%, #000 60%, transparent 61%);
}
.curve-band.single .strip { grid-template-columns: 1fr; }
.curve-band.single figure { height: auto; aspect-ratio: 1230 / 300; }
.curve-band.split .strip { grid-template-columns: 1fr 1fr; }
.curve-band.split figure { height: 300px; }
@media (max-width: 720px) {
  .curve-band .strip { grid-template-columns: 1fr; }
  .curve-band.split figure { height: 190px; }
  .curve-band.split figure:nth-child(2) { display: none; }
}

/* ---------- hero ---------- */
.hero { padding: 74px 0 30px; }
.hero .pill {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--navy); background: var(--blue-soft);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); max-width: 15ch; }
.hero .lede { font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--ink); margin-top: 22px; max-width: 52ch; }
.hero .cta-row { margin-top: 30px; display: flex; gap: 13px; flex-wrap: wrap; }
.hero .meta { margin-top: 26px; display: flex; gap: 26px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); letter-spacing: .02em; }
.hero .meta strong { color: var(--navy); font-weight: 500; }

/* ---------- generic section ---------- */
.section { padding: 66px 0; }
.section.tight { padding: 44px 0; }
.section h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
.section .sub { color: var(--ink); margin-top: 10px; margin-bottom: 34px; max-width: 56ch; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- statement slide ---------- */
.statement { text-align: center; padding: 84px 0; }
.statement.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.statement p { font-family: var(--font-display); color: var(--navy); font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1.15; }
.statement em { display: block; font-family: var(--font-body); font-style: italic; color: var(--ink); font-size: clamp(1.05rem, 2vw, 1.35rem); margin-top: 16px; }

/* ---------- instructor (prominent) ---------- */
.instructor-feature { background: var(--navy); color: var(--cream); }
.instructor-feature h2, .instructor-feature h3 { color: #fff; }
.instructor-feature .eyebrow { color: var(--blue-soft); }
.instructor-feature .wrap { padding-top: 66px; padding-bottom: 66px; }
.if-grid { display: grid; grid-template-columns: 320px 1fr; gap: 46px; align-items: start; }
.if-portrait { border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: #2b435c; }
.if-portrait img { width: 100%; height: 100%; object-fit: cover; }
.instructor-feature h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 8px; }
.instructor-feature .role { font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em; color: var(--blue-soft); margin: 10px 0 18px; }
.instructor-feature p { color: #e7ecf1; margin-bottom: 14px; max-width: 60ch; }
.cred-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 22px; }
.cred {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em;
  background: rgba(220,232,242,.12); color: #fff; padding: 7px 12px; border-radius: 999px;
}
.if-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.if-photos figure { margin: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 16/10; background: #2b435c; }
.if-photos img { width: 100%; height: 100%; object-fit: cover; }
.if-photos figcaption { display: none; }
@media (max-width: 820px) {
  .if-grid { grid-template-columns: 1fr; gap: 26px; }
  .if-portrait { max-width: 240px; }
}

/* ---------- feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 26px; }
.feature h3 { font-size: 1.15rem; margin-bottom: 6px; }
.feature p { font-size: .98rem; }
.feature .ico { font-size: 24px; margin-bottom: 10px; }

/* ---------- home: curriculum teaser ---------- */
.mini-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 12px; margin-top: 8px; }
.mini-mod { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 14px 16px; }
.mini-mod .n { font-family: var(--font-mono); font-size: 11px; color: var(--blue); letter-spacing: .08em; }
.mini-mod h4 { font-size: 1.02rem; margin-top: 3px; }
.mini-mod span { font-family: var(--font-mono); font-size: 11px; color: var(--ink); }

/* ---------- curriculum view ---------- */
.view { display: none; }
body[data-view="home"] .view-home { display: block; }
body[data-view="curriculum"] .view-curriculum { display: block; }
body[data-view="lesson"] .view-lesson { display: block; }

.module { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; overflow: hidden; }
.module > summary { list-style: none; cursor: pointer; padding: 18px 20px; display: flex; align-items: center; gap: 16px; }
.module > summary::-webkit-details-marker { display: none; }
.module .m-num { flex: none; width: 40px; height: 40px; border-radius: 9px; background: var(--blue-soft); display: grid; place-items: center; font-family: var(--font-display); font-size: 16px; color: var(--navy); }
.module .m-head { flex: 1; min-width: 0; }
.module .m-head h3 { font-size: 1.15rem; }
.module .m-head p { font-size: .92rem; color: var(--ink); margin-top: 2px; }
.module .m-stat { font-family: var(--font-mono); font-size: 12px; color: var(--ink); flex: none; }
.module .chev { flex: none; transition: transform .2s ease; color: var(--blue); }
.module[open] .chev { transform: rotate(180deg); }

.lesson-list { border-top: 1px solid var(--line); }
.lesson-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px 13px 18px; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--line);
  font-family: inherit; text-align: left; cursor: pointer; color: var(--navy);
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: var(--cream); }
.lesson-row .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; color: #fff; }
.lesson-row.done .tick { background: var(--good); border-color: var(--good); }
.lesson-row .l-title { flex: 1; min-width: 0; font-size: 1rem; }
.lesson-row .l-code { font-family: var(--font-mono); color: var(--blue); font-size: .78rem; margin-right: 8px; letter-spacing: .03em; }
.lesson-row .l-dur { flex: none; font-family: var(--font-mono); font-size: .78rem; color: var(--ink); }
.lesson-row.active { background: var(--blue-soft); }

/* next lesson to watch - clear call to action */
.lesson-row.next { background: var(--blue-soft); }
.lesson-row.next:hover { background: #cfe0ef; }
.lesson-row.next .tick { background: var(--blue); border-color: var(--blue); color: #fff; }
.lesson-row.next .l-title { font-weight: 600; }
.l-next-tag {
  flex: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: #fff; background: var(--blue);
  padding: 3px 8px; border-radius: 999px;
}
.module.has-next { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.module.has-next > summary .m-num { background: var(--blue); color: #fff; }

/* ---------- progress bits ---------- */
.bar { height: 8px; background: var(--blue-soft); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--good); width: 0; transition: width .3s ease; }
.progress-headline { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.progress-headline .pct { font-family: var(--font-display); font-size: 2rem; color: var(--navy); }
.progress-headline .cnt { font-family: var(--font-mono); font-size: 12px; color: var(--ink); }

.resume-card {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  border: 1px solid var(--line); background: var(--surface);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 30px;
}
.resume-card .rc-text { flex: 1; min-width: 220px; }
.resume-card .rc-text strong { display: block; font-family: var(--font-display); font-size: 1.1rem; color: var(--navy); font-weight: 400; }
.resume-card .rc-text span { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); }
.resume-card .bar { width: 100%; margin-top: 10px; }

/* ---------- lesson / player ---------- */
.view-lesson { padding: 26px 0 90px; }
.player-grid { display: grid; grid-template-columns: 1fr 340px; gap: 34px; align-items: start; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.video-frame iframe, .video-frame #ytplayer { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.player-main .back { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; margin-bottom: 14px; background: none; border: none; cursor: pointer; }
.player-main .back:hover { color: var(--navy); }
.player-main h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 18px 0 6px; }
.player-main .l-meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink); margin-bottom: 18px; letter-spacing: .02em; }
.player-main .l-desc { white-space: pre-wrap; color: var(--ink); margin: 8px 0 22px; max-width: 62ch; }
.complete-block { margin: 6px 0 0; }
.complete-block .btn { width: 100%; justify-content: center; }
.auto-note { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); margin-top: 8px; text-align: center; }
.nav-row { display: flex; justify-content: space-between; margin-top: 16px; gap: 12px; }
.nav-row > * { flex: 1; }
.nav-row .btn { justify-content: center; }

.playlist-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; position: sticky; top: 82px; }
.playlist-panel .pp-head { padding: 15px 16px; border-bottom: 1px solid var(--line); }
.playlist-panel .pp-head strong { font-family: var(--font-display); font-size: 1rem; color: var(--navy); font-weight: 400; }
.playlist-panel .pp-head .cnt { font-family: var(--font-mono); font-size: 11px; color: var(--ink); margin-top: 6px; display: block; }
.playlist-panel .pp-scroll { max-height: 64vh; overflow-y: auto; }
.pp-module-title { padding: 11px 16px 4px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 44px 0; font-family: var(--font-mono); font-size: 13px; color: var(--ink); background: var(--surface); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; align-items: center; }
.site-footer a { color: var(--navy); }
.reset-link { background: none; border: none; color: var(--ink); font-family: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }

/* ---------- placeholder styling for missing images ---------- */
img[data-ph] { background: repeating-linear-gradient(45deg, var(--blue-soft), var(--blue-soft) 12px, #e9f0f7 12px, #e9f0f7 24px); }

@media (max-width: 860px) {
  .player-grid { grid-template-columns: 1fr; }
  .playlist-panel { position: static; }
  .if-photos { grid-template-columns: 1fr 1fr; }
  .hero { padding: 50px 0 24px; }
}
