/* ---- Colours (dark theme; the accent blue picks up the blue edges of the particle render in the hero) ---- */
:root {
  --bg: #08080a;
  --surface: #131316;
  --surface-2: #1c1c20;
  --text: #f2eff2;
  --muted: #a39ea6;
  --border: #25252b;
  --accent: #6ea8ff;        /* change this to restyle the whole site */
  --accent-text: #050d1f;
  --max: 72rem;
  --prose: 40rem;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

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

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
nav { display: flex; gap: 1.4rem; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }

/* ---- Hero ---- */
/* Full-screen hero with the particle render behind it; the rest of the page starts below the fold. */
.hero {
  position: relative;
  min-height: calc(100vh - 3.75rem);
  min-height: calc(100svh - 3.75rem);
  display: flex;
  align-items: flex-end;
  padding: 6rem 0 clamp(5rem, 12vh, 8rem);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 45%;
}
.hero::after {
  /* darken the bottom and left so the text stays readable over the particles */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(8, 8, 10, 0.7) 30%, transparent 65%),
    linear-gradient(to right, rgba(8, 8, 10, 0.75) 0%, transparent 60%);
}
.hero .wrap { width: 100%; }
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  translate: -50% 0;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
  animation: bob 2.4s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--text); }
@keyframes bob { 50% { transform: translateY(6px); } }
.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.lede { margin: 1.4rem 0 0; font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 42rem; }
.lede em { font-style: normal; color: var(--text); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.2rem; }
.button {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.95rem;
  border: 1px solid var(--accent);
  transition: filter 0.15s, border-color 0.15s;
}
.button:hover { filter: brightness(1.1); }
.button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.button.ghost:hover { border-color: var(--muted); filter: none; }

/* ---- Sections ---- */
.section { padding-top: clamp(3rem, 7vw, 4.5rem); scroll-margin-top: 3.5rem; }
h2 {
  margin: 0 0 1.4rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 650;
}
h2.spaced { margin-top: 3.5rem; }
h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; letter-spacing: -0.01em; font-weight: 650; }
h3 a { color: inherit; text-decoration: none; }
h3 a:hover { color: var(--accent); }
.year { color: var(--muted); font-weight: 400; font-size: 0.9rem; margin-left: 0.3rem; font-variant-numeric: tabular-nums; }
.meta { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.88rem; }
.fx { margin: 0.45rem 0 0; font-size: 0.92rem; }
.note { color: var(--muted); font-size: 0.95rem; margin: 1rem 0 0; }

.prose { max-width: var(--prose); }
.prose p { margin: 0 0 1rem; }

/* Showreel */
.reel {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.reel iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Text credits */
.credits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 0.75rem;
}
.credits li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}
.credits.compact { margin-top: 0.75rem; }

/* Video credits */
.videos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 2rem 1.25rem;
}
.thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  aspect-ratio: 16 / 9;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease, opacity 0.2s; }
.thumb::after {
  /* play icon */
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.4rem;
  height: 3.4rem;
  translate: -50% -50%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l9 5-9 5z' fill='white'/%3E%3C/svg%3E") center / 60% no-repeat;
  backdrop-filter: blur(4px);
  transition: background-color 0.2s, scale 0.2s;
}
.thumb:hover img { transform: scale(1.04); }
.thumb:hover::after { background-color: var(--accent); scale: 1.08; }

/* About & contact */
.contact-lede { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; letter-spacing: -0.02em; word-break: break-word; }
.contact-lede a { color: var(--text); text-decoration-color: var(--accent); }
.links { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.links a { font-weight: 600; }

/* ---- Photography page ---- */
.page-intro { padding: clamp(3rem, 8vw, 5rem) 0 2rem; }
.page-intro h1 { font-size: clamp(2.5rem, 7vw, 4rem); }

/* Justified rows: each photo grows in proportion to its aspect ratio (--ar). */
.gallery { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gallery::after { content: ""; flex-grow: 999; }
.photo {
  flex-grow: calc(var(--ar) * 100);
  flex-basis: calc(var(--ar) * 15rem);
  aspect-ratio: var(--ar);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
}
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease, opacity 0.2s; }
.photo:hover img { transform: scale(1.03); }

@media (max-width: 560px) {
  .gallery { gap: 0.35rem; }
  .photo { flex-basis: calc(var(--ar) * 6.5rem); border-radius: 4px; }
}

/* ---- Dialogs (video player and photo lightbox) ---- */
dialog {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
  max-height: none;
  overflow: visible;
}
dialog::backdrop { background: rgba(5, 5, 6, 0.92); }
dialog .close, dialog .prev, dialog .next {
  position: fixed;
  border: 0;
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
dialog .close:hover, dialog .prev:hover, dialog .next:hover { background: rgba(255, 255, 255, 0.25); }
dialog .close { top: 1rem; right: 1rem; }
dialog .prev { left: 1rem; top: 50%; translate: 0 -50%; }
dialog .next { right: 1rem; top: 50%; translate: 0 -50%; }

.player-frame { width: min(92vw, calc(82vh * 16 / 9)); aspect-ratio: 16 / 9; }
.player-frame iframe, .player-frame video { width: 100%; height: 100%; border: 0; border-radius: 8px; background: #000; }
.player-frame video:focus { outline: none; }

.lightbox img {
  width: auto;
  height: auto;
  max-width: calc(100vw - 8rem);
  max-height: calc(100vh - 4rem);
  border-radius: 4px;
}
@media (max-width: 700px) {
  .lightbox img { max-width: 100vw; max-height: 85vh; border-radius: 0; }
  dialog .prev, dialog .next { top: auto; bottom: 1rem; translate: none; }
}

/* ---- Footer ---- */
.site-footer { margin-top: 6rem; border-top: 1px solid var(--border); }
.site-footer p { margin: 0; padding: 2rem 0; color: var(--muted); font-size: 0.9rem; }

/* ---- 404 ---- */
.notfound { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }

/* ---- Small screens ---- */
@media (max-width: 560px) {
  .brand { font-size: 0.95rem; }
  nav { gap: 0.85rem; }
  nav a { font-size: 0.85rem; }
}
@media (max-width: 400px) {
  .site-header .wrap { flex-direction: column; justify-content: center; gap: 0.1rem; padding-block: 0.5rem; }
}

@media (max-width: 700px) {
  .hero-bg img { object-position: 60% 30%; }
  .hero::after {
    background: linear-gradient(to top, var(--bg) 0%, rgba(8, 8, 10, 0.75) 40%, transparent 75%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
