/* ============================================================
   RAJIV RANJAN — Portfolio · Dark Theme
   ============================================================ */

@import url('https://api.fontshare.com/v2/css?f[]=switzer@300,400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Bungee&display=swap');

:root {
  --bg:       #0A0A0A;
  --text:     #F0F0F0;
  --muted:    rgba(240,240,240,0.38);
  --border:   rgba(240,240,240,0.1);
  --card-bg:  #111111;
  --tag-bg:   rgba(240,240,240,0.08);
  --tag-text: rgba(240,240,240,0.4);
  --side:     64px;   /* = logo size: the logo defines the grid boundary */
  --gap:      20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Switzer', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

/* Global film-grain over the background (fixed = no scroll repaint) */
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 170px 170px; opacity: 0.06;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ====================================================================
   NAV — logo flush to top-left corner, no bar
   ==================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  background: transparent;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
/* Desktop: nav links hide after the first scroll (logo stays sticky),
   and a hamburger fades in (same menu as mobile) */
@media (min-width: 768px) {
  .nav__links { transition: opacity 0.4s ease, transform 0.4s ease; }
  .nav.scrolled .nav__links { opacity: 0; transform: translateY(-14px); pointer-events: none; }
}
.nav > * { pointer-events: auto; }

/* Logo pinned to the very corner — zero space top & left */
.nav__logo {
  display: flex; align-items: center; gap: 14px;
  position: relative; z-index: 201;
}
.nav__logo svg {
  /* Logo box exactly fills the corner gutter, so its right edge = the grid's
     left boundary. Everything else aligns to --side. */
  width: var(--side); height: var(--side); flex-shrink: 0;
  display: block;
  will-change: transform;
}
/* Black-background logo version: black square, white R/ */
.nav__logo svg rect { fill: #0A0A0A; }
.nav__logo svg g    { fill: #ffffff; }

/* Animate the "/" slash (2nd path) every 5s — minimal smooth flick */
.nav__logo svg g path:nth-child(2) {
  transform-box: fill-box;
  transform-origin: center;
  animation: slashFlick 5s ease-in-out infinite;
}
@keyframes slashFlick {
  0%, 84%   { transform: translateY(0) scaleY(1); opacity: 1; }
  88%       { transform: translateY(-2px) scaleY(0.78); opacity: 0.55; }
  94%       { transform: translateY(1px) scaleY(1.08); opacity: 1; }
  100%      { transform: translateY(0) scaleY(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .nav__logo svg g path:nth-child(2) { animation: none; }
}

/* Text label sits beside the corner logo, vertically centred to it */
.nav__logo-text { display: none; }
.nav__logo-name { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; color: var(--text); }
.nav__logo-sub  { font-size: 10px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; color: var(--text); opacity: 0.55; }

/* Nav links — padded away from the corner */
.nav__links { display: flex; align-items: center; gap: 32px; list-style: none; padding: 0 var(--side) 0 0; }
.nav__links a {
  font-size: clamp(20px, 1.8vw, 26px); font-weight: 400; letter-spacing: -0.01em; text-transform: none;
  color: var(--text);
  transition: opacity 0.2s;
}
.nav__links a:hover { opacity: 0.6; }
.nav__links .funbit-btn { display: inline-flex; color: var(--text); }

/* Home hero: nav tone reacts to the current cover's lightness — black on light
   covers, white on dark ones (toggled per slide via .hero-dark on <html>).
   Inner pages stay solid dark. */
body:has(.hero) .nav__links a,
body:has(.hero) .nav__links .funbit-btn { color: #0f0f0f; }
html.hero-dark .nav__links a,
html.hero-dark .nav__links .funbit-btn { color: #fff; }
body:has(.hero) .nav__logo-name,
body:has(.hero) .nav__logo-sub { color: #0f0f0f; }

.nav__hamburger { display: none; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; padding: 0 var(--side) 0 0; position: relative; z-index: 210; color: #0f0f0f; }
.nav__hamburger svg { display: block; width: 22px; height: auto; fill: currentColor; }
/* white only while a dark hero cover is still behind it; black once past the hero */
html.hero-dark:not(.past-hero) .nav__hamburger { color: #fff; }
.nav__hamburger[aria-expanded="true"] { color: #fff; }   /* solid white over the dark overlay */

/* Desktop: hamburger fades in once the nav tabs hide after the first scroll */
@media (min-width: 768px) {
  .nav__hamburger {
    display: flex; position: absolute; top: 0; right: 0;
    height: var(--side); padding: 0 var(--side) 0 0;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
  }
  .nav.scrolled .nav__hamburger { opacity: 1; pointer-events: auto; }
}
/* legacy span styles (no longer rendered — icon is now an SVG) */
.nav__hamburger span {
  display: block; width: 20px; height: 1.5px; background: var(--text); transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.25s ease;
}
.nav__hamburger[aria-expanded="true"] span { background: #fff !important; }
.nav__hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
/* keep the logo mark white over the black menu */
body:has(.nav__overlay.open) .nav__logo svg rect { fill: transparent; }

/* Full-screen black overlay — Offform style: left-aligned links, socials bottom */
.nav__overlay {
  position: fixed; inset: 0; background: #0A0A0A; z-index: 199;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  padding: 112px var(--side) 44px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4,0,0.2,1), visibility 0.5s;
}
.nav__overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
.nav__overlay > a {
  font-size: clamp(34px, 9vw, 46px); font-weight: 400; letter-spacing: -0.02em;
  color: #fff; margin-bottom: 8px;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.2,1,0.3,1), color 0.2s;
}
.nav__overlay.open > a { opacity: 1; transform: none; }
.nav__overlay.open > a:nth-of-type(1) { transition-delay: 0.10s; }
.nav__overlay.open > a:nth-of-type(2) { transition-delay: 0.17s; }
.nav__overlay.open > a:nth-of-type(3) { transition-delay: 0.24s; }
.nav__overlay.open > a:nth-of-type(4) { transition-delay: 0.31s; }
.nav__overlay > a:hover { opacity: 0.5; }
.nav__close { display: none; }

/* bottom block: social links + smiley */
.nav__overlay-bottom {
  margin-top: auto; width: 100%;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.45s ease 0.3s, transform 0.6s cubic-bezier(0.2,1,0.3,1) 0.3s;
}
.nav__overlay.open .nav__overlay-bottom { opacity: 1; transform: none; }
.nav__social { display: flex; flex-direction: column; gap: 4px; }
.nav__social a { font-size: 16px; color: #fff; opacity: 0.8; }
.nav__social a:hover { opacity: 1; }
.nav__mctl { display: none; }
.nav__overlay-bottom .nav__mctl { display: flex; align-items: center; }

/* ====================================================================
   CUSTOM CURSOR
   ==================================================================== */
body:has(.cursor) * { cursor: none !important; }

/* Refined cursor:
   - default: small, semi-transparent black dot (over content)
   - grow:    larger glassy disc — only over BLANK areas or after 3s idle
   - reveal:  subtle photochromatic/x-ray lens after 2s dwell on an element
   State classes are only toggled on boundary crossings (no pulsing). */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 12px; height: 12px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(0,0,0,0.45);          /* semi-transparent black */
  /* glassy edge so it stays visible on black */
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: inset 0 0 6px rgba(255,255,255,0.18),
              0 0 0 0.5px rgba(255,255,255,0.06);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  transition: width 0.55s cubic-bezier(0.22,1,0.36,1),
              height 0.55s cubic-bezier(0.22,1,0.36,1),
              background 0.5s ease, backdrop-filter 0.5s ease, opacity 0.3s ease;
  will-change: transform;
}
/* Grow — blank area or 3s idle (50% smaller than before) */
.cursor--grow {
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: inset 0 0 10px rgba(255,255,255,0.2),
              0 2px 12px rgba(0,0,0,0.3);
  backdrop-filter: blur(5px) saturate(120%);
  -webkit-backdrop-filter: blur(5px) saturate(120%);
}
/* Reveal — 2s dwell: photochromatic invert lens (50% smaller) */
.cursor--reveal {
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.88);
  border-color: transparent;
  box-shadow: none;
  mix-blend-mode: difference;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ====================================================================
   HERO
   ==================================================================== */
.hero { position: relative; width: 100%; height: 100vh; overflow: hidden; background: #000; touch-action: pan-y; }
.hero__slides {
  position: absolute;
  top: -7%; left: 0; right: 0; bottom: -7%;
  will-change: transform;
}
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.5s ease; }
.hero__slide.active { opacity: 1; }
/* media-agnostic: img / video / gif all fill the slide identically */
.hero__slide img,
.hero__slide video { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero__bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 34px var(--side);
}
.hero__label { opacity: 0.9; transition: opacity 0.2s; }
.hero__label:hover { opacity: 1; }
.hero__project-name { display: block; font-size: 16px; font-weight: 400; color: #fff; letter-spacing: -0.01em; transition: color 0.3s ease; }
.hero__arrow {
  background: none; border: none; cursor: pointer; padding: 6px 0;
  display: inline-flex; align-items: center; color: #fff;
  transition: transform 0.25s ease, opacity 0.2s ease; opacity: 0.9;
}
.hero__arrow:hover { transform: translateX(6px); opacity: 1; }
.hero__arrow svg { width: 46px; height: 16px; display: block; }
.hero__arrow svg line, .hero__arrow svg polyline {
  fill: none; stroke: #fff; stroke-width: 1.5; transition: stroke 0.3s ease;
}
/* Adaptive hero label colour: dark text on light covers */
.hero__bar--on-light .hero__project-name { color: #0f0f0f; }
.hero__bar--on-light .hero__arrow { color: #0f0f0f; }
.hero__bar--on-light .hero__arrow svg line,
.hero__bar--on-light .hero__arrow svg polyline { stroke: #0f0f0f; }

/* ====================================================================
   SELECTED WORKS HEADER
   ==================================================================== */
.works-header { padding: 140px var(--side) 56px; }
.works-header__label { font-size: 14px; font-weight: 400; color: var(--text); }

/* ====================================================================
   GRID — dark cards
   ==================================================================== */
.grid { padding: 0 var(--side); display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid__item--wide { grid-column: span 2; }

.card { display: block; }
.card__image { overflow: hidden; background: #1a1a1a; }
/* media-agnostic card media: swap <img> ⇄ <video> ⇄ gif with no layout change */
.card__image img,
.card__image video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s cubic-bezier(0.25,0.1,0.25,1);
  will-change: transform;
}
.card:hover .card__image img,
.card:hover .card__image video { transform: scale(1.40) !important; }

.card--16-9 .card__image { aspect-ratio: 16 / 9; }
.card--sq   .card__image { aspect-ratio: 1 / 1; }

/* Square cards fill their column — keeps left & right gutters symmetric */

.card__meta { padding: 24px 0 80px; }
.card__name { font-size: 15px; font-weight: 400; color: var(--text); letter-spacing: -0.01em; display: block; margin-bottom: 3px; }
.card__desc { font-size: 14px; font-weight: 400; color: var(--muted); display: block; margin-bottom: 10px; }
.card__tags { display: none; }   /* Offform-clean: no chip tags on cards */
.card__tag { font-size: 12px; font-weight: 400; color: var(--tag-text); background: var(--tag-bg); border-radius: 5px; padding: 3px 9px; }

/* ====================================================================
   STUDIO INTRO
   ==================================================================== */
.studio-intro { padding: 180px var(--side) 160px; }
.studio-intro__text {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 400; line-height: 1.18;
  letter-spacing: -0.03em; color: var(--text);
}

/* ====================================================================
   VIEW ALL
   ==================================================================== */
.view-all { padding: 40px var(--side) 40px; }
.view-all a { font-size: 14px; font-weight: 400; color: var(--text); display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.2s; }
.view-all a:hover { opacity: 0.4; }
.view-all .arr { transition: transform 0.2s; }
.view-all a:hover .arr { transform: translateX(4px); }

/* ====================================================================
   DARK SECTIONS — About / Approach / Services
   ==================================================================== */
.dark-sections {
  margin-top: 0;
  scroll-margin-top: 80px;
  padding: 20px var(--side) 40px;
  background: #0A0A0A;
  border-top: none;
}
.dark-sections .dark-row { border-bottom-color: rgba(255,255,255,0.12); }
.dark-sections .dark-row:last-child { border-bottom: none; }
.dark-sections .dark-row__label { color: rgba(255,255,255,0.5); }
.dark-sections .dark-row__headline,
.dark-sections .service__name { color: #F2F2F2; }
.dark-sections .dark-row__body,
.dark-sections .service__list { color: rgba(255,255,255,0.5); }
.dark-sections .service + .service { border-top-color: rgba(255,255,255,0.14); }
.dark-sections .service__list .dot { color: rgba(255,255,255,0.45); }
.dark-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  padding: 130px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.dark-row__label { font-size: 15px; font-weight: 400; color: var(--text); letter-spacing: -0.01em; padding-top: 4px; }

/* Approach row: large text treatment matching screenshot */
.dark-row--approach .dark-row__content { }

.dark-row__headline {
  font-size: clamp(19px, 2.56vw, 35px);
  font-weight: 400; line-height: 1.28;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 32px;
}
.dark-row__body {
  font-size: clamp(19px, 2.56vw, 35px);
  font-weight: 300; line-height: 1.28;
  letter-spacing: -0.025em;
  color: var(--muted);   /* ~38% opacity white — matches screenshot */
}
.dark-row__body p + p { margin-top: 24px; }

/* About + Services use the SAME large format as Our Approach (no overrides) */

/* Services — grouped, big-dot separated lists with dividers (Offform) */
.services-grid { display: flex; flex-direction: column; }
.service { padding: 36px 0; }
.service:first-child { padding-top: 4px; }
.service:last-child { padding-bottom: 0; }
.service + .service { border-top: 1px solid var(--border); }
.service__name {
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 500; line-height: 1.2; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 18px;
}
.service__list {
  font-size: clamp(18px, 1.8vw, 26px);
  font-weight: 300; line-height: 1.45; letter-spacing: -0.01em;
  color: var(--muted);
}
.service__list .dot {
  display: inline-block; font-size: 1em; line-height: 0; vertical-align: middle;
  color: var(--muted); margin: 0 0.4em; position: relative; top: -0.04em;
}

/* ====================================================================
   FOOTER — dark, 4-col + massive wordmark
   ==================================================================== */
.footer { padding: 58px var(--side) 0; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.footer__grid { display: grid; grid-template-columns: 160px 200px 1fr 360px; gap: 24px; padding-bottom: 48px; }
.footer__links { display: flex; flex-direction: column; gap: 8px; list-style: none; }
.footer__links a { font-size: 16px; font-weight: 400; color: var(--text); transition: opacity 0.2s; }
.footer__links a:hover { opacity: 0.4; }
.footer__cta-text { font-size: 16px; font-weight: 400; line-height: 1.5; letter-spacing: -0.01em; color: var(--text); margin-bottom: 6px; }
.footer__cta-text em { font-style: italic; color: var(--muted); }
.footer__cta-email { font-size: 16px; font-weight: 400; color: var(--text); text-decoration: underline; text-underline-offset: 3px; transition: opacity 0.2s; }
.footer__cta-email:hover { opacity: 0.4; }

.footer__wordmark {
  /* sized so "RANDOM PROJEKT" fits one line within the page gutters */
  font-size: clamp(34px, 9.4vw, 150px);
  font-weight: 400; letter-spacing: -0.04em; line-height: 0.9;
  color: var(--text); display: block; padding: 0 0 8px;
  white-space: nowrap;
}
.footer__bottom { border-top: 1px solid var(--border); padding: 20px 0; display: flex; justify-content: flex-end; }
.footer__copy { font-size: 13px; font-weight: 400; color: var(--muted); }

/* ====================================================================
   WORK PAGE
   ==================================================================== */
.page-hero { padding: 144px var(--side) 48px; }
.page-hero__eyebrow { font-size: 13px; font-weight: 400; color: var(--muted); display: block; margin-bottom: 12px; }
.page-hero h1 { font-size: clamp(40px, 5vw, 64px); font-weight: 400; letter-spacing: -0.03em; line-height: 1.0; color: var(--text); }
/* Offform work index: uniform 2-column grid, landscape thumbs, caption below */
.work-grid { padding: 0 var(--side) 96px; display: grid; grid-template-columns: 1fr 1fr; gap: 56px 24px; }
.work-grid__break { display: none; }
.work-grid .grid__item--wide { grid-column: span 1; }
.work-grid .card__image { aspect-ratio: 4 / 3; }
.work-grid .card__meta { padding: 16px 0 0; }
.work-grid .card__name { font-size: 16px; font-weight: 500; }
.work-grid .card__desc { font-size: 14px; color: var(--muted); }

/* ====================================================================
   CASE STUDY
   ==================================================================== */
/* Offform case study: title + tagline, two-col about/meta, full-bleed media */
.cs-header { padding: 140px var(--side) 0; }
.cs-header h1 { font-size: clamp(40px, 5.2vw, 68px); font-weight: 400; letter-spacing: -0.03em; line-height: 1.0; margin-bottom: 4px; color: var(--text); }
.cs-tagline { font-size: clamp(34px, 5.2vw, 68px); font-weight: 400; letter-spacing: -0.03em; line-height: 1.02; color: var(--muted); }
.cs-header__eyebrow, .cs-header__desc, .cs-header__tags { display: none; }

.cs-about { padding: 56px var(--side) 64px; }
.cs-about__label { display: block; font-size: 14px; color: var(--text); margin-bottom: 44px; }
/* collapsible toggle */
.cs-about__toggle {
  display: inline-flex; align-items: center; gap: 16px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; color: var(--text); margin-bottom: 0;
}
.cs-about__plus { position: relative; width: 16px; height: 16px; flex-shrink: 0; }
.cs-about__plus::before, .cs-about__plus::after {
  content: ""; position: absolute; background: var(--text);
}
.cs-about__plus::before { left: 0; top: 50%; width: 100%; height: 1.5px; transform: translateY(-50%); }
.cs-about__plus::after  { top: 0; left: 50%; width: 1.5px; height: 100%; transform: translateX(-50%); transition: transform 0.3s ease; }
.cs-about.open .cs-about__plus::after { transform: translateX(-50%) scaleY(0); }
/* collapsed by default */
.cs-about--collapsible .cs-about__grid { display: none; }
.cs-about--collapsible.open .cs-about__grid { display: grid; margin-top: 40px; }
.cs-about__grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 64px; align-items: start; }
.cs-about__h { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.cs-credits { font-size: 15px; color: var(--muted); line-height: 1.6; margin-bottom: 36px; }
.cs-about__body p { font-size: 16px; color: var(--muted); line-height: 1.7; margin-bottom: 18px; max-width: 580px; }
.cs-about__meta { display: flex; flex-direction: column; gap: 26px; }
.cs-meta-block h4 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.cs-meta-block p { font-size: 15px; color: var(--muted); line-height: 1.55; }

.cs-hero { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #EEEEEE; }
.cs-hero img,
.cs-hero video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* clean meta row — no boxes, just an inline list between hairlines */
.cs-meta-strip { display: flex; flex-wrap: wrap; gap: 28px 64px; padding: 30px var(--side); border-bottom: 1px solid var(--border); margin-bottom: 0; }
.cs-meta-item { padding: 0; border: none; }
.cs-meta__label { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.cs-meta__value { font-size: 15px; font-weight: 400; color: var(--text); line-height: 1.5; }

/* full-bleed media stacked with tight uniform spacing */
.cs-sequence { padding: 0; margin-bottom: 90px; }
.cs-block { margin: 0 0 8px; }
/* nudge the second full-width image lower in the sequence */
.cs-sequence .cs-block--full + .cs-block--full { margin-top: 48px; }

.cs-block--quote { max-width: 1000px; padding: 64px var(--side); margin: 0 auto; }
.cs-block--quote p {
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 400; line-height: 1.2; letter-spacing: -0.03em; color: var(--text);
}

.cs-block--prose { max-width: 720px; padding: 64px var(--side); margin: 0 auto; }
.cs-block--prose p { font-size: clamp(17px, 1.5vw, 20px); font-weight: 300; line-height: 1.7; color: var(--text); margin-bottom: 18px; }

/* Media figures — img / video / gif interchangeable */
.cs-figure { margin: 0; }
.cs-figure img, .cs-figure video { width: 100%; display: block; object-fit: cover; }
/* hide iOS/Safari native inline play-button overlay + any default controls */
.cs-figure video::-webkit-media-controls-start-playback-button,
.cs-figure video::-webkit-media-controls-play-button,
.cs-figure video::-webkit-media-controls-panel,
.cs-figure video::-webkit-media-controls { display: none !important; -webkit-appearance: none; }
.cs-block--full .cs-figure img, .cs-block--full .cs-figure video,
.cs-block--inset .cs-figure img, .cs-block--inset .cs-figure video { aspect-ratio: 16/9; }
.cs-block--pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cs-block--pair .cs-figure img, .cs-block--pair .cs-figure video { aspect-ratio: 1/1; }

.cs-caption { display: none; }   /* Offform-clean: no captions under images */

.prevnext { border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; }
.prevnext__item { padding: 43px var(--side); display: flex; flex-direction: column; gap: 6px; transition: background 0.2s; }
.prevnext__item:hover { background: rgba(255,255,255,0.03); }
.prevnext__item--next { text-align: right; border-left: 1px solid var(--border); }
.prevnext__label { font-size: 12px; font-weight: 400; color: var(--muted); }
.prevnext__title { font-size: 15px; font-weight: 400; color: var(--text); display: flex; align-items: center; gap: 6px; transition: gap 0.2s; }
.prevnext__item--next .prevnext__title { justify-content: flex-end; }
.prevnext__item:hover .prevnext__title { gap: 10px; }

/* ====================================================================
   ABOUT PAGE
   ==================================================================== */
.about-sections { padding: 0 var(--side) 96px; }
.about-row { padding: 58px 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 200px 1fr; gap: 48px; }
.about-row__label { font-size: 13px; font-weight: 400; color: var(--muted); padding-top: 3px; }
.about-bio p { font-size: 16px; font-weight: 300; line-height: 1.8; color: var(--muted); margin-bottom: 18px; max-width: 600px; }
.exp-list { list-style: none; }
.exp-list li { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.exp-list .yr { color: var(--muted); }
.exp-list .co { font-weight: 500; color: var(--text); }
.exp-list .ro { color: var(--muted); font-size: 13px; margin-top: 2px; }
.philosophy { font-size: 18px; font-weight: 300; line-height: 1.7; color: var(--muted); max-width: 540px; font-style: italic; }

/* ====================================================================
   CONTACT PAGE
   ==================================================================== */
.contact-body { padding: 48px var(--side) 96px; border-top: 1px solid var(--border); }
.contact-email { font-size: clamp(24px, 3vw, 40px); font-weight: 400; letter-spacing: -0.025em; display: inline-block; margin-bottom: 43px; color: var(--text); transition: opacity 0.2s; }
.contact-email:hover { opacity: 0.4; }
.contact-links { display: flex; flex-direction: column; gap: 14px; margin-bottom: 48px; }
.contact-links a { font-size: 16px; font-weight: 300; color: var(--muted); transition: opacity 0.2s; }
.contact-links a:hover { opacity: 0.6; }
.contact-avail { font-size: 13px; color: var(--muted); }
.about-contact .contact-email { margin-bottom: 22px; }
.about-contact .contact-links { margin-bottom: 22px; }

/* ====================================================================
   RESUME PAGE
   ==================================================================== */
.resume-tagline { font-size: clamp(16px, 1.6vw, 20px); font-weight: 300; color: var(--muted); margin-top: 16px; }
.resume-download { display: inline-block; margin-top: 18px; font-size: 14px; font-weight: 500; color: var(--text); text-decoration: underline; text-underline-offset: 4px; transition: opacity 0.2s; }
.resume-download:hover { opacity: 0.5; }
.resume-exp { display: flex; flex-direction: column; }
.resume-job { padding: 0 0 32px; }
.resume-job + .resume-job { border-top: 1px solid var(--border); padding-top: 32px; }
.resume-job__head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px; margin-bottom: 16px; }
.resume-job__role { font-size: 17px; font-weight: 600; color: var(--text); }
.resume-job__co { font-size: 14px; color: var(--muted); margin-top: 2px; }
.resume-job__yr { font-size: 13px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.resume-job ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.resume-job li { font-size: 15px; line-height: 1.55; color: var(--muted); padding-left: 20px; position: relative; }
.resume-job li::before { content: "\2014"; position: absolute; left: 0; color: var(--muted); }
.about-bio strong { color: var(--text); font-weight: 600; }
.resume-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.resume-list li { font-size: 16px; line-height: 1.6; color: var(--muted); padding-left: 20px; position: relative; }
.resume-list li::before { content: "\2014"; position: absolute; left: 0; color: var(--muted); }
.resume-list strong { color: var(--text); font-weight: 600; }

/* ====================================================================
   RESPONSIVE
   ==================================================================== */
@media (max-width: 1023px) {
  :root { --side: 52px; }   /* logo + gutter scale together */
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .dark-row { grid-template-columns: 120px 1fr; }
  .about-row { grid-template-columns: 1fr; gap: 20px; }
  .cs-meta-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  :root { --side: 40px; --gap: 12px; }
  .nav__links { display: none; }
  .nav__hamburger { display: flex; padding-right: 18px; }
  .hero__bar { padding-left: 20px; padding-right: 20px; }
  .grid, .work-grid { grid-template-columns: 1fr; }
  .grid__item--wide, .work-grid .grid__item--wide { grid-column: span 1; }

  /* Offform-style work list: stacked images w/ small gutter, large captions */
  .grid, .work-grid { padding-left: 20px; padding-right: 20px; gap: 56px; }
  .work-grid { padding-bottom: 72px; }
  .card--sq .card__image, .card--sq .card__meta { max-width: 100%; }
  .card__image { width: 100%; }
  .card__meta { padding: 16px 0 0; }
  .card__name { font-size: 21px; font-weight: 500; color: #0A0A0A; margin-bottom: 4px; }
  .card__desc { font-size: 18px; line-height: 1.32; color: var(--muted); }
  .card__tags { display: none; }   /* Offform-clean: no chip tags on mobile */
  /* page hero on the work page keeps its gutter */
  .dark-row { grid-template-columns: 1fr; gap: 16px; }

  /* Prev / Next stay side by side on mobile */
  .prevnext { grid-template-columns: 1fr 1fr; }
  .prevnext__item { padding: 24px 16px; gap: 4px; }
  .prevnext__label { font-size: 11px; }
  .prevnext__title { font-size: 13px; }

  /* Case study — stacked about + full-bleed media */
  .cs-header { padding: 110px var(--side) 0; }
  .cs-about { padding: 36px var(--side) 40px; }
  .cs-about__grid { grid-template-columns: 1fr; gap: 36px; }
  .cs-about__label { margin-bottom: 28px; }
  .cs-block { margin-bottom: 8px; }
  .cs-block--pair { grid-template-columns: 1fr; gap: 8px; }
  .cs-sequence { margin-bottom: 56px; }

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__wordmark { font-size: clamp(26px, 9.2vw, 96px); letter-spacing: -0.045em; }

  .hero__slides { will-change: auto; top: 0; bottom: 0; }

  /* Flashback: show the WHOLE portrait image fitted to the screen (no zoom/crop) */
  .flashback { display: flex; align-items: center; justify-content: center; overflow: hidden; background: #07060f; }
  .flashback .fb-stage {
    position: relative; margin: 0; max-width: none;
    width: 100vw;                                  /* fit to width; full image visible */
    max-height: 100dvh;
  }
  .flashback .fb-bg { width: 100%; height: auto; display: block; }
  /* no zoom/shake on mobile so the image stays put */
  .flashback .fb-bg, .flashback .fb-stage { animation: none; }
  /* larger title, nudged lower */
  .fb-title { font-size: clamp(46px, 14vw, 80px); top: 9%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ====================================================================
   THEME SYSTEM — Dark (default) / Light / RGB
   ==================================================================== */

/* ---- LIGHT ---- */
html[data-theme="light"] {
  --bg:       #FFFFFF;
  --text:     #0A0A0A;
  --muted:    #8A8A8A;
  --border:   #E2E2E2;
  --card-bg:  #F0F0F0;
  --tag-bg:   #ECECEC;
  --tag-text: #777777;
}
html[data-theme="light"] .card__image,
html[data-theme="light"] .cs-hero { background: #EEEEEE; }
html[data-theme="light"] .hero { background: #DDDDDD; }
html[data-theme="light"] .prevnext__item:hover { background: #F6F6F6; }



/* ====================================================================
   THEME SWITCH — thin inline pill, sits in the nav beside the links
   ==================================================================== */
.nav__links { align-items: center; }
.theme-switch {
  display: inline-flex; gap: 1px; padding: 1px;
  background: rgba(128,128,128,0.16);
  border: 1px solid rgba(128,128,128,0.28);
  border-radius: 999px;
  vertical-align: middle;
}
.theme-switch button {
  border: none; background: none; cursor: pointer;
  font-family: 'Switzer', sans-serif; font-size: 9px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); opacity: 0.5; line-height: 1;
  padding: 3px 8px; border-radius: 999px;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.theme-switch button:hover { opacity: 0.85; }
.theme-switch button.active { opacity: 1; background: rgba(128,128,128,0.32); }
/* keep label colour readable over the hero image on the home nav */
.nav--over .theme-switch button { color: #fff; mix-blend-mode: difference; }

/* ====================================================================
   THEME TOGGLE SWITCH + slow theme crossfade
   ==================================================================== */
.theme-toggle {
  position: relative; display: inline-block; vertical-align: middle;
  width: 32px; height: 18px; padding: 0; border: none; cursor: pointer;
  border-radius: 999px; background: rgba(140,140,140,0.45);
  box-shadow: inset 0 0 0 1px rgba(140,140,140,0.6);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.theme-toggle__knob {
  position: absolute; top: 2.5px; left: 2.5px; width: 13px; height: 13px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
  transition: transform 0.4s cubic-bezier(0.34,1.4,0.5,1), background 0.4s ease;
}
.theme-toggle.on {
  background: rgba(255,255,255,0.85);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.75),
              0 0 8px rgba(255,255,255,0.65), 0 0 16px rgba(255,255,255,0.35);
}
.theme-toggle.on .theme-toggle__knob { transform: translateX(14px); background: #fff; }

/* Slow "bulb warming on" crossfade while toggling */
html.theming, html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color .55s ease, color .55s ease, border-color .55s ease,
              fill .55s ease, box-shadow .55s ease !important;
}

/* ====================================================================
   90s KID MEMORY WALL — smiley drops retro objects for 10s
   ==================================================================== */
.funbit-btn {
  display: inline-flex; align-items: center; vertical-align: middle;
  cursor: pointer; line-height: 0;
  background: none; border: none; box-shadow: none; padding: 0;
  transition: transform .2s ease;
}
.funbit-btn:hover { transform: scale(1.15); }
.funbit-btn svg { display: block; width: 18px; height: 18px; }

/* ====================================================================
   90s FLASHBACK — full-screen retro desk, flickering lamp, animated title
   (smiley easter egg, auto-closes after 10s)
   ==================================================================== */
.flashback {
  position: fixed; inset: 0; z-index: 9500; overflow: hidden;
  background: #05060f; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  animation: fbIn .5s ease both, fbOut .6s ease 5.4s forwards;
}
@keyframes fbIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fbOut { to { opacity: 0; } }

.fb-stage { position: relative; width: 100%; max-width: none; margin: 0; }
.fb-bg    { width: 100%; height: auto; display: block; transform-origin: 58% 45%; animation: lofiZoom 13s ease-out both; }
@keyframes lofiZoom { from { transform: scale(1.02); } to { transform: scale(1.09); } }

.fb-close {
  position: fixed; top: 16px; right: 16px; z-index: 9600;
  width: 42px; height: 42px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer; backdrop-filter: blur(4px); transition: background .2s, transform .2s;
}
.fb-close:hover { background: rgba(0,0,0,.8); transform: scale(1.08); }
.fb-mute {
  position: fixed; top: 16px; left: 16px; z-index: 9600;
  width: 42px; height: 42px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; line-height: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(4px); transition: background .2s, transform .2s;
}
.fb-mute:hover { background: rgba(0,0,0,.8); transform: scale(1.08); }
.fb-mute svg { display: block; }

/* flickering desk-lamp light */
.fb-lamp {
  position: absolute; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle,
    rgba(255,240,190,0.55) 0%, rgba(255,214,130,0.30) 34%, rgba(255,190,90,0) 70%);
  animation: fbLamp 2.8s infinite;
}
@keyframes fbLamp {
  0%,100% { opacity: .9; } 6% { opacity: .5; } 8% { opacity: .95; }
  18% { opacity: .72; } 20% { opacity: .98; } 38% { opacity: .55; }
  40% { opacity: .9; } 63% { opacity: .42; } 65% { opacity: .92; }
  82% { opacity: .7; } 84% { opacity: .96; }
}

/* animated 90s / VHS FLASHBACK title */
.fb-title {
  position: absolute; top: 5%; left: 50%; z-index: 10; white-space: nowrap;
  font-family: 'Bungee', 'Archivo Black', sans-serif; font-weight: 400;
  font-size: clamp(30px, 6vw, 84px); letter-spacing: 0.015em; line-height: 1;
  transform: translateX(-50%);
  /* chrome-sunset gradient + a sweeping shine, both clipped to the text */
  background-image:
    linear-gradient(108deg, rgba(255,255,255,0) 42%, rgba(255,255,255,.95) 50%, rgba(255,255,255,0) 58%),
    linear-gradient(180deg, #fff7b0 0%, #ffd23a 32%, #ff5db1 64%, #7a3cff 100%);
  background-size: 220% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: -130% 0, 0 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  -webkit-text-stroke: 1.5px rgba(60,10,50,.55);
  /* stacked 3D extrude + neon bloom */
  text-shadow:
    0 2px 0 #c01a6f, 0 4px 0 #9c0f57, 0 6px 0 #6e0a45,
    0 8px 16px rgba(0,0,0,.55);
  filter: drop-shadow(0 0 16px rgba(255,90,190,.6));
  animation:
    fbTitleIn 0.9s cubic-bezier(.2,1.5,.35,1) both,
    fbShine 3s linear 0.9s infinite,
    fbFloat 3.4s ease-in-out 0.9s infinite,
    fbNeon 2.2s steps(1,end) 0.9s infinite;
}
/* RGB-split glitch layers */
.fb-title::before, .fb-title::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  background: none; -webkit-text-fill-color: currentColor; -webkit-text-stroke: 0;
  text-shadow: none; filter: none; z-index: -1; mix-blend-mode: screen; opacity: .85;
}
.fb-title::before { color: #00e6ff; animation: fbGlitchA 3.2s steps(1,end) 0.9s infinite; }
.fb-title::after  { color: #ff2ec4; animation: fbGlitchB 3.2s steps(1,end) 0.9s infinite; }

@keyframes fbTitleIn {
  0%   { opacity: 0; transform: translateX(-50%) scale(.45) rotate(-7deg); }
  55%  { opacity: 1; transform: translateX(-50%) scale(1.14) rotate(2.5deg); }
  75%  { transform: translateX(-50%) scale(.97) rotate(-1deg); }
  100% { opacity: 1; transform: translateX(-50%) scale(1) rotate(0); }
}
@keyframes fbShine {
  0%   { background-position: -130% 0, 0 0; }
  55%, 100% { background-position: 240% 0, 0 0; }
}
@keyframes fbFloat {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%     { transform: translateX(-50%) translateY(-7px); }
}
@keyframes fbNeon {
  0%,88%,94%,100% { filter: drop-shadow(0 0 16px rgba(255,90,190,.6)); }
  90% { filter: drop-shadow(0 0 4px rgba(255,90,190,.25)); }
  92% { filter: drop-shadow(0 0 26px rgba(255,90,190,1)); }
}
@keyframes fbGlitchA {
  0%,90%,100% { clip-path: inset(0 0 0 0); transform: translate(0,0); opacity:0; }
  91% { clip-path: inset(12% 0 60% 0); transform: translate(-5px,-2px); opacity:.9; }
  93% { clip-path: inset(55% 0 18% 0); transform: translate(5px,1px); opacity:.9; }
  95% { clip-path: inset(30% 0 40% 0); transform: translate(-3px,2px); opacity:.9; }
  96% { clip-path: inset(0 0 0 0); transform: translate(0,0); opacity:0; }
}
@keyframes fbGlitchB {
  0%,90%,100% { clip-path: inset(0 0 0 0); transform: translate(0,0); opacity:0; }
  91% { clip-path: inset(60% 0 12% 0); transform: translate(5px,2px); opacity:.9; }
  93% { clip-path: inset(20% 0 55% 0); transform: translate(-5px,-1px); opacity:.9; }
  95% { clip-path: inset(45% 0 30% 0); transform: translate(3px,-2px); opacity:.9; }
  96% { clip-path: inset(0 0 0 0); transform: translate(0,0); opacity:0; }
}

/* lofi atmosphere: film grain, vignette, CRT screen flicker */
.fb-lamp { z-index: 4; }
.fb-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at 56% 44%, rgba(0,0,0,0) 42%, rgba(0,0,0,.58) 100%);
  animation: lofiBreath 6s ease-in-out infinite;
}
@keyframes lofiBreath { 0%,100% { opacity: .82; } 50% { opacity: 1; } }
.fb-grain {
  position: absolute; inset: -10px; pointer-events: none; z-index: 6;
  opacity: .13; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.9'%20numOctaves='2'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'%20opacity='0.55'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: lofiGrain .5s steps(3,end) infinite;
}
@keyframes lofiGrain {
  0% { transform: translate(0,0); } 33% { transform: translate(-7px,5px); }
  66% { transform: translate(6px,-6px); } 100% { transform: translate(0,0); }
}
.fb-crt {
  position: absolute; z-index: 7; pointer-events: none; overflow: hidden; border-radius: 8px;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(20,0,30,.22) 2px 3px);
  mix-blend-mode: multiply; box-shadow: inset 0 0 24px rgba(120,40,200,.25);
  animation: lofiCrt 3.2s steps(1,end) infinite;
}
@keyframes lofiCrt { 0%,92%,97%,100% { opacity: .55; } 94% { opacity: .18; } 95% { opacity: .8; } }

/* dark-blue header space + full-frame glitch */
.fb-topfade {
  position: absolute; left: 0; right: 0; top: 0; height: 40%; z-index: 8; pointer-events: none;
  background: linear-gradient(180deg, #050b22 0%, rgba(6,14,40,.94) 28%, rgba(6,14,40,.5) 68%, rgba(6,14,40,0) 100%);
}
.fb-stage { animation: fbShake 5.5s steps(1,end) infinite; }
@keyframes fbShake {
  0%,40%,44%,71%,75%,100% { transform: translate(0,0); }
  41% { transform: translate(-4px,1px); } 43% { transform: translate(4px,-1px); }
  72% { transform: translate(3px,0); }    74% { transform: translate(-3px,1px); }
}
.fb-glitch {
  position: absolute; inset: 0; z-index: 9; pointer-events: none;
  background-size: 100% 100%; background-position: center; opacity: 0;
  animation: fbGlitchImg 5.5s steps(1,end) infinite;
}
@keyframes fbGlitchImg {
  0%,40%,44%,71%,75%,100% { opacity: 0; }
  41% { opacity: 1; clip-path: inset(16% 0 66% 0); transform: translate(-12px,0); filter: hue-rotate(-30deg) saturate(1.7); }
  42% { opacity: 1; clip-path: inset(58% 0 16% 0); transform: translate(13px,0);  filter: hue-rotate(45deg) saturate(1.7); }
  43% { opacity: 1; clip-path: inset(38% 0 40% 0); transform: translate(-7px,0);  filter: hue-rotate(15deg); }
  72% { opacity: 1; clip-path: inset(8% 0 80% 0);  transform: translate(10px,0);  filter: hue-rotate(60deg) saturate(1.6); }
  73% { opacity: 1; clip-path: inset(70% 0 8% 0);  transform: translate(-9px,0);  filter: hue-rotate(-20deg); }
  74% { opacity: 1; clip-path: inset(45% 0 35% 0); transform: translate(5px,0); }
}

@media (prefers-reduced-motion: reduce) {
  .fb-lamp, .fb-title, .fb-title::before, .fb-title::after, .fb-bg, .fb-grain, .fb-vignette, .fb-crt, .fb-stage, .fb-glitch { animation: none; }
  .fb-title::before, .fb-title::after { opacity: 0; }
}

/* ====================================================================
   IMAGE PROTECTION (deterrent — disables drag/save/long-press on media)
   ==================================================================== */
img, video {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;   /* iOS long-press save */
  pointer-events: auto;
}

/* Scroll parallax on full-width case-study media (desktop, fine pointer) */
@media (min-width: 768px) and (pointer: fine) {
  .cs-block--full .cs-figure { overflow: hidden; }
  .cs-block--full .cs-figure img,
  .cs-block--full .cs-figure video { transform: scale(1.04); will-change: transform; }
}

/* opt-out of parallax zoom for specific images */
@media (min-width: 768px) and (pointer: fine) {
  .cs-block--full .cs-figure img[data-noparallax] { transform: none !important; }
}
