/* creationist.dev — shared styles. Design tokens carried over from Design Desk Live. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #0a0a0a;
  --white: #f8f7f4;
  --gray-100: #f0eeea;
  --gray-200: #e2dfda;
  --gray-400: #aaa89f;
  --gray-600: #6b6861;
  --line: 1px solid rgba(10, 10, 10, 0.11);
  --font-display: 'neue-haas-grotesk-display', 'Neue Haas Grotesk Display Pro', 'Neue Haas Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: 'neue-haas-grotesk-text', 'Neue Haas Grotesk Text Pro', 'Neue Haas Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --radius: 10px;
  --maxw: 1200px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }

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

/* ---------- Home intro (single full-width description) ---------- */
.home-intro { padding: 4.5rem 1.25rem 2.5rem; }
.home-intro p {
  margin: 0;
  font-family: var(--font-body); font-weight: 400;
  font-size: 2.375rem; line-height: 1.3; letter-spacing: 0.01em;
  color: var(--black);
}
.home-contacts { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.9rem 1.75rem; }
.home-contact {
  font-family: var(--font-body); font-size: 1.25rem;
  color: var(--black); text-decoration: underline; text-underline-offset: 4px;
  transition: color 0.2s ease, text-underline-offset 0.2s ease;
}
.home-contact:hover { color: var(--gray-600); text-underline-offset: 6px; }

/* ---------- Gallery grid ---------- */
/* Full-width, case-study-style gallery: featured items span both columns,
   regular shots sit 2-up. Gutters match .portal-media. */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 0.5rem 1.25rem 2.5rem;
}
.see-more { padding: 0 1.25rem 6rem; }
.card { text-decoration: none; display: block; }
/* Scroll-reveal: cards fade + slide up as they enter the viewport. */
.gallery .card { opacity: 0; transform: translateY(30px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.gallery .card.revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .gallery .card { opacity: 1; transform: none; transition: none; }
}
.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover .card-media {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -18px rgba(10, 10, 10, 0.35);
}
.card-media img, .card-media video {
  width: 100%; height: 100%; object-fit: cover;
}
.card-media video { position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s; }
.card-media.playing video { opacity: 1; }

/* ---------- Featured full-width item (grid thumb → case study) ---------- */
.card-featured { grid-column: 1 / -1; }
.card-featured .featured-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-100);
}
.card-featured .featured-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.card-featured:hover .featured-media img { transform: scale(1.02); }
.card-featured .featured-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.3s ease;
}
.card-featured .featured-media.playing video { opacity: 1; }
/* Image slideshow (case study without a video): slides stack, hover cycles them. */
.featured-media[data-slideshow] .slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.4s ease, transform 0.4s ease;
}
.featured-media[data-slideshow] .slide.current { opacity: 1; }

/* ---------- Case-study video block (hover-play preview + watch link) ---------- */
.video-block { display: flex; flex-direction: column; gap: 0.65rem; }
.hover-media { position: relative; aspect-ratio: 16 / 9; background: var(--black); cursor: pointer; }
.hover-media img { width: 100%; height: 100%; object-fit: cover; }
.hover-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.3s ease;
}
.hover-media.playing video { opacity: 1; }

/* ---------- Horizontal media row (e.g. GIF trio) ---------- */
.shot-media-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.shot-media-row .row-cell {
  aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: var(--radius); border: var(--line); background: var(--gray-100);
}
.shot-media-row .row-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 50/50 split pair ---------- */
.shot-media-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.shot-media-split .shot-media img { width: 100%; height: auto; display: block; }
/* Cover variant: cells share a fixed aspect ratio and crop-fill (no gray gaps). */
.shot-media-split--cover .shot-media { overflow: hidden; }
.shot-media-split--cover .shot-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) {
  .shot-media-split { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* ---------- Editorial writeup block ---------- */
.case-essay { max-width: 44rem; margin: 1.5rem auto; padding: 1.5rem 0; }
.essay-eyebrow {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gray-600); margin-bottom: 1.5rem;
}
.essay-lead {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.3rem, 2.4vw, 1.65rem); line-height: 1.3; letter-spacing: 0.005em;
  margin-bottom: 1.5rem;
}
.essay-body p {
  font-size: 1.05rem; line-height: 1.55; color: var(--gray-600);
  margin-bottom: 1.15rem; max-width: 40rem;
}
.essay-body p:last-child { margin-bottom: 0; }

/* Small italic caption sitting tight beneath its image. */
.media-note {
  margin-top: -0.55rem;
  max-width: 44rem;
  font-size: 0.8rem; font-style: italic; line-height: 1.5;
  color: var(--gray-600);
}

/* ---------- Full-width "portal" page ---------- */
.portal-intro {
  padding: 4.5rem 1.25rem 3rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start;
}
/* Uniform intro type: NHG Text 25.92px / 400 / line-height 1.2 / +0.01em, black. */
.portal-title,
.portal-skills li,
.portal-intro__text p {
  font-family: var(--font-body); font-weight: 400;
  font-size: 1.62rem; line-height: 1.2; letter-spacing: 0.01em;
  color: var(--black);
}
.portal-title { margin: 0 0 1.2em; }
.portal-skills { list-style: none; margin: 0; padding: 0; }
.portal-intro__text { max-width: 42rem; }
.portal-intro__text p { margin: 0 0 1.2em; }
.portal-intro__text p:last-child { margin-bottom: 0; }

.portal-media { display: flex; flex-direction: column; gap: 1.25rem; padding: 0 1.25rem 5rem; }
.portal-figure {
  margin: 0; overflow: hidden;
  border-radius: var(--radius); background: var(--gray-100);
}
.portal-figure img { width: 100%; height: auto; display: block; }
.portal-figure .hover-media { cursor: pointer; }
.portal-play {
  position: absolute; bottom: 1rem; left: 1rem; z-index: 2;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(10, 10, 10, 0.5); backdrop-filter: blur(4px);
  pointer-events: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.portal-figure .hover-media:hover .portal-play { background: var(--black); transform: scale(1.06); }
.portal-play::after {
  content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}
.portal-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.portal-split--cover .portal-figure img { width: 100%; height: 100%; object-fit: cover; }
.portal-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
/* Equal square cells so a shorter gif cover-fills instead of leaving a gray gap. */
.portal-row .portal-figure { aspect-ratio: 1; }
.portal-row .portal-figure img { width: 100%; height: 100%; object-fit: cover; }
.portal-text { max-width: 44rem; margin: 1.5rem auto; padding: 0 1.25rem; }
@media (max-width: 800px) {
  .portal-intro { grid-template-columns: 1fr; gap: 1.75rem; padding: 3rem 1.25rem 1.5rem; }
  .portal-split, .portal-row { grid-template-columns: 1fr; }
  .portal-row .portal-figure { aspect-ratio: auto; }
  .portal-row .portal-figure img { height: auto; }
}

.video-watch {
  align-self: flex-start;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em;
  color: var(--gray-600); text-decoration: none;
  border-bottom: 1px solid var(--gray-400); padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.video-watch:hover { color: var(--black); border-color: var(--black); }
.shot-subtitle {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em;
  color: var(--gray-600); margin-top: 0.5rem;
}

/* ---------- Scroll-scrubbed full-screen hero ---------- */
/* .scrolly is just an empty scroll track; the fixed stage overlays it while
   scrubbing, then shrinks onto the inline .scrolly-rest card that follows. */
.scrolly { height: 340vh; }
.scrolly-stage {
  position: fixed; top: 0; left: 0; z-index: 60;
  width: 100vw; height: 100vh;
  overflow: hidden;
  background: var(--black);
  cursor: pointer;
  will-change: width, height, top, left;
}
@supports (height: 100dvh) { .scrolly-stage { height: 100dvh; } }
.scrolly-stage video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.scrolly-stage.done { display: none; }
/* The resting card is a normal inline video block (hover-media handles it). */
.scrolly-rest { scroll-margin-top: 80px; }

/* Topbar steps aside while the hero owns the viewport. */
.topbar { transition: opacity 0.35s ease, transform 0.35s ease; }
body.scrolly-pinned .topbar { opacity: 0; transform: translateY(-100%); pointer-events: none; }

/* Reduced motion: skip the scrub entirely — collapse the spacer + stage and
   let the inline resting card stand on its own. */
body.scrolly-off .scrolly { display: none; }
body.scrolly-off .scrolly-stage { display: none; }

/* ---------- Shadowbox / lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 5vmin;
  background: rgba(6, 6, 6, 0.92);
  backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; }
.lightbox-inner {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
/* Video: fixed 16:9 frame. */
.lightbox-frame {
  width: min(1200px, 92vw); aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.lightbox-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
/* Image: shown at its natural aspect, bounded to the viewport. */
.lightbox-img,
.lightbox-video {
  max-width: 92vw; max-height: 88vh; width: auto; height: auto;
  border-radius: var(--radius); display: block;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.lightbox-video { background: #000; }
/* Clickable stills. */
[data-lb-img] { cursor: zoom-in; }
.lightbox-close {
  position: absolute; top: 1.1rem; right: 1.4rem;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  font-size: 1.6rem; line-height: 1;
  transition: background 0.2s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: var(--line);
  padding: 2.5rem 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.65rem; letter-spacing: 0.06em;
  color: var(--gray-600);
}
.site-footer a { color: var(--black); }

/* ---------- Shot detail page ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: var(--line);
  position: sticky; top: 0; z-index: 10;
  background: rgba(248, 247, 244, 0.9);
  backdrop-filter: blur(10px);
}
.topbar a { text-decoration: none; }
.topbar .back { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; color: var(--gray-600); }
.topbar .back:hover { color: var(--black); }
.topbar .brand { font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; letter-spacing: 0; }

.shot { max-width: 1040px; margin: 0 auto; padding: 3rem 2rem 4rem; }
.shot-gallery { display: flex; flex-direction: column; gap: 1.25rem; }
.shot-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--line);
  background: var(--gray-100);
}
.shot-media img, .shot-media video { width: 100%; height: auto; }
.shot-head { margin-top: 2rem; }
.shot-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  letter-spacing: 0.005em;
}
.shot-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.shot-tags span {
  font-family: var(--font-mono);
  font-size: 0.65rem; letter-spacing: 0.04em;
  color: var(--gray-600);
  background: var(--gray-100);
  border: var(--line);
  padding: 0.3rem 0.7rem; border-radius: 999px;
}

.shot-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: var(--line); margin-top: 3.5rem; padding-top: 1.75rem;
}
.shot-nav a {
  text-decoration: none; max-width: 45%;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.03em;
  color: var(--gray-600);
}
.shot-nav a:hover { color: var(--black); }
.shot-nav .label { display: block; font-size: 0.58rem; text-transform: uppercase; color: var(--gray-400); margin-bottom: 0.25rem; }
.shot-nav .next { text-align: right; margin-left: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 1.25rem; }
  .home-intro { padding: 3rem 1.25rem 1.5rem; }
  .home-intro p { font-size: 1.75rem; }
  .gallery { grid-template-columns: 1fr; gap: 1.5rem; padding-bottom: 3.5rem; }
  .topbar { padding: 1.1rem 1.25rem; }
  .shot { padding: 2rem 1.25rem 3rem; }
}
