/* ============================================================
   JING PORTFOLIO — Shared Styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

p { font-weight: 400 !important; }

:root {
  /* Dynamic side padding — derived from Figma breakpoints:
     72px @ 1440px → 120px @ 1920px (linear: 10vw - 72px) */
  --pad-h:      max(72px, calc(10vw - 72px));
  /* Work cards: 32px @ 1440px → 120px @ 1920px, max content 1680px */
  --pad-h-work: max(32px, calc((100vw - 1680px) / 2));

  --bg:           #0f0e0c;
  --black:        #000000;
  --text:         #f0ede8;
  --text-muted:   #9b958d;
  --text-footer:  #5a5450;
  --amber:        #e09a70;
  --work-bg:      #c0d2da;
  --marquee-bg:   #202020;
  --border:       rgba(240, 237, 232, 0.15);
  --border-work:  #f0ede8;
}

/* Light mode overrides */
body.light {
  --bg:          #f0ede8;
  --black:       #ffffff;
  --text:        #0f0e0c;
  --text-muted:  #5a5450;
  --text-footer: #9b958d;
  --marquee-bg:  #e5e0d8;
  --border:      rgba(15, 14, 12, 0.15);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Instrument Sans', sans-serif;
  overflow-x: hidden;
  transition: background 0.2s, color 0.2s;
}


/* ── NAV ─────────────────────────────────────────────────── */

nav {
  position: absolute;
  top: 26px;
  right: var(--pad-h);
  z-index: 10;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1.2px;
  color: #fffcf8;
  text-decoration: none;
  text-transform: uppercase;
  transition: opacity 0.2s;
}

.nav-links a:hover { opacity: 0.7; }


/* ── HERO ────────────────────────────────────────────────── */

.hero {
  background: var(--black);
  position: relative;
  padding: 120px var(--pad-h) 108px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: luminosity;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 72px;
}

.hero-headline {
  font-family: 'Doto', sans-serif;
  font-weight: 700;
  font-size: clamp(72px, 9.7vw, 140px);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.114;
  color: #fffcf8;
  flex-shrink: 0;
  width: clamp(400px, 52vw, 748px);
}

.hero-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 24px;
}

.hero-body {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(16px, 1.67vw, 24px);
  line-height: 30px;
  color: #fffcf8;
}

.available-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.available-dot {
  width: 12px;
  height: 12px;
  background: #2bf349;
  flex-shrink: 0;
}

.available-badge span {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: #ffffff;
}


/* ── MARQUEE ─────────────────────────────────────────────── */

.marquee-bar {
  background: var(--marquee-bg);
  padding: 18px 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  animation: marquee 22s linear infinite;
}

.marquee-track:hover { animation-play-state: paused; }

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-item {
  display: flex;
  align-items: center;
  gap: 48px;
  flex-shrink: 0;
}

.marquee-item span {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff1e0;
}

.marquee-dot {
  width: 4px;
  height: 4px;
  background: var(--amber);
  border-radius: 50%;
  flex-shrink: 0;
}


/* ── WORK ────────────────────────────────────────────────── */

/* height is set dynamically by JS (n × 100vh) */
.work-section {
  position: relative;
  background: var(--bg);
  padding: 24px var(--pad-h-work) 48px;
}

/* Sticky stage — inset from edges, sticks with the top gap */
.work-stage {
  position: sticky;
  top: 24px;
  height: 100vh;
  overflow: hidden;
}

/* Layer 0 — current card's colour, always full-screen */
.work-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Layer 1 — next card's colour, slides up from below via transform */
.work-bg-next {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform: translateY(100%); /* starts parked below the viewport */
}

/* Layer 2 — card content, floats above both colour layers */
#work-cards {
  position: relative;
  height: 100%;
  z-index: 2;
}

.work-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px;
  gap: 40px;
  text-decoration: none;
  cursor: pointer;
  /* opacity animated by GSAP — no CSS transition to keep scrub smooth */
}

.work-item:hover { opacity: 0.85; }

.work-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  flex-shrink: 0;
  width: 465px;
}

.work-top { display: flex; flex-direction: column; gap: 40px; }

.work-logo { height: 24px; width: auto; max-width: 166px; object-fit: contain; }

.work-text { display: flex; flex-direction: column; gap: 24px; }

.work-title {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.09;
  color: var(--black);
  width: 465px;
}

.work-desc {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(16px, 1.67vw, 24px);
  line-height: 30px;
  color: var(--black);
  width: 465px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 465px;
}

.pill {
  border: 0.5px solid #000;
  border-radius: 50px;
  padding: 6px 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 11px;
  color: #000;
  white-space: nowrap;
}

.work-image-wrap {
  width: 680px;
  height: 600px;
  background: #fbfbfb;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.work-image-wrap img {
  position: absolute;
  object-fit: cover;
}

.work-image-wrap img.img-inset {
  left: 69px;
  top: 68px;
  width: 527px;
  height: 464px;
}

.work-image-wrap img.img-fill {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  object-position: center;
}

.work-image-wrap img.img-wide {
  width: 706px;
  height: 600px;
  left: -99px;
  top: 0;
}

.work-image-wrap img.img-offset {
  width: 706px;
  left: -106px;
  top: 10px;
}

.work-item[data-index="0"] .work-image-wrap img {
  box-shadow: 3px 4px 27px rgba(162, 162, 162, 0.25);
}

/* Coming-soon card — fade the content but keep the background
   fully opaque so the colour-wipe stacking effect stays clean */
.work-item.coming-soon {
  cursor: default;
  pointer-events: none;
}

.work-item.coming-soon .work-info,
.work-item.coming-soon .work-image-wrap {
  opacity: 0.4;
}

.work-item.coming-soon .work-title::after {
  content: ' — Coming soon';
  font-size: 0.5em;
  letter-spacing: 0.1em;
  opacity: 0.6;
  vertical-align: middle;
}

.work-image-placeholder {
  width: 600px;
  height: 600px;
  background: rgba(0,0,0,0.1);
  border: 1px dashed rgba(0,0,0,0.3);
  border-radius: 4px;
  flex-shrink: 0;
}


/* ── BOTTOM SECTIONS (experience + footer) ───────────────── */

.bottom-sections {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

.bottom-sections::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/bg-texture.jpg') top left / 100% auto no-repeat;
  opacity: 0.4;
  mix-blend-mode: luminosity;
  pointer-events: none;
}


/* ── CONTACT / EXPERIENCE ─────────────────────────────────── */

.contact-section {
  background: transparent;
  padding: 64px var(--pad-h) 112px;
  display: flex;
  flex-direction: column;
  gap: 59px;
  position: relative;
}

.experience-heading {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 32px;
  color: var(--text);
  width: 480px;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 24px;
  border-bottom: 2px solid rgba(255,255,255,0.15);
}


.exp-cols {
  display: grid;
  grid-template-columns: 280px 180px 1fr;
  align-items: center;
  gap: 0 48px;
}

.exp-date,
.exp-company,
.exp-role {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: var(--text);
  white-space: nowrap;
}

.exp-icon {
  width: 16px;
  height: 16px;
  background: white;
  flex-shrink: 0;
}


/* ── FOOTER ──────────────────────────────────────────────── */

footer {
  background: transparent;
  padding: 24px var(--pad-h) 48px;
  position: relative;
  min-height: 336px;
}

/* "Available for work" — pinned to content right edge */
.footer-available {
  position: absolute;
  right: var(--pad-h);
  top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-available span {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: #ffffff;
  white-space: nowrap;
}

/* Big headline */
.footer-big {
  font-family: 'Doto', sans-serif;
  font-weight: 400;
  font-size: 128px;
  letter-spacing: -2.56px;
  text-transform: uppercase;
  color: #f0ede8;
  line-height: 132px;
}

/* "together" line — 9 monospace spaces at 128px Doto = 668px */
.footer-big-indent {
  display: block;
  text-indent: 668px;
}

/* Credit — sits between the two text lines */
.footer-credit {
  position: absolute;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  font-size: 10px;
  color: white;
  left: var(--pad-h);
  top: 143.5px;
  white-space: nowrap;
}

/* Links row — Figma: top:223 from content-top = 24+223=247 from footer-top */
.footer-links {
  position: absolute;
  top: 247px;
  left: var(--pad-h);
  display: flex;
  align-items: center;
  gap: 51px;
}

.footer-links span,
.footer-links a {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: white;
  white-space: nowrap;
  text-decoration: none;
}

.footer-links a {
  transition: opacity 0.2s ease;
}

.footer-links a:hover {
  opacity: 0.7;
}


/* ── CASE STUDY NAV ──────────────────────────────────────── */

.cs-page nav.cs-nav {
  position: sticky;
  top: 0;
  right: unset;
  background: var(--black);
  padding: 20px var(--pad-h);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 200;
}


/* ── CASE STUDY PAGE ─────────────────────────────────────── */

.cs-hero {
  background: var(--black);
  padding: 80px 80px 0;
}

.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 48px;
  transition: color 0.2s;
}

.cs-back:hover { color: var(--text); }

.cs-company-logo {
  display: block;
  height: 24px;
  width: auto;
  max-width: 166px;
  object-fit: contain;
  margin-bottom: 32px;
}

.cs-title {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(36px, 5vw, 80px);
  line-height: 1.05;
  color: var(--text);
  max-width: 900px;
  margin-bottom: 32px;
}

.cs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
}

.cs-pill {
  border: 0.5px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cs-meta {
  display: flex;
  gap: 48px;
  margin-bottom: 64px;
}

.cs-meta-item { display: flex; flex-direction: column; gap: 4px; }

.cs-meta-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cs-meta-value {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
}

.cs-cover-wrap {
  width: 100%;
  height: 560px;
  overflow: hidden;
  position: relative;
  background: #1a1a1a;
}

.cs-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* ── CASE STUDY SECTIONS ─────────────────────────────────── */

.cs-section {
  display: flex;
  gap: 80px;
  align-items: flex-start;
  padding: 72px 80px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg); /* solid bg needed for layered pinning */
  position: relative;
}

.cs-section:last-of-type { border-bottom: none; }

.cs-section-label {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 160px;
  padding-top: 8px;
  flex-shrink: 0;
}

.cs-section-content { flex: 1; min-width: 0; }

.cs-section-content h2 {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(24px, 2.5vw, 36px);
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 24px;
}

.cs-section-content p {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 28px;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 680px;
}

/* Stats */
.cs-stats {
  display: flex;
  gap: 48px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.cs-stat { display: flex; flex-direction: column; gap: 6px; }

.cs-stat-value {
  font-family: 'Doto', sans-serif;
  font-weight: 600;
  font-size: 56px;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.cs-stat-label {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 160px;
}

/* Image containers */
.cs-img-wrap {
  background: #fbfbfb;
  overflow: hidden;
  margin: 32px 0;
  border-radius: 2px;
}

.cs-img-wrap.full { width: 100%; height: 480px; }

.cs-img-wrap.half-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: 320px;
  background: transparent;
}

.cs-img-wrap.half-grid > div {
  background: #fbfbfb;
  border-radius: 2px;
  overflow: hidden;
}

.cs-img-wrap img, .cs-img-wrap.half-grid > div img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Callout */
.cs-callout {
  border-left: 2px solid var(--amber);
  padding: 20px 24px;
  margin: 32px 0;
}

.cs-callout p {
  font-size: 20px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  line-height: 1.5 !important;
  margin-bottom: 0 !important;
  max-width: none !important;
}

/* Responsive */
@media (max-width: 900px) {
  .cs-hero { padding: 48px 24px 0; }
  .cs-section { flex-direction: column; gap: 24px; padding: 48px 24px; }
  .cs-section-label { min-width: unset; }
  .cs-img-wrap.full { height: 280px; }
  .cs-img-wrap.half-grid { height: auto; grid-template-columns: 1fr; }
  .cs-stats { gap: 32px; }
  .cs-cover-wrap { height: 300px; }
}


/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 900px) {
  nav { position: absolute; top: 16px; right: 24px; }

  .hero { padding: 64px 24px 72px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 32px; }
  .hero-headline { width: 100%; font-size: clamp(56px, 15vw, 100px); }
  .hero-right { padding-bottom: 0; }

  /* ── Work section: no animation on mobile, stack cards ── */
  .work-section { height: auto !important; padding: 0 !important; }
  .work-stage   { position: static !important; height: auto !important; overflow: visible; }
  .work-bg, .work-bg-next { display: none; }
  #work-cards   { position: static !important; height: auto !important; }

  .work-item {
    position: relative !important;
    inset: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: var(--card-bg, #232323);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 32px 24px;
    gap: 16px;
  }
  .work-info { width: 100%; height: auto; flex-shrink: 0; gap: 24px; }
  .work-top { gap: 12px; }
  .work-logo { height: 16px; width: auto; align-self: flex-start; }
  .work-title { width: 100%; font-size: clamp(24px, 7vw, 36px); }
  .work-desc { width: 100%; font-size: 15px; line-height: 22px; }
  .pills { width: 100%; }
  .work-image-wrap {
    width: 100%;
    height: 240px;
    flex-shrink: 0;
  }
  .work-image-wrap img.img-inset { left: 5%; top: 5%; width: 90%; height: 90%; }
  .work-image-wrap img.img-wide { width: 100%; left: 0; height: 240px; }
  .work-image-wrap img.img-offset { width: 100%; left: 0; height: 240px; }
  .work-image-placeholder { width: 100%; height: 240px; }

  /* ── Experience table ── */
  .contact-section { padding: 48px 24px 64px; gap: 32px; }
  .experience-heading { width: 100%; font-size: 24px; }
  .exp-cols { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1; }
  .exp-date { font-size: 12px; white-space: normal; }
  .exp-company, .exp-role { font-size: 16px; white-space: normal; }
  .exp-role { font-size: 14px; }
  .exp-row { padding: 20px 0; }
  .exp-icon { width: 8px; height: 8px; }

  .bottom-sections::before { background-size: cover; background-position: top center; }
  footer { padding: 24px 24px 40px; min-height: unset; display: flex; flex-direction: column; }
  .footer-big { order: 10; margin-top: 24px; }
  .footer-credit { order: 11; margin-top: 12px; }
  .footer-available { position: static; margin-bottom: 16px; display: flex; }
  .footer-big { font-size: clamp(56px, 18.5vw, 96px); line-height: 1.05; letter-spacing: -0.02em; }
  .footer-big-indent { text-indent: 0; }
  .footer-credit { position: static; margin-top: 16px; }
  .footer-links { position: static; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 16px; }

  .cs-hero { padding: 48px 24px 40px; }
  .cs-body { padding: 48px 24px; }
  .cs-meta { flex-wrap: wrap; gap: 24px; }
}
