/* Certifingo coming soon page */

@font-face {
  font-family: "Baloo 2";
  src: url("../fonts/baloo-2-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* colour, sampled from the logo */
  --ink: #000f37;        /* wordmark navy */
  --ink-2: #444c70;      /* secondary text */
  --paper: #ffffff;
  --mist: #f2f4fc;
  --line: #d9deef;
  --royal: #003ecd;      /* logo blue */
  --royal-hover: #0031a6;
  --violet: #6e18e4;     /* logo violet */
  --cyan: #00d4fe;       /* logo highlight */
  --call: #0b1233;       /* video-call chrome */
  --call-2: #1c2452;
  --live: #ff4d6d;
  --ok: #0c7a49;
  --error: #c0213f;

  --font-display: "Baloo 2", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* type scale: 14 / 16 / 18 / 21 / 24 / 36 / 48 / 72 */
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.3125rem;
  --step-3: 1.5rem;
  --step-5: 2.25rem;
  --step-6: 3rem;

  --gutter: clamp(20px, 4vw, 40px);
  --maxw: 1200px;
  --header-h: 76px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
p { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

a {
  color: var(--royal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: 600 var(--step-0) / 1.1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn--primary { background: var(--royal); color: #fff; }
.btn--primary:hover { background: var(--royal-hover); }
.btn--primary:disabled { background: #57648f; cursor: default; }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: #e6eafb; }
.btn--small { min-height: 42px; padding: 0 20px; font-size: 0.9375rem; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(255 255 255 / 0.94);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: rgb(255 255 255 / 0.82); backdrop-filter: saturate(1.4) blur(12px); }
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-h);
}

.brand { display: block; flex-shrink: 0; border-radius: 6px; }
.brand img { width: auto; height: 42px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 32px);
}
.site-nav__link {
  padding-block: 6px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav__link:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

/* -------------------------------------------------------------------- hero */
.hero { padding-block: clamp(32px, 6vw, 72px) clamp(72px, 9vw, 120px); }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.hero__title {
  font-size: clamp(2.6rem, 1.5rem + 3.4vw, 4.25rem);
  line-height: 0.98;
}
.hero__title span { display: block; }
.hero__title span + span { margin-top: 0.12em; }

.hero__lead {
  margin-top: 24px;
  max-width: 31em;
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.6;
}

/* ---------------------------------------------------------------- waitlist */
.waitlist { margin-top: 36px; max-width: 520px; }

.waitlist__label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.waitlist__row { display: flex; gap: 10px; }

.waitlist__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 22px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 400 var(--step-0) var(--font-body);
}
.waitlist__input::placeholder { color: #6b7394; }
.waitlist__input:hover { border-color: #b8c0de; }
.waitlist__input:focus-visible {
  outline: none;
  border-color: var(--royal);
  box-shadow: 0 0 0 4px rgb(0 62 205 / 0.2);
}
.waitlist__input[aria-invalid="true"] { border-color: var(--error); }
.waitlist__input:read-only { background: var(--mist); }

.waitlist .btn { min-height: 56px; }

.waitlist__msg {
  margin-top: 12px;
  min-height: 1.6em;
  color: var(--ink-2);
  font-size: var(--step--1);
}
.waitlist__msg[data-tone="error"] { color: var(--error); font-weight: 500; }
.waitlist__msg[data-tone="ok"] { color: var(--ok); font-weight: 500; }
.waitlist__msg[data-tone="info"] { color: var(--ink); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ----------------------------------------------- the camera tile (hero) */
.proctor {
  padding: 8px;
  border-radius: 22px;
  background: var(--call);
}

.proctor__screen {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 15px;
  background: #161c44;
  container-type: inline-size;
}

.proctor__art,
.tile__art { position: absolute; inset: 0; }

.t-art { width: 100%; height: 100%; }

.proctor__screen .t-art {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.35s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.proctor__screen[data-state="live"] .t-art { opacity: 1; transform: none; }

.proctor__connecting {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: #c9cff0;
  font-size: var(--step--1);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.proctor__screen[data-state="connecting"] .proctor__connecting { opacity: 1; }

.dots { display: flex; gap: 6px; }
.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: dot 1s infinite ease-in-out;
}
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}

/* overlays shared by the hero tile and the grid tiles */
.proctor__room,
.proctor__toast,
.nameplate {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 5px 11px 5px 9px;
  border-radius: 9px;
  background: rgb(5 8 25 / 0.64);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
}

.proctor__room { top: 12px; left: 12px; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(255 77 109 / 0.7); }
  70%, 100% { box-shadow: 0 0 0 7px rgb(255 77 109 / 0); }
}

.proctor__toast {
  top: 12px;
  right: 12px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.proctor__toast.is-on { opacity: 1; transform: none; }

.nameplate { left: 12px; bottom: 12px; transition: opacity 0.2s ease; }
.proctor__screen[data-state="connecting"] .nameplate { opacity: 0; }
.nameplate svg { flex-shrink: 0; width: 14px; height: 14px; color: #aab3dc; transition: color 0.15s; }
.is-talking .nameplate svg { color: var(--cyan); }

.captions {
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: max-content;
  max-width: min(88%, 22em);
  margin: 0;
  padding: 7px 14px 6px;
  transform: translateX(-50%);
  border-radius: 10px;
  background: rgb(5 8 25 / 0.8);
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(15px, 3.7cqi, 21px);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-wrap: pretty;
}
.captions[hidden] { display: none; }
.captions span { opacity: 0; }
.captions span.on { opacity: 1; }

/* active-speaker ring, like a video call */
.proctor__screen::after,
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px var(--cyan);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.is-talking .proctor__screen::after,
.tile.is-talking::after { opacity: 1; }

.proctor__controls {
  display: flex;
  gap: 8px;
  padding: 8px 0 0;
}

.call-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  background: var(--call-2);
  color: #fff;
  font: 500 0.9375rem / 1.2 var(--font-body);
  cursor: pointer;
}
.call-btn:hover { background: #29336e; }
.call-btn:focus-visible { outline-color: var(--cyan); outline-offset: 2px; }
.call-btn svg { flex-shrink: 0; width: 18px; height: 18px; }

/* --------------------------------------------------------- teacher drawing */
.t-pupil {
  transform: translate(calc(var(--px, 0) * 1px), calc(var(--py, 0) * 1px));
  transition: transform 0.14s ease-out;
}

.t-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 5.2s var(--blink-delay, 0s) infinite;
}
@keyframes blink {
  0%, 93%, 100% { transform: scaleY(1); }
  95.5% { transform: scaleY(0.08); }
}

.t-mouth-open { opacity: 0; }
.is-talking .t-mouth-open { animation: mouth-open 0.26s steps(1) infinite; }
.is-talking .t-mouth-closed { animation: mouth-closed 0.26s steps(1) infinite; }
@keyframes mouth-open { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes mouth-closed { 0% { opacity: 0; } 50% { opacity: 1; } }

.t-brow {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s ease;
}
.is-suspicious .t-brow-r { transform: translateY(-6px) rotate(-8deg); }
.is-suspicious .t-brow-l { transform: translateY(2px) rotate(5deg); }

/* ---------------------------------------------------------------- sections */
.section { padding-block: clamp(72px, 10vw, 128px); }

.section__title { font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3rem); }

.section__intro { max-width: 40em; }
.section__intro p {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: var(--step-1);
}
.section__note { margin-top: 24px; color: var(--ink-2); }

/* ---------------------------------------------------------------- teachers */
.teachers { background: var(--mist); }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 24px;
  margin: 52px 0 0;
  padding: 0;
  list-style: none;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #161c44;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  container-type: inline-size;
}
.tile .captions { bottom: 46px; max-width: 90%; font-size: clamp(12px, 4.9cqi, 18px); }
.tile .nameplate { left: 10px; bottom: 10px; }

.teacher__bio {
  margin-top: 14px;
  max-width: 30em;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* ------------------------------------------------------------------- about */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(48px, 7vw, 104px);
  align-items: start;
}

.about__lead {
  margin-top: 22px;
  max-width: 24em;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.3;
}

.about__story p:not(.about__lead) {
  margin-top: 18px;
  max-width: 34em;
  color: var(--ink-2);
}
.about__story .about__contact { color: var(--ink); }

.steps {
  margin: 0;
  padding: 8px 0 0;
  list-style: none;
}

.step {
  position: relative;
  padding: 0 0 44px 60px;
}
.step:last-child { padding-bottom: 0; }

/* the rail that joins the steps */
.step::before {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 4px;
  left: 15px;
  width: 2px;
  background: var(--line);
}
.step:last-child::before { display: none; }

.step__mark {
  position: absolute;
  top: 6px;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #fff;
}
.step--done .step__mark {
  border: 0;
  background: linear-gradient(135deg, var(--cyan), var(--royal) 48%, var(--violet));
}
.step__mark svg { width: 18px; height: 18px; }

.step__title { font-size: var(--step-5); }
.step p {
  margin-top: 6px;
  max-width: 26em;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ footer */
.site-footer {
  padding-block: 64px 36px;
  background: var(--ink);
  color: #c3c9e4;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.site-footer__logo img { width: 280px; height: auto; }

.footer-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.footer-cta p {
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
}
.site-footer .btn:focus-visible { outline-color: var(--cyan); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgb(255 255 255 / 0.12);
  font-size: var(--step--1);
}
.site-footer__bottom a { color: #fff; }
.site-footer__bottom a:focus-visible { outline-color: var(--cyan); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__copy { max-width: 640px; }
  .proctor { width: 100%; max-width: 640px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .brand img { height: 34px; }
  .site-nav__cta { display: none; }
  .site-nav__link { font-size: 0.875rem; }

  .waitlist__row { flex-direction: column; }
  .waitlist__input { flex: none; width: 100%; }
  .waitlist .btn { width: 100%; }

  .proctor { padding: 6px; border-radius: 18px; }
  .proctor__screen { border-radius: 13px; }
  .proctor__room, .proctor__toast, .nameplate { font-size: 0.75rem; padding: 4px 9px 4px 8px; }
  .proctor__room { top: 9px; left: 9px; }
  .proctor__toast { top: 9px; right: 9px; }
  .nameplate { left: 9px; bottom: 9px; }
  .captions { bottom: 44px; }
  .call-btn { gap: 7px; padding: 0 10px; font-size: 0.875rem; }

  /* on phones the cast becomes a swipeable row, so each tile stays big enough to read */
  .gallery {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(80%, 320px);
    gap: 14px;
    margin: 28px calc(-1 * var(--gutter)) 0;
    padding: 8px var(--gutter) 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: thin;
  }
  .teacher { scroll-snap-align: start; }
  .tile { border-radius: 14px; }
  .tile .nameplate { left: 9px; bottom: 9px; font-size: 0.75rem; padding: 4px 9px 4px 8px; }
  .tile .captions { bottom: 40px; }
  .teacher__bio { margin-top: 10px; font-size: 0.875rem; }

  .step { padding-left: 52px; padding-bottom: 36px; }
  .step__title { font-size: 1.875rem; }
  .site-footer__logo img { width: 230px; }
}

@media (max-width: 370px) {
  .site-nav { gap: 14px; }
  .brand img { height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .t-eye,
  .live-dot,
  .dots span,
  .is-talking .t-mouth-open,
  .is-talking .t-mouth-closed { animation: none; }
  .proctor__screen .t-art,
  .t-pupil,
  .t-brow,
  .proctor__toast { transition: none; }
}
