/*
 * Teaching landing page — maths / lightboard themed.
 * Reuses the portfolio tokens from styles.css (--ink, --accent, --signal, …).
 * All classes are prefixed `tch-` so this file cannot affect other pages.
 * The lightboard "glass" is intentionally dark in BOTH themes — a lightboard is
 * a dark glass panel with glowing ink, so the look is consistent either way.
 */

.teaching-page main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.button--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

/* ---------- HERO ---------- */
.tch-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(32px, 6vw, 72px) 0 40px;
}
.tch-hero__copy h1 {
  margin: 6px 0 14px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.tch-hero__copy .lede { max-width: 46ch; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); }
.tch-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- LIGHTBOARD GLASS ---------- */
.tch-board {
  display: block; position: relative;
  perspective: 1400px;
  text-decoration: none; color: inherit; cursor: pointer;
}
.tch-board__glass { transition: box-shadow 0.25s ease, transform 0.25s ease; }
.tch-board:hover .tch-board__glass { box-shadow: 0 36px 80px rgba(0, 0, 0, 0.5), inset 0 0 70px rgba(52, 211, 196, 0.10); transform: rotateY(-4deg) rotateX(1deg); }
.tch-board:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 6px; border-radius: 18px; }

/* "Watch on YouTube" overlay badge — signals the panel is clickable */
.tch-board__watch {
  position: absolute; left: 50%; top: 46%;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 18px; border-radius: 999px;
  background: rgba(8, 13, 20, 0.74); border: 1px solid rgba(52, 211, 196, 0.55);
  color: #d7fff8; font-size: 13.5px; font-weight: 750; white-space: nowrap;
  box-shadow: 0 0 22px rgba(52, 211, 196, 0.4); backdrop-filter: blur(2px);
  pointer-events: none; transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  z-index: 2;
}
.tch-board:hover .tch-board__watch { transform: translate(-50%, -50%) scale(1.06); background: rgba(8, 13, 20, 0.88); box-shadow: 0 0 30px rgba(52, 211, 196, 0.6); }
.tch-board__play {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: #34d3c4; color: #06231f; font-size: 10px;
  padding-left: 2px;
}
.tch-board__glass {
  position: relative;
  display: grid;
  align-content: center;
  gap: 22px;
  min-height: 340px;
  padding: 40px 38px;
  border-radius: 16px;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(52, 211, 196, 0.10), transparent 55%),
    linear-gradient(155deg, #0c151d 0%, #0a1019 60%, #0d1620 100%);
  border: 1px solid rgba(52, 211, 196, 0.30);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 0 60px rgba(52, 211, 196, 0.05);
  transform: rotateY(-6deg) rotateX(2deg);
  overflow: hidden;
}
.tch-board__glass::after { /* glass sheen */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
  pointer-events: none;
}
.tch-board__glass--still { transform: none; min-height: 240px; }

.tch-board__led { /* glowing LED edge */
  position: absolute; inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(140deg, rgba(52, 211, 196, 0.7), rgba(95, 168, 255, 0.4), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: tch-led 6s ease-in-out infinite;
}
@keyframes tch-led { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.tch-board__marker { /* the "pen" dot */
  position: absolute; right: 30px; bottom: 26px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #34d3c4;
  box-shadow: 0 0 14px 4px rgba(52, 211, 196, 0.8);
  animation: tch-marker 5s ease-in-out infinite;
}
@keyframes tch-marker {
  0% { transform: translate(0, 0); opacity: 0.4; }
  25% { transform: translate(-120px, -40px); opacity: 1; }
  60% { transform: translate(-30px, -120px); opacity: 0.8; }
  100% { transform: translate(0, 0); opacity: 0.4; }
}

/* glowing fluorescent ink — KaTeX rendered equations */
.tch-board__ink { display: grid; gap: 20px; position: relative; z-index: 1; }
.tch-eq {
  color: #d7fff8;
  text-shadow: 0 0 8px rgba(52, 211, 196, 0.9), 0 0 22px rgba(52, 211, 196, 0.5);
  font-size: 20px;
}
.tch-eq .katex { color: inherit; }
/* Hero ink: equations glow in sequence, like being written one after another */
.tch-board__ink:not(.tch-board__ink--still) .tch-eq {
  opacity: 0.22;
  transition: opacity 0.6s ease, text-shadow 0.6s ease;
}
.tch-board__ink:not(.tch-board__ink--still) .tch-eq.is-lit {
  opacity: 1;
  text-shadow: 0 0 10px rgba(52, 211, 196, 1), 0 0 28px rgba(52, 211, 196, 0.65), 0 0 50px rgba(95, 168, 255, 0.35);
}
.tch-board__caption { margin: 14px 4px 0; color: var(--muted); font-size: 12px; letter-spacing: 0.02em; text-align: center; }

/* ---------- FLOATING SYMBOLS BACKDROP ---------- */
.tch-symbols { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.tch-symbols span {
  position: absolute; top: 100%; left: var(--x);
  font-size: clamp(38px, 5vw, 64px);
  color: color-mix(in srgb, var(--accent) 22%, transparent);
  font-family: "Times New Roman", serif;
  animation: tch-float var(--t, 28s) linear var(--d, 0s) infinite;
}
@keyframes tch-float {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-118vh) rotate(40deg); opacity: 0; }
}

/* ---------- SECTIONS ---------- */
.tch-section { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.tch-section__head { max-width: 64ch; margin-bottom: 32px; }
.tch-section__head h2 { margin: 8px 0 12px; font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -0.02em; }
.tch-section__lede { color: var(--muted); font-size: clamp(15px, 1.5vw, 18px); }

/* reveal on scroll */
.tch-reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.tch-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .tch-reveal { opacity: 1; transform: none; transition: none; }
  .tch-symbols, .tch-board__marker, .tch-board__led { animation: none; }
}

/* ---------- LIGHTBOARD SECTION BODY ---------- */
.tch-light { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(28px, 4vw, 52px); align-items: start; }
.tch-light__text p { color: var(--ink); }
.tch-benefits {
  list-style: none; margin: 22px 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px;
}
.tch-benefits li { position: relative; padding-left: 26px; color: var(--ink); font-size: 14.5px; }
.tch-benefits li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 12px; height: 12px; border-radius: 3px;
  background: var(--signal); box-shadow: 0 0 8px rgba(52, 211, 196, 0.6);
}
.tch-quote {
  margin: 24px 0; padding: 18px 22px;
  border-left: 4px solid var(--signal); border-radius: 0 10px 10px 0;
  background: var(--soft); color: var(--ink);
  font-size: 19px; font-style: italic; line-height: 1.4;
}
.tch-quote cite { display: block; margin-top: 10px; font-size: 13px; font-style: normal; color: var(--muted); }

.tch-light__panel { position: sticky; top: 92px; }
.tch-light__panel .tch-board__ink--still { gap: 16px; }
/* Embedded lightboard video (responsive 16:9), click-to-play with a custom poster */
.tch-video {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--line);
  background: #000; box-shadow: var(--shadow);
}
/* The playing video: nudge the blacks deeper (the source has a slightly grey board) */
.tch-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: brightness(0.96) contrast(1.12) saturate(1.05); }
.tch-video__btn {
  display: block; width: 100%; height: 100%; padding: 0; margin: 0;
  border: 0; background: #000; cursor: pointer; position: relative;
}
.tch-video__poster {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: contrast(1.04); transition: transform 0.4s ease, filter 0.3s ease;
}
.tch-video__btn:hover .tch-video__poster { transform: scale(1.03); }
.tch-video__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(8, 13, 20, 0.66); border: 1px solid rgba(52, 211, 196, 0.65);
  box-shadow: 0 0 26px rgba(52, 211, 196, 0.45); transition: transform 0.2s ease, background 0.2s ease;
}
.tch-video__btn:hover .tch-video__play { transform: translate(-50%, -50%) scale(1.08); background: rgba(8, 13, 20, 0.82); }
.tch-video__btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; }
.tch-video__tri { color: #34d3c4; font-size: 22px; margin-left: 4px; }
.tch-light__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tch-light__chips span {
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12.5px; font-weight: 650; color: var(--muted);
}

/* ---------- COURSES ---------- */
.tch-courses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tch-courses--pbl { margin-top: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tch-course {
  padding: 20px 22px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.tch-course:hover { transform: translateY(-4px); border-color: var(--accent); }
.tch-course__code {
  display: inline-block; margin-bottom: 8px; padding: 3px 9px;
  border-radius: 999px; background: var(--chip);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; font-weight: 700;
  color: var(--accent-strong); letter-spacing: 0.02em;
}
.tch-course h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.2; }
.tch-course p { margin: 0; color: var(--muted); font-size: 13.5px; }
.tch-course--pbl { background: var(--soft); }
.tch-course--pbl h3 { font-size: 15.5px; }

/* ---------- DIGITAL RESOURCES ---------- */
.tch-resources { display: grid; grid-template-columns: 1fr; gap: 22px; }
/* Full-width feature card: media panel on the left, copy on the right */
.tch-resource--wide { grid-template-columns: 0.95fr 1.05fr; grid-template-rows: 1fr; }
.tch-resource--wide .tch-resource__board { min-height: 100%; border-bottom: 0; border-right: 1px solid rgba(52, 211, 196, 0.25); }
.tch-resource {
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  border-radius: 16px; border: 1px solid var(--line);
  background: var(--panel); box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
a.tch-resource:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 28px 60px rgba(11, 107, 203, 0.22); }
.tch-resource__board {
  position: relative;
  display: grid; place-items: center; min-height: 150px; padding: 24px;
  background:
    radial-gradient(120% 120% at 30% 0%, rgba(52, 211, 196, 0.12), transparent 60%),
    linear-gradient(155deg, #0c151d, #0a1019);
  border-bottom: 1px solid rgba(52, 211, 196, 0.25);
}
.tch-resource__board--soon { filter: saturate(0.5); opacity: 0.8; }
.tch-eq--card { font-size: 30px; }
.tch-resource__badge {
  position: absolute; top: 14px; right: 14px;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(52, 211, 196, 0.16); border: 1px solid rgba(52, 211, 196, 0.5);
  color: #aef5ec; font-size: 11px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase;
}
.tch-resource__badge--soon { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); color: #c7d2e0; }
.tch-resource__body { padding: 24px 26px 28px; }
.tch-resource__body h3 { margin: 6px 0 10px; font-size: 22px; line-height: 1.2; }
.tch-resource__body > p { color: var(--muted); }
.tch-resource__features {
  list-style: none; margin: 16px 0 18px; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px;
}
.tch-resource__features li { position: relative; padding-left: 20px; font-size: 13.5px; color: var(--ink); }
.tch-resource__features li::before { content: "✓"; position: absolute; left: 0; color: var(--signal); font-weight: 800; }
.tch-resource__cta { display: inline-flex; align-items: center; gap: 4px; font-weight: 750; color: var(--accent); }
a.tch-resource:hover .tch-resource__cta { color: var(--accent-strong); }
.tch-resource__cta--muted { color: var(--muted); }
.tch-resource--soon { opacity: 0.92; }

/* ---------- FOOTER ---------- */
.tch-footer {
  position: relative; z-index: 1;
  margin-top: 24px; padding: 30px clamp(20px, 5vw, 64px);
  border-top: 1px solid var(--line); background: var(--panel-translucent);
  color: var(--muted); font-size: 13.5px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
}
.tch-footer__links { display: flex; gap: 18px; margin: 0; }
.tch-footer a { color: var(--accent); text-decoration: none; }
.tch-footer p { margin: 0; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 920px) {
  .tch-hero { grid-template-columns: 1fr; }
  .tch-board__glass { transform: none; }
  .tch-light { grid-template-columns: 1fr; }
  .tch-light__panel { position: static; }
  .tch-courses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tch-courses--pbl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tch-resources { grid-template-columns: 1fr; }
  .tch-resource--wide { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .tch-resource--wide .tch-resource__board { border-right: 0; border-bottom: 1px solid rgba(52, 211, 196, 0.25); }
}
@media (max-width: 560px) {
  .tch-benefits, .tch-resource__features { grid-template-columns: 1fr; }
  .tch-courses, .tch-courses--pbl { grid-template-columns: 1fr; }
  .tch-footer { flex-direction: column; }
}
