/* Infinite Minds Academy: IGCSE ICT course site */
:root {
  --page: #0b0a17;
  --text: #f6f6fc;
  --soft: #d3d3e6;
  --line: rgba(255, 255, 255, .18);
  --panel: rgba(255, 255, 255, .055);
  --cyan: #5ce1e6;
  --amber: #ffb547;
  --magenta: #e879f9;
  --accent: var(--cyan);
  --head: "Unbounded", "Segoe UI", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Verdana, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--text);
  font: 400 18px/1.55 var(--body);
  min-height: 100vh; display: flex; flex-direction: column;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.22; margin: 0 0 .5em; overflow-wrap: break-word; }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.02em; }
h2 { font-size: clamp(21px, 2.4vw, 27px); }
h3 { font-size: 19px; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0 0 .8em; padding-left: 1.3em; }
li { margin-bottom: .3em; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
main { flex: 1; display: block; }
main:focus { outline: none; }
.icon { width: 22px; height: 22px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -80px; z-index: 20; min-height: 44px; padding: 8px 16px;
  background: #fff; color: #0b0a17; border: 0; border-radius: 8px; }
.skip:focus { top: 8px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 8px 20px; padding: 14px clamp(16px, 2.6vw, 37px); position: relative; z-index: 10; }
.logo { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; font: 700 17px/1.2 var(--head); text-decoration: none; }
.logo-dot { width: 7px; height: 7px; border-radius: 50%; background: #ed193a; align-self: center; margin-top: 8px; flex: none; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0 auto; }
.topbar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 22px; text-decoration: none; }
.topbar nav a:hover { background: var(--panel); }
.topbar nav a[aria-current="page"] { background: rgba(255, 255, 255, .13); font-weight: 700; }
.menu-btn { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 22px;
  border: 1px solid rgba(255, 255, 255, .45); border-radius: 26px; background: transparent; cursor: pointer;
  font-weight: 700; text-decoration: none; text-align: center; }
.btn:hover { background: rgba(255, 255, 255, .1); }
.btn-light { background: #fff; color: #0b0a17; border-color: #fff; }
.btn-light:hover { background: #dedef0; }
.btn-primary { background: var(--cyan); color: #05191b; border-color: var(--cyan); }
.btn-primary:hover { background: #9bf0f3; }
.btn-round { width: 48px; padding: 0; }
.top-download { white-space: nowrap; }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

@media (min-width: 821px) and (max-width: 1239px) {
  .topbar { flex-wrap: wrap; justify-content: space-between; }
  .topbar nav { order: 3; width: 100%; justify-content: center; }
}

/* ---------- home hero: one screen ---------- */
body[data-view="home"] { background: radial-gradient(120% 90% at 50% 8%, #221d4a 0%, #100e24 45%, #08070f 100%) fixed #08070f; }
body[data-view="home"] .footer { display: none; }
body[data-view="home"] { height: 100vh; height: 100dvh; min-height: 620px; }
body[data-view="home"] main { min-height: 0; display: flex; flex-direction: column; }
.hero { flex: 1; min-height: 0; display: flex; flex-direction: column; text-align: center; padding-bottom: 12px; }
.hero-copy { padding: 0 16px; }
.hero-copy h1 { font-size: clamp(30px, min(5vw, 7.4vh), 80px); line-height: 1.12; letter-spacing: -.03em; margin: clamp(2px, calc(12vh - 78px), 64px) 0 .28em; }
.hero-copy h1 span { display: block; }
.hero-copy p { font-size: clamp(18px, min(1.5vw, 2.4vh), 22px); color: var(--soft); margin: 0 auto; max-width: 62ch; }
.stage { flex: 1; position: relative; min-height: 250px; margin: 6px 0; overflow: hidden; overflow: clip;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.stage.dragging, .stage.dragging .card { cursor: grabbing; }
.card { position: absolute; left: 0; top: 0; display: block; text-decoration: none; text-align: left;
  background: var(--c); will-change: transform; cursor: grab; -webkit-user-drag: none; -webkit-tap-highlight-color: transparent; }
.card.offscreen { pointer-events: none; }
.art { position: absolute; inset: 0; display: block; overflow: hidden;
  background: linear-gradient(170deg, rgba(150, 160, 255, .34), rgba(120, 130, 220, .12) 48%, rgba(0, 0, 0, 0) 80%), var(--c); }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; opacity: 0; }
.art.has-cover img { opacity: 1; }
.art.has-cover .art-icon { display: none; }
.art-icon { position: absolute; left: 0; right: 0; top: 14%; height: 44%; display: flex; align-items: center; justify-content: center; }
.art-icon .icon { width: 66%; height: 100%; stroke-width: 1.1; color: #fff; opacity: .88; }
.card-shade { position: absolute; inset: 0;
  background: linear-gradient(to top, var(--c) 0%, var(--c) 22%, color-mix(in srgb, var(--c) 78%, transparent) 40%, transparent 68%); }
.card-text { position: absolute; left: 11px; right: 8px; bottom: calc(var(--slant, 0px) + 13px); display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.card-num { font: 700 24px/1 var(--head); }
.card-title { font-size: 17px; font-weight: 700; line-height: 1.18; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 17px; font-weight: 700; line-height: 1.3; }
.chip-ready { background: #cdf7dc; color: #062313; border: 1px solid #cdf7dc; }
.chip-soon { background: rgba(0, 0, 0, .5); color: #fff; border: 1px dashed rgba(255, 255, 255, .75); }
.card .chip { padding: 3px 7px; }
.card-rim { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.card-rim path { fill: none; stroke: rgba(255, 255, 255, .26); stroke-width: 2; }
.card:hover .card-rim path { stroke: rgba(255, 255, 255, .85); stroke-width: 4; }
.card:focus-visible { outline: none; }
.card:focus-visible .card-rim path { stroke: #fff; stroke-width: 10; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; padding: 4px 12px 0; }
.pause-btn { min-width: 124px; }
.pause-btn .when-paused, .pause-btn.is-paused .when-playing { display: none; }
.pause-btn.is-paused .when-paused { display: block; }
.hero-download { display: none; }
.hero-hint { font-size: 17px; color: var(--soft); margin: 8px 12px 0; }

/* ---------- inner pages ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 18px clamp(16px, 3vw, 32px) 48px; }
.wrap.wide { max-width: 1320px; }
.page-head { margin-bottom: 24px; }
.page-head p { font-size: 20px; color: var(--soft); margin: 0; }
.block, .lane, .which { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: clamp(16px, 2.4vw, 28px); margin: 0 0 22px; }
.block > :last-child, .lane > :last-child, .which > :last-child { margin-bottom: 0; }
.footer { border-top: 1px solid var(--line); color: var(--soft); text-align: center; padding: 18px 16px; font-size: 17px; }
.footer p { margin: 0; }

ul.ticks { list-style: none; padding: 0; }
ul.ticks li { position: relative; padding-left: 26px; margin-bottom: .55em; }
ul.ticks li::before { content: ""; position: absolute; left: 3px; top: .45em; width: 11px; height: 6px;
  border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }

/* start here: left-to-right flow */
.lane { --lane: var(--cyan); }
.lane-teacher { --lane: var(--amber); }
.lane h2 { display: flex; align-items: center; gap: 10px; color: var(--lane); }
.lane h2 .icon { width: 30px; height: 30px; }
.flow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 30px; }
.flow li { position: relative; margin: 0; display: flex; }
.flow li:not(:last-child)::after { content: ""; position: absolute; right: -21px; top: 50%; width: 10px; height: 10px; margin-top: -6px;
  border-top: 3px solid var(--lane); border-right: 3px solid var(--lane); transform: rotate(45deg); }
.step { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 12px;
  border: 2px solid var(--line); border-top: 5px solid var(--lane); border-radius: 12px; background: rgba(0, 0, 0, .22); text-decoration: none; }
a.step:hover { border-color: var(--lane); }
a.step .step-label { text-decoration: underline; text-underline-offset: 4px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--lane); color: #0b0a17; font-weight: 700; display: grid; place-items: center; }
.step-icon { width: 34px; height: 34px; color: var(--lane); }
.step-label { font-weight: 700; font-size: 19px; line-height: 1.25; }
.step-note { font-size: 17px; line-height: 1.4; color: var(--soft); }
.routine { list-style: none; padding: 0; display: flex; gap: 6px; margin-bottom: 10px; }
.routine li { flex: 1 1 0; min-width: 104px; margin: 0; padding: 12px 8px; border-radius: 10px; display: flex; flex-direction: column; text-align: center;
  justify-content: center; background: rgba(255, 255, 255, .1); border-bottom: 5px solid var(--cyan); line-height: 1.3; }
.routine .r-break { border-bottom-color: #b9b9cc; }
.routine .r-worksheet { border-bottom-color: var(--amber); }
.routine .r-exit { border-bottom-color: var(--magenta); }
.routine span { color: var(--soft); }
.routine-total { display: flex; align-items: center; gap: 8px; }
.which-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.which-item { border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 10px; padding: 14px 16px; }
.which-item h3 { font-size: 17px; color: var(--accent); }
.which-item p { margin: 6px 0 0; }

/* chapter list */
.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 10px; flex: 1 1 100%; max-width: 520px; min-height: 50px; padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .45); border-radius: 26px; }
.search:focus-within { outline: 3px solid #fff; outline-offset: 2px; }
.search input { flex: 1; min-width: 0; min-height: 46px; background: transparent; border: 0; outline: 0; font-size: 18px; }
.search input::placeholder { color: #b9b9d2; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 6px 16px; border-radius: 24px; border: 1px solid rgba(255, 255, 255, .4); background: transparent; cursor: pointer; }
.pill[aria-pressed="true"] { background: #fff; color: #0b0a17; border-color: #fff; font-weight: 700; }
.result-count { color: var(--soft); }
.tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.tiles li { margin: 0; display: flex; }
.tile { flex: 1; display: flex; flex-direction: column; border-radius: 15px; overflow: hidden; background: var(--c); border: 1px solid rgba(255, 255, 255, .28); text-decoration: none; }
.tile:hover { border-color: #fff; }
.tile .art { position: relative; aspect-ratio: 3 / 4; }
.tile .art-icon { top: 20%; height: 55%; }
.tile-text { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 12px 14px 15px; }
.tile-num { color: var(--soft); font-size: 17px; }
.tile-title { font-weight: 700; font-size: 20px; line-height: 1.25; }
.tile .chip { margin-top: auto; }

/* chapter page */
body[data-view="chapter"] { background: var(--page); }
.crumb { margin-bottom: 10px; }
.chapter-top { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: center; margin-bottom: 28px; }
.chapter-cover { position: relative; aspect-ratio: 3 / 5; border-radius: 18px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .28); background: var(--page); }
.chapter-cover .art { background-color: var(--page); }
.chapter-num { color: var(--soft); font-weight: 700; }
.summary { font-size: 21px; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.point { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: rgba(0, 0, 0, .22); }
.point h3 { font-size: 17px; }
.point-num { color: var(--cyan); }
.point ul { margin: 0; }
.point li { margin-bottom: .55em; }
.syllabus-note { color: var(--soft); }
.level-area { margin-top: 8px; }
.level-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.level-switch button { min-height: 54px; padding: 8px 10px; border-radius: 12px; cursor: pointer; background: var(--panel);
  border: 2px solid var(--line); border-bottom: 6px solid var(--accent); font-weight: 700; overflow-wrap: break-word; }
.level-switch button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #0b0a17; }
#level-panel .block > h2, .level-block h2 { border-left: 6px solid var(--accent); padding-left: 12px; }
.sessions { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.session { margin: 0; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 12px; padding: 16px 18px; background: rgba(0, 0, 0, .22); }
.session-num { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; color: var(--accent); font-weight: 700; }
.session-num span { color: var(--soft); font-weight: 400; }
.session h3 { font-size: 17px; }
.session ul { margin: 0; }
.download-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 20px; }
.download { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; border-radius: 12px; text-decoration: none;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .32); }
.download:hover { background: rgba(255, 255, 255, .16); border-color: #fff; }
.download-type { width: 30px; height: 30px; color: var(--accent); }
.download-arrow { margin-left: auto; }
.download-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; line-height: 1.3; }
.download-label { font-weight: 700; }
.download-note, .download-size { color: var(--soft); font-size: 17px; overflow-wrap: anywhere; }
.teacher-tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 6px; background: #ffe3a8; color: #2a1a00; font-size: 17px; font-weight: 700; }
.teacher-tag .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* levels */
.ladder { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: end; margin-bottom: 22px; }
.ladder > li { margin: 0; padding: 20px; border-radius: 16px; border: 1px solid var(--line); border-top: 8px solid var(--accent); background: var(--panel); }
.ladder > li:nth-child(1) { min-height: 520px; }
.ladder > li:nth-child(2) { min-height: 560px; }
.ladder > li:nth-child(3) { min-height: 600px; }
.ladder h2 { font-size: 20px; color: var(--accent); }
.ladder-step { color: var(--soft); margin: 0; }
.ladder-goal { font: 700 20px/1.3 var(--head); }
.ladder-count { display: flex; align-items: center; gap: 8px; color: var(--soft); }

/* exams */
.papers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.paper { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-top: 6px solid var(--cyan); border-radius: 16px; padding: 20px; }
.paper h2 { font-size: 19px; min-height: 3.7em; }
.paper-num { font-weight: 700; color: var(--cyan); margin-bottom: 4px; }
.paper dl { margin: 0 0 14px; }
.paper dl div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.paper dt { color: var(--soft); }
.paper dd { margin: 0; font-weight: 700; text-align: right; }
.paper > p:last-child { margin: 0; }
.parts, .bands { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.parts li, .bands li { margin: 0; display: flex; flex-direction: column; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.parts strong { font-family: var(--head); }
.band-ok { background: #c9f2d5; color: #062313; }
.band-support { background: #ffe7b3; color: #2a1a00; }
.band-time { background: #f9c9d1; color: #33060f; }
.numbered li { margin-bottom: .55em; }

/* checklist sheet: white paper on screen and in print */
.sheet { background: #fff; color: #111; border-radius: 10px; padding: clamp(14px, 3vw, 32px); }
.sheet h2 { margin-bottom: 2px; font-size: 22px; }
.sheet-org { margin: 0; }
.sheet-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin: 18px 0 12px; }
.sheet-fields span { border-bottom: 1px solid #333; padding-bottom: 2px; }
.table-scroll { overflow-x: auto; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 17px; }
.sheet th, .sheet td { border: 1px solid #555; padding: 5px 8px; text-align: center; }
.sheet thead th { background: #e9e9f2; }
.sheet tbody th { text-align: left; font-weight: 400; }
.box { display: inline-block; width: 17px; height: 17px; border: 2px solid #222; border-radius: 3px; vertical-align: middle; }
.sheet-foot { margin: 8px 0 0; font-size: 17px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .routine { flex-wrap: wrap; }
  .routine li { flex-basis: 28%; }
  .ladder { grid-template-columns: 1fr; }
  .ladder > li:nth-child(n) { min-height: 0; }
  .papers { grid-template-columns: 1fr; }
  .paper h2 { min-height: 0; }
}

/* ---------- phones ---------- */
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; justify-content: space-between; padding: 8px 14px; gap: 6px 10px; }
  .logo { font-size: 15px; flex: 1; min-width: 0; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 76px; padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .5); border-radius: 22px; background: transparent; cursor: pointer; font-weight: 700; }
  .topbar nav, .top-download { display: none; }
  .menu-open .topbar nav { display: flex; flex-direction: column; width: 100%; }
  .menu-open .topbar nav a { min-height: 48px; border-radius: 10px; }
  .menu-open .top-download { display: inline-flex; width: 100%; }

  body[data-view="home"] { height: auto; min-height: 100vh; min-height: 100dvh; }
  .hero { justify-content: center; padding-bottom: 20px; }
  .hero-copy h1 { font-size: clamp(23px, 7.4vw, 54px); margin-top: 12px; }
  .stage { flex: none; height: 260px; min-height: 0; margin: 16px 0 10px; }
  .card-text { left: 9px; right: 5px; bottom: calc(var(--slant, 0px) + 10px); gap: 4px; }
  .card-num { font-size: 21px; }
  .art-icon { top: 8%; height: 40%; }
  .hero-actions .btn-primary { order: -1; width: min(100%, 340px); }
  .hero-download { display: inline-flex; order: 5; width: min(100%, 340px); }

  .chapter-top { grid-template-columns: 1fr; gap: 18px; }
  .chapter-cover { width: min(56%, 220px); margin: 0 auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile-text { padding: 10px; }
  .tile-title { font-size: 18px; overflow-wrap: anywhere; hyphens: auto; }
  .level-switch { grid-template-columns: 1fr; }
  .parts, .bands { grid-template-columns: 1fr; }
  .download-grid, .points, .sessions { grid-template-columns: minmax(0, 1fr); }
  .hero-copy h1 span { text-wrap: balance; }
  .wrap.checklist-page { padding-left: 8px; padding-right: 8px; }
  .sheet { padding: 12px 8px; }
  .sheet th, .sheet td { padding: 5px 2px; }
  .sheet thead th { font-size: 17px; line-height: 1.25; }
  .sheet .box { width: 15px; height: 15px; }
}

@media (max-width: 600px) {
  /* the flow turns into a top-to-bottom list on phones */
  .flow { grid-template-columns: 1fr; gap: 26px; }
  .flow li:not(:last-child)::after { right: 50%; top: auto; bottom: -17px; margin: 0 -5px 0 0; transform: rotate(135deg); }
  .routine { flex-direction: column; }
  .routine li { flex-basis: auto; flex-direction: row; justify-content: space-between; gap: 10px; padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- print ---------- */
@page { size: A4 portrait; margin: 11mm; }
@media print {
  body, body[data-view] { background: #fff !important; color: #000; display: block; height: auto; min-height: 0; font-size: 11pt; }
  .topbar, .footer, .skip, .no-print, .hero-actions, .hero-hint, .pager, .crumb { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .block, .lane, .which, .paper, .step, .point, .session { background: #fff; break-inside: avoid; }
  .sheet { padding: 0; border-radius: 0; }
  .sheet h2 { font-size: 16pt; }
  .sheet-fields { margin: 12px 0 8px; }
  .sheet table { font-size: 11pt; }
  .sheet th, .sheet td { padding: 1.5mm 2mm; }
  .sheet tr { break-inside: avoid; }
  .sheet-foot { font-size: 10pt; }
  .table-scroll { overflow: visible; }
}
