/* ---------- Colours and spacing, used everywhere below ---------- */
:root {
  --black: #000;
  --text: #f0ece2;
  --cream: #f4efe4;
  --muted: #a39c8e;
  --muted-light: #c4bdae;
  --line: rgba(244, 239, 228, 0.14);
  --card: rgba(26, 23, 18, 0.55);
  --panel: #1a1712;
  --red: #b10707;
  --blue: #4655d6;
  --name-blue: #0055d7;
  --rec: #d1492e;
  --green: #2f8f4e;

  --font-head: 'Bricolage Grotesque', sans-serif;
  --font-text: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --pad-x: clamp(1.5rem, 5vw, 3.5rem);
  --gap: clamp(0.8rem, 2vw, 1.2rem);
  --radius: 14px;

  /* 0 at the top, 1 once Klub Halal is reached. Set by main.js on scroll. */
  --drift: 0;
}

/* ---------- Basics ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--text);
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--blue); }
::selection { background: var(--blue); color: var(--cream); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- Background: blurred still, dark vignette, glow ---------- */
.bg, .bg-dim, .bg-glow { position: fixed; z-index: 0; pointer-events: none; }
.bg {
  inset: -60px;
  background: url('images/bg.jpg') center / cover;
  transform: scale(1.06);
  filter: blur(14px) saturate(1.05);
}
.bg-dim {
  inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.78) 70%, rgba(0,0,0,0.9) 100%);
}
/* The purple glow fades in as you scroll towards Klub Halal */
.bg-glow {
  inset: -80px;
  opacity: var(--drift);
  mix-blend-mode: screen;
  background: url('images/glow.jpg') 60% 45% / cover;
  filter: blur(30px) saturate(1.15) brightness(0.34);
  -webkit-mask-image: radial-gradient(120% 100% at 55% 50%, #000 0%, rgba(0,0,0,0.85) 45%, transparent 100%);
  mask-image: radial-gradient(120% 100% at 55% 50%, #000 0%, rgba(0,0,0,0.85) 45%, transparent 100%);
}
.page { position: relative; z-index: 1; }

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem var(--pad-x);
  border-bottom: 1px solid var(--line);
}
.nav-links { display: flex; gap: clamp(1.2rem, 3vw, 2.2rem); }
.nav-links a, .rec {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-links a:hover { color: var(--blue); }
.rec { display: flex; align-items: center; gap: 0.5rem; font-size: 0.68rem; letter-spacing: 0.12em; }
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rec);
  animation: rec-pulse 1.6s ease-in-out infinite;
}
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- Header ---------- */
.header {
  padding: clamp(2rem, 6vw, 3.5rem) var(--pad-x) clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.name {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--name-blue);
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin-left: -0.055em;
}
.roles {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.9rem;
}
.availability {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.dot-green { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* ---------- Shared bits ---------- */
.section { padding: clamp(1.2rem, 3vw, 2rem) var(--pad-x); }
.section-title { display: flex; align-items: stretch; gap: 1rem; margin-bottom: clamp(1rem, 2.5vw, 1.6rem); }
.section-title h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--red);
}
.section-title-bar { width: 2px; background: var(--cream); flex: 0 0 auto; }

.kicker, .role {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}
.kicker { margin-bottom: 0.5rem; }
.role-inline { text-transform: none; font-size: 0.7rem; letter-spacing: 0.06em; opacity: 0.75; margin-top: 0.9rem; }

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.4rem;
  align-items: baseline;
  margin-top: clamp(1rem, 2vw, 1.4rem);
  padding-top: clamp(0.8rem, 1.6vw, 1.1rem);
  border-top: 1px solid var(--line);
}
.facts dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}
.facts dd { font-family: var(--font-mono); font-size: clamp(0.82rem, 1.1vw, 0.95rem); color: var(--text); }

.project-title { font-family: var(--font-head); font-weight: 700; line-height: 1.05; }

/* ---------- Selected work: lead tile + side column ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(0.9rem, 2vw, 1.4rem);
}
.tile { display: block; overflow: hidden; background: var(--card); border-radius: var(--radius); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile-lead { aspect-ratio: 810 / 687; }
.tile-wide { aspect-ratio: 16 / 9; }
.hero-side { display: flex; flex-direction: column; gap: clamp(0.9rem, 2vw, 1.4rem); }
.overview {
  flex: 1 1 auto;
  min-height: 180px;
  padding: clamp(1.2rem, 2.5vw, 1.8rem);
  background: var(--card);
  border-radius: var(--radius);
}
.overview-title {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  color: var(--cream);
  text-decoration: underline 3px var(--red);
  text-underline-offset: 0.18em;
}
.overview p {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  line-height: 1.6;
  margin-top: clamp(0.8rem, 1.6vw, 1.1rem);
  text-wrap: pretty;
}
.overview .facts dt { font-size: 0.66rem; letter-spacing: 0.1em; color: var(--muted); opacity: 1; }
.overview .facts dd { font-family: var(--font-text); font-size: clamp(0.9rem, 1.2vw, 1.02rem); }

/* ---------- Project sections ---------- */
.project {
  padding: 0 var(--pad-x) clamp(0.9rem, 2vw, 1.2rem);
  border-top: 1px solid var(--line);
}
.project-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: var(--gap);
}
.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.2rem;
  min-height: 300px;
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--card);
}
.card-text {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  max-width: 38ch;
  margin-top: clamp(0.7rem, 1.6vw, 1rem);
  text-wrap: pretty;
}
.title-atnlb { font-size: clamp(1.3rem, 2.4vw, 1.8rem); color: var(--red); text-transform: uppercase; letter-spacing: -0.01em; }
.title-and { font-size: clamp(1.3rem, 2.4vw, 1.8rem); color: #c4b093; text-transform: uppercase; letter-spacing: 0.06em; }

.wide-still {
  margin-top: var(--gap);
  aspect-ratio: 939 / 254;
  overflow: hidden;
  background: var(--panel);
  border-radius: var(--radius);
}
.wide-still img { width: 100%; height: 100%; object-fit: cover; }

/* Oyster: full-width carousel with text on glass */
.carousel-full { min-height: 88vh; }
.oyster-shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, rgba(15,20,24,0.55) 0%, rgba(15,20,24,0.1) 55%, transparent 100%);
}
.oyster-copy {
  position: relative; z-index: 3;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  padding: clamp(1rem, 5vw, 4rem);
  pointer-events: none;
}
.glass {
  max-width: 44ch;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  background: rgba(18, 24, 28, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--cream);
  pointer-events: auto;
}
.title-oyster { font-weight: 500; font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin-top: 0.5rem; }
.oyster-tagline { font-family: var(--font-head); font-size: clamp(1.05rem, 1.8vw, 1.35rem); line-height: 1.35; margin-top: 0.9rem; }
.oyster-text { font-size: 0.92rem; line-height: 1.6; margin-top: 0.5rem; opacity: 0.92; text-wrap: pretty; }
.credit { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; opacity: 0.7; margin-top: 0.6rem; }

/* Klub Halal and Checkdomain: glass card beside a 16:9 carousel */
.project-pair {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.9rem;
  align-items: stretch;
}
.project-pair-flip { grid-template-columns: 1.4fr 1fr; }
.glass-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  padding: 1.4rem;
  color: var(--cream);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.glass-purple { background: rgba(61, 33, 84, 0.34); }
.glass-green { background: rgba(47, 143, 78, 0.34); }
.glass-text { font-size: 0.85rem; line-height: 1.55; margin-top: 0.6rem; opacity: 0.92; max-width: 34ch; text-wrap: pretty; }
.glass-card .facts { margin-top: clamp(0.9rem, 1.8vw, 1.2rem); padding-top: clamp(0.7rem, 1.4vw, 0.95rem); }
.title-klub {
  width: fit-content;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  margin-top: 0.5rem;
  /* half cream, half purple letters */
  background: linear-gradient(to bottom, var(--cream) 50%, #9b2fa3 50%) 0 0.27em / 100% 0.72em no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.title-check { font-size: clamp(1.25rem, 2.6vw, 1.9rem); margin-top: 0.5rem; }

/* ---------- Carousels ---------- */
.carousel {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  background: var(--panel);
  border-radius: var(--radius);
}
.carousel-16x9 { aspect-ratio: 16 / 9; min-height: 0; }
.carousel-track {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}
.carousel-track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--panel);
  filter: saturate(0.92) contrast(1.03);
  border-radius: var(--radius);
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 38px; height: 38px;
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(27, 26, 23, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.carousel-btn:hover { opacity: 1; background: rgba(27, 26, 23, 0.6); }
.carousel-btn svg { width: 16px; height: 16px; }
.carousel-prev { left: 0.8rem; }
.carousel-next { right: 0.8rem; }
.carousel-dots {
  position: absolute;
  bottom: 0.8rem; left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 0.4rem;
}
.carousel-dots button {
  width: 6px; height: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(244, 239, 228, 0.4);
  cursor: pointer;
  transition: background 0.25s ease;
}
.carousel-dots button[aria-current="true"] { background: var(--cream); }

/* ---------- Photography ---------- */
.section-photo { border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: clamp(0.9rem, 2vw, 1.2rem); }
.photo-title {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1;
  margin-bottom: clamp(1rem, 2.5vw, 1.6rem);
}
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.5fr;
  gap: clamp(0.7rem, 1.6vw, 1.1rem);
  min-height: clamp(460px, 58vw, 860px);
}
.photo-col { display: flex; flex-direction: column; gap: clamp(0.7rem, 1.6vw, 1.1rem); }
.photo { overflow: hidden; border-radius: var(--radius); background: var(--panel); min-height: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-a { flex: 348 1 0; }
.photo-b { flex: 525 1 0; }
.photo-full { flex: 1 1 0; }

/* ---------- Footer ---------- */
.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  padding: clamp(2.5rem, 6vw, 3.5rem) var(--pad-x) 2rem;
  background: rgba(10, 9, 8, 0.82);
  border-top: 1px solid var(--line);
}
.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-light);
  margin-bottom: 0.9rem;
}
.footer a { display: block; font-size: 0.88rem; color: var(--muted); margin-bottom: 0.5rem; }
.footer a:hover { color: var(--blue); }
.footer-center { text-align: center; }
.footer-right { text-align: right; }
.footer-base {
  grid-column: 1 / -1;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted-light);
}

/* ---------- Back to top: red at the top, purple by Klub Halal ---------- */
.to-top {
  position: fixed;
  right: 1.5rem; bottom: 1.5rem;
  z-index: 100;
  width: 44px; height: 44px;
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, rgb(106, 58, 168) calc(var(--drift) * 100%), rgb(221, 6, 10));
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 18px; height: 18px; }

/* ---------- Phone: everything in one column ---------- */
@media (max-width: 700px) {
  .nav { padding-top: 1rem; padding-bottom: 1rem; }
  .nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.25rem; }

  .hero-grid,
  .project-pair,
  .project-pair-flip { grid-template-columns: 1fr; }
  .tile-lead { aspect-ratio: 4 / 3; }

  .carousel-full, .oyster-copy { min-height: 75vh; }

  .wide-still { aspect-ratio: 16 / 9; }

  .photo-grid { grid-template-columns: 1fr; min-height: 0; }
  .photo, .photo-a, .photo-b, .photo-full { flex: none; }
  .photo img { height: auto; }

  .footer { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-center, .footer-right { text-align: left; }
  .footer a { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
