/* Thomas Shillingford — site styles
   Tokens are the single source of truth: change colours and type here. */

@font-face {
  font-family: "Figtree";
  src: url("../fonts/Figtree-var.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/Figtree-Italic-var.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* colour */
  --paper: #f2f3f4;
  --surface: #ffffff;
  --ink: #111316;
  --graphite: #4a5058;
  --mist: #d9dce0;
  --signal: #2b3bff;

  /* type */
  --font: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --step-3: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem);

  /* layout */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 90rem;
  --gap: 0.5rem;
  --measure: 40rem;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 50;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- header ---------- */
.site-header { padding-block: 1.75rem; }
.site-header .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.nav { display: flex; gap: 1.5rem; }
.nav a {
  text-decoration: none;
  font-size: 0.9375rem;
  color: var(--graphite);
  padding-block: 0.25rem;
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease), color 0.2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background-size: 100% 1px; }
.wordmark {
  font-weight: 600;
  font-size: 1.1875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- home hero ---------- */
.intro { padding-block: clamp(4rem, 12vw, 10rem) clamp(3rem, 8vw, 6.5rem); text-align: center; }
.intro__kicker { margin: 0 0 1.25rem; color: var(--graphite); font-size: var(--step-1); font-weight: 500; }
.intro h1 {
  margin: 0 auto;
  max-width: 18ch;
  font-size: var(--step-3);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* ---------- work grid ---------- */
.work { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); padding-bottom: clamp(4rem, 10vw, 8rem); }
.tile { position: relative; margin: 0; overflow: hidden; background: var(--mist); }
.tile--wide { grid-column: 1 / -1; }
.tile a { display: block; text-decoration: none; cursor: none; }
.tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.5s var(--ease), opacity 0.5s var(--ease);
}
.tile--wide img { aspect-ratio: 2 / 1; }
.tile__name {
  position: absolute; left: 1rem; bottom: 1rem;
  margin: 0;
  padding: 0.45rem 0.8rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem; font-weight: 600; line-height: 1.2;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
/* spotlight: the hovered project stays vivid, the rest step back */
@media (hover: hover) and (pointer: fine) {
  .work:has(.tile a:hover) .tile:not(:hover) img { filter: grayscale(0.6); opacity: 0.72; }
  .tile a:hover img { transform: scale(1.025); }
}
.tile a:focus-visible { outline-offset: -4px; outline-width: 4px; }
.tile a:focus-visible .tile__name { opacity: 1; transform: none; }

/* cursor label: follows the pointer over the grid, names the project */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 40;
  pointer-events: none;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--signal);
  color: #fff;
  font-size: 0.9375rem; font-weight: 600; white-space: nowrap;
  opacity: 0;
  transform: translate3d(var(--x, -100px), var(--y, -100px), 0) translate(-50%, -50%) scale(0.6);
  transition: opacity 0.2s, transform 0.35s var(--ease);
}
.cursor.is-on { opacity: 1; transform: translate3d(var(--x), var(--y), 0) translate(-50%, -50%) scale(1); transition: opacity 0.2s, transform 0.08s linear; }
.cursor::after { content: " \2192"; }

/* touch / no fine pointer: names sit under each image */
@media (hover: none), (pointer: coarse) {
  .tile a { cursor: pointer; }
  .tile__name { position: static; opacity: 1; transform: none; background: none; padding: 0.75rem 0 1.25rem; font-size: 1rem; }
  .tile { background: none; }
  .cursor { display: none; }
}
@media (max-width: 40rem) {
  .work { grid-template-columns: 1fr; gap: 0; }
  .tile img, .tile--wide img { aspect-ratio: 4 / 3; }
}

/* ---------- case study ---------- */
.cs-head { padding-block: clamp(3rem, 9vw, 7rem) clamp(2rem, 5vw, 3.5rem); }
.cs-head__back { display: inline-block; margin-bottom: 2rem; font-size: 0.9375rem; color: var(--graphite); text-decoration: none; }
.cs-head__back:hover { color: var(--ink); }
.cs-head h1 { margin: 0; max-width: 16ch; font-size: var(--step-3); line-height: 1.04; font-weight: 700; letter-spacing: -0.025em; text-wrap: balance; }
.cs-hero { margin: 0; }
.cs-hero img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }

.cs-body {
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, var(--measure));
  justify-content: center;
  column-gap: clamp(2rem, 7vw, 7rem);
  padding-block: clamp(3rem, 8vw, 6rem);
}
.facts { align-self: start; position: sticky; top: 2rem; margin: 0; }
.facts div { padding-block: 1rem; border-top: 1px solid var(--mist); }
.facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite); margin-bottom: 0.4rem; }
.facts dd { margin: 0; font-size: 0.9375rem; line-height: 1.5; }
.facts ul { list-style: none; margin: 0; padding: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tags li { padding: 0.2rem 0.6rem; border: 1px solid var(--mist); border-radius: 999px; font-size: 0.8125rem; background: var(--surface); }

.prose h2 { margin: 3rem 0 0.75rem; font-size: var(--step-2); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1rem; }
.prose .lede { font-size: var(--step-1); line-height: 1.55; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--signal); }
.prose a:hover { color: var(--signal); }
.prose figure { margin: 2.5rem 0; }
.prose figure img { width: 100%; background: var(--surface); }
.prose figcaption { margin-top: 0.75rem; font-size: var(--step--1); color: var(--graphite); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); padding-bottom: clamp(3rem, 8vw, 6rem); margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.next { display: block; border-top: 1px solid var(--mist); padding-block: clamp(3rem, 8vw, 6rem); text-decoration: none; }
.next__label { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite); margin-bottom: 0.75rem; }
.next__title { font-size: var(--step-3); font-weight: 700; line-height: 1.04; letter-spacing: -0.025em; }
.next__title::after { content: "\2192"; display: inline-block; margin-left: 0.3em; transition: transform 0.4s var(--ease); }
.next:hover .next__title::after { transform: translateX(0.35em); }

@media (max-width: 56rem) {
  .cs-body { grid-template-columns: 1fr; row-gap: 3rem; }
  .facts { position: static; }
  .cs-hero img { aspect-ratio: 16 / 9; }
  .gallery { grid-template-columns: 1fr; }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--mist); padding-block: 2.5rem 3rem; font-size: 0.875rem; color: var(--graphite); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 46rem) auto; justify-content: space-between; gap: 1.5rem 3rem; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 1.25rem; align-items: start; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 40rem) {
  .site-header .wrap { grid-template-columns: 1fr; justify-items: center; gap: 0.75rem; }
  .site-header .wordmark { order: -1; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .cursor { display: none; }
  .tile a { cursor: pointer; }
  .tile a:hover .tile__name { opacity: 1; transform: none; }
}

/* ---------- prose extras ---------- */
.prose h3 { margin: 2.25rem 0 0.5rem; font-size: var(--step-1); line-height: 1.3; font-weight: 700; }
.prose h4 { margin: 1.75rem 0 0.4rem; font-size: var(--step-0); font-weight: 700; }
.prose ul, .prose ol { margin: 0 0 1.25rem; padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--graphite); }
.prose blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 2px solid var(--signal); }
.prose blockquote p { margin: 0; }
.pull { margin: 3rem 0; }
.pull blockquote { margin: 0; padding: 0; border: 0; }
.pull blockquote p { font-size: var(--step-2); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.pull figcaption { margin-top: 1rem; font-size: var(--step--1); color: var(--graphite); }
.inline-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--gap); margin: 2.5rem 0; }
.inline-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.facts dd p { margin: 0 0 0.35rem; }
.facts dd ul:not(.tags) li { margin-bottom: 0.35rem; }

/* ---------- buttons & forms ---------- */
.button {
  display: inline-block; padding: 0.85rem 1.4rem; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper); font: 600 0.9375rem/1 var(--font);
  text-decoration: none; cursor: pointer; transition: background 0.2s;
}
.button:hover { background: var(--signal); color: #fff; }
.prose a.button { color: var(--paper); text-decoration: none; }
.prose a.button:hover { color: #fff; }

.contact { padding-block: clamp(3rem, 9vw, 7rem) clamp(4rem, 10vw, 8rem); max-width: 44rem; margin-inline: auto; }
.contact h1 { margin: 0 0 1rem; font-size: var(--step-3); line-height: 1.04; font-weight: 700; letter-spacing: -0.025em; }
.contact__lede { margin: 0 0 2.5rem; font-size: var(--step-1); color: var(--graphite); }
.field { margin-bottom: 1.25rem; }
.field label { display: block; margin-bottom: 0.4rem; font-size: 0.875rem; font-weight: 600; }
.field input, .field textarea {
  width: 100%; padding: 0.8rem 0.9rem; border: 1px solid var(--mist); border-radius: 0.5rem;
  background: var(--surface); color: var(--ink); font: inherit;
}
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--signal); outline-offset: 0; border-color: var(--signal); }
.form__trap { position: absolute; left: -9999px; }
.form__note { font-size: 0.875rem; color: var(--graphite); }

/* ---------- hello ---------- */
.hello { padding-block: clamp(3rem, 9vw, 7rem) clamp(4rem, 10vw, 8rem); }
.hello__words { margin: 0 auto clamp(3rem, 7vw, 5rem); max-width: 30ch; text-align: center; font-size: var(--step-2); line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.hello__grid { display: grid; grid-template-columns: minmax(14rem, 22rem) minmax(0, var(--measure)); justify-content: center; column-gap: clamp(2rem, 7vw, 7rem); }
.hello__portrait { margin: 0; align-self: start; position: sticky; top: 2rem; }
.hello__portrait img { width: 100%; }
.hello__logos { margin: clamp(3rem, 8vw, 6rem) auto 0; max-width: 60rem; }
@media (max-width: 56rem) {
  .hello__grid { grid-template-columns: 1fr; row-gap: 2.5rem; }
  .hello__portrait { position: static; max-width: 20rem; }
}

/* ---------- simple pages ---------- */
.page { padding-block: clamp(3rem, 9vw, 7rem) clamp(4rem, 10vw, 8rem); max-width: 44rem; margin-inline: auto; }
.page h1 { margin: 0 0 1.5rem; font-size: var(--step-3); line-height: 1.04; font-weight: 700; letter-spacing: -0.025em; }

/* bulleted lists in the facts panel */
.facts ul:not(.tags) li { position: relative; padding-left: 0.9rem; margin-bottom: 0.3rem; }
.facts ul:not(.tags) li::before { content: "\2022"; position: absolute; left: 0; color: var(--graphite); }

/* ---------- CV ---------- */
.cv { padding-block: clamp(3rem, 8vw, 6rem) clamp(4rem, 10vw, 8rem); max-width: 64rem; }
.cv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; padding-bottom: 2rem; border-bottom: 1px solid var(--ink); }
.cv-head h1 { margin: 0; font-size: var(--step-3); line-height: 1.04; font-weight: 700; letter-spacing: -0.025em; }
.cv-head__tag { margin: 0.75rem 0 0; font-size: var(--step-1); color: var(--graphite); }
.cv-head__print { display: none; }
.cv-head__actions { display: flex; align-items: center; gap: 1.25rem; }
.cv-head__contact { font-size: 0.9375rem; text-underline-offset: 0.2em; text-decoration-color: var(--signal); }
.cv-section { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1rem 3rem; padding-block: 2rem; border-bottom: 1px solid var(--mist); }
.cv-section h2 { margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite); padding-top: 0.3rem; }
.cv-section__body p { margin: 0 0 1rem; }
.cv-section__body > p:last-child { margin-bottom: 0; }
.cv-list { margin: 0; padding: 0; list-style: none; }
.cv-list li { position: relative; padding-left: 1rem; margin-bottom: 0.6rem; }
.cv-list li::before { content: "\2022"; position: absolute; left: 0; color: var(--graphite); }
.cv-role + .cv-role { margin-top: 1.75rem; }
.cv-role h3 { margin: 0 0 0.6rem; font-size: var(--step-0); font-weight: 700; }
.cv-role__dates { margin: 0 0 0.2rem; font-size: 0.875rem; color: var(--graphite); }
.cv a:not(.button) { text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--signal); }
.cv a:not(.button):hover { color: var(--signal); }
@media (max-width: 40rem) {
  .cv-section { grid-template-columns: 1fr; }
}

/* ---------- print (CV PDF) ---------- */
@media print {
  @page { size: A4; margin: 12mm 14mm 12mm; }
  body { background: #fff; font-size: 9.5pt; line-height: 1.35; }
  .site-header, .site-footer, .skip, .cv-head__actions, .cursor { display: none !important; }
  .wrap { padding-inline: 0; max-width: none; }
  .cv { padding: 0; }
  .cv-head { padding-bottom: 7pt; }
  .cv-head h1 { font-size: 21pt; }
  .cv-head__tag { font-size: 10pt; margin-top: 3pt; }
  .cv-head__print { display: block; margin: 4pt 0 0; font-size: 9.5pt; color: var(--graphite); }
  .cv-section { grid-template-columns: 30mm 1fr; gap: 0 6mm; padding-block: 6pt; break-inside: auto; }
  .cv-section h2 { font-size: 8pt; padding-top: 1pt; }
  .cv-role { break-inside: avoid; }
  .cv-role + .cv-role { margin-top: 5pt; }
  .cv-role h3 { font-size: 9.5pt; margin-bottom: 2pt; }
  .cv-role__dates { font-size: 8pt; margin: 0; }
  .cv-section__body p { margin-bottom: 4pt; }
  .cv-list li { margin-bottom: 1.5pt; padding-left: 8pt; }
  .cv a { color: inherit; text-decoration: none; }
}

/* Hello: talks and articles */
.prose .pub { margin-bottom: 1.1rem; }
.pub__meta { display: block; margin-top: 0.15rem; font-size: 0.875rem; color: var(--graphite); }
.prose .hello__signoff { margin-top: 3rem; }
