/* Hallmark · checked · redesign: polish · built: the GitSkins Motion Studio page, rebuilt clean
   critique: kept the dark canvas, the cyan accent, the big display type, the bordered hero with its
   moving field and the project cards; removed the eyebrows, tracked caps, mono labels, gradient
   text, middle-dot strings, glow shadows, the scroll cue, the vanity counters and the placeholder
   GitHub data; content is visible without JavaScript and every animation stops under reduced motion
   or the Motion button. Design adapted from Hamish Williams' portfolio (MIT) by way of GitSkins. */

@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/albert-sans-latin-wght-normal.woff2") format("woff2");
}

:root {
  --bg: oklch(13% 0.012 235);
  --surface: oklch(17.5% 0.014 235);
  --surface-2: oklch(21% 0.016 235);
  --line: oklch(28% 0.016 235);
  --line-strong: oklch(40% 0.02 235);
  --text: oklch(97% 0.004 235);
  --muted: oklch(78% 0.014 235);
  --dim: oklch(66% 0.014 235);
  --cyan: oklch(84% 0.13 205);
  --cyan-ink: oklch(18% 0.03 220);
  --teal: oklch(55% 0.09 195);
  --font: "Albert Sans", ui-sans-serif, sans-serif;
  --radius: 22px;
  --radius-hero: 32px;
  --ease: cubic-bezier(0.22, 0.75, 0.22, 1);
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: clamp(6rem, 12vw, 9rem);
  --container: min(1220px, 100% - 3rem);
  color-scheme: dark;
}

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

html,
body {
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  top: -100px;
  left: var(--space-sm);
  z-index: 50;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 8px;
  background: var(--cyan);
  color: var(--cyan-ink);
  font-weight: 600;
}

.skip:focus {
  top: var(--space-sm);
}

.filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* The display face: one weight, tight, as in the original. */
.display {
  min-width: 0;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.92;
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: var(--container);
  margin-inline: auto;
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: var(--space-xs);
}

.nav-links a,
.motion-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.875rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font: 500 0.9375rem/1 var(--font);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="true"] {
  border-color: var(--line-strong);
  color: var(--text);
}

.motion-toggle {
  gap: 0.5rem;
  background: transparent;
  cursor: pointer;
}

.motion-toggle::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  content: "";
}

.motion-toggle[aria-pressed="false"]::before {
  background: var(--dim);
}

.motion-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

@media (width < 52rem) {
  .nav-links li:nth-child(2) {
    display: none;
  }
}

@media (width < 36rem) {
  .nav {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  .nav nav {
    order: 3;
    width: 100%;
  }

  .nav-links a {
    padding-inline: 0.625rem;
  }

  .nav-links a:first-child {
    padding-left: 0;
  }
}

/* Hero: the bordered stage with the moving field on the right. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  width: var(--container);
  min-height: min(760px, calc(100dvh - 5rem));
  margin: var(--space-md) auto 0;
  padding: clamp(3.5rem, 9vw, 7rem) clamp(1.5rem, 7vw, 8rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-hero);
  background: var(--bg);
}

.ambient {
  position: absolute;
  z-index: -1;
  inset: -10% -8% -10% 34%;
  pointer-events: none;
}

/* Teal and slate shapes pushed through the turbulence filter: a slow, liquid field in place of the
   original's photograph. */
.ambient-field {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(38% 46% at 66% 42%, var(--teal), transparent 70%),
    radial-gradient(30% 34% at 82% 70%, oklch(42% 0.06 210), transparent 72%),
    radial-gradient(26% 30% at 52% 64%, oklch(36% 0.05 190), transparent 70%),
    radial-gradient(22% 26% at 78% 22%, oklch(62% 0.05 200), transparent 70%);
  filter: url("#displace") blur(2px);
  opacity: 0.85;
  transform: scale(1.1);
}

.ambient::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in oklch, var(--bg) 70%, transparent) 28%, transparent 62%);
  content: "";
}

.hero-copy {
  width: min(100%, 54rem);
}

.hero h1 {
  font-size: clamp(2.25rem, 0.6rem + 7.4vw, 7.25rem);
}

.hero-line {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  white-space: nowrap;
}

.hero-line-2 {
  display: block;
  margin-left: clamp(0.5rem, 3vw, 2.5rem);
}

.plus {
  margin-right: 0.12em;
  color: var(--cyan);
}

/* Hamish Williams' line beside the first word, drawn once. */
.hero-rule {
  flex: 0 0 clamp(3rem, 16vw, 15rem);
  height: 1px;
  margin-top: 0.08em;
  background: var(--dim);
  transform-origin: left center;
}

.lede {
  max-width: 34rem;
  margin-top: var(--space-lg);
  color: var(--muted);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--space-lg);
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.875rem;
  padding: 0 1.375rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  border-color: var(--text);
}

.button:active {
  background: var(--surface-2);
}

.button.primary {
  border-color: var(--cyan);
  background: var(--cyan);
  color: var(--cyan-ink);
}

.button.primary:hover {
  border-color: var(--text);
  background: var(--text);
}

/* Sections */
.section {
  width: var(--container);
  margin-inline: auto;
  padding-top: var(--space-2xl);
}

.section-heading {
  display: grid;
  gap: var(--space-md);
  align-items: end;
  margin-bottom: var(--space-xl);
}

.section h2 {
  font-size: clamp(3rem, 1.6rem + 6vw, 7rem);
}

.section-heading p {
  max-width: 30rem;
  color: var(--muted);
  font-size: 1.125rem;
}

@media (width >= 56rem) {
  .section-heading {
    grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  }
}

/* Project cards */
.projects {
  display: grid;
  gap: var(--space-sm);
}

@media (width >= 56rem) {
  .projects {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .project-lead {
    grid-column: 1 / -1;
  }
}

.project {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project:hover {
  border-color: var(--line-strong);
}

.project-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  color: var(--dim);
  font-size: 0.9375rem;
  font-weight: 500;
}

.project-index {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.project h3 {
  margin-top: var(--space-xs);
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.project-lead h3 {
  font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.75rem);
}

.project p {
  max-width: 38rem;
  color: var(--muted);
}

.project .figure {
  display: grid;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--line);
}

.figure strong {
  color: var(--text);
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.figure span {
  color: var(--muted);
}

@media (width >= 56rem) {
  .project-lead {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    column-gap: var(--space-xl);
  }

  .project-lead > :not(.figure) {
    grid-column: 1;
  }

  .project-lead .figure {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: end;
    margin-top: 0;
  }

  .project-lead .figure strong {
    font-size: clamp(3rem, 2rem + 3vw, 5rem);
  }
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-weight: 600;
}

.project-links a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
}

/* Experience */
.timeline > li {
  display: grid;
  gap: 0.25rem var(--space-lg);
  padding-block: var(--space-lg);
  border-top: 1px solid var(--line);
}

.timeline > li:last-child {
  border-bottom: 1px solid var(--line);
}

@media (width >= 56rem) {
  .timeline > li {
    grid-template-columns: 14rem minmax(0, 1fr);
  }
}

.when {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  padding-top: 0.25rem;
}

.timeline h3 {
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.where {
  color: var(--dim);
}

.timeline p:last-child {
  max-width: 44rem;
  margin-top: var(--space-sm);
  color: var(--muted);
}

/* About */
.about {
  display: grid;
  gap: var(--space-lg);
}

@media (width >= 56rem) {
  .about {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: var(--space-xl);
  }
}

.about-copy > * + * {
  margin-top: var(--space-md);
}

.about-lead {
  color: var(--text);
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.about-copy p {
  max-width: 40rem;
  color: var(--muted);
}

.about-copy .about-lead {
  color: var(--text);
}

.about h3 {
  padding-top: var(--space-md);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.papers {
  display: grid;
  gap: var(--space-md);
}

.papers a {
  font-weight: 500;
}

.papers span {
  display: block;
  margin-top: 0.25rem;
  color: var(--dim);
}

/* Contact */
.contact h2 {
  max-width: 10ch;
}

.contact > p {
  margin-top: var(--space-md);
  color: var(--muted);
  font-size: 1.25rem;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-lg);
  width: var(--container);
  margin: var(--space-2xl) auto 0;
  padding-block: var(--space-lg);
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.9375rem;
}

/* Motion. Content is visible by default; only with scripting and motion allowed do cards fade up. */
@media (prefers-reduced-motion: no-preference) {
  .hero-rule {
    animation: rule-draw 1.4s var(--ease) 0.2s both;
  }

  .ambient-field {
    animation: breathe 14s ease-in-out infinite alternate;
  }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  }

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

  .nav-links a,
  .button,
  .project {
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
  }
}

.no-motion .ambient-field,
.no-motion .hero-rule {
  animation: none;
}

.no-motion .ambient-field {
  filter: blur(2px);
}

.no-motion [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

@keyframes rule-draw {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes breathe {
  from {
    transform: scale(1.06) translate3d(-1%, -2%, 0);
  }

  to {
    transform: scale(1.16) translate3d(2%, 1%, 0);
  }
}

@media (width < 40rem) {
  .hero {
    min-height: auto;
    border-radius: var(--radius);
  }

  .ambient {
    inset: -10% -30% 40% 10%;
    opacity: 0.6;
  }

  .ambient::after {
    background: linear-gradient(180deg, transparent 0%, var(--bg) 85%);
  }

  .hero-rule {
    display: none;
  }
}
