/* NuBlock -- landing sheet.
 *
 * One page: a glass nav pill, a centred hero, a dark footer. The system is
 * Mobbin's -- a pure white canvas, near-black #141414 ink, one translucent
 * grey doing every surface, 999px pills on anything you press, and no accent
 * colour or elevation anywhere.
 *
 * The face is Inter Variable, standing in for Mobbin's M Saans, so the four
 * weights that system uses are reachable exactly: 300 for ledes and labels,
 * 456 for body copy, 600 for UI, 652 for display. */

@font-face {
  font-family: "InterVar";
  src: url("/fonts/InterVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ink */
  --ink: #141414;
  --ink-muted: #717171;
  --ink-faint: #a3a3a3;

  /* Surfaces. Both greys are translucent, so they tint what is behind them
   * instead of stacking hard fills. */
  --canvas: #ffffff;
  --surface: rgba(64, 64, 64, 0.06);
  --surface-strong: rgba(64, 64, 64, 0.08);
  --hairline: rgba(65, 65, 65, 0.16);
  --nav-glass: rgba(237, 237, 237, 0.64);

  /* Dark end of the page */
  --dark: #141414;
  --on-dark: #ffffff;
  --on-dark-muted: rgba(255, 255, 255, 0.56);

  /* Face */
  --font-sans: "InterVar", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;

  /* Weights, named for the roles rather than the numbers */
  --w-light: 300;
  --w-book: 456;
  --w-ui: 600;
  --w-display: 652;

  /* Scale. 80px display is the ceiling; it clamps down so the sheet survives a
   * phone without a horizontal scrollbar. */
  --text-display: clamp(40px, 6.4vw, 80px);
  --text-h3: clamp(21px, 2vw, 24px);
  --text-lede: 20px;
  --text-ui: 16px;
  --text-body: 16px;
  --text-label: 14px;
  --text-micro: 13px;

  /* Layout */
  --container: 1262px;
  --bleed-inset: 20px;
  --page-pad: clamp(20px, 4vw, 40px);

  /* Radii */
  --r-pill: 999px;
  --r-bleed: 24px;
  --r-inner: 12px;
  --r-app: 22px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Column layout so the footer sits at the bottom of a short page and the hero
 * takes whatever height is left. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: var(--w-book);
  font-size: var(--text-body);
  line-height: 1.45;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The hero owns the fold: the nav pill is 60px in a 24px inset, so taking
 * that off the viewport height leaves the stack centred on the first screen
 * and puts the footer immediately below it. */
main {
  flex: 1;
  min-height: calc(100dvh - 84px);
  display: grid;
  place-items: center;
  padding: clamp(48px, 8vw, 96px) 0;
}

img,
svg {
  max-width: 100%;
}

/* ------------------------------------------------------------------ *
 * Type roles
 * ------------------------------------------------------------------ */

.display {
  margin: 0;
  font-size: var(--text-display);
  font-weight: var(--w-display);
  line-height: 1;
  letter-spacing: -0.0075em;
  text-wrap: balance;
}

.h3 {
  margin: 0;
  font-size: var(--text-h3);
  font-weight: var(--w-display);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* 20/300 grey -- the one paragraph style that sits under a display line. */
.lede {
  margin: 0;
  font-size: var(--text-lede);
  font-weight: var(--w-light);
  line-height: 1.3;
  color: var(--ink-muted);
  text-wrap: pretty;
}

.body {
  margin: 0;
  font-weight: var(--w-book);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------------ *
 * Buttons
 * ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: var(--text-ui);
  font-weight: var(--w-ui);
  letter-spacing: 0.2px;
  line-height: 22px;
  border-radius: var(--r-pill);
  border: 0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

/* Ink-filled pill: the only high-contrast element on the page. */
.btn-ink {
  padding: 11px 16px;
  background: var(--ink);
  color: #fff;
}

.btn-ink:hover:not(:disabled) {
  background: #2b2b2b;
}

.btn-ink:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Its partner is the same size in a single pixel of grey. */
.btn-line {
  padding: 10px 16px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.btn-line:hover {
  background: var(--surface);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ *
 * Logo placeholders
 * ------------------------------------------------------------------ *
 * Shapes standing in for artwork that has not arrived yet. A slot is a grey
 * shape with its initials inside; to drop a real logo in, add the has-logo
 * class and set --logo to a url(). The box does not change, so nothing shifts
 * when the logos land. */

.mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  background-color: var(--surface-strong);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  color: var(--ink-faint);
  font-size: var(--text-micro);
  font-weight: var(--w-ui);
  letter-spacing: 0.02em;
  overflow: hidden;
}

.mark.has-logo {
  background-color: transparent;
  background-image: var(--logo);
  color: transparent;
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mark-app {
  width: 72px;
  height: 72px;
  border-radius: var(--r-app);
}

.mark-app svg {
  width: 34px;
  height: 34px;
}

.mark-squircle {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.mark-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
}

.mark-wordmark {
  width: 116px;
  height: 28px;
  border-radius: 6px;
}

.mark-sm {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 9px;
}

/* On the dark footer the placeholder shape has to lift off the ground rather
 * than sink into it. */
.foot .mark {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--on-dark-muted);
}

/* ------------------------------------------------------------------ *
 * Shell
 * ------------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* Nav: a 620px glass pill floating at the top, centred, no shadow. */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 24px var(--page-pad) 0;
  pointer-events: none;
}

.nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(620px, 100%);
  height: 60px;
  padding: 0 10px 0 18px;
  border-radius: 30px;
  background: var(--nav-glass);
  backdrop-filter: blur(48px);
  -webkit-backdrop-filter: blur(48px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  font-size: 17px;
  font-weight: var(--w-display);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark .glyph {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}

.wordmark .glyph svg {
  width: 15px;
  height: 15px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: var(--r-pill);
  font-size: var(--text-ui);
  font-weight: var(--w-ui);
  letter-spacing: 0.2px;
  color: var(--ink);
  text-decoration: none;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.55);
}

/* ------------------------------------------------------------------ *
 * Hero -- the page
 * ------------------------------------------------------------------ */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.hero .display {
  max-width: 15ch;
}

.hero .lede {
  max-width: 44ch;
}

.hero .actions {
  margin-top: 8px;
}

/* ------------------------------------------------------------------ *
 * Footer
 * ------------------------------------------------------------------ */

.foot {
  background: var(--dark);
  color: var(--on-dark);
  padding: clamp(48px, 6vw, 80px) 0 32px;
  border-radius: var(--r-bleed) var(--r-bleed) 0 0;
  margin: 0 var(--bleed-inset);
}

.foot-line {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: var(--w-display);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 clamp(40px, 5vw, 64px);
  max-width: 22ch;
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.foot-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.foot-col h2 {
  margin: 0;
  font-size: var(--text-label);
  font-weight: var(--w-ui);
  letter-spacing: 0.2px;
  color: var(--on-dark);
}

.foot-col a,
.foot-col p {
  margin: 0;
  font-size: var(--text-ui);
  font-weight: var(--w-light);
  letter-spacing: 0.2px;
  color: var(--on-dark-muted);
  text-decoration: none;
}

.foot-col a:hover {
  color: var(--on-dark);
}

/* The catalog list: a logo slot beside each school, so the marks have a home
 * on the page while the rest of it stays a single hero. */
.foot-schools {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.foot-schools li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-ui);
  font-weight: var(--w-light);
  letter-spacing: 0.2px;
  color: var(--on-dark-muted);
}

.foot-base {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  font-size: var(--text-micro);
  font-weight: var(--w-light);
  color: var(--on-dark-muted);
}

.foot-base .spacer {
  margin-left: auto;
}

/* ------------------------------------------------------------------ *
 * Sign in
 * ------------------------------------------------------------------ */

.gate[hidden] {
  display: none;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.gate-scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gate-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  background: var(--canvas);
  border-radius: var(--r-bleed);
  border: 1px solid var(--hairline);
}

.gate-head {
  margin: 14px 0 6px;
}

.gate-card .body {
  margin-bottom: 20px;
  font-size: var(--text-label);
}

.gate-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.gate-close:hover {
  background: var(--surface-strong);
}

.gate-close svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: var(--text-micro);
  font-weight: var(--w-light);
  letter-spacing: 0.2px;
  color: var(--ink-muted);
}

.select-wrap {
  position: relative;
}

.gate-card select {
  width: 100%;
  appearance: none;
  font-family: inherit;
  font-size: var(--text-ui);
  font-weight: var(--w-book);
  color: var(--ink);
  padding: 12px 40px 12px 14px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--r-inner);
  cursor: pointer;
  outline: none;
}

.gate-card select:invalid {
  color: var(--ink-muted);
}

.gate-card select:focus {
  border-color: var(--ink);
  background: var(--canvas);
}

.select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  pointer-events: none;
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-block {
  width: 100%;
  margin-top: 4px;
}

.gate-error {
  margin: 12px 0 0;
  font-size: var(--text-micro);
  font-weight: var(--w-ui);
  color: #c0392b;
}

.gate-error[hidden] {
  display: none;
}

.gate-note {
  margin: 14px 0 0;
  font-size: var(--text-micro);
  font-weight: var(--w-light);
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------------ *
 * Narrow
 * ------------------------------------------------------------------ */

@media (max-width: 1000px) {
  .foot-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  /* The hero lede is written to break in two lines at desktop width; at phone
   * width the wrap does that job and the hard break only makes it ragged. */
  .opt-br {
    display: none;
  }

  .foot-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .foot-base .spacer {
    margin-left: 0;
  }
}
