/* Students' site. Phones first; tablets from 640px, PC layout from 1024px. */
@font-face {
  font-family: "Lexend";
  src: url("/static/fonts/lexend-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lexend";
  src: url("/static/fonts/lexend-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #141a2e;
  --muted: #5b6478;
  --line: #e4e7ef;
  --blue: #1f6bff;
  --violet: #a422ff;
  --grad: linear-gradient(100deg, var(--blue) 0%, #6a3dff 55%, var(--violet) 100%);
  --radius: 22px;
  --shadow-lg: 0 24px 60px -18px rgba(31, 45, 110, .28), 0 8px 20px -10px rgba(31, 45, 110, .18);
  --gutter: 16px;
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #fff; line-height: 1.5; overflow-x: hidden; }
img, svg, video { display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(31, 107, 255, .45); outline-offset: 3px; }

/* Light-grey formulas behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vmax 40vmax at 100% 0%, rgba(164, 34, 255, .07), transparent 60%),
    radial-gradient(60vmax 40vmax at 0% 100%, rgba(31, 107, 255, .07), transparent 60%),
    url("/static/img/math-bg.svg") center / cover no-repeat,
    #fff;
}

.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter) 24px; }

/* Header: logo + language ------------------------------------------------------ */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.logo img { width: 38px; height: 38px; }
.logo span { white-space: nowrap; }

.lang { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(20, 26, 46, .06); }
.lang-option { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; text-decoration: none; font-size: .9rem; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.lang-option:hover { color: var(--ink); background: #f2f4fa; }
.lang-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c3c9d6; background: #fff; flex: none; transition: border-color .2s; }
.lang-option.is-on { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -6px rgba(106, 61, 255, .7); }
.lang-option.is-on .lang-dot { border-color: #fff; background: radial-gradient(circle, #fff 0 38%, transparent 42%); }

/* Cover --------------------------------------------------------------------------- */
.hero { flex: 1; display: grid; gap: 20px; grid-template-areas: "slogan" "stage" "cta"; align-content: start; padding-top: 8px; }

.slogan {
  grid-area: slogan;
  margin: 0;
  text-align: center;
  font-size: clamp(1.6rem, 6.4vw, 3.3rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.slogan .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.stage { grid-area: stage; position: relative; display: flex; justify-content: center; }

.video-frame {
  --ar: 9 / 16;
  position: relative;
  margin: 0;
  height: min(58vh, 520px);
  height: min(58dvh, 520px);
  aspect-ratio: var(--ar);
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #e9ecf3;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.video-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(20, 26, 46, .08); pointer-events: none; }
.video-frame.is-landscape { height: auto; width: 100%; min-width: 0; }
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }

.video-play {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); box-shadow: 0 10px 30px rgba(20, 26, 46, .25); cursor: pointer;
  display: grid; place-items: center; transition: transform .2s, opacity .2s;
}
.video-play:hover { transform: scale(1.06); }
.video-play svg { width: 30px; height: 30px; margin-left: 4px; fill: var(--blue); }
.is-playing .video-play { opacity: 0; pointer-events: none; transform: scale(.85); }

.video-bar {
  position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px;
  padding: 6px; border-radius: 999px; background: rgba(15, 20, 40, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .25s;
}
.video-frame:hover .video-bar, .video-frame:focus-within .video-bar, .video-frame:not(.is-playing) .video-bar { opacity: 1; }
@media (hover: none) { .video-bar { opacity: 1; } }
.video-btn { width: 34px; height: 34px; flex: none; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.video-btn:hover { background: rgba(255, 255, 255, .18); }
.video-btn svg { width: 20px; height: 20px; fill: currentColor; }
.video-btn .w { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.i-pause, .is-playing .i-play, .i-muted, .is-muted .i-sound { display: none; }
.is-playing .i-pause, .is-muted .i-muted { display: block; }
.video-progress { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.video-progress span { transition: transform .25s linear; display: block; height: 100%; width: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }

.video-frame.is-empty { display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; color: var(--muted); background: linear-gradient(160deg, #f4f6ff, #f7efff); }
.video-frame.is-empty svg { width: 64px; height: 64px; fill: none; stroke: #8b7cf6; stroke-width: 3; stroke-linejoin: round; }
.video-frame.is-empty p { margin: 0; max-width: 22ch; font-size: .95rem; }

/* Subtitles: PC only (hidden on phones and tablets) */
.captions { display: none; }

/* Buttons */
.cta { grid-area: cta; display: flex; flex-direction: column; align-items: stretch; gap: 12px; max-width: 420px; width: 100%; margin: 0 auto; }
.subline { margin: 0 0 6px; text-align: center; color: var(--muted); font-size: 1rem; }
.cta-note { margin: -4px 0 6px; text-align: center; color: var(--muted); font-size: .82rem; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 56px; padding: 8px 10px 8px 28px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 1.08rem; font-weight: 600; text-decoration: none; letter-spacing: -.005em;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s;
}
.btn > span:first-child { flex: 1; text-align: center; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.btn-badge svg { width: 20px; height: 20px; }

.btn-primary { color: #fff; background: var(--grad); box-shadow: 0 14px 30px -10px rgba(80, 60, 255, .6); }
.btn-primary:hover { box-shadow: 0 18px 36px -10px rgba(80, 60, 255, .7); filter: saturate(1.1) brightness(1.04); }
.btn-primary .btn-badge { background: #fff; }
.btn-primary .btn-badge svg { fill: var(--violet); }

.btn-ghost { color: var(--ink); background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box; border: 2px solid transparent; box-shadow: 0 8px 20px -12px rgba(80, 60, 255, .45); }
.btn-ghost:hover { box-shadow: 0 12px 26px -12px rgba(80, 60, 255, .55); }
.btn-ghost .btn-badge { background: var(--grad); }
.btn-ghost .btn-badge svg { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* Speakers pop-up ------------------------------------------------------------------- */
.speaker { padding: 0; border: 0; background: transparent; color: inherit; max-width: none; max-height: none; }
.speaker::backdrop { background: #fff; }
.speaker[open] { animation: pop .35s cubic-bezier(.2, .9, .3, 1.2); }
/* Phones: the pop-up fills the screen */
.speaker { width: 100%; height: 100%; margin: 0; }
.speaker-card {
  position: relative; height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 48px 28px calc(32px + env(safe-area-inset-bottom)); text-align: center; background: #fff;
}
.speaker-card h2 { margin: 8px 0 0; font-size: 1.5rem; letter-spacing: -.02em; }
.speaker-card p { margin: 0 0 14px; color: var(--muted); font-size: 1.05rem; max-width: 30ch; }
.speaker-icon svg { width: 120px; height: 120px; }
.wave { animation: wave 1.6s ease-in-out infinite; }
.w2 { animation-delay: .25s; }
.speaker-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.speaker-close:hover { background: #f2f0ff; }
.speaker-close svg { width: 26px; height: 26px; fill: none; stroke-width: 3; stroke-linecap: round; }
.btn-ok { width: min(100%, 260px); padding: 8px 28px; }

@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes wave { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation: none !important; transition: none !important; } }

/* Placeholder pages ------------------------------------------------------------------ */
.soon { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.soon h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -.02em; }
.soon p { margin: 0 0 18px; color: var(--muted); }
.soon .btn { padding-right: 28px; }

/* Tablets and up -------------------------------------------------------------------- */
@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .top { padding: 22px 0; }
  .logo img { width: 44px; height: 44px; }
  .logo { font-size: 1.2rem; }
  /* White, see-through, blurred frame over the cover page */
  .speaker { width: min(440px, calc(100% - 48px)); height: fit-content; margin: auto; }
  .speaker::backdrop { background: rgba(255, 255, 255, .55); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); }
  .speaker-card { height: auto; padding: 48px 40px 40px; border-radius: 28px; border: 1px solid rgba(106, 61, 255, .18); box-shadow: 0 30px 80px -20px rgba(40, 30, 120, .35); }
}

@media (min-width: 820px) {
  .hero { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "slogan slogan" "stage cta"; column-gap: clamp(32px, 6vw, 96px); row-gap: clamp(20px, 4vh, 40px); align-items: center; }
  .hero.has-landscape { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .slogan { padding: 18px 32px; border-radius: 999px; background: rgba(255, 255, 255, .78); border: 1px solid var(--line); box-shadow: 0 10px 30px -18px rgba(20, 26, 46, .25); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); font-size: clamp(1.7rem, 3.4vw, 3rem); }
  .video-frame { height: min(64vh, 660px); }
  .cta { margin: 0; max-width: 400px; justify-self: center; }
  .subline { font-size: 1.12rem; }
}

/* PC: subtitles under the speaking teacher, two lines at most */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .captions {
    display: block; position: absolute; z-index: 2; left: 52%; bottom: 76px; width: min(560px, 46vw);
    margin: 0; pointer-events: none; transition: opacity .25s;
  }
  .captions.is-hidden { opacity: 0; }
  .captions p { margin: 0; font-size: 1.15rem; line-height: 1.75; font-weight: 500; }
  .captions span {
    padding: .2em .7em; border-radius: 10px; background: rgba(255, 255, 255, .95); color: var(--ink);
    box-shadow: 0 8px 24px -10px rgba(20, 26, 46, .35); border: 1px solid var(--line);
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
  }
}

/* Narrow phones: short language names (EN / ES) */
.lang-short { display: none; text-decoration: none; }
@media (max-width: 419px) {
  .lang-name { display: none; }
  .lang-short { display: inline; }
  .lang-option { padding: 7px 12px 7px 8px; gap: 6px; }
  .logo span { font-size: .95rem; }
}
