/* Fly With Stu. One stylesheet, no build step. */

:root {
    --navy-900: #071632;
    --navy-800: #0a1f44;
    --navy-700: #10305f;
    --navy-600: #1a4280;
    --blue: #1f6fd6;
    --blue-dark: #1859ad;
    --gold: #f5a623;
    --gold-soft: #ffd27a;
    --green: #0fa968;
    --red: #e5484d;
    --ink: #0f2140;
    --muted: #64748b;
    --line: #e3e8f1;
    --page: #f3f5fa;
    --card: #ffffff;
    --radius: 18px;
    --shadow: 0 1px 2px rgba(15, 33, 64, .06), 0 8px 24px rgba(15, 33, 64, .06);
    --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute must win over component display rules such as .btn. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--page);
}

body.dark { background: var(--navy-800); color: #fff; }

img, svg { max-width: 100%; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.dark .muted, .band .muted { color: #a9b8d4; }
.small { font-size: .875rem; }
.right { margin-left: auto; }
.stack > * + * { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Header */

.site-header { background: var(--navy-800); color: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 20px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--gold); }
.brand span span { color: var(--gold); }
.nav { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav form { margin: 0; }
.pill {
    display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28);
    color: #fff; background: transparent; text-decoration: none; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
}
.pill:hover { border-color: #fff; }
.pill.active { background: #fff; color: var(--navy-800); border-color: #fff; }

/* Title band under the header, as on a dashboard page */

.band { background: linear-gradient(120deg, var(--navy-800), var(--navy-700)); color: #fff; padding: 22px 0 76px; }
.band h1 { margin-bottom: .2em; }
.band p { margin: 0; color: #b8c6de; }
.band a { color: #cfe0ff; }
.crumbs { font-size: .875rem; margin-bottom: 10px; color: #a9b8d4; }
.crumbs a { color: #cfe0ff; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.band + main { margin-top: -52px; }
main { padding-bottom: 64px; }

/* Cards */

.card { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.card.tight { padding: 20px; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.with-side { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 960px) { .with-side { grid-template-columns: 1fr; } }

/* Buttons and badges */

.btn {
    display: inline-block; padding: 12px 22px; border-radius: 999px; border: 0; background: var(--blue); color: #fff;
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: 0 6px 16px rgba(31, 111, 214, .28);
}
.btn:hover { background: var(--blue-dark); }
.btn.gold { background: var(--gold); color: var(--navy-900); box-shadow: 0 6px 18px rgba(245, 166, 35, .35); }
.btn.gold:hover { background: #ffb941; }
.btn.ghost { background: transparent; color: var(--blue); box-shadow: none; border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--blue); background: transparent; }
.btn.danger { background: transparent; color: var(--red); box-shadow: none; border: 1px solid #f3c6c8; }
.btn.small { padding: 7px 14px; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.badge.green { background: #d9f6ea; color: #067a49; }
.badge.gold { background: #fff0cf; color: #8a5a00; }
.badge.grey { background: #e9edf5; color: #55637a; }
.badge.blue { background: #dce9fb; color: #164f9c; }
.badge.red { background: #fde3e4; color: #b3262b; }

.notice { padding: 12px 16px; border-radius: 12px; background: #e6f6ee; border: 1px solid #bfe8d3; color: #0b5c3a; margin-bottom: 20px; }
.notice.error { background: #fde8e9; border-color: #f6c5c7; color: #92191e; }
.notice.draft { background: #fff6df; border-color: #f6dd9f; color: #6b4a00; }

/* Forms */

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=search], select, textarea {
    width: 100%; padding: 11px 14px; border: 1px solid #cdd5e3; border-radius: 12px; font: inherit; color: var(--ink); background: #fff;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; min-height: 420px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .pill:focus-visible { outline: 3px solid rgba(31, 111, 214, .35); outline-offset: 1px; }
.field { margin-bottom: 18px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.fields { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; }

/* Tables (admin) */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; text-decoration: none; }

/* Landing page */

.hero { color: #fff; background: linear-gradient(180deg, var(--navy-900), var(--navy-800)); }
.hero .wrap { padding-top: 28px; padding-bottom: 72px; }
/* The channel banner, cropped to its middle band as it appears on YouTube. */
.hero-banner { aspect-ratio: 5.4 / 1; min-height: 120px; border-radius: var(--radius); background: var(--navy-700) url(/img/banner.jpg) center 46% / cover no-repeat; margin-bottom: 48px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.8rem); max-width: 13em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.lead { font-size: 1.2rem; max-width: 34em; color: #dbe5f6; }
.eyebrow { font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.signup { display: flex; gap: 10px; flex-wrap: wrap; max-width: 520px; margin-top: 26px; }
.signup input { flex: 1 1 240px; border: 0; padding: 14px 18px; border-radius: 999px; }
.signup-note { font-size: .875rem; color: #b8c6de; margin-top: 10px; }

.section { padding: 64px 0; }
.dark .section h2 { font-size: 1.8rem; }
.panel { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 24px; }
.panel h3 { color: #fff; }
.panel p { color: #b8c6de; margin: 0; }
.panel .num { color: var(--gold); font-weight: 800; font-size: .8rem; letter-spacing: .1em; }
.about { display: grid; grid-template-columns: 160px 1fr; gap: 28px; align-items: center; }
.about img { border-radius: 50%; border: 4px solid var(--gold); }
@media (max-width: 640px) { .about { grid-template-columns: 1fr; } .about img { width: 120px; } }

.site-footer { background: var(--navy-900); color: #a9b8d4; padding: 28px 0; font-size: .9rem; }
.site-footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: #cfe0ff; text-decoration: none; }

/* Course dashboard */

.progress { height: 8px; border-radius: 999px; background: #e3e8f1; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.module-head { display: flex; gap: 16px; align-items: flex-start; }
.module-num { flex: 0 0 44px; height: 44px; border-radius: 12px; background: var(--navy-800); color: #fff; font-weight: 800; display: grid; place-items: center; }
.lesson-list { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.lesson-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.lesson-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.lesson-list a { font-weight: 600; text-decoration: none; color: var(--ink); }
.lesson-list a:hover { color: var(--blue); }
.lesson-list .soon { color: var(--muted); }
.tick { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid #c8d1e0; display: grid; place-items: center; font-size: .75rem; color: #fff; }
.tick.done { background: var(--green); border-color: var(--green); }
.tick.lock { border-style: dashed; }

/* Lesson page */

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); color: #fff; display: grid; place-items: center; text-align: center; box-shadow: var(--shadow); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .play { width: 72px; height: 72px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); display: grid; place-items: center; margin: 0 auto 12px; font-size: 1.6rem; }
.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose table { margin: 1em 0; font-size: .95rem; }
.protected { -webkit-user-select: none; user-select: none; }
.objectives { background: #eef4fd; border: 1px solid #d3e2f8; border-radius: 14px; padding: 18px 22px; }
.keypoints { background: #fff8e8; border: 1px solid #f6dd9f; border-radius: 14px; padding: 18px 22px; }
.objectives ul, .keypoints ul { margin: 0; padding-left: 1.2em; }
.objectives h3, .keypoints h3 { margin-bottom: .6em; }
.interactive { border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 1.5em 0; background: #f8fafd; -webkit-user-select: none; user-select: none; }
.interactive input[type=range] { width: 100%; }
.readouts { display: flex; gap: 24px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.readouts b { display: block; font-size: 1.3rem; }
@media print { .protected, .quiz { display: none !important; } }

/* Quiz */

.quiz-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.quiz-bar .progress { flex: 1; }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; padding: 4px 12px; border-radius: 999px; background: #e9edf5; }
.timer.low { background: #fde3e4; color: #b3262b; }
.stem { font-size: 1.2rem; font-weight: 700; margin-bottom: 18px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; margin-bottom: 10px; cursor: pointer; font-weight: 500; }
.option:hover { border-color: #b9c6dc; }
.option input { margin-top: 5px; width: 17px; height: 17px; flex: 0 0 auto; }
.option.selected { border-color: var(--blue); background: #f1f6fe; }
.option.right { border-color: var(--green); background: #e9f9f1; }
.option.wrong { border-color: var(--red); background: #fdeeee; }
.option.locked { cursor: default; }
.feedback { border-radius: 14px; padding: 14px 18px; margin: 16px 0; background: #e9f9f1; border: 1px solid #bfe8d3; }
.feedback.bad { background: #fdeeee; border-color: #f6c5c7; }
.score { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.review-q { padding: 20px 0; border-top: 1px solid var(--line); }
.review-q:first-of-type { border-top: 0; }

/* Admin */

.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.stat b { display: block; font-size: 1.5rem; }
.option-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; }
.option-row .check { margin: 0; white-space: nowrap; }
.inline-form { display: inline; }
