/*
  STYLES
  ------
  The look of the whole site. The colours and fonts are set once at the top
  (the "palette"), and everything below borrows from it. To shift the mood of
  the site, start by changing the palette.
*/

/* ---------- 1. Palette ---------- */
:root {
  /* The "screen": a deep, slightly purple black, like a dark cinema */
  --bg: #0b0a10;
  --bg-raised: #15131d;
  --line: rgba(255, 255, 255, 0.08);

  /* Text */
  --text: #f4f1ea;
  --text-dim: #a9a4b5;

  /* The "stage lights": three saturated colours used for glows and accents */
  --magenta: #ff3d7f;
  --amber: #ffb03b;
  --cyan: #2de2e6;
  --spectrum: linear-gradient(100deg, var(--magenta), var(--amber) 50%, var(--cyan));

  /* Type */
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* Spacing */
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 14px;
}

/* ---------- 2. Basics ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

/* Film grain: a faint noise texture laid over everything, like film stock */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

a {
  color: inherit;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
}

h2 {
  font-size: clamp(2.2rem, 6vw, 4rem);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 200;
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
}

/* ---------- 3. Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, rgba(11, 10, 16, 0.85), rgba(11, 10, 16, 0));
  backdrop-filter: blur(6px);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  gap: clamp(14px, 3vw, 32px);
}

.site-nav a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: color 0.2s;
}
.site-nav a:hover {
  color: var(--text);
}

/* ---------- 4. Hero (the opening title card) ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: 120px var(--gutter) clamp(64px, 12vh, 140px);
  overflow: hidden;
  /* Letterbox bars, top and bottom, like a widescreen frame */
  border-block: clamp(10px, 3vh, 28px) solid #000;
}

/* Slow-drifting coloured light behind the title */
.hero-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 50% at 20% 30%, rgba(255, 61, 127, 0.55), transparent 70%),
    radial-gradient(35% 45% at 80% 25%, rgba(45, 226, 230, 0.4), transparent 70%),
    radial-gradient(45% 55% at 60% 85%, rgba(255, 176, 59, 0.45), transparent 70%);
  filter: blur(40px);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1);
  }
  to {
    transform: translate3d(3%, 2%, 0) rotate(8deg) scale(1.08);
  }
}

.hero-inner {
  position: relative;
  max-width: 980px;
}

.eyebrow {
  margin: 0 0 18px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.hero-title {
  font-size: clamp(3.4rem, 13vw, 10rem);
  line-height: 0.9;
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.3rem, 3vw, 2rem);
  margin: 22px 0 10px;
}

.hero-intro {
  max-width: 52ch;
  color: var(--text-dim);
  margin: 0 0 32px;
}

.button {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px -10px var(--magenta);
}

/* ---------- 5. Sections ---------- */
.section {
  padding: clamp(80px, 14vh, 160px) var(--gutter);
  max-width: 1400px;
  margin: 0 auto;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
}

/* ---------- 6. Work gallery ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter:hover {
  color: var(--text);
}
.filter[aria-pressed="true"] {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(14px, 2vw, 24px);
}

.card {
  position: relative;
}

.card-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.card-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
}

.card-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.6s;
}

.card-button:hover .card-frame img,
.card-button:focus-visible .card-frame img {
  transform: scale(1.05);
  filter: saturate(1.2);
}

/* Small label in the corner: PHOTO or VIDEO */
.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(11, 10, 16, 0.7);
  backdrop-filter: blur(4px);
}

/* Play symbol on video covers */
.card-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(244, 241, 234, 0.9);
  color: var(--bg);
  font-size: 1.4rem;
  padding-left: 4px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

.card-year,
.card-note {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.card-note {
  margin: 4px 0 0;
}

/* "Coming soon" frames, shown while there is no work in the list yet */
.card.placeholder .card-frame {
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 80% at 30% 20%, rgba(255, 61, 127, 0.35), transparent 70%),
    radial-gradient(60% 80% at 80% 90%, rgba(45, 226, 230, 0.3), transparent 70%),
    var(--bg-raised);
}
.card.placeholder:nth-child(2) .card-frame {
  background:
    radial-gradient(60% 80% at 70% 20%, rgba(255, 176, 59, 0.35), transparent 70%),
    radial-gradient(60% 80% at 20% 90%, rgba(255, 61, 127, 0.3), transparent 70%),
    var(--bg-raised);
}
.card.placeholder:nth-child(3) .card-frame {
  background:
    radial-gradient(60% 80% at 40% 30%, rgba(45, 226, 230, 0.35), transparent 70%),
    radial-gradient(60% 80% at 90% 80%, rgba(255, 176, 59, 0.3), transparent 70%),
    var(--bg-raised);
}
.placeholder-label {
  font-family: var(--font-display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------- 7. About ---------- */
.about {
  display: grid;
  gap: 32px;
}
@media (min-width: 860px) {
  .about {
    grid-template-columns: 1fr 1.4fr;
  }
}
.about-body p {
  margin: 0 0 1.2em;
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 60ch;
}
.about-body p:first-child {
  color: var(--text);
}

/* ---------- 8. Contact ---------- */
.contact {
  text-align: center;
  position: relative;
}
.contact-email {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 5vw, 3rem);
  text-decoration: none;
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
}
.socials {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
}
.socials a {
  color: var(--text-dim);
  text-decoration: none;
}
.socials a:hover {
  color: var(--text);
}

/* ---------- 9. Footer ---------- */
.site-footer {
  padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- 10. Viewer (lightbox) ---------- */
.viewer {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 56px var(--gutter) 24px;
  border: 0;
  background: rgba(5, 5, 8, 0.96);
  color: var(--text);
}
.viewer[open] {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 12px;
}
.viewer::backdrop {
  background: rgba(0, 0, 0, 0.8);
}
.viewer-stage {
  grid-column: 2;
  height: 100%;
  display: grid;
  place-items: center;
  min-width: 0;
}
.viewer-stage img {
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.viewer-stage iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 100%;
  border: 0;
  border-radius: 6px;
}
.viewer-caption {
  grid-column: 1 / -1;
  text-align: center;
  margin: 0;
  color: var(--text-dim);
}
.viewer-close,
.viewer-nav {
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font-size: 2.4rem;
  line-height: 1;
  padding: 8px;
}
.viewer-close {
  position: absolute;
  top: 10px;
  right: var(--gutter);
}
.viewer-nav[hidden] {
  visibility: hidden;
  display: block;
}

/* ---------- 11. Gentle entrance animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Respect visitors who have asked their device for less motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-glow {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
