:root {
  --deep-ink: #14110D;
  --brand-red: #B5483C;
  --brand-red-light: #D66A5D;
  --brand-cream: #FAF7F0;
  --brand-paper: #FFFDF9;
  --brand-ink: #2A2520;
  --brand-muted: #8E8374;
  --origin-x: 50vw;
  --origin-y: 64vh;
}

html,
body.student-code-page {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body.student-code-page {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--brand-ink);
  background: var(--brand-cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.student-code-page button,
.student-code-page input {
  font: inherit;
}

.experience {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 540px;
  isolation: isolate;
  overflow: hidden;
  background: var(--brand-cream);
}

.intro-scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(42, 37, 32, .025) 1px, transparent 1px),
    var(--brand-cream);
  background-size: 100% 32px;
}

.intro-content {
  position: relative;
  z-index: 2;
  width: min(620px, calc(100vw - 56px));
  margin-top: -11vh;
  transition:
    opacity 320ms ease,
    transform 650ms cubic-bezier(.2, .7, .2, 1),
    filter 420ms ease;
}

.student-brand-logo {
  display: block;
  width: 100%;
  height: auto;
}

.radial-ink {
  position: fixed;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at var(--origin-x) var(--origin-y), rgba(181, 72, 60, .12), transparent 26%),
    var(--deep-ink);
  clip-path: circle(0 at var(--origin-x) var(--origin-y));
  pointer-events: none;
}

.radial-ring {
  position: fixed;
  z-index: 4;
  left: var(--origin-x);
  top: var(--origin-y);
  width: 34px;
  height: 34px;
  border: 2px solid var(--brand-red-light);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.2);
  pointer-events: none;
}

.engaged-scene {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: var(--brand-paper);
  pointer-events: none;
}

.engaged-content {
  width: min(1120px, calc(100vw - 56px));
  margin-top: -19vh;
  text-align: center;
  opacity: 0;
  transform: scale(.94) translateY(22px);
}

.engaged-title {
  margin: 0;
  color: var(--brand-paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 7.1vw, 104px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.055em;
}

.glow-word {
  color: var(--brand-red-light);
  text-shadow:
    0 0 10px rgba(214, 106, 93, .62),
    0 0 28px rgba(181, 72, 60, .34);
}

.form-zone {
  position: fixed;
  z-index: 6;
  left: 50%;
  top: 64%;
  width: min(430px, calc(100vw - 48px));
  transform: translate(-50%, -50%);
  transition:
    top 620ms cubic-bezier(.68, 0, .2, 1),
    width 620ms cubic-bezier(.68, 0, .2, 1);
}

.code-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(42, 37, 32, .16);
  border-radius: 14px;
  background: rgba(255, 253, 249, .78);
  box-shadow: 0 8px 28px rgba(42, 37, 32, .035);
  backdrop-filter: blur(8px);
  transition:
    background 420ms ease,
    border-color 420ms ease,
    box-shadow 420ms ease;
}

.code-form:focus-within {
  outline: 2px solid var(--brand-red-light);
  outline-offset: 3px;
}

.code-input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 13px 17px;
  background: transparent;
  color: var(--brand-ink);
  font-size: 15px;
  letter-spacing: .06em;
}

.code-input::placeholder {
  color: #9A8E7D;
  letter-spacing: .03em;
}

.submit-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-ink);
  color: var(--brand-paper);
  cursor: pointer;
  display: grid;
  grid-auto-flow: column;
  place-items: center;
  transition: background 180ms ease, transform 180ms ease, width 420ms ease;
}

.submit-button:hover {
  transform: translateX(2px);
}

.submit-button:focus-visible,
.back-button:focus-visible,
.teacher-login-link:focus-visible {
  outline: 2px solid var(--brand-red-light);
  outline-offset: 3px;
}

.submit-label {
  width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: width 360ms ease, opacity 260ms ease;
}

.submit-arrow {
  font-size: 20px;
  line-height: 1;
}

.form-zone .err {
  display: block;
  min-height: 20px;
  margin: 10px 10px 0;
  color: var(--brand-red-light);
  font-size: 12px;
  text-align: left;
  opacity: 0;
  transition: opacity 180ms ease;
}

.form-zone .err.show {
  opacity: 1;
}

.teacher-login-link,
.back-button {
  position: fixed;
  z-index: 8;
  border: 0;
  background: transparent;
  font-size: 12px;
  letter-spacing: .08em;
  text-decoration: none;
}

.teacher-login-link {
  top: 27px;
  right: 32px;
  padding: 10px;
  color: rgba(42, 37, 32, .55);
}

.back-button {
  top: 25px;
  left: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: rgba(255, 253, 249, .62);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.student-code-page .site-compliance-footer {
  z-index: 8;
  color: rgba(42, 37, 32, .38);
  transition: color 420ms ease;
}

body[data-state="engaged"] .radial-ink {
  animation: radial-reveal 650ms cubic-bezier(.66, 0, .2, 1) forwards;
}

body[data-state="engaged"] .radial-ring {
  animation: focus-ring 620ms cubic-bezier(.2, .7, .2, 1) forwards;
}

body[data-state="engaged"] .intro-content {
  opacity: 0;
  filter: blur(5px);
  transform: scale(.88);
}

body[data-state="engaged"] .engaged-content {
  animation: reveal-copy 580ms 390ms cubic-bezier(.2, .7, .2, 1) forwards;
}

body[data-state="engaged"] .form-zone {
  top: 68%;
  width: min(600px, calc(100vw - 48px));
}

body[data-state="engaged"] .code-form {
  border-color: rgba(255, 253, 249, .22);
  background: rgba(255, 253, 249, .07);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
}

body[data-state="engaged"] .code-input {
  color: var(--brand-paper);
}

body[data-state="engaged"] .code-input::placeholder {
  color: rgba(255, 253, 249, .42);
}

body[data-state="engaged"] .submit-button {
  width: 132px;
  background: var(--brand-red);
}

body[data-state="engaged"] .submit-label {
  width: 76px;
  opacity: 1;
}

body[data-state="engaged"] .submit-arrow {
  display: none;
}

body[data-state="engaged"] .teacher-login-link,
body[data-state="engaged"] .site-compliance-footer {
  color: rgba(255, 253, 249, .42);
}

body[data-state="engaged"] .back-button {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 260ms 700ms ease, transform 260ms 700ms ease;
}

@keyframes radial-reveal {
  from { clip-path: circle(0 at var(--origin-x) var(--origin-y)); }
  to { clip-path: circle(150vmax at var(--origin-x) var(--origin-y)); }
}

@keyframes focus-ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  35% { opacity: .72; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(16); }
}

@keyframes reveal-copy {
  from { opacity: 0; transform: scale(.94) translateY(22px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 720px) {
  .experience {
    min-height: 520px;
  }

  .intro-content {
    width: min(420px, calc(100vw - 42px));
    margin-top: -14vh;
  }

  .engaged-content {
    width: calc(100vw - 34px);
    margin-top: -22vh;
  }

  .engaged-title {
    font-size: clamp(40px, 13vw, 64px);
    line-height: 1.04;
  }

  .form-zone {
    top: 66%;
    width: calc(100vw - 34px);
  }

  body[data-state="engaged"] .form-zone {
    top: 70%;
    width: calc(100vw - 34px);
  }

  .code-input {
    padding-inline: 12px;
  }

  body[data-state="engaged"] .submit-button {
    width: 112px;
  }

  .teacher-login-link {
    top: 14px;
    right: 14px;
  }

  .back-button {
    top: 13px;
    left: 10px;
  }
}

@media (max-height: 650px) and (min-width: 721px) {
  .engaged-content {
    margin-top: -23vh;
  }

  body[data-state="engaged"] .form-zone {
    top: 72%;
  }
}

@supports not (clip-path: circle(1px at 50% 50%)) {
  body[data-state="engaged"] .radial-ink {
    animation: fallback-fade 280ms ease forwards;
  }
}

@keyframes fallback-fade {
  from { opacity: 0; clip-path: none; }
  to { opacity: 1; clip-path: none; }
}

@media (prefers-reduced-motion: reduce) {
  .student-code-page *,
  .student-code-page *::before,
  .student-code-page *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }

  body[data-state="engaged"] .radial-ink {
    clip-path: circle(150vmax at var(--origin-x) var(--origin-y));
  }

  body[data-state="engaged"] .engaged-content {
    opacity: 1;
    transform: none;
  }
}
