/* TeacherCam website: one dark, centred column for the landing page, the
   thank-you page and the "page not found" page. Written for phones first;
   the media queries at the bottom add room on bigger screens. */

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

:root {
  --ground: #14100e;            /* the dark page colour (also theme-color) */
  --text: #ffffff;
  --muted: #d9d1cb;             /* secondary lines, still 4.5:1 on the ground */
  --faint: #b5aca5;             /* the footer's small print */
  --orange: #f0883e;            /* TeacherCam orange, from the logo */
  --orange-light: #f6a165;
  --on-orange: #1b1009;         /* dark text on orange (white fails contrast) */
  --line: rgba(255, 255, 255, 0.14);
  --ok: #9fe3b8;
  --err: #ffb3a6;
  --focus: #ffd5ae;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--text);
  font: 400 16px/1.55 "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The blurred still of the teacher in the app, behind the top of every page.
   A dark gradient on top keeps white text readable, and it fades into the
   plain dark ground further down. */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: max(100vh, 1000px);
  z-index: -1;
  background: linear-gradient(to bottom, rgba(20, 16, 14, 0.74) 0%, rgba(20, 16, 14, 0.82) 55%, var(--ground) 100%);
}
/* Two sizes of the picture; the two queries never both match, so a visit
   downloads only one of them. */
@media (max-width: 599px) {
  body::before {
    background:
      linear-gradient(to bottom, rgba(20, 16, 14, 0.74) 0%, rgba(20, 16, 14, 0.82) 55%, var(--ground) 100%),
      url("/img/bg-phone.jpg") center top / cover no-repeat;
  }
}
@media (min-width: 600px) {
  body::before {
    background:
      linear-gradient(to bottom, rgba(20, 16, 14, 0.72) 0%, rgba(20, 16, 14, 0.82) 55%, var(--ground) 100%),
      url("/img/bg.jpg") center top / cover no-repeat;
  }
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--orange-light); }
h1, h2, h3, p { margin: 0; }

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

/* Only for screen readers */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* The spam trap: off screen, never seen or reached by keyboard */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- the column ---------- */

main { padding: 0 20px; }

.hero,
.simple {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 0 8px;
  text-align: center;
}

/* Small label at the very top */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow img { width: 24px; height: 24px; border-radius: 6px; }

h1 {
  margin: 16px auto 0;
  font-size: clamp(34px, 6.4vw + 10px, 58px);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.sub {
  margin: 14px auto 0;
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(17px, 0.6vw + 14px, 21px);
  line-height: 1.4;
  text-wrap: balance;
}

/* ---------- the film ---------- */

.film {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 20px auto 0;
  aspect-ratio: 1080 / 980;         /* the film is 1080 x 980 */
  overflow: hidden;
  border: 2px solid var(--orange);
  border-radius: 18px;
  background: #000;
  box-shadow:
    0 0 0 6px rgba(240, 136, 62, 0.14),
    0 0 46px rgba(240, 136, 62, 0.38),
    0 24px 60px rgba(0, 0, 0, 0.5);
}
.film picture,
.film-poster,
.film-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.film-video { background: transparent; }
/* Until it is started (and again after the end) only the poster shows. */
.film:not(.is-started) .film-video { visibility: hidden; }
/* Once started, the frame keeps the shape of the file that was chosen at the
   press (app.js), and the video is shown whole, so turning a phone never
   crops the captions. The tall frame is kept lower than the screen. */
.film.is-started .film-video { object-fit: contain; }
.film.is-started { aspect-ratio: 1080 / 980; }

/* The big play button covers the whole poster, so a press anywhere on it
   starts the video. What you see is the orange circle and the words under it. */
.film-play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: radial-gradient(closest-side, rgba(10, 8, 7, 0.38), rgba(10, 8, 7, 0) 100%);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.film-play[hidden] { display: none; }
.film-play:focus-visible { outline: none; }
.film-play-circle {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--on-orange);
  box-shadow: 0 0 0 8px rgba(240, 136, 62, 0.22), 0 12px 34px rgba(0, 0, 0, 0.5);
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.film-play-circle svg { width: 40px; height: 40px; margin-left: 5px; }
.film-play:hover .film-play-circle {
  background: var(--orange-light);
  transform: scale(1.06);
  box-shadow: 0 0 0 11px rgba(240, 136, 62, 0.28), 0 14px 38px rgba(0, 0, 0, 0.55);
}
.film-play:active .film-play-circle { transform: scale(0.98); }
.film-play:focus-visible .film-play-circle {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}
.film-label {
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.62);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

/* No JavaScript: a link over the poster opens the right video file. The two
   queries match the poster's, so each screen shows one of them. */
.film-nojs { position: absolute; inset: 0; z-index: 1; }

/* The chapter list: small and quiet, so the sign-up button stays the one
   thing to press. On phones it is one row that scrolls sideways inside
   itself; on bigger screens it wraps. */
.chapters { max-width: 680px; margin: 10px auto 0; }
.chapters[hidden] { display: none; }
.chapter-list {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 6px 6px 8px;
  list-style: none;
  overflow-x: auto;
  scroll-padding-inline: 28px;      /* a focused chapter never sits under the faded edge */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Soft edges show there is more to swipe to. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.chapter-list::-webkit-scrollbar { display: none; }
.chapter-list li { flex: none; }
.chapter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.chapter:hover { border-color: rgba(255, 255, 255, 0.45); color: var(--text); }
.chapter:focus-visible { outline-offset: 2px; border-radius: 999px; }
.chapter-time { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.chapter[aria-current="true"] {
  border-color: var(--orange);
  background: rgba(240, 136, 62, 0.18);
  color: var(--text);
}
.chapter[aria-current="true"] .chapter-time { color: var(--orange-light); }

/* ---------- forms ---------- */

.signup {
  max-width: 460px;
  margin: 18px auto 0;
  display: grid;
  gap: 14px;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  color: #17110d;
  font: inherit;
  font-size: 18px;                  /* 16px or more, so iPhones do not zoom in */
}
input::placeholder { color: #6e655f; }
input[type="email"]:focus-visible,
input[type="text"]:focus-visible { border-color: var(--orange); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--err); }
.pills[aria-invalid="true"] .pill span { border-color: var(--err); }

/* Tap choices (radio buttons on the main page, checkboxes on the thank-you page) */
.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.pills legend {
  float: left;                      /* lets the legend sit in the row like the pills */
  width: 100%;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
}
.opt { color: var(--faint); font-weight: 400; }
.pill { position: relative; }
.pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.pill span {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-weight: 600;
}
.pill:hover span { border-color: rgba(255, 255, 255, 0.6); }
.pill input:checked + span {
  border-color: var(--orange);
  background: rgba(240, 136, 62, 0.2);
  color: #fff;
}
.pill input:checked + span::before { content: "\2713"; margin-right: 8px; color: var(--orange-light); }
.pill input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: var(--on-orange);
  font: inherit;
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 34px rgba(240, 136, 62, 0.35);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--orange-light); color: var(--on-orange); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.7; cursor: progress; }
.signup .btn { width: 100%; }
.btn-quiet {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
}
.btn-quiet:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

.status { font-weight: 700; }
.status:empty { display: none; }
.status.is-ok { color: var(--ok); }
.status.is-err { color: var(--err); }

.note { color: var(--muted); font-size: 14.5px; text-wrap: balance; }
.note a { white-space: nowrap; }

/* After a sign-up that needs no thank-you page (already on the list) */
.signup.is-done input,
.signup.is-done .pills,
.signup.is-done .btn { display: none; }
.signup.is-done .status { font-size: 18px; }

/* ---------- the three questions ---------- */

.faq {
  max-width: 640px;
  margin: 0 auto;
  padding: 80px 0 72px;
}
.answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 30px; }
.answers li { position: relative; padding-left: 28px; }
.answers li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
}
.answers h3 { font-size: 19px; font-weight: 800; line-height: 1.3; }
.answers p { margin-top: 6px; color: var(--muted); }
.again { margin-top: 44px; text-align: center; }

/* ---------- footer ---------- */

.foot {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13.5px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 16px; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.privacy { margin-top: 20px; display: grid; gap: 10px; }
.privacy:focus { outline: none; }
.privacy h2 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.legal { margin-top: 20px; }

/* ---------- thank-you and "not found" pages ---------- */

.simple { padding: 48px 20px 72px; }
.details input[type="text"] { font-size: 16px; }
.simple .sub { margin-top: 16px; }
.details {
  margin: 40px auto 0;
  max-width: 600px;
  padding: 26px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  gap: 22px;
}
.details[hidden] { display: none; }
.details h2 { font-size: 21px; font-weight: 800; }
.details-lead { margin-top: -14px; color: var(--muted); }
.details .pills legend { margin-bottom: 10px; color: var(--text); font-weight: 700; font-size: 16px; }
.other-label { font-weight: 700; margin-bottom: -12px; }
.details .btn { justify-self: center; min-width: 200px; }
.details.is-done fieldset,
.details.is-done input,
.details.is-done .other-label,
.details.is-done .details-lead,
.details.is-done .btn { display: none; }
.back { margin-top: 36px; }

/* ---------- bigger screens ---------- */

@media (min-width: 600px) {
  .hero { max-width: 820px; padding-top: 24px; }
  .sub { max-width: none; font-size: clamp(17px, 0.5vw + 13px, 19.5px); }
  .film { max-width: 640px; }
  .chapters { max-width: none; }
  .chapter-list {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    overflow: visible;
    padding: 4px 0 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .chapter { min-height: 28px; padding: 0 9px; gap: 5px; font-size: 12.5px; }
  .film-play-circle { width: 96px; height: 96px; }
  .film-play-circle svg { width: 44px; height: 44px; }
  /* Email and button side by side, the computer choice underneath. The
     order in the page (and for the Tab key) stays email, computer, button. */
  .signup {
    max-width: 580px;
    grid-template-columns: 1fr auto;
    grid-template-areas: "email button" "pills pills" "status status" "note note";
    gap: 12px;
  }
  .signup input[type="email"] { grid-area: email; min-height: 60px; }
  .signup .pills { grid-area: pills; }
  .signup .btn { grid-area: button; width: auto; }
  .signup .status { grid-area: status; }
  .signup .note { grid-area: note; }
  .eyebrow { font-size: 12px; letter-spacing: 0.14em; }
  /* Headline, video, chapters and the email box all fit on one laptop screen: the headline may run
     wider than the column (two lines instead of three), and the video is sized from the screen height. */
  .hero h1 { width: min(1060px, 94vw); position: relative; left: 50%; transform: translateX(-50%); }
  .film { max-width: min(600px, max(340px, calc((100vh - 450px) * 1.102))); }
  .pills legend { float: left; width: auto; margin-right: 6px; }
  .details .pills legend { width: 100%; margin-right: 0; }
  .details { padding: 32px; }
  .faq { padding-top: 104px; }
}

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

/* ---------- short laptop windows ---------- */
/* A 13-inch laptop browser window is often only 650 to 760 px tall. Tighter spacing, a smaller
   headline and one swipeable row of chapters keep the email box on the first screen. */
@media (min-width: 600px) and (max-height: 760px) {
  .hero { padding-top: 12px; }
  .hero h1 { margin-top: 10px; font-size: 42px; }
  .sub { margin-top: 8px; }
  .film { margin-top: 12px; max-width: max(300px, calc((100vh - 330px) * 1.102)); }
  .chapters { margin-top: 6px; }
  .chapter-list {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }
  .chapter { flex: none; }
  .signup { margin-top: 10px; }
}
