/*
 * The password page of the sealed release (gate/index.html). It stands alone: the app's own stylesheets
 * are inside the sealed file, so the tokens below repeat the few the page needs from css/frame.css.
 * Black, white and silver; Boldonse for the wordmark, Inter for the rest (both from css/fonts.css).
 * gate/gate.js removes this stylesheet once the app is open.
 */

:root {
  color-scheme: dark;
  --bg: #080808;
  --bg-deep: #050505;
  --line: #262626;
  --line-strong: #3a3a3a;
  --line-bright: #5d6066;
  --text: #ffffff;
  --text-2: #d8d9dc;
  --muted: #a3a5aa;
  --faint: #85878d;
  --silver: #c5c8cd;
  --silver-hi: #f2f3f5;
  --silver-lo: #8e9298;
  --silver-grad: linear-gradient(180deg, #f7f8fa 0%, #e2e4e8 36%, #c3c7cd 64%, #b8bcc2 100%);
  --silver-text: linear-gradient(180deg, #ffffff 0%, #e4e6ea 45%, #a9adb3 100%);
  --silver-sheen: linear-gradient(105deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 65%);
  --silver-rule: linear-gradient(90deg, rgba(242, 243, 245, 0), rgba(242, 243, 245, .42) 50%, rgba(242, 243, 245, 0));
  --bad: #ff7a70;
  --gutter: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 200ms;
  --display: "Boldonse", "Arial Black", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--bg-deep); }

body.gate {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 46% 62% at 80% 38%, rgba(222, 226, 232, .11), rgba(222, 226, 232, 0) 70%),
    radial-gradient(ellipse 70% 50% at 18% -10%, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 65%),
    var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--silver-hi); color: #000; }

.gate-page {
  position: relative;
  isolation: isolate;
  /* clip, not just hidden: a hidden box can still be scrolled by focus(), which slid the page sideways
     (the iris hangs past the right edge) after a wrong password. */
  overflow: hidden;
  overflow: clip;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
/* Architectural hairlines that fade out toward the edges, as on the app's welcome page. */
.gate-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 132px);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000, transparent 75%);
}
.gate-iris {
  position: absolute;
  z-index: -1;
  right: -170px;
  top: 44%;
  width: 780px;
  height: 780px;
  transform: translateY(-50%);
  opacity: .45;
  pointer-events: none;
  animation: gate-iris-in 1600ms var(--ease) both;
}
.gate-iris svg { width: 100%; height: 100%; display: block; }

.gate-inner {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(44px, 9vh, 112px) var(--gutter) clamp(36px, 6vh, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 440px);
  gap: 44px 64px;
  align-items: center;
}
.gate-intro { min-width: 0; }

.gate-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--silver);
}
.gate-kicker::before { content: ""; width: 44px; height: 1px; background: var(--silver-grad); }

/* Boldonse is very wide (UNIVERSITY is about 6.7 em, ANCHORED 7.1 em): the size follows the column. Its
   capitals stand 1.2 em tall, so wrapped lines need a line-height of about 1.28. */
.gate-title {
  margin: 0 0 22px;
  font-family: var(--display);
  font-weight: 900;
  font-synthesis: none;
  font-size: clamp(44px, 5.4vw, 84px);
  line-height: 1.28;
  letter-spacing: .005em;
  text-transform: uppercase;
}
.gate-word { display: block; width: max-content; max-width: 100%; animation: gate-word-in 900ms var(--ease) both; }
.gate-word + .gate-word { animation-delay: 120ms; }
.gate-silver {
  background: var(--silver-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--silver-hi);
}
.gate-product {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--text-2);
  animation: gate-word-in 900ms 240ms var(--ease) both;
}
.gate-product::after { content: ""; flex: 0 1 120px; height: 1px; background: linear-gradient(90deg, var(--silver-lo), transparent); }
/* The "independent, not affiliated" line, the first thing under the name: quieter than the panel, but
   plainly readable (--muted is about 8:1 on the page) and above the fold on a phone. */
.gate-disclaimer {
  margin: 18px 0 0;
  max-width: 34em;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  animation: gate-word-in 900ms 320ms var(--ease) both;
}

/* ---------------------------------------------------------------- the panel */

.gate-panel {
  position: relative;
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(26, 26, 26, .84), rgba(10, 10, 10, .88));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 50px 110px -40px #000, inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: gate-rise-in 700ms 200ms var(--ease) both;
}
.gate-panel::before { content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; background: var(--silver-rule); }
.gate-eyebrow { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--silver); }
.gate-panel h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; color: var(--text); }
.gate-lead { margin: 0 0 22px; color: var(--muted); font-size: 15px; }

.gate-label { display: block; margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.gate-field { position: relative; }
.gate-input {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 10px 92px 10px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming in on focus */
  letter-spacing: .02em;
  color: var(--text);
  background: var(--bg-deep);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.gate-input:hover { border-color: var(--line-bright); }
.gate-input:focus { outline: none; border-color: var(--silver-hi); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), 0 0 0 3px rgba(242, 243, 245, .2); }
.gate-input[aria-invalid="true"] { border-color: rgba(255, 122, 112, .7); }
.gate-input[aria-invalid="true"]:focus { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), 0 0 0 3px rgba(255, 122, 112, .2); }
.gate-input[readonly] { color: var(--muted); }
/* Safari's own key and reveal buttons would sit under Show. */
.gate-input::-webkit-credentials-auto-fill-button { margin-right: 64px; }
.gate-input::-ms-reveal { display: none; }

.gate-show {
  position: absolute;
  top: 5px;
  right: 5px;
  bottom: 5px;
  min-width: 72px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: 600 11.5px/1 var(--font);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.gate-show:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.gate-show:focus-visible { outline: 2px solid var(--silver-hi); outline-offset: -2px; }

.gate-msg { margin: 12px 4px 0; min-height: 1.5em; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.gate-msg:empty { min-height: 0; margin: 0; }
.gate-msg-error { color: var(--bad); font-weight: 600; }

.gate-btn {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  margin: 18px 0 0;
  padding: 8px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .55);
  color: #050505;
  background: var(--silver-sheen) no-repeat -160% 0 / 55% 100%, var(--silver-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(0, 0, 0, .2), 0 10px 30px -14px rgba(222, 226, 232, .45);
  font: 600 13px/1.15 var(--font);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: box-shadow var(--dur) var(--ease), background-position 700ms var(--ease), opacity var(--dur) var(--ease);
}
.gate-btn:hover { color: #000; background-position: 260% 0, 0 0; box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .2), 0 14px 36px -12px rgba(222, 226, 232, .6); }
.gate-btn:active { box-shadow: inset 0 2px 4px rgba(0, 0, 0, .25); }
.gate-btn:focus-visible { outline: 2px solid var(--silver-hi); outline-offset: 3px; }
.gate-btn[aria-disabled="true"] { cursor: progress; opacity: .7; }
.gate-btn[aria-disabled="true"]:hover { background-position: -160% 0, 0 0; }
.gate-arrow { width: 14px; height: 10px; flex: 0 0 14px; transition: transform var(--dur) var(--ease); }
.gate-btn:hover .gate-arrow { transform: translateX(3px); }
.gate-btn[aria-disabled="true"] .gate-arrow { display: none; }
.gate-btn[aria-disabled="true"]::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, .25);
  border-top-color: #050505;
  animation: gate-spin 800ms linear infinite;
}
/* Locked out for a while (too many tries): a settled state, not "working". A lock and the time left, no
   spinner, and a cursor that says the button can't be pressed yet. */
.gate-lock { display: none; width: 12px; height: 14px; flex: 0 0 12px; }
.gate-count { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.gate-count:empty { display: none; }
.gate-btn[data-locked="true"] { cursor: not-allowed; opacity: .78; }
.gate-btn[data-locked="true"]::after { content: none; animation: none; }
.gate-btn[data-locked="true"] .gate-lock { display: block; }

.gate-fine { margin: 18px 0 0; color: var(--faint); font-size: 13px; line-height: 1.5; }
/* The page can't open the course here (no secure address, an old browser, a file that didn't load). */
.gate-form[hidden] { display: none; }

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

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

.gate-footer {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px var(--gutter) 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  font-size: 12px;
  color: var(--faint);
}
.gate-footer::before { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 0; height: 1px; background: var(--silver-rule); opacity: .5; }
.gate-footer-word { font-family: var(--display); font-weight: 900; font-synthesis: none; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.gate-footer-product { font-size: 9.5px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--faint); }
.gate-footer-legal { margin: 0 0 0 auto; }

/* ---------------------------------------------------------------- motion */

@keyframes gate-word-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes gate-rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes gate-iris-in { from { opacity: 0; transform: translateY(-50%) rotate(-24deg) scale(.94); } to { opacity: .45; transform: translateY(-50%); } }
@keyframes gate-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .gate-btn[aria-disabled="true"]::after { animation: none; }
}

/* ---------------------------------------------------------------- smaller screens */

@media (max-width: 979px) {
  .gate-inner { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 36px; }
  .gate-title { font-size: min(calc((100vw - 2 * var(--gutter)) / 7.3), 76px); }
  .gate-panel { max-width: 520px; }
  .gate-iris { right: -260px; top: 26%; width: 640px; height: 640px; opacity: .3; }
  @keyframes gate-iris-in { from { opacity: 0; } to { opacity: .3; } }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .gate-inner { padding-top: 40px; padding-bottom: 32px; gap: 28px; }
  .gate-kicker { margin-bottom: 18px; }
  .gate-title { margin-bottom: 14px; }
  .gate-product { font-size: 11.5px; letter-spacing: .34em; }
  .gate-panel { padding: 24px 20px; border-radius: 16px; }
  .gate-panel h2 { font-size: 21px; }
  .gate-iris { right: -300px; top: 18%; width: 520px; height: 520px; }
  .gate-footer { flex-direction: column; align-items: flex-start; }
  .gate-footer-legal { margin: 4px 0 0; }
}
