/* ---------------------------------------------------------------- tokens */

:root {
  --ink: #14110f;
  --ink-soft: #6a645d;
  --paper: #f4f4f2;
  --paper-dot: rgba(20, 17, 15, 0.062);
  --paper-grid: 22px;

  --blue: #cfe4f2;
  --yellow: #f6edcb;
  --purple: #e0d2f7;
  --green: #dcead0;
  --red: #d62b1f;

  --topbar-h: 4.5rem;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  /* The slim bars at either end of the page: the rail that docks on scroll and
     the footer that closes it. Shared so they stay the same bar. */
  --bar: rgba(244, 244, 242, 0.88);
  --bar-line: rgba(20, 17, 15, 0.08);
  --ease: cubic-bezier(0.32, 0.08, 0.24, 1);
}

/* ------------------------------------------------------------------ base */

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

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

/* Clear the docked bar when a section is jumped to. */
[id] { scroll-margin-top: 4.5rem; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--paper-dot) 1.3px, transparent 1.4px);
  background-size: var(--paper-grid) var(--paper-grid);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1rem, 0.93rem + 0.32vw, 1.16rem);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0 0 0.5rem 0;
}

.skip-link:focus { left: 0; }

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

/* ----------------------------------------------------------------- hero */

.hero {
  /* Named so the board can work out how much of the first screenful is left
     for it, rather than guessing at a fraction of the window. */
  --hero-pad-top: clamp(1.25rem, 4vh, 3rem);
  --hero-pad-bottom: clamp(1.25rem, 3vh, 2.25rem);

  position: relative; /* the player's slot anchors to this */
  min-height: calc(100svh - var(--topbar-h));
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.78fr);
  /* Top-aligned on purpose: the slack belongs below the name, not around it. */
  align-items: start;
  gap: clamp(1.75rem, 4vw, 3.75rem);
  padding: var(--hero-pad-top) var(--gutter) var(--hero-pad-bottom);
}

.wordmark {
  margin: 0 0 clamp(1.6rem, 4vh, 2.6rem);
  font-family: Anton, "Arial Narrow", Inter, sans-serif;
  font-weight: 400;
  /* Sized to fill the column and still clear it on one line. */
  font-size: clamp(3.6rem, 11.3vw, 10.2rem);
  line-height: 0.9;
  letter-spacing: 0.004em;
  text-transform: uppercase;
}

.facts {
  margin: 0;
  padding: 0 0 0 1.15em;
  list-style: none;
  display: grid;
  gap: clamp(0.8rem, 1.9vh, 1.25rem);
  max-width: 49ch;
  /* Tabbed in from the name rather than flush with it. */
  margin-left: clamp(0.75rem, 1.7vw, 1.6rem);
}

.facts li {
  position: relative;
  z-index: 0;
  transition: transform 0.17s var(--ease);
}

.facts li::marker { content: none; }

.facts li::after {
  content: "";
  position: absolute;
  left: -1.15em;
  top: 0.55em;
  width: 0.32em;
  height: 0.32em;
  border-radius: 50%;
  background: var(--ink);
}

.facts li:hover,
.facts li:focus-within { transform: translateX(6px); }

/* The colour is drawn as a real stroke by js/marker.js; the mark itself only
   reserves the room the pen needs around the words. */
.mark {
  padding: 0.08em 0.26em;
  text-decoration: none;
}

/* Strokes sit behind the words, drawn into the line's own box. */
.marker-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: visible;
  pointer-events: none;
}

.marker-layer path {
  fill: none;
  stroke-linecap: round;
  mix-blend-mode: multiply;
}

/* Only things you can click grow; the bullets themselves just move right.
   Inline elements ignore transform, hence the inline-block, and they scale
   from the centre so a link doesn't shove into the words after it. A mark or a
   rule drifts a couple of px past the stroke drawn behind it, which is painted
   once at load in pixel coordinates and does not scale -- small enough at this
   size to read as the pen and the word moving together. */
a.mark,
.facts .rule,
.crest-link,
.card h3 a,
.card__links a {
  display: inline-block;
  transition: transform 0.15s var(--ease);
}

a.mark:hover,
.facts .rule:hover,
.crest-link:hover,
.card h3 a:hover,
.card__links a:hover {
  transform: scale(1.04);
}

/* Close enough together to read as one pass of the pen, far enough apart to
   still land separately. */
.mark--blue { --hl: var(--blue); }
.mark--yellow { --hl: var(--yellow); }
.mark--purple { --hl: var(--purple); }
.mark--green { --hl: var(--green); }


/* The shield and the name it belongs to break as one. */
.crest-pair { white-space: nowrap; }

/* The link around the shield does the aligning now, and carries no line of its
   own so the box is exactly the image. */
.crest-link {
  line-height: 0;
  vertical-align: -0.24em;
}

.crest {
  height: 1.18em;
  width: auto;
  margin: 0 0.16em 0 0.3em;
}

/* The words the eye should catch, at the same weight as the marked phrases. */
.facts b,
.facts .rule,
.scored { font-weight: 600; }

.rule {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.2em;
}

/* The red double score under "internship opportunities". */
.scored {
  --score: var(--red);
  position: relative;
  white-space: nowrap;
}

/* ------------------------------------------------------------- projects */

.band {
  /* Shared with the heading row so a landing slot can line its player up with
     the cap line of the title. */
  --title-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.2rem);
  padding: 0 var(--gutter) clamp(4rem, 12vh, 8rem);
}

/* The last section needs a screen's worth of room beneath it, or the document
   is too short to scroll it to the top and jumping to it lands halfway down. */
.band:last-of-type { min-height: 100svh; }

.band__title {
  margin: 0.5rem 0 clamp(1.5rem, 4vh, 2.5rem);
  font-family: Anton, "Arial Narrow", Inter, sans-serif;
  font-weight: 400;
  font-size: var(--title-size);
  letter-spacing: 0.006em;
  text-transform: uppercase;
}

.cards {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* Cards size to their own content; a half-written one shouldn't be stretched
     to the height of a finished one. */
  align-items: start;
  column-gap: clamp(1rem, 2.2vw, 1.6rem);
  row-gap: clamp(2rem, 4vw, 3rem);
}

.card {
  /* the marker layer is drawn into this box, same as a bullet line */
  position: relative;
  z-index: 0;
  padding: 0 0 0.95rem;
  border: 1.5px solid rgba(20, 17, 15, 0.12);
  border-radius: 0.55rem;
}

/* Edge to edge, no inset, no tint: the frame belongs to the card, not the shot. */
.card__shot {
  display: block;
  width: 100%;
  /* The width/height attributes are kept on the img to reserve space, but the
     height one lands as a presentational hint and aspect-ratio only applies
     when a dimension is auto -- without this the shot renders 540px tall. */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.45rem 0.45rem 0 0;
  margin-bottom: 0.7rem;
}

.card__shot--empty {
  border-bottom: 1.5px dashed rgba(20, 17, 15, 0.13);
  background: rgba(20, 17, 15, 0.025);
}

.card__head,
.card p { padding: 0 0.85rem; }

/* Title left, date right -- baseline-aligned so the loop sits with the words. */
.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.card h3 a {
  text-decoration: none;
  text-underline-offset: 0.2em;
}

.card h3 a:hover { text-decoration: underline; }

.card__date {
  flex: none;
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.card p {
  margin: 0;
  /* clearly below the title, the way the reference reads */
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.card__links {
  display: flex;
  gap: 0.85rem;
  margin-top: 0.7rem !important;
  font-size: 0.78rem;
}


/* ------------------------------------------------------------- entrance */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.topbar__cn,
.nav,
.socials { animation: fade 0.7s var(--ease) 0.05s both; }

.wordmark { animation: rise 0.75s var(--ease) 0.12s both; }

.facts li { animation: rise 0.66s var(--ease) both; }
.facts li:nth-child(1) { animation-delay: 0.28s; }
.facts li:nth-child(2) { animation-delay: 0.46s; }
.facts li:nth-child(3) { animation-delay: 0.64s; }
.facts li:nth-child(4) { animation-delay: 0.82s; }


/* ----------------------------------------------------------- responsive */

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

/* The page closes the way it opens: the same slim frosted bar as the rail that
   docks at the top on scroll, with the sign-off centred in it. No blur here --
   nothing scrolls underneath a bar at the end of the page, so it would buy a
   compositing layer and nothing else. */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3.1rem;
  padding: 0 var(--gutter);
  border-top: 1px solid var(--bar-line);
  background: var(--bar);
  color: var(--ink-soft);
  font-size: 0.83rem;
  letter-spacing: 0.015em;
}


@media (max-width: 62rem) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Name, then bullets, then the board full width -- the board keeps its
     personality at phone size rather than being dropped. */
  .hero {
    /* The board and the player are a pair: close enough to read as one block,
       and the padding below sets them well apart from the next section. The
       name keeps its own distance rather than taking that gap. */
    --hero-pad-top: clamp(1.25rem, 4vh, 2.5rem);
    --hero-pad-bottom: clamp(2.5rem, 6vh, 3.75rem);

    min-height: 0;
    grid-template-columns: 1fr;
    row-gap: 1.25rem;
  }

  .hero__text { margin-bottom: clamp(0.75rem, 2.4vh, 1.5rem); }

  .facts {
    max-width: none;
    margin-left: 0;
  }

  /* Sized off the viewport rather than the shared clamp, which bottomed out
     around 58px and left the name looking timid on a phone. */
  .wordmark { font-size: clamp(2.8rem, 19vw, 5.2rem); }
}

@media (max-width: 34rem) {
  .cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .facts li:hover { transform: none; }
}
