/* See Why — seewhy.bishoy.io. Palette and type from AGENTS.md section 4. */
@font-face { font-family: "Fredoka"; src: url("/fonts/Fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/Nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --navy: #12172B; --slate: #1E2640; --slate-2: #273152; --chalk: #F4F1EA; --sunny: #FFC83D;
  --sky: #4FC3F7; --coral: #FF7A6B; --mint: #4ADE9A; --fog: #7A849E; --fog-2: #A9B1C6;
  --radius: 18px; --max: 1120px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--navy); color: var(--chalk);
  font: 400 18px/1.6 "Nunito", system-ui, sans-serif;
}
h1, h2, h3 { font-family: "Fredoka", "Nunito", sans-serif; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin: 0.2em 0 0.4em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 1.6em 0 0.5em; }
h3 { font-size: 1.25rem; margin: 1.2em 0 0.3em; }
a { color: var(--sky); text-underline-offset: 3px; }
a:hover { color: var(--chalk); }
img { max-width: 100%; height: auto; display: block; }
code { background: var(--slate); padding: 0.1em 0.35em; border-radius: 6px; font-size: 0.9em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--sunny); color: var(--navy); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--sunny); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.small { font-size: 0.9rem; color: var(--fog-2); }
.lede { font-size: 1.2rem; color: #DCD8CE; max-width: 46rem; }

/* header / footer */
.top { max-width: var(--max); margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--chalk); text-decoration: none; font: 600 1.45rem "Fredoka", sans-serif; }
.top nav { display: flex; gap: 18px; flex-wrap: wrap; }
.top nav a { color: var(--chalk); text-decoration: none; font-weight: 800; font-size: 1rem; }
.top nav a:hover { color: var(--sky); }
.foot { margin-top: 80px; background: var(--slate); }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 28px 20px 36px; color: var(--fog-2); font-size: 0.95rem; }
.foot-in p { margin: 0.3em 0; }
.foot .fine { color: var(--fog); }

/* buttons & chips */
.btn { display: inline-block; background: var(--sunny); color: var(--navy); font-weight: 900; text-decoration: none; padding: 12px 22px; border-radius: 999px; margin: 4px 8px 4px 0; }
.btn:hover { color: var(--navy); filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--chalk); box-shadow: inset 0 0 0 2px var(--fog); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--chalk); }
.btn.small { padding: 6px 14px; font-size: 0.9rem; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 0.8rem; font-weight: 900; padding: 3px 10px; border-radius: 999px; background: var(--slate-2); color: var(--fog-2); }
.c-chemistry { background: rgba(255,90,90,.16); color: #FF9A9A; }
.c-math { background: rgba(79,195,247,.16); color: var(--sky); }
.c-biology { background: rgba(74,222,154,.15); color: var(--mint); }
.c-physics { background: rgba(176,124,255,.16); color: #C9A7FF; }
.c-pack { background: rgba(255,200,61,.14); color: var(--sunny); }

/* home */
.hero { padding: 40px 0 10px; }
.hero-in { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.hero-eye { width: 96px; height: 96px; border-radius: 24px; }
.hero h1 em { font-style: normal; color: var(--sunny); }
.cta { margin-top: 18px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card a { display: block; height: 100%; background: var(--slate); border-radius: var(--radius); overflow: hidden; color: var(--chalk); text-decoration: none; transition: transform .2s ease, background .2s ease; }
.card a:hover { transform: translateY(-3px); background: var(--slate-2); }
.card-in { padding: 14px 18px 18px; }
.card h3 { margin: 10px 0 6px; font-size: 1.3rem; }
.card p { margin: 0; color: #CFCBC2; font-size: 1rem; }
.more { color: var(--fog-2); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.steps, .ticks { padding-left: 1.2em; }
.steps li, .ticks li { margin-bottom: 0.5em; }
.ticks { list-style: none; padding-left: 0; }
.ticks li { padding-left: 1.6em; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.7em; height: 0.4em; border-left: 3px solid var(--mint); border-bottom: 3px solid var(--mint); transform: rotate(-45deg); }

/* episode */
.crumbs { margin-top: 20px; font-size: 0.95rem; color: var(--fog); }
.crumbs a { color: var(--fog-2); }
.ep h1 { margin-top: 0.35em; }
.answer { background: var(--slate); border-radius: var(--radius); padding: 16px 20px; font-size: 1.25rem; font-weight: 800; border-left: 6px solid var(--sunny); max-width: 52rem; }
.answer span { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fog-2); font-weight: 900; margin-bottom: 4px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; margin-top: 22px; }
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video .play { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; border: 0; cursor: pointer; }
.video .play span { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; background: var(--sunny); box-shadow: 0 8px 30px rgba(0,0,0,.4); transition: transform .2s ease; }
.video .play span::after { content: ""; position: absolute; left: 36px; top: 27px; border-left: 30px solid var(--navy); border-top: 19px solid transparent; border-bottom: 19px solid transparent; }
.video .play:hover span { transform: scale(1.07); }
.video .soon { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; background: rgba(18,23,43,.92); padding: 10px 18px; border-radius: 999px; font-weight: 900; white-space: nowrap; }
.watch { color: var(--fog-2); font-size: 0.95rem; }
.ep-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
.key { font-size: 1.1rem; }
.term { font-weight: 900; border-bottom: 4px solid var(--sunny); }
.pack { background: var(--slate); border-radius: var(--radius); padding: 6px 22px 16px; margin: 26px 0; }
.pack h2 { margin-top: 0.8em; }
.pack.muted { background: transparent; box-shadow: inset 0 0 0 2px var(--slate-2); }
.transcript h3 { color: var(--sky); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; }
.transcript p { color: #DCD8CE; }
.chapters { padding-left: 0; list-style: none; }
.chapters li { margin-bottom: 4px; }
.chapters a { font-weight: 900; margin-right: 6px; }
.sources { padding-left: 1.1em; font-size: 0.95rem; }
.sources li { margin-bottom: 6px; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 50px; }
.pn a { background: var(--slate); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--chalk); font-weight: 800; }
.pn a span { display: block; color: var(--fog-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .08em; }
.pn .next { grid-column: 2; text-align: right; }

/* lessons table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 1rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--slate-2); vertical-align: middle; }
th { color: var(--fog-2); font-size: 0.85rem; text-transform: uppercase; letter-spacing: .06em; }
.prose { max-width: 46rem; }
.nw { white-space: nowrap; }
.top nav .sm { display: none; }

@media (max-width: 820px) {
  body { font-size: 17px; }
  .split, .ep-grid { grid-template-columns: 1fr; gap: 10px; }
  .pn { grid-template-columns: 1fr; }
  .pn .next { grid-column: 1; text-align: left; }
  .top { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 16px; }
  .wrap, .hero-in { padding: 0 16px; }
  .video .play span { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
  .video .play span::after { left: 28px; top: 21px; border-left-width: 24px; border-top-width: 15px; border-bottom-width: 15px; }
  .video .soon { font-size: 0.85rem; white-space: normal; text-align: center; width: max-content; max-width: 90%; }
}

/* phones */
@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .top { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; }
  .brand { font-size: 1.2rem; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .brand { white-space: nowrap; flex: none; }
  .top nav { gap: 14px; flex-wrap: nowrap; justify-content: flex-end; }
  .top nav .lg { display: none; } .top nav .sm { display: inline; }
  .top nav a { font-size: 0.9rem; padding: 6px 0; }
  .hero { padding-top: 14px; }
  .hero-eye { display: none; }
  .lede { font-size: 1.05rem; }
  .cta .btn, .pack .btn:not(.small) { display: block; text-align: center; margin: 10px 0 0; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .card h3 { font-size: 1.2rem; }
  .crumbs { margin-top: 10px; margin-bottom: 8px; }
  .answer { font-size: 1.1rem; padding: 14px 16px; }
  .pack { padding: 4px 16px 14px; }
  .foot { margin-top: 56px; }
  .foot-in { padding: 22px 16px 30px; }
  /* lessons table becomes one card per episode */
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; left: -9999px; }
  tr { background: var(--slate); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
  td { border: 0; padding: 2px 0; }
  td[data-label]::before { content: attr(data-label) ": "; color: var(--fog-2); font-weight: 800; }
  td.t-ep { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.15rem; line-height: 1.25; padding-bottom: 6px; }
  td.t-dl { padding-top: 10px; }
  td.t-dl .btn { display: block; text-align: center; padding: 10px 16px; font-size: 1rem; margin: 0; }
}

/* very narrow phones: nav drops under the logo */
@media (max-width: 360px) {
  .top { flex-direction: column; align-items: flex-start; }
  .top nav { justify-content: flex-start; flex-wrap: wrap; }
}
