/* thealexwong.com
   Concept: "opening night". A black stage, cream house lights, and Alex's
   colours as metal: electric blue, gold, silver and copper foil. Archivo's
   width axis does the shouting: ultra-expanded for display, normal width for
   reading. All motion lives behind prefers-reduced-motion. */

/* Self-hosted font (SIL Open Font License). Variable weight 100–900, width 62–125%. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-standard-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-standard-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

/* Lets the metallic border on the collab panel spin. */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --stage: #050608;
  --stage-2: #101217;
  --stage-3: #1A1D24;
  --line: #2A2E38;
  --text: #FAF7F0;
  --muted: #A3A6AF;
  --cream: #F4EBD9;
  --cream-muted: #5C574B;  /* muted text on cream */

  --blue: #3D7BFF;         /* on black */
  --blue-deep: #1F4FD8;    /* on cream, or as a fill under white text */
  --gold: #F5C543;
  --silver: #C9CED6;
  --copper: #D9773F;
  --copper-deep: #8A4A1F;  /* on cream */

  --gold-foil: linear-gradient(110deg, #A8741A 0%, #F5C543 28%, #FFF0B3 42%, #F5C543 56%, #C38A22 78%, #F9D46B 100%);
  --silver-foil: linear-gradient(110deg, #7D838C 0%, #DDE1E6 28%, #FFFFFF 42%, #C9CED6 56%, #8D939C 78%, #E6E9ED 100%);
  --copper-foil: linear-gradient(110deg, #7A3417 0%, #D9773F 28%, #F7B78E 42%, #D9773F 56%, #9A4521 78%, #E89462 100%);
  --blue-foil: linear-gradient(110deg, #0F2E8A 0%, #3D7BFF 30%, #A9C4FF 44%, #3D7BFF 58%, #1F4FD8 100%);
  --spectrum: linear-gradient(100deg, var(--blue) 0%, var(--silver) 34%, var(--gold) 66%, var(--copper) 100%);

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.2, 0.75, 0.1, 1);

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 80rem;

  color-scheme: dark;
}

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

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

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

/* Film grain over everything. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 200;
  pointer-events: none;
  opacity: 0.07;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--gold); text-decoration-thickness: 2px; }

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

::selection { background: var(--gold); color: var(--stage); }

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--cream);
  color: var(--stage);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0.5rem; }

/* Metallic text. The oversized background lets the shine travel. */
.foil-text {
  background: var(--gold-foil);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 6, 8, 0.75);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.logo {
  font-weight: 800;
  font-stretch: 125%;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.logo:hover { color: var(--gold); }

.site-nav ul {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  position: relative;
  display: inline-block;
  padding-block: 0.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }

/* Underline that draws in on hover. */
.site-nav a:not([aria-current="page"])::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.1rem;
  height: 2px;
  background: var(--spectrum);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Spike-tape mark, in gold tape: where you are standing. */
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 3px;
  background: var(--gold);
  filter: drop-shadow(0 0 6px rgba(245, 197, 67, 0.8));
}

@media (max-width: 34rem) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0.4rem; padding-block: 0.75rem 1rem; }
  .site-nav ul { gap: 1.25rem; }
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  padding: 0.85rem 1.5rem;
  border: 1.5px solid rgba(250, 247, 240, 0.6);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 600 1rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.25s, transform 0.2s;
}
.btn:hover { background: var(--cream); color: var(--stage); border-color: var(--cream); text-decoration: none; }
.btn:active { transform: scale(0.97); }

/* Gold foil buttons take dark text (white on gold fails WCAG). */
.btn-primary {
  border-color: transparent;
  background: var(--gold-foil);
  background-size: 250% 100%;
  background-position: 0% 0;
  color: var(--stage);
  box-shadow: 0 0 0 0 rgba(245, 197, 67, 0);
  transition: background-position 0.7s var(--ease-out), box-shadow 0.25s, transform 0.2s;
}
.btn-primary:hover {
  background: var(--gold-foil);
  background-size: 250% 100%;
  background-position: 100% 0;
  border-color: transparent;
  color: var(--stage);
  box-shadow: 0 0 36px 4px rgba(245, 197, 67, 0.5), 0 0 80px 10px rgba(61, 123, 255, 0.25);
}

.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Home: hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(56rem, calc(100svh - 4rem));
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-photo {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(62%, 54rem);
  margin: 0;
  z-index: -2;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 38%), linear-gradient(to top, transparent 0%, #000 45%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, #000 38%), linear-gradient(to top, transparent 0%, #000 45%);
  mask-composite: intersect;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }

/* Stage lights: three gel beams from the rig and a follow spot, blended with screen. */
.hero-lights { position: absolute; inset: 0; z-index: -1; pointer-events: none; container-type: size; }
.beam {
  position: absolute;
  top: -20%;
  width: 70vmax;
  height: 120%;
  transform-origin: 50% 0;
  mix-blend-mode: screen;
  filter: blur(26px);
  opacity: 0.6;
}
.beam-a {
  left: 16%;
  background: conic-gradient(from 168deg at 50% 0%, transparent 0deg, rgba(61, 123, 255, 0.95) 12deg, transparent 24deg);
  transform: translateX(-50%) rotate(14deg);
}
.beam-b {
  left: 80%;
  background: conic-gradient(from 168deg at 50% 0%, transparent 0deg, rgba(245, 197, 67, 0.8) 12deg, transparent 24deg);
  transform: translateX(-50%) rotate(-16deg);
}
.beam-c {
  left: 50%;
  opacity: 0.4;
  background: conic-gradient(from 170deg at 50% 0%, transparent 0deg, rgba(217, 119, 63, 0.9) 10deg, transparent 20deg);
  transform: translateX(-50%) rotate(4deg);
}
.hero-spot {
  /* --spot-x / --spot-y are set by js/site.js when a mouse moves over the hero.
     Positioned with transform (not left/top) so iOS Safari can animate it on the GPU. */
  position: absolute;
  left: 0;
  top: 0;
  width: 34rem;
  height: 34rem;
  transform: translate(calc(var(--spot-x, 68cqw) - 50%), calc(var(--spot-y, 38cqh) - 50%));
  border-radius: 50%;
  mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 244, 220, 0.24), rgba(245, 197, 67, 0.1) 55%, transparent);
  transition: transform 0.3s ease-out;
  will-change: transform;
}
.hero-lights::after {
  /* the pool of light on the floor */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18rem;
  width: 90rem;
  height: 30rem;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(61, 123, 255, 0.35), rgba(217, 119, 63, 0.12) 60%, transparent);
}

.hero-inner { width: 100%; padding-block: 3rem clamp(2.5rem, 5vw, 4rem); display: flex; flex-direction: column; }

.hero-lede {
  max-width: 28rem;
  margin: 0;
  font-size: clamp(1.0625rem, 1.4vw, 1.2rem);
  color: var(--text);
}
.hero-lede strong {
  /* the headline credit, on its own line */
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.15em;
  font-weight: 800;
  line-height: 1.3;
  color: var(--gold);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 1.5rem;
}
.stats { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(201, 206, 214, 0.35);
  border-radius: 999px;
  background: rgba(16, 18, 23, 0.7);
  backdrop-filter: blur(6px);
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.stat strong { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.stat:hover { border-color: var(--silver); text-decoration: none; transform: translateY(-2px); }

.hero-name {
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 0 -0.04em;
  font-size: clamp(3rem, 12.375vw, 11.625rem);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.82;
  letter-spacing: -0.045em;
}
.hero-name .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero-name .line > span { display: block; }

@media (max-width: 52rem) {
  .hero { min-height: auto; padding-top: 44svh; }
  .hero-name { order: -1; margin: 0 0 1.5rem -0.04em; }
  .hero-photo {
    width: 100%;
    height: 72svh;
    inset: 0 0 auto 0;
    -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 50%);
    mask-image: linear-gradient(to top, transparent 0%, #000 50%);
  }
  .hero-name { font-size: clamp(3.5rem, 21vw, 9rem); }
  .beam { width: 120vmax; }
  .hero-spot { width: 22rem; height: 22rem; }
}

@media (prefers-reduced-motion: no-preference) {
  /* House lights down, stage lights up: the photo flickers on. */
  .hero-photo { animation: lights-up 1.8s ease-out both; }
  .hero-name .line > span { animation: rise 1.1s var(--ease-out) 0.35s both; }
  .hero-name .line:nth-child(2) > span { animation-delay: 0.5s; }
  .hero-name .line:nth-child(2) > .foil-text { animation: rise 1.1s var(--ease-out) 0.5s both, shine 5s linear 1.6s infinite; }
  .hero-lede,
  .hero-actions { animation: fade-up 0.9s var(--ease-out) 0.9s both; }
  .hero-actions { animation-delay: 1.05s; }
  .beam-a { animation: beam-on 1.2s ease-out both, sweep-a 11s ease-in-out 1.2s infinite alternate; }
  .beam-b { animation: beam-on 1.2s ease-out 0.2s both, sweep-b 13s ease-in-out 1.4s infinite alternate; }
  .beam-c { animation: beam-on 1.2s ease-out 0.4s both, sweep-c 9s ease-in-out 1.6s infinite alternate; }
  .hero:not(.is-tracking) .hero-spot { animation: drift 16s ease-in-out infinite alternate; }
}
@keyframes lights-up {
  0%   { filter: brightness(0) saturate(0); }
  18%  { filter: brightness(0.7) saturate(0.4); }
  22%  { filter: brightness(0.08) saturate(0); }
  34%  { filter: brightness(0.9) saturate(0.7); }
  38%  { filter: brightness(0.35) saturate(0.4); }
  100% { filter: brightness(1) saturate(1); }
}
@keyframes rise { from { transform: translateY(105%) skewY(6deg); } to { transform: translateY(0) skewY(0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(1.5rem); } }
@keyframes shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes beam-on { from { opacity: 0; } }
@keyframes sweep-a {
  from { transform: translateX(-50%) rotate(22deg); }
  to   { transform: translateX(-50%) rotate(-6deg); }
}
@keyframes sweep-b {
  from { transform: translateX(-50%) rotate(-24deg); }
  to   { transform: translateX(-50%) rotate(6deg); }
}
@keyframes sweep-c {
  from { transform: translateX(-50%) rotate(-12deg); }
  to   { transform: translateX(-50%) rotate(14deg); }
}
@keyframes drift {
  0%   { transform: translate(calc(70cqw - 50%), calc(34cqh - 50%)); }
  35%  { transform: translate(calc(52cqw - 50%), calc(52cqh - 50%)); }
  70%  { transform: translate(calc(82cqw - 50%), calc(60cqh - 50%)); }
  100% { transform: translate(calc(62cqw - 50%), calc(28cqh - 50%)); }
}

/* ---------- Marquee bands ---------- */

/* Two bands of tape crossing the stage: cream credits one way, blue the other. */
.bands {
  position: relative;
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.marquee {
  position: relative;
  overflow: hidden;
  margin-inline: -2rem;
  padding-block: 1.1rem;
  background: var(--cream);
  color: var(--stage);
  transform: rotate(-3deg);
  box-shadow: 0 18px 50px -18px rgba(245, 197, 67, 0.45);
  z-index: 1;
}
.marquee-alt {
  position: absolute;
  inset: 50% 0 auto 0;
  padding-block: 0.7rem;
  background: var(--blue-deep);
  color: #FFFFFF;
  transform: translateY(-50%) rotate(3.5deg);
  box-shadow: none;
  z-index: 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 0;
}
.marquee ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.marquee li {
  display: flex;
  align-items: center;
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 800;
  font-stretch: 115%;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.marquee-alt li { font-size: clamp(0.95rem, 1.6vw, 1.2rem); font-weight: 700; letter-spacing: 0.06em; }
.marquee li::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  margin-inline: 1.1em;
  background: var(--blue-deep);
  transform: rotate(45deg);
}
.marquee-alt li::after { background: var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marquee 48s linear infinite; }
  .marquee-alt .marquee-track { animation-duration: 36s; animation-direction: reverse; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Section headings ---------- */

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-bottom: 2.5rem;
}
.section-head h2 { font-size: clamp(2.25rem, 6vw, 4.5rem); }
.section-head a { font-weight: 600; color: var(--muted); }
.section-head a:hover { color: var(--gold); }

/* ---------- Section photos ----------
   A photo behind a home section, fading into the stage like the hero. */

.has-photo { position: relative; isolation: isolate; overflow: hidden; }
.section-photo {
  position: absolute;
  margin: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.section-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Selected work: the dark studio shot on the left, opposite the hero photo.
   The fades at the left and bottom edges also hide the photographer's watermark. */
.work .section-photo {
  inset: 0 auto 0 0;
  width: min(50%, 42rem);
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 15%, #000 50%, transparent 100%), linear-gradient(to bottom, transparent 0%, #000 20%, #000 60%, transparent 88%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, #000 15%, #000 50%, transparent 100%), linear-gradient(to bottom, transparent 0%, #000 20%, #000 60%, transparent 88%);
  mask-composite: intersect;
}
.work .section-photo img { object-position: 60% 25%; }

/* Follow: a street leap, sized to the section's height so the whole split
   shows, and dim enough for the outlined names. */
.follow .section-photo {
  inset-block: 0;
  left: 50%;
  translate: -50% 0;
  aspect-ratio: 1599 / 2000;
  max-width: 100%;
  opacity: 0.4;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%), linear-gradient(to bottom, transparent 0%, #000 15%, #000 85%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%), linear-gradient(to bottom, transparent 0%, #000 15%, #000 85%, transparent 100%);
  mask-composite: intersect;
}
.follow .section-photo img { object-position: 50% 35%; filter: contrast(1.1) brightness(0.8); }

/* Work with Alex: the loft is a backdrop above the panel, which rises over it.
   The photo is cropped around Alex and keeps its shape at every width, so his
   whole body always shows; the panel starts just below his feet (91% down). */
.collab { padding-top: min(37%, 33.3rem); }
.collab .section-photo {
  top: 0;
  left: 50%;
  translate: -50% 0;
  width: min(100%, 90rem);
  aspect-ratio: 2000 / 784;
  opacity: 0.8;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 85%, transparent 100%), linear-gradient(to right, transparent 0%, #000 10%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 85%, transparent 100%), linear-gradient(to right, transparent 0%, #000 10%, #000 88%, transparent 100%);
  mask-composite: intersect;
}

@media (max-width: 52rem) {
  .work .section-photo { width: 100%; opacity: 0.35; }
}

/* ---------- Selected work ---------- */

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.work-list li {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) minmax(12rem, 22rem);
  gap: 0.25rem 1.5rem;
  align-items: baseline;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.3s;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.work-icon {
  /* a category icon in copper; deliberately not a number, since the list isn't ranked */
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  /* centre on the title's first line */
  margin-top: calc((clamp(1.4rem, 3.4vw, 2.6rem) * 1.05 - 1.75rem) / 2);
  width: 1.75rem;
  height: 1.75rem;
  fill: none;
  stroke: var(--copper);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s, transform 0.4s var(--ease-out);
}
.work-list li::before {
  /* a gold foil wipe that lights the row on hover */
  content: "";
  position: absolute;
  inset: 0 calc(var(--gutter) * -1);
  background: var(--gold-foil);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
  z-index: -1;
}
.work-list li:hover { color: var(--stage); }
.work-list li:hover::before { transform: scaleX(1); transform-origin: left; }
.work-list li:hover .work-meta { color: var(--stage); }
.work-list li:hover .work-icon { stroke: var(--stage); transform: rotate(-8deg) scale(1.1); }
.work-title {
  grid-column: 2;
  font-size: clamp(1.4rem, 3.4vw, 2.6rem);
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  transition: transform 0.4s var(--ease-out);
}
.work-list li:hover .work-title { transform: translateX(0.5rem); }
.work-meta { grid-column: 3; color: var(--muted); font-size: 0.975rem; transition: color 0.3s; }

@media (max-width: 40rem) {
  .work-list li { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .work-meta { grid-column: 2; }
}

/* ---------- Home: gallery teaser ---------- */

/* Masonry: js/site.js gives each photo a row span from its shape, so any
   number of photos packs into the shortest column. Without JS it's a plain
   grid with each photo at its own shape. */
.teaser {
  --cols: 3;
  --gap: clamp(0.5rem, 1.2vw, 1rem);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  align-items: start;
  gap: var(--gap);
  list-style: none;
  margin: 0;
  padding: 0;
}
.teaser.is-masonry { grid-auto-rows: 1px; row-gap: 0; align-items: stretch; }
.teaser.is-masonry li { margin-bottom: var(--gap); }
.teaser li {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--stage-2);
}
.teaser img { width: 100%; height: auto; transition: transform 0.8s var(--ease-out); }
.teaser.is-masonry img { height: 100%; object-fit: cover; }
.teaser li:hover img { transform: scale(1.06); }
.teaser-btn { margin-top: 2rem; }

/* two columns on tablets and phones, still packed as masonry */
@media (max-width: 60rem) { .teaser { --cols: 2; } }

/* A sheen that sweeps across a photo on hover. Used by the teaser and gallery. */
.teaser li::after,
.gallery a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 244, 220, 0.35) 48%, rgba(245, 197, 67, 0.2) 52%, transparent 65%);
  background-size: 250% 100%;
  background-position: 120% 0;
  pointer-events: none;
  transition: background-position 0.9s var(--ease-out);
}
.teaser li:hover::after,
.gallery a:hover::after,
.gallery a:focus-visible::after { background-position: -20% 0; }

/* ---------- Follow ---------- */

.follow { position: relative; isolation: isolate; overflow: hidden; }
.follow::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% -20%;
  height: 80%;
  z-index: -1;
  background: radial-gradient(50% 60% at 30% 100%, rgba(61, 123, 255, 0.28), transparent), radial-gradient(45% 60% at 75% 100%, rgba(217, 119, 63, 0.2), transparent);
}

.follow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.follow-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem 2rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
/* Outlined letters that fill with metal on hover: gold, silver, copper. */
.follow-name {
  --foil: var(--gold-foil);
  font-size: clamp(2.75rem, 9vw, 7.5rem);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--text);
  background: var(--foil) 0 0 / 0% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-size 0.6s var(--ease-out), -webkit-text-stroke-color 0.3s;
}
.follow-list li:nth-child(2) .follow-name { --foil: var(--silver-foil); }
.follow-list li:nth-child(3) .follow-name { --foil: var(--copper-foil); }
.follow-list a:hover .follow-name,
.follow-list a:focus-visible .follow-name { background-size: 100% 100%; -webkit-text-stroke-color: transparent; }
.follow-meta { color: var(--muted); text-align: right; font-size: 1rem; }
.follow-meta strong { display: block; color: var(--text); font-size: 1.3rem; font-weight: 700; }

@media (max-width: 34rem) {
  .follow-list a { grid-template-columns: 1fr; }
  .follow-meta { text-align: left; }
}

/* ---------- Work with Alex ---------- */

/* The one cream panel on the page: black type, high contrast, spinning metal edge. */
.collab-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: 1.5rem;
  background: var(--cream);
  color: var(--stage);
  isolation: isolate;
  overflow: hidden;
  box-shadow: 0 30px 90px -30px rgba(245, 197, 67, 0.45), 0 0 0 1px rgba(245, 197, 67, 0.2);
}
.collab-panel::before {
  /* metal border */
  content: "";
  position: absolute;
  inset: 0;
  padding: 3px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), var(--blue), var(--silver), var(--gold), var(--copper), var(--blue));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.collab-panel::after {
  content: "";
  position: absolute;
  inset: -30% auto auto -10%;
  width: 60%;
  height: 120%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(245, 197, 67, 0.35), transparent);
}
.collab-panel h2 { font-size: clamp(2.25rem, 5.5vw, 4.25rem); }
.collab-panel p { margin: 0 0 1.25rem; max-width: 34rem; }
.collab-panel ul { margin: 0 0 2rem; padding-left: 1.1rem; }
.collab-panel li { margin-bottom: 0.35rem; }
.collab-panel li::marker { color: var(--copper-deep); }
.collab-panel :focus-visible { outline-color: var(--blue-deep); }
/* On cream the gold button needs a black edge to stand out. */
.collab-panel .btn-primary { background: var(--stage); color: var(--cream); }
.collab-panel .btn-primary:hover { background: var(--gold-foil); background-size: 250% 100%; color: var(--stage); }
.rep { color: var(--muted); font-size: 0.95rem; }
.collab-panel .rep { color: var(--cream-muted); }

@media (max-width: 48rem) {
  .collab-panel { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .collab-panel::before { animation: spin 6s linear infinite; }
}
@keyframes spin { to { --angle: 360deg; } }

/* ---------- Inner pages ---------- */

.page-head {
  position: relative;
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 4vw, 3rem);
}
.page-head::before {
  content: "";
  position: absolute;
  top: -8rem;
  left: -10rem;
  width: 42rem;
  height: 28rem;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(61, 123, 255, 0.32), transparent);
  pointer-events: none;
}
.page-head::after {
  content: "";
  position: absolute;
  top: -4rem;
  left: 28rem;
  width: 30rem;
  height: 20rem;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(245, 197, 67, 0.16), transparent);
  pointer-events: none;
}
/* Page titles are white with a gold glint that crosses once on load. */
.page-head h1 {
  font-size: clamp(3.25rem, 12vw, 9.5rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.045em;
  background: linear-gradient(100deg, var(--text) 42%, var(--gold) 48%, #FFF0B3 50%, var(--copper) 53%, var(--text) 59%);
  background-size: 300% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head p { max-width: 38rem; margin: 1.5rem 0 0; color: var(--muted); font-size: 1.125rem; }
.page-head .btn { margin-top: 1.75rem; }

@media (prefers-reduced-motion: no-preference) {
  .page-head h1 { animation: glint 1.6s ease-out 0.2s both, fade-up 0.8s var(--ease-out) both; }
}
@keyframes glint { from { background-position: 100% 0; } to { background-position: 0% 0; } }

main { position: relative; isolation: isolate; overflow-x: clip; }

/* Bio */
.bio {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}
.bio-photo {
  position: sticky;
  top: 6rem;
  align-self: start;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--stage-2);
  box-shadow: -24px 24px 80px -24px rgba(61, 123, 255, 0.5), 24px -16px 80px -32px rgba(245, 197, 67, 0.45);
}
.bio-photo img { width: 100%; height: 100%; object-fit: cover; }
.bio-text { max-width: 40rem; font-size: 1.125rem; line-height: 1.75; color: #E4DED0; }
.bio-text p { margin: 0 0 1.4em; }
.bio-text .lead {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 600;
  font-stretch: 105%;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
.bio-text cite { font-style: italic; color: var(--gold); }

@media (max-width: 48rem) {
  .bio { grid-template-columns: 1fr; }
  .bio-photo { position: static; max-height: 70svh; }
}

.photo-band { margin: 0 auto; padding-bottom: clamp(4rem, 8vw, 7rem); }
.photo-band img {
  width: 100%;
  aspect-ratio: 7 / 3;
  object-fit: cover;
  border-radius: 1.25rem;
}
.photo-band figcaption { margin-top: 0.85rem; color: var(--muted); font-size: 0.95rem; }

@media (max-width: 40rem) {
  .photo-band img { aspect-ratio: 3 / 2; }
}

/* Gallery */
/* Row-ordered grid: portrait photos fill one 4:5 cell, landscape (.wide) span two.
   "dense" lets a later portrait fill a gap left by a wide photo. */
.gallery-wrap { padding-bottom: clamp(4rem, 8vw, 7rem); container-type: inline-size; }
.gallery {
  --cols: 2;
  --gap: clamp(0.5rem, 1.2vw, 1rem);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols) * 1.25);
  grid-auto-flow: dense;
  gap: var(--gap);
  list-style: none;
  margin: 0;
  padding: 0;
}
.gallery .wide { grid-column: span 2; }
.gallery a {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--stage-2);
  transition: box-shadow 0.4s;
}
.gallery a:hover { box-shadow: 0 0 0 2px var(--gold), 0 20px 60px -20px rgba(245, 197, 67, 0.55); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-out); }
.gallery a:hover img { transform: scale(1.05); }
.gallery-credits { margin: 2rem 0 0; color: var(--muted); font-size: 0.95rem; }

@media (min-width: 40rem) { .gallery { --cols: 3; } }
@media (min-width: 64rem) { .gallery { --cols: 4; } }
@media (max-width: 34rem) {
  .gallery a { border-radius: 0.6rem; }
}

/* Lightbox (built by js/gallery.js) */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(0.75rem, 3vw, 2rem) clamp(0.75rem, 6vw, 5rem);
  border: 0;
  background: transparent;
  color: var(--text);
}
.lightbox::backdrop { background: rgba(5, 6, 8, 0.95); backdrop-filter: blur(6px); }
.lightbox-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 0.85rem;
  height: 100%;
  margin: 0;
}
.lightbox-img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
}
.lightbox-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  width: min(100%, 60rem);
  font-size: 0.95rem;
}
.lightbox-meta { display: flex; gap: 1.25rem; color: var(--muted); }
.lightbox-btn {
  position: fixed;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0 0 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 18, 23, 0.85);
  color: var(--text);
  font: 400 2rem/1 var(--font);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.lightbox-btn:hover { border-color: var(--gold); background: var(--gold); color: var(--stage); }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { top: 50%; left: 1rem; transform: translateY(-50%); }
.lightbox-next { top: 50%; right: 1rem; transform: translateY(-50%); }

@media (max-width: 40rem) {
  .lightbox { padding-bottom: 5rem; }
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: 1rem; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: fade 0.2s ease-out; }
  .lightbox[open] .lightbox-img { animation: zoom-in 0.4s var(--ease-out); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.94); } }

/* Credits */
.credits { padding-bottom: clamp(4rem, 8vw, 7rem); }
.credit-group + .credit-group { margin-top: clamp(3.5rem, 7vw, 5rem); }
.credit-group h2 { font-size: clamp(1.9rem, 4.5vw, 3.25rem); margin-bottom: 1.25rem; }
.credit-group h2::before {
  /* a short bar of metal before each heading, cycling through his colours */
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.35em;
  vertical-align: 0.08em;
  border-radius: 50%;
  background: var(--gold-foil);
}
.credit-group:nth-child(4n + 2) h2::before { background: var(--blue-foil); }
.credit-group:nth-child(4n + 3) h2::before { background: var(--silver-foil); }
.credit-group:nth-child(4n + 4) h2::before { background: var(--copper-foil); }

.credit-table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--line); }
.credit-table th,
.credit-table td { text-align: left; padding: 0.8rem 1rem 0.8rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.credit-table thead th { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.credit-table tbody th { font-weight: 600; width: 44%; color: var(--text); transition: color 0.2s; }
.credit-table td { color: #D8D3C6; }
.credit-table td:last-child { color: var(--muted); }
.credit-table tbody tr { transition: background 0.2s; }
.credit-table tbody tr:hover { background: linear-gradient(90deg, rgba(245, 197, 67, 0.14), rgba(61, 123, 255, 0.06) 50%, transparent 80%); }
.credit-table tbody tr:hover th { color: var(--gold); }

@media (max-width: 40rem) {
  .credit-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .credit-table tr { display: block; padding-block: 0.85rem; border-bottom: 1px solid var(--line); }
  .credit-table th,
  .credit-table td { display: block; border: 0; padding: 0; width: auto; }
  .credit-table tbody th { width: auto; }
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}
.contact-aside p { margin: 0 0 1.25rem; max-width: 26rem; color: #E4DED0; }
.contact-aside .rep { margin-top: 2rem; color: var(--muted); }
.contact-photo {
  margin: 0 0 2rem;
  max-width: 26rem;
  aspect-ratio: 4 / 5;
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--stage-2);
  box-shadow: 24px 24px 80px -32px rgba(61, 123, 255, 0.5), -16px -16px 70px -36px rgba(217, 119, 63, 0.45);
}
.contact-photo img { width: 100%; height: 100%; object-fit: cover; }

/* On small screens the form matters more than the photo. */
@media (max-width: 48rem) {
  .contact-photo { display: none; }
}

#form-area {
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 1.25rem;
  background: var(--stage-2);
  border: 1px solid var(--line);
}
#form-area::before {
  /* a thin metal line along the top edge */
  content: "";
  position: absolute;
  inset: -1px 1.5rem auto;
  height: 2px;
  background: var(--spectrum);
  border-radius: 2px;
}

.form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.45rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { color: var(--muted); font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--stage);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #4A505E; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: right 1.15rem center, right 0.85rem center;
  background-size: 0.3rem 0.3rem;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}
.field textarea { min-height: 10rem; resize: vertical; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(61, 123, 255, 0.4), 0 0 24px rgba(61, 123, 255, 0.25);
}

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-status { min-height: 1.5rem; margin: 0; font-weight: 500; }
.form-status.error { color: #F7A57A; }

.thanks h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-bottom: 1rem; }

@media (max-width: 48rem) {
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 34rem) {
  .field-row { grid-template-columns: 1fr; }
}

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

.site-footer {
  position: relative;
  padding-block: 2rem 2.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--spectrum);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--gold); }
.site-footer p { margin: 0; }

/* ---------- Scroll-driven motion ----------
   Browsers without scroll timelines (and anyone who prefers reduced motion)
   simply see everything in place. */

@media (prefers-reduced-motion: no-preference) {
  body::after { animation: grain 0.9s steps(6) infinite; }

  @supports (animation-timeline: view()) {
    /* Gold progress bar under the header. */
    .site-header::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -1px;
      height: 2px;
      background: var(--spectrum);
      transform-origin: left;
      animation: progress linear both;
      animation-timeline: scroll(root);
    }

    /* Things rise into place as they enter the viewport. */
    .section-head,
    .work-list li,
    .follow-list li,
    .collab-panel,
    .credit-group h2,
    .credit-table tbody tr,
    .bio-text > *,
    .photo-band,
    .contact-aside,
    #form-area {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0 entry 12rem;
    }

    /* Photos wipe open like a curtain going up. */
    .teaser li,
    .gallery li {
      animation: curtain linear both;
      animation-timeline: view();
      animation-range: entry 0 entry 16rem;
    }

    /* The hero photo drifts slower than the page. */
    .hero-photo img {
      animation: parallax linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }

    /* Section photos drift as their section scrolls by. Not the Work with
       Alex one: it's cropped to fit Alex exactly. */
    .work .section-photo img,
    .follow .section-photo img {
      animation: drift-photo linear both;
      animation-timeline: view();
    }

    /* The cream band tilts further as you scroll past. */
    .marquee:not(.marquee-alt) {
      animation: tilt linear both;
      animation-timeline: view();
    }
  }
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(-1%, 1%); }
}
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes reveal { from { opacity: 0; transform: translateY(2.5rem) scale(0.98); } }
@keyframes curtain {
  from { clip-path: inset(100% 0 0 0 round 1rem); transform: translateY(2rem); }
  to   { clip-path: inset(0 0 0 0 round 1rem); transform: none; }
}
@keyframes parallax { to { transform: translateY(12%) scale(1.06); } }
@keyframes drift-photo {
  from { transform: translateY(-5%) scale(1.12); }
  to   { transform: translateY(5%) scale(1.12); }
}
@keyframes tilt {
  from { transform: rotate(-5deg); }
  to   { transform: rotate(-1deg); }
}
