/* ==========================================================
   StudyStation - styles
   Orange, peach and black. Colours are set once here and reused.
   ========================================================== */

:root {
  --orange: #FF6A13;     /* brand orange: header, highlights */
  --bg: #FFF4EC;         /* soft peach page background */
  --white: #ffffff;      /* cards and panels */
  --paper: #FFE7D6;      /* peach tint for hover and open rows */
  --line: #F2D5C0;       /* thin dividers and graph-paper grid */
  --soft: #E0BCA3;       /* borders on "coming soon" items */
  --grey: #6E5E53;       /* secondary text */
  --ink: #141414;        /* main black */

  --display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

  --radius: 10px;
  --max: 1080px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--white); color: var(--ink); padding: 10px 14px; font-weight: 600;
}
.skip:focus { left: 12px; top: 12px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* ---------- Header and navigation ---------- */

.site-header {
  background: var(--orange);
  color: var(--ink);
  min-height: 68px;            /* keeps space while the menu loads */
  position: relative;
  z-index: 50;
}
.site-header :focus-visible { outline-color: var(--ink); }

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.brand strong { font-weight: 700; }
.brand-mark { width: 34px; height: 34px; display: block; flex: none; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}
.burger, .burger::before, .burger::after {
  display: block; width: 16px; height: 2px; background: currentColor; position: relative; content: "";
}
.burger::before { position: absolute; top: -5px; }
.burger::after { position: absolute; top: 5px; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link, .nav-btn {
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.nav-link:hover, .nav-btn:hover, .nav-btn[aria-expanded="true"] { background: rgba(20, 20, 20, 0.1); }
.nav-link[aria-current="page"], .nav-btn.is-current {
  text-decoration: underline;
  text-underline-offset: 7px;
  text-decoration-thickness: 2px;
}

.chev { width: 10px; height: 10px; transition: transform 0.15s ease; }
.nav-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.dropdown { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.14);
  list-style: none;
  margin: 0;
  padding: 6px;
}
.menu-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  padding: 8px 12px 4px;
}
.menu a, .menu .soon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 500;
}
.menu a:hover { background: var(--paper); }
.menu a[aria-current="page"] { background: var(--paper); }
.menu .soon { color: #9a9a9a; cursor: not-allowed; user-select: none; }

.tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--soft);
  color: #8a8a8a;
}
.tag.live { background: var(--orange); color: var(--ink); border-color: var(--orange); }

/* Phone and small tablet menu */
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .site-nav { flex-basis: 100%; display: none; padding-bottom: 16px; }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link, .nav-btn { width: 100%; justify-content: space-between; padding: 12px 10px; font-size: 1rem; }
  .menu {
    position: static;
    min-width: 0;
    box-shadow: none;
    margin: 4px 0 10px;
    border-color: var(--ink);
  }
}

/* ---------- Page hero (graph-paper background) ---------- */

.page-hero {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  border-bottom: 1px solid var(--line);
  padding-block: 64px 52px;
}
.eyebrow {
  display: inline-block;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
.page-hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 12px 0 0;
}
.lead {
  font-size: 1.12rem;
  color: #333;
  max-width: 58ch;
  margin: 18px 0 0;
}
.meta {
  margin: 18px 0 0;
  font-size: 0.92rem;
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}

.stamp {
  display: inline-block;
  margin-top: 26px;
  border: 2px solid var(--ink);
  background: var(--orange);
  padding: 7px 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
  cursor: pointer;
}
.btn.solid { background: var(--ink); color: var(--white); }
.btn.solid:hover { background: #333; border-color: #333; }
.btn.line { background: var(--white); color: var(--ink); }
.btn.line:hover { background: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---------- Home page status grid ---------- */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 14px;
  margin-top: 40px;
}
.status-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  background: var(--white);
}
.status-card h2 { font-size: 1.15rem; margin: 0; }
.status-card p { margin: 0; color: var(--grey); font-size: 0.94rem; }
.status-card .tag { align-self: flex-start; margin-top: auto; }
a.status-card { border-color: var(--ink); }
a.status-card:hover { background: var(--paper); }

/* ---------- GCSE Maths page ---------- */

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 36px;
}
.switch-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  font: inherit;
  padding: 20px 22px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}
.switch-btn:hover { background: var(--paper); }
.switch-btn[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.switch-btn .t { font-family: var(--display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.switch-btn .d { font-size: 0.92rem; opacity: 0.72; }
@media (max-width: 560px) { .switch { grid-template-columns: 1fr; } }

.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--soft);
  background: var(--white);
}
.chip:hover { border-color: var(--ink); }

.strand { margin-top: 44px; scroll-margin-top: 16px; }
.strand-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
}
.strand-head h2 { font-size: 1.55rem; letter-spacing: -0.02em; margin: 0; display: flex; align-items: center; gap: 10px; }
.strand-head h2::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--white); border: 3px solid var(--orange);
}
.strand-head span { color: var(--grey); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.topic { border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.topic summary {
  list-style: none;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 6px 12px;
  padding: 16px 8px;
  cursor: pointer;
}
.topic summary::-webkit-details-marker { display: none; }
.topic summary:hover { background: var(--paper); }
.topic[open] summary { background: var(--paper); }
.t-num { font-variant-numeric: tabular-nums; color: var(--grey); font-weight: 600; }
.t-name { font-weight: 600; min-width: 0; }
.h-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 0 5px;
  vertical-align: 2px;
}
.t-status { display: flex; flex-wrap: wrap; gap: 5px; }
.pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--soft);
  color: #9a9a9a;
  white-space: nowrap;
}
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--white); }

.plus { position: relative; width: 16px; height: 16px; justify-self: end; }
.plus::before, .plus::after {
  content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 2px; background: var(--ink);
  transition: transform 0.2s ease;
}
.plus::after { transform: rotate(90deg); }
.topic[open] .plus::after { transform: rotate(0deg); }

@media (max-width: 640px) {
  .topic summary { grid-template-columns: 2rem minmax(0, 1fr) 22px; }
  .t-status { grid-column: 2; grid-row: 2; }
  .plus { grid-column: 3; grid-row: 1; }
}

.topic-body { padding: 18px 8px 34px; display: grid; gap: 28px; }
.area { min-width: 0; }
.area-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.area-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.video-box {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.placeholder {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  border: 1.5px dashed var(--soft);
  border-radius: var(--radius);
  color: var(--grey);
  font-weight: 600;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 106, 19, 0.07) 14px 15px),
    var(--white);
}
.placeholder.short { aspect-ratio: auto; min-height: 130px; }
.placeholder small { display: block; font-weight: 400; margin-top: 4px; }

.pdf-frame {
  display: block;
  width: 100%;
  height: 620px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
}
.mobile-note {
  display: none;
  margin: 0;
  padding: 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 500;
}
@media (max-width: 700px) {
  .pdf-frame { display: none; }
  .mobile-note { display: block; }
}

.notice {
  margin-top: 32px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  padding: 18px 20px;
}
.notice code { font-size: 0.95em; }

.soon-panel {
  margin-top: 32px;
  border: 1.5px dashed var(--soft);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  background: var(--white);
}
.soon-panel h2 { margin: 0; font-size: 1.6rem; }
.soon-panel p { margin: 8px auto 0; color: var(--grey); max-width: 46ch; }

/* ---------- Footer ---------- */

.site-footer { border-top: 2px solid var(--ink); margin-top: 88px; background: var(--white); }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .brand-mark { width: 30px; height: 30px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 26px 34px;
  font-size: 0.92rem;
}
.footer-inner strong { font-family: var(--display); font-size: 1.05rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; color: var(--grey); }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
