/* GradMarket — public page.
 *
 * Type scale has two bands and nothing between 1.0625rem and 2.5rem:
 * display (name, tagline, stats, section titles) and body (subhead, rows,
 * micro-labels). Keep it that way.
 * Colour is greyscale plus one accent, used only for "new" and focus rings.
 */

:root {
  --bg: #0b0c0f;
  --surface: #121419;
  --hairline: #202328;
  --text: #f2f3f5;
  --muted: #7e848d;
  --accent: #f2b23a;
  --bar: rgb(11 12 15 / 0.85);

  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --gutter: 32px;
  --nav-h: 64px;
  --filters-h: 73px; /* measured and updated by site.js; this is the unwrapped height */
  --row-h: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f3;
    --surface: #ebebe8;
    --hairline: #dcdcd8;
    --text: #0b0c0f;
    --muted: #686d75;
    --accent: #8f5a00;
    --bar: rgb(245 245 243 / 0.85);
    color-scheme: light;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.skip-link {
  position: absolute;
  top: 12px;
  left: var(--gutter);
  z-index: 10;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* --- type --- */

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.micro {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- nav --- */

.nav {
  position: sticky;
  top: 0;
  z-index: 6;
  height: var(--nav-h);
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity 150ms var(--ease);
}

.nav__home:hover {
  opacity: 0.8;
  text-decoration: none;
}

.nav__mark {
  display: block;
  flex: none;
  width: 26px;
  height: 26px;
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* --- hero --- */

.hero {
  border-bottom: 1px solid var(--hairline);
}

/* The content's own height fills the hero; padding only keeps it off the
 * nav and the closing hairline. */
.hero__inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 88vh;
  min-height: 88svh;
  padding-top: 64px;
  padding-bottom: 40px;
}

.hero__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 8.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--text);
}

.hero__tagline {
  margin: 24px 0 0;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--muted);
}

.hero__sub {
  max-width: 52ch;
  margin: 20px 0 0;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.55;
  /* --muted at 80% as a colour, not opacity — the reveal animation owns
   * opacity. */
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

/* Baseline grid: every stat shares one row, values sit on a common
 * baseline, captions on a second one beneath. */
.stats {
  display: grid;
  /* The date is the widest value ("10 Aug 2026"): its column sizes to it,
   * the three counts share the rest. */
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0 var(--gutter);
  /* Stretch, so every stat's top hairline lines up even when one value
   * wraps; .stat's column-reverse keeps values bottom-aligned within. */
  align-items: stretch;
  margin: 72px 0 0;
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

.stat__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}

/* --- arrivals strip --- */

.arrivals {
  margin: 56px 0 0;
}

.arrivals__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.arrivals__plot {
  position: relative;
}

/* Exactly 80px of plot, sitting on a hairline baseline so a zero day reads
 * as zero, not as missing data. Linear scale: the busiest day touches the
 * top. */
.arrivals__bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: calc(80px + 1px); /* border-box: 80px of plot plus the baseline */
  border-bottom: 1px solid var(--hairline);
}

/* Each bar is a full-height hover target (so a zero day can still be
 * hovered); its ::after is the visible fill. height: 100% of a fixed-height
 * parent, not flex stretch, so the fill's percentage height resolves in
 * every engine. */
.bar {
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  min-width: 0;
  height: 100%;
}

.bar::after {
  content: "";
  width: 100%;
  height: var(--h);
  background: var(--muted);
  opacity: 0.55;
}

/* A day with any arrival is never invisible: one role still draws 2px. */
.bar--some::after {
  min-height: 2px;
}

.bar--recent::after {
  background: var(--accent);
  opacity: 1;
}

.bar:hover::after {
  opacity: 0.9;
}

.bar--recent:hover::after {
  opacity: 1;
}

.arrivals__tip {
  position: absolute;
  bottom: calc(100% + 8px);
  z-index: 2;
  padding: 6px 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  font-size: 0.6875rem;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

.arrivals__months {
  display: flex;
  gap: 1px;
  margin-top: 8px;
}

.arrivals__months span {
  flex-basis: 0;
  min-width: 0;
  white-space: nowrap;
}

/* A short final month: the label hugs the chart's right edge and overflows
 * leftwards (flex-end alignment overflows towards the start). */
.arrivals__month--end {
  display: flex;
  justify-content: flex-end;
}

.arrivals__note {
  margin-top: 12px;
}

/* --- section heads --- */

.list {
  padding-top: 128px;
}

.section-head {
  display: grid;
  gap: 20px;
  padding-bottom: 56px;
}

.section-head__title {
  max-width: 18ch;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
}

/* --- filter bar --- */

.filters {
  position: sticky;
  top: var(--nav-h);
  z-index: 5;
  margin: 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--bar);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.filters__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field--grow {
  flex: 1 1 240px;
}

input[type="search"],
select {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
}

input[type="search"]::placeholder {
  color: var(--muted);
  opacity: 1;
}

select {
  min-width: 11rem;
  padding-right: 32px;
  appearance: none;
  cursor: pointer;
}

/* Chevron: two hairline borders of a rotated square — no icon, no image. */
.select {
  position: relative;
}

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

input[type="search"]:hover,
select:hover {
  border-color: var(--muted);
}

.field--toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
}

.field--toggle label {
  color: var(--text);
  cursor: pointer;
}

input[type="checkbox"] {
  display: grid;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid var(--muted);
  border-radius: 0;
  background: var(--bg);
  appearance: none;
  cursor: pointer;
}

input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: scale(0);
}

input[type="checkbox"]:checked {
  border-color: var(--accent);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.filters__count {
  display: flex;
  align-items: center;
  height: 40px;
  margin-left: auto;
}

/* --- freshness groups --- */

.group__head th {
  position: sticky;
  top: calc(var(--nav-h) + var(--filters-h));
  z-index: 2;
  height: 44px;
  padding: 0;
  padding-top: 20px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
  text-align: left;
  vertical-align: bottom;
  padding-bottom: 10px;
}

.group__name {
  color: var(--text);
}

.group__span,
.group__count {
  margin-left: 12px;
}

.sort-note {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.sort-note[hidden] {
  display: none;
}

.sort-note button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* --- rows --- */

.roles {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.roles th {
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
  font-weight: 500;
  text-align: left;
  vertical-align: bottom;
  padding-bottom: 12px;
}

.roles th button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.roles th button:hover,
.roles th[aria-sort] button {
  color: var(--text);
}

.roles th[aria-sort="ascending"] button::after {
  content: " ↑";
}

.roles th[aria-sort="descending"] button::after {
  content: " ↓";
}

.col-role {
  width: 48%;
}

.col-location {
  width: 24%;
}

.col-num {
  width: 14%;
  text-align: right;
}

.roles th.col-num {
  text-align: right;
}

.roles td {
  height: var(--row-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}

.roles td:first-child,
.roles th:first-child {
  padding-left: 0;
}

.roles td:last-child,
.roles th:last-child {
  padding-right: 0;
}

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

/* One line each at 64px; the full text stays in the DOM (and in the link's
 * accessible name), only the visual overflow is clipped. */
.role__title,
.role__location {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td.col-location {
  color: var(--muted);
}

/* Micro size, so it reads as an annotation on the location beside it. */
.role__more {
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.role__title {
  font-weight: 450;
}

.role__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag--new {
  color: var(--accent);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.role--long,
.role--long .role__title {
  color: var(--muted);
}

.roles td.col-num {
  white-space: nowrap;
}

.empty {
  padding: 48px 0;
  color: var(--muted);
}

/* --- footer --- */

.footer {
  margin-top: 160px;
  padding: 128px 0 48px;
  border-top: 1px solid var(--hairline);
}

.limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px var(--gutter);
  max-width: 920px;
  margin: 0;
}

.limits dd {
  max-width: 52ch;
  margin: 12px 0 0;
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 128px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

.footer__base a {
  color: var(--text);
}

/* --- motion: hero stats and section heads only; rows never animate --- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 400ms var(--ease),
    transform 400ms var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .nav__home {
    transition: none;
  }
}

/* --- mobile --- */

@media (max-width: 760px) {
  .hero__inner {
    padding-bottom: 48px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 16px;
    margin-top: 56px;
  }

  /* "10 Aug 2026" is wider than half a phone: let it break after the month. */
  .stat--date .stat__value {
    white-space: normal;
  }

  /* clamp(4rem, ...)'s floor is wider than a phone: "GradMarket." at
   * 4rem is ~334px against ~326px of content width at 390px. */
  .hero__name {
    font-size: 15.5vw;
  }

  .group__head th {
    top: var(--nav-h); /* the filter bar isn't sticky here */
  }

  .nav__links {
    gap: 20px;
  }

  /* Wrapped onto three rows the bar would hold a fifth of a phone screen
   * for the whole scroll; on narrow screens it scrolls away instead. */
  .filters {
    position: static;
  }

  .filters__count {
    margin-left: 0;
  }

  .field:not(.field--grow):not(.field--toggle) {
    flex: 1 1 140px;
  }

  select {
    min-width: 0;
  }

  .roles,
  .roles tbody {
    display: block;
  }

  .roles thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .role {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 16px 0;
    border-bottom: 1px solid var(--hairline);
  }

  .roles td {
    display: block;
    height: auto;
    padding: 0;
    border: 0;
  }

  .roles td.col-role,
  .roles td.col-location {
    width: 100%;
    text-align: left;
  }

  .role__title {
    white-space: normal;
  }

  td.col-location {
    margin-bottom: 6px;
  }

  .role__location {
    white-space: normal;
  }

  /* The two numbers become labelled inline micro-pills. */
  .roles td.col-num {
    display: inline-flex;
    gap: 8px;
    width: auto;
    padding: 4px 10px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
  }

  .roles td.col-num::before {
    content: attr(data-label);
    color: var(--muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .limits {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .footer {
    margin-top: 96px;
    padding-top: 96px;
  }
}
