/* ═══════════════════════════════════════════════════════
   Mr Pohl's Core Maths Compendium — AQA 1350
   "Ledger & graph paper" design system
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

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

:root {
  --ink:      #12233A;   /* deep navy ink */
  --ink-2:    #1D3454;   /* lighter ink */
  --green:    #1B998B;   /* spreadsheet green */
  --green-dk: #147a6e;
  --amber:    #F4A93F;   /* highlighter */
  --paper:    #FBFAF6;   /* warm paper */
  --grid:     #E4E9EF;   /* graph-paper line */
  --text:     #1F2A37;
  --muted:    #63748A;
  --white:    #FFFFFF;
  --radius:   10px;
  --shadow:   0 4px 22px rgba(18,35,58,.10);
  --shadow-lg:0 14px 40px rgba(18,35,58,.16);
  /* brand accent, matching Mr Pohl's own logo gradient */
  --brand-blue:   #3E6FD9;
  --brand-purple: #6A4FB0;
  --brand-bg:     #D9E4FB;
}

/* ═══ ABOUT / BRAND-LOGO SECTIONS ═══ */
.brand-hero {
  background: linear-gradient(135deg, var(--brand-bg) 0%, #EFF3FE 100%);
  padding: 3rem 0 2.4rem;
  border-bottom: 3px solid var(--brand-purple);
}
.brand-hero img.brand-logo-img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.bio-section { display: grid; grid-template-columns: 220px 1fr; gap: 2.6rem; align-items: center; }
.bio-photo-wrap {
  width: 220px; height: 220px; margin: 0 auto; border-radius: 50%;
  padding: 6px; background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
  box-shadow: var(--shadow-lg);
}
.bio-photo {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  display: block; border: 4px solid var(--white);
}
.bio-text h2 { font-family: 'Fraunces', serif; font-weight: 600; color: var(--ink); font-size: clamp(1.6rem,3vw,2.1rem); margin-bottom: .8rem; }
.bio-text p { color: var(--text); font-size: 1rem; margin-bottom: 1rem; }
.booklet-banner { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); margin: 2rem 0; }
@media (max-width: 700px) {
  .bio-section { grid-template-columns: 1fr; text-align: center; }
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.6;
  /* faint graph-paper grid */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* ── Utility ── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.mono { font-family: 'Space Mono', monospace; }

/* ═══ NAV ═══ */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(18,35,58,.97);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--green);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; height: 62px;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark {
  height: 38px; width: auto; padding: 0 10px; border-radius: 8px; flex-shrink: 0;
  background: #fff; box-sizing: content-box; display: block;
}
.brand-text { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.05rem; color: var(--white); line-height: 1.1; }
.brand-text span { display: block; font-family: 'Space Mono', monospace; font-size: .62rem; font-weight: 400; color: var(--green); letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }

.nav-links { display: flex; gap: .15rem; list-style: none; align-items: center; }
.nav-links a {
  color: rgba(255,255,255,.82); text-decoration: none;
  font-size: .88rem; font-weight: 500; padding: .45rem .8rem; border-radius: 7px;
  transition: background .18s, color .18s;
}
.nav-links a:hover, .nav-links a:focus-visible { background: rgba(255,255,255,.1); color: var(--white); outline: 2px solid var(--green); outline-offset: 2px; }
.nav-links a.active { color: var(--amber); }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .5rem; }
.hamburger span { display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; }
.mobile-menu { display: none; flex-direction: column; background: var(--ink); padding: .8rem 1.5rem 1.4rem; border-bottom: 2px solid var(--green); }
.mobile-menu a { color: rgba(255,255,255,.82); text-decoration: none; font-weight: 500; padding: .55rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.mobile-menu a:hover { color: var(--amber); }
.mobile-menu.open { display: flex; }

/* ═══ MOBILE SCROLLABLE SECTION TABS ═══ */
.mobile-tabbar { display: none; }
@media (max-width: 860px) {
  .mobile-tabbar {
    display: flex; gap: .55rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: .7rem 1rem; background: var(--ink-2);
    border-bottom: 2px solid var(--green); position: sticky; top: 62px; z-index: 99;
    scroll-snap-type: x proximity;
  }
  .mobile-tabbar::-webkit-scrollbar { display: none; }
  .mobile-tabbar a {
    flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap;
    color: rgba(255,255,255,.88); background: rgba(255,255,255,.09);
    font-family: 'Space Mono', monospace; font-size: .74rem; font-weight: 600;
    letter-spacing: .02em; padding: .5rem 1rem; border-radius: 50px;
    text-decoration: none; border: 1px solid rgba(255,255,255,.14);
    transition: background .15s, color .15s;
  }
  .mobile-tabbar a.active { background: var(--green); color: #fff; border-color: var(--green); }
  .mobile-tabbar a:hover, .mobile-tabbar a:focus-visible { background: rgba(255,255,255,.18); }
}

/* ═══ HERO ═══ */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink);
  color: var(--white);
  padding: 4.5rem 0 4rem;
}
/* graph grid overlay on hero */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 80% at 70% 40%, #000 40%, transparent 100%);
}
.hero .container { position: relative; z-index: 2; }
.hero-eyebrow {
  font-family: 'Space Mono', monospace; font-size: .78rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--green);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: 'Fraunces', serif; font-weight: 600;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem); line-height: 1.05;
  letter-spacing: -.01em; max-width: 16ch;
}
.hero h1 .hl {
  background: linear-gradient(transparent 60%, rgba(244,169,63,.55) 60%);
  padding: 0 .1em;
}
.hero p.lede { margin-top: 1.4rem; font-size: 1.15rem; color: rgba(255,255,255,.78); max-width: 52ch; }
.hero-cta { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }

/* animated plotted regression line in hero */
.hero-plot { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .9; }
.hero-plot path.line { fill: none; stroke: var(--green); stroke-width: 2.5;
  stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 3s ease-out .3s forwards; }
.hero-plot circle { fill: var(--amber); opacity: 0; animation: pop .4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: .95rem;
  padding: .8rem 1.5rem; border-radius: 50px; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s, background .18s, border-color .18s;
}
.btn-primary { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-primary:hover { background: var(--green-dk); border-color: var(--green-dk); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.3); }
.btn-ghost:hover { border-color: var(--white); transform: translateY(-2px); }
.btn-dark { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-dark:hover { background: var(--ink-2); border-color: var(--ink-2); transform: translateY(-2px); }

/* ═══ SECTION ═══ */
.section { padding: 4rem 0; }
.section-head { margin-bottom: 2.2rem; }
.section-head .kicker {
  font-family: 'Space Mono', monospace; font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--green-dk); font-weight: 700; margin-bottom: .5rem;
}
.section-head h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(1.7rem,3.5vw,2.4rem); color: var(--ink); letter-spacing: -.01em; }
.section-head p { color: var(--muted); margin-top: .5rem; max-width: 60ch; }

/* ═══ SPEC / PAPER STRUCTURE ═══ */
.papers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 1.4rem; }
.paper-card {
  background: var(--white); border: 1px solid var(--grid); border-radius: var(--radius);
  padding: 1.6rem 1.7rem; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.paper-card::before { content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--green); }
.paper-card.optional::before { background: var(--amber); }
.paper-tag {
  font-family: 'Space Mono', monospace; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700; padding: .2rem .6rem; border-radius: 50px; display: inline-block; margin-bottom: .8rem;
  background: rgba(27,153,139,.12); color: var(--green-dk);
}
.paper-card.optional .paper-tag { background: rgba(244,169,63,.18); color: #b5751a; }
.paper-card h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.3rem; color: var(--ink); margin-bottom: .3rem; }
.paper-card .meta { font-family: 'Space Mono', monospace; font-size: .78rem; color: var(--muted); margin-bottom: .9rem; }
.paper-card p { font-size: .92rem; color: var(--text); }

/* ═══ TOPIC GRID ═══ */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.3rem; }
.topic-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--white); border: 1px solid var(--grid); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.topic-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.topic-card:hover .topic-go { gap: .7rem; color: var(--green-dk); }
.topic-card-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; }
.topic-num {
  font-family: 'Space Mono', monospace; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; color: var(--white); background: var(--ink);
  padding: .35rem .8rem; display: flex; justify-content: space-between; align-items: center;
}
.topic-num .status { font-size: .62rem; padding: .1rem .5rem; border-radius: 50px; }
.status.ready { background: var(--green); }
.status.soon  { background: rgba(255,255,255,.2); color: rgba(255,255,255,.75); }
.topic-body { padding: 1.2rem 1.3rem 1.4rem; flex: 1; display: flex; flex-direction: column; }
.topic-body h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.18rem; color: var(--ink); margin-bottom: .4rem; line-height: 1.2; }
.topic-body p { font-size: .88rem; color: var(--muted); flex: 1; }
.topic-card-foot { padding: 0 1.3rem 1.3rem; display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap; }
.topic-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .9rem; }
.topic-card-foot .topic-tags { margin-top: 0; }
.topic-tags span { font-family: 'Space Mono', monospace; font-size: .66rem; padding: .2rem .55rem; background: var(--paper); border: 1px solid var(--grid); border-radius: 50px; color: var(--muted); }
.topic-tags a {
  font-family: 'Space Mono', monospace; font-size: .66rem; padding: .2rem .55rem;
  background: var(--paper); border: 1px solid var(--grid); border-radius: 50px; color: var(--muted);
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.topic-tags a:hover, .topic-tags a:focus-visible { background: var(--green); color: #fff; border-color: var(--green); }
.topic-go { margin-top: 1rem; font-weight: 600; font-size: .85rem; color: var(--green); display: flex; align-items: center; gap: .4rem; transition: gap .2s, color .2s; text-decoration: none; }
.topic-card-foot .topic-go { margin-top: 0; flex-shrink: 0; }
.paper2-badge { font-family:'Space Mono',monospace; font-size:.62rem; font-weight:700; color:#b5751a; background:rgba(244,169,63,.16); padding:.15rem .5rem; border-radius:50px; margin-left:.4rem; }

/* ═══ RESOURCE ROWS (on topic pages) ═══ */
.res-list { display: flex; flex-direction: column; gap: .7rem; }
.res-row {
  display: flex; align-items: center; gap: 1rem; text-decoration: none; color: inherit;
  background: var(--white); border: 1px solid var(--grid); border-radius: var(--radius);
  padding: 1rem 1.2rem; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.res-row:hover { transform: translateX(5px); box-shadow: var(--shadow); border-color: var(--green); }
.res-ico { width: 42px; height: 42px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.res-ico.video { background: rgba(244,169,63,.16); }
.res-ico.notes { background: rgba(27,153,139,.14); }
.res-ico.quest { background: rgba(18,35,58,.08); }
.res-ico.sheet { background: rgba(120,80,200,.12); }
.res-row h4 { font-family: 'Inter', sans-serif; font-weight: 600; font-size: .96rem; color: var(--ink); }
.res-row p { font-size: .8rem; color: var(--muted); }
.res-row .go { margin-left: auto; color: var(--muted); font-size: 1.2rem; flex-shrink: 0; }
.res-type { margin-left: auto; font-family: 'Space Mono', monospace; font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--grid); padding: .2rem .55rem; border-radius: 50px; flex-shrink: 0; }

/* ═══ SUBTOPIC ACCORDION ═══ */
.sub-block { margin-bottom: 1.2rem; border: 1px solid var(--grid); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.sub-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.3rem; cursor: pointer; user-select: none; background: var(--white); transition: background .15s; }
.sub-head:hover { background: var(--paper); }
.sub-head h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.12rem; color: var(--ink); }
.sub-head .code { font-family: 'Space Mono', monospace; font-size: .72rem; color: var(--green-dk); }
.sub-head .chev { transition: transform .25s; color: var(--muted); }
.sub-head.open .chev { transform: rotate(180deg); }
.sub-body { padding: 0 1.3rem; max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .35s ease; }
.sub-body.open { padding: .4rem 1.3rem 1.3rem; }
.sub-body ul { list-style: none; }
.sub-body li { font-size: .9rem; color: var(--text); padding: .3rem 0 .3rem 1.4rem; position: relative; }
.sub-body li::before { content: "▸"; position: absolute; left: 0; color: var(--green); }

/* ═══ CALLOUT ═══ */
.callout { border-left: 4px solid var(--amber); background: #FEF6E7; border-radius: 0 var(--radius) var(--radius) 0; padding: 1.1rem 1.3rem; margin: 1.4rem 0; font-size: .92rem; }
.callout strong { color: #b5751a; }
.callout.green { border-color: var(--green); background: #E7F6F3; }
.callout.green strong { color: var(--green-dk); }

/* ═══ EXAM-AT-A-GLANCE STRIP ═══ */
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1px; background: var(--grid); border: 1px solid var(--grid); border-radius: var(--radius); overflow: hidden; }
.glance-cell { background: var(--white); padding: 1.3rem 1.2rem; text-align: center; }
.glance-cell .num { font-family: 'Fraunces', serif; font-weight: 700; font-size: 2rem; color: var(--green); line-height: 1; }
.glance-cell .lbl { font-family: 'Space Mono', monospace; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: .5rem; }

/* ═══ TRACKER WALKTHROUGH ═══ */
.walkthrough { display: flex; flex-direction: column; gap: 2.6rem; }
.walk-step { overflow: hidden; } /* clearfix so the step's border/spacing wraps the floated shots */
.walk-num {
  font-family: 'Space Mono', monospace; font-weight: 700; font-size: .8rem; color: #fff;
  background: var(--green); width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-bottom: .9rem;
}
.walk-step-text h3 { font-family: 'Fraunces', serif; font-size: 1.3rem; color: var(--ink); margin: 0 0 .5rem; }
.walk-step-text p { color: var(--muted); font-size: .95rem; line-height: 1.55; margin: 0; }
.walk-shots {
  float: right; width: 320px; margin: 0 0 1.2rem 1.8rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.walk-shots a { display: block; }
.walk-shots img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--grid); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.walk-shots a:hover img { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.walk-shots-caption { font-family: 'Space Mono', monospace; font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .4rem; text-align: center; width: 100%; }
.walk-upload-mock {
  border: 2px dashed var(--grid); border-radius: var(--radius); background: var(--paper);
  padding: 1.8rem 1.2rem; text-align: center; width: 100%; margin: 0;
}
.walk-upload-mock .walk-upload-icon {
  width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff;
  font-size: 1rem; display: flex; align-items: center; justify-content: center; margin: 0 auto .7rem;
}
.walk-upload-mock p { font-size: .78rem; }
.walk-upload-mock .mono { font-size: .64rem; color: var(--muted); word-break: break-all; }
@media (max-width: 760px) {
  .walk-shots { float: none; width: 100%; max-width: 340px; margin: 0 auto 1rem; }
  .walk-upload-mock { margin: 0 auto; }
}

/* ═══ CONTACT FORM ═══ */
.contact-form { max-width: 560px; margin: 0 auto 1.5rem; display: flex; flex-direction: column; gap: 1.2rem; }
.contact-form .field { display: flex; flex-direction: column; }
.contact-form label {
  font-family: 'Space Mono', monospace; font-size: .74rem; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem;
}
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea {
  width: 100%; font-family: 'Inter', sans-serif; font-size: .95rem; color: var(--text);
  padding: .8rem .95rem; border: 1px solid var(--grid); border-radius: var(--radius);
  background: var(--white); transition: border-color .15s, box-shadow .15s;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(27,153,139,.15);
}
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form button[type="submit"] { border: none; cursor: pointer; }
.contact-form button[type="submit"]:disabled { opacity: .6; cursor: default; }
.form-status { font-size: .88rem; font-weight: 600; margin-top: .8rem; min-height: 1.3em; }
.form-status.ok { color: var(--green-dk); }
.form-status.err { color: #c0392b; }
.contact-badge {
  display: inline-flex; align-items: center; gap: .5rem; font-family: 'Space Mono', monospace; font-size: .82rem;
  color: var(--muted); background: var(--paper); border: 1px solid var(--grid); border-radius: 50px;
  padding: .55rem 1.2rem;
}

/* ═══ BREADCRUMB ═══ */
.crumb { font-family: 'Space Mono', monospace; font-size: .76rem; color: var(--muted); padding: 1rem 0 0; }
.crumb a { color: var(--green-dk); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ═══ HOMEWORK / FOR TEACHERS PAGE ═══ */
.principle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1.2rem; }
.principle-card {
  background: var(--white); border: 1px solid var(--grid); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
}
.principle-card .pr-num { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.6rem; color: var(--green); line-height: 1; margin-bottom: .5rem; }
.principle-card h4 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.02rem; color: var(--ink); margin-bottom: .4rem; }
.principle-card p { font-size: .86rem; color: var(--muted); line-height: 1.5; }

.cmp-table-wrap { overflow-x: auto; border: 1px solid var(--grid); border-radius: var(--radius); box-shadow: var(--shadow); }
table.cmp-table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .88rem; min-width: 720px; }
table.cmp-table th, table.cmp-table td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.cmp-table thead th { background: var(--ink); color: #fff; font-family: 'Space Mono', monospace; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
table.cmp-table tbody tr:last-child td { border-bottom: none; }
table.cmp-table tbody tr:nth-child(even) { background: var(--paper); }
table.cmp-table td strong { color: var(--ink); }
table.cmp-table tr.recommended td:first-child { position: relative; padding-left: 1.2rem; }
table.cmp-table tr.recommended td:first-child::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--green); }
.pill-cost { font-family: 'Space Mono', monospace; font-size: .68rem; padding: .15rem .5rem; border-radius: 50px; background: rgba(27,153,139,.12); color: var(--green-dk); display: inline-block; }
.pill-cost.paid { background: rgba(244,169,63,.18); color: #b5751a; }

.cycle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1.4rem; }
.cycle-card {
  background: var(--white); border: 1px solid var(--grid); border-radius: var(--radius);
  padding: 1.5rem 1.6rem; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.cycle-card::before { content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--green); }
.cycle-card:nth-child(2)::before { background: var(--amber); }
.cycle-card:nth-child(3)::before { background: var(--brand-purple, #6A4FB0); }
.cycle-tag {
  font-family: 'Space Mono', monospace; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700; padding: .2rem .6rem; border-radius: 50px; display: inline-block; margin-bottom: .8rem;
  background: rgba(27,153,139,.12); color: var(--green-dk);
}
.cycle-card:nth-child(2) .cycle-tag { background: rgba(244,169,63,.18); color: #b5751a; }
.cycle-card:nth-child(3) .cycle-tag { background: rgba(106,79,176,.14); color: var(--brand-purple, #6A4FB0); }
.cycle-card h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.2rem; color: var(--ink); margin-bottom: .5rem; }
.cycle-card p { font-size: .88rem; color: var(--text); margin-bottom: .5rem; }
.cycle-card .cycle-time { font-family: 'Space Mono', monospace; font-size: .74rem; color: var(--muted); }

/* ═══ FOOTER ═══ */
footer { background: var(--ink); color: rgba(255,255,255,.55); padding: 2.5rem 0; margin-top: 3rem; }
footer .container { display: flex; flex-direction: column; align-items: center; gap: 1.8rem; }
footer .footer-top { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; width: 100%; }
footer a { color: var(--green); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .fnote { font-size: .8rem; }
footer .mono-tag { font-family: 'Space Mono', monospace; font-size: .72rem; letter-spacing: .08em; }
footer .footer-logo { padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,.12); width: 100%; text-align: center; }
footer .footer-logo img { height: 70px; width: auto; }

/* ═══ REVEAL ANIM ═══ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.22,1,.36,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ═══ TRACKER TOOL ═══ */
.tracker-tool { max-width: 900px; margin: 0 auto; }
.dropzone {
  border: 2px dashed var(--grid); border-radius: var(--radius); background: var(--white);
  padding: 2.6rem 1.5rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--green); background: #F3FBFA; outline: none; }
.dropzone.dragover { border-color: var(--green); background: #E7F6F3; }
.dropzone-icon {
  width: 48px; height: 48px; margin: 0 auto .9rem; border-radius: 50%; background: var(--green);
  color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700;
}
.dropzone p { margin: .3rem 0; color: var(--text); }
.dropzone-sub { font-size: .78rem; color: var(--muted); }

.report-preview { margin-top: 2rem; }
.student-cards { display: flex; flex-direction: column; gap: 1.6rem; }

/* Each report card mirrors the printed PDF page: a wide main area of topic
   boxes on the left, a fixed-width detail rail on the right. */
.report-card, #class-summary-card > .report-card {
  background: var(--white); border: 1px solid var(--grid); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.8rem 2rem;
  display: grid; grid-template-columns: 1fr 260px; gap: 1.8rem; align-items: start;
}
.report-card-main h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.5rem; color: var(--ink); margin-bottom: 1.1rem; }
.chip-grid-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

.box-panel h4 {
  font-family: 'Space Mono', monospace; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .6rem; display: flex; align-items: center; gap: .4rem;
}
.box-panel h4 span { font-family: 'Inter', sans-serif; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.box-panel-green h4 { color: var(--green-dk); }
.box-panel-amber h4 { color: #b5751a; }
.box-panel-red h4 { color: #c0392b; }
.box-panel-black h4 { color: var(--ink); }
.chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.topic-chip {
  background: var(--paper); border: 1px solid var(--grid); border-radius: 8px; padding: .5rem .6rem;
  font-size: .78rem; position: relative; padding-left: .8rem; overflow: hidden;
}
.box-panel-green .topic-chip::before, .box-panel-amber .topic-chip::before,
.box-panel-red .topic-chip::before, .box-panel-black .topic-chip::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.box-panel-green .topic-chip::before { background: var(--green); }
.box-panel-amber .topic-chip::before { background: var(--amber); }
.box-panel-red .topic-chip::before { background: #c0392b; }
.box-panel-black .topic-chip::before { background: var(--ink); }
.chip-code { font-family: 'Space Mono', monospace; font-weight: 700; color: var(--ink); margin-right: .3rem; }
.chip-desc { color: var(--text); }
.chip-pct { float: right; font-family: 'Space Mono', monospace; color: var(--muted); font-size: .72rem; }
.chip-empty { font-size: .8rem; color: var(--muted); font-style: italic; }
.chip-more { font-size: .72rem; color: var(--muted); margin-top: .4rem; font-style: italic; }

.report-card-side { display: flex; flex-direction: column; align-items: stretch; border-left: 1px dashed var(--grid); padding-left: 1.8rem; }
.report-card-side canvas.donut { display: block; margin: 0 auto; }
.rag-legend { display: flex; flex-direction: column; gap: .3rem; margin-top: .8rem; }
.rag-chip { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--text); }
.rag-chip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.details-panel { border-top: 1px dashed var(--grid); margin-top: 1rem; padding-top: .9rem; font-size: .84rem; color: var(--text); display: flex; flex-direction: column; gap: .3rem; }
.details-panel strong { color: var(--ink); margin-right: .3rem; }

.grade-badge-wrap { border-top: 1px dashed var(--grid); margin-top: 1rem; padding-top: 1rem; }
.grade-badge {
  width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center; font-family: 'Fraunces', serif;
  font-weight: 700; font-size: 1.3rem; float: left; margin-right: .8rem;
}
.grade-label { font-weight: 600; color: var(--ink); font-size: .88rem; padding-top: .35rem; }
.grade-explain { clear: both; font-size: .7rem; color: var(--muted); margin-top: .6rem; line-height: 1.5; }
.grade-dist { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.grade-pill { background: var(--paper); border: 1px solid var(--grid); border-radius: 50px; padding: .2rem .6rem; font-size: .76rem; font-family: 'Space Mono', monospace; }

.best-worst-callout { border-top: 1px dashed var(--grid); margin-top: 1rem; padding-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.bw-row { font-size: .82rem; padding-left: .7rem; border-left: 3px solid var(--grid); line-height: 1.5; }
.bw-row strong { display: block; font-family: 'Space Mono', monospace; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; }
.bw-best { border-left-color: var(--green); }
.bw-best strong { color: var(--green-dk); }
.bw-worst { border-left-color: #c0392b; }
.bw-worst strong { color: #c0392b; }

@media (max-width: 760px) {
  .report-card { grid-template-columns: 1fr; }
  .report-card-side { border-left: none; padding-left: 0; border-top: 1px dashed var(--grid); padding-top: 1.4rem; margin-top: 1rem; }
  .chip-grid-wrap, .chip-grid { grid-template-columns: 1fr; }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 3rem 0 2.6rem; }
  .section { padding: 2.6rem 0; }
}
@media (max-width: 600px) {
  nav { padding: 0 1rem; height: 56px; }
  .brand-text span { display: none; }
  .container { padding: 0 1.1rem; }
  .hero h1 { font-size: clamp(1.7rem, 8vw, 2.3rem); max-width: 100%; }
  .hero p.lede { font-size: 1rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
  .sub-head { padding: .85rem 1rem; gap: .6rem; }
  .sub-head h3 { font-size: 1rem; }
  .glance { grid-template-columns: repeat(2,1fr); }
  .glance-cell { padding: 1rem .8rem; }
  .glance-cell .num { font-size: 1.5rem; }
  .res-row { flex-wrap: wrap; row-gap: .4rem; }
  .res-type { margin-left: auto; }
  .bio-photo-wrap { width: 180px; height: 180px; }
  footer .footer-top { text-align: center; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-plot path.line { stroke-dashoffset: 0; animation: none; }
  .hero-plot circle { opacity: 1; animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ═══ COMING-SOON TOPIC CARDS ═══ */
.topic-card.is-soon {
  opacity: .72;
  cursor: default;
  background: repeating-linear-gradient(45deg, var(--white), var(--white) 12px, #F6F8FA 12px, #F6F8FA 24px);
}
.topic-card.is-soon:hover { transform: none; box-shadow: var(--shadow); }
.topic-card.is-soon .topic-num { background: var(--muted); }
.status.soon { background: rgba(255,255,255,.25); color: #fff; }
