/* ---------------------------------- */
/* Tokens (from Figma)                */
/* ---------------------------------- */

:root {
  --surface-main: #191919;
  --surface-subtle: #242424;
  --border-subtle: #383838;
  --text-main: #ffffff;
  --text-subtle: #b4b4b4;
  --content-w: 1140px;
  --pad: clamp(20px, 4vw, 48px);
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-logo: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--surface-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Film-grain overlay — fixed, non-interactive noise over the whole viewport */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
}

.wrap {
  max-width: var(--content-w);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

@media (min-width: 1236px) {
  .wrap {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ---------------------------------- */
/* Navbar                             */
/* ---------------------------------- */

.navbar-zone {
  padding-top: 32px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
}

.navbar .logo {
  font-family: var(--font-logo);
  font-size: 24px;
  line-height: 32px;
  color: var(--text-main);
}

.btn {
  display: inline-block;
  background: var(--text-main);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.btn:hover {
  background: var(--text-subtle);
}

.btn--lg {
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.05em;
  padding: 12px 24px;
}

/* ---------------------------------- */
/* Hero                               */
/* ---------------------------------- */

.hero {
  padding-top: clamp(60px, 10vh, 108px);
  padding-bottom: 80px;
}

.headline {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(26px, 4.4vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-main);
}

.headline .line {
  display: block;
  margin-bottom: 0.5em;
}

.headline .line:last-child {
  margin-bottom: 0;
}

.headline .cursor {
  display: inline-block;
  width: 0.3em;
  height: 0.55em;
  background: var(--border-subtle);
  vertical-align: baseline;
  margin: 0 0.22em;
}

.hero .byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.hero .byline .sep {
  width: 1px;
  height: 14px;
  background: #d9d9d9;
}

/* ---------------------------------- */
/* Section headings                   */
/* ---------------------------------- */

.h2 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-subtle);
}

/* ---------------------------------- */
/* Work strip                         */
/* ---------------------------------- */

.work {
  padding: 40px 0;
}

.work .h2 {
  margin-bottom: 32px;
}

/* Pinned mode (desktop): the section is given extra height by JS, the
   inner .work-pin sticks to the viewport, and vertical scroll progress
   drives the strip's horizontal translation. */
.work--pinned {
  padding: 0;
}

.work--pinned .work-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* Auto cross-axis margins would shrink-center .wrap in the flex column */
.work--pinned .work-pin > .wrap {
  width: 100%;
}

.work--pinned .works {
  overflow: visible;
}

/* Trailing spacer so the last card stops short of the right edge
   (a flex item is counted in scrollWidth; trailing padding is not). */
.work--pinned .works::after {
  content: "";
  flex: 0 0 clamp(20px, 5.6vw, 108px);
}

.work--pinned .work-card {
  height: min(calc(100vh - 200px), 808px);
  width: auto;
}

.works {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-left: clamp(20px, 5.6vw, 108px);
  padding-right: clamp(20px, 5.6vw, 108px);
  scrollbar-width: none;
  will-change: transform;
}

.works::-webkit-scrollbar {
  display: none;
}

.work-card {
  position: relative;
  flex-shrink: 0;
  width: min(552px, 78vw);
  aspect-ratio: 552 / 808;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-subtle);
  outline: none;
}

.work-card .media {
  position: absolute;
  inset: 0;
}

.work-card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-card:hover .media img {
  transform: scale(1.03);
}

.tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-subtle);
  line-height: 1.2;
}

/* Hover info bar — project name, description, year (Variant2 in Figma) */
.work-card .info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border-subtle);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(101%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-card:hover .info,
.work-card:focus-visible .info {
  transform: translateY(0);
}

.work-card .info .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  color: var(--text-main);
}

.work-card .info .name {
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.work-card .info .year {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.work-card .info .desc {
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--text-subtle);
}

/* Touch devices have no hover — keep the info bar visible */
@media (hover: none) {
  .work-card .info {
    transform: none;
  }
}

/* Custom "View" cursor shown while hovering a work card */
.has-view-cursor .work-card {
  cursor: none;
}

.view-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  padding: 11px 22px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition: opacity 0.18s ease, transform 0.18s ease;
  will-change: left, top, transform;
}

.view-cursor.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ---------------------------------- */
/* Placeholder media                  */
/* ---------------------------------- */

.placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.placeholder span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #999;
}

.placeholder--dark {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.02) 18px 36px
    ),
    var(--surface-subtle);
}

.placeholder--dark span {
  color: var(--text-subtle);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
}

/* ---------------------------------- */
/* Career                             */
/* ---------------------------------- */

.career {
  padding: 80px 0 64px;
}

.career .h2 {
  margin-bottom: 48px;
}

.career-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.career-row:first-of-type {
  padding-top: 0;
}

.career-row .who {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.career-row .logo-box {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.career-row .logo-box img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.career-row .logo-box.logo--full img {
  width: 40px;
  height: 40px;
}

.career-row .logo-box.logo--sm img {
  width: 20px;
  height: 20px;
}

/* The Walmart asset is an uncropped sprite sheet — replicate the
   Figma crop that isolates the spark icon. */
.career-row .logo-box.logo--walmart .crop {
  position: relative;
  width: 22px;
  height: 24px;
  overflow: hidden;
}

.career-row .logo-box.logo--walmart img {
  position: absolute;
  width: auto;
  height: 40px;
  max-width: none;
  left: -86px;
  top: -5.8px;
}

.career-row .meta .company {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.career-row .meta .sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text-subtle);
}

.career-row .meta .sub .sep {
  width: 1px;
  height: 14px;
  border-left: 1px dashed var(--text-subtle);
}

.career-row .period {
  flex-shrink: 0;
  font-weight: 500;
  font-size: clamp(16px, 1.6vw, 22px);
  letter-spacing: 0.02em;
  color: var(--text-main);
  white-space: nowrap;
}

/* ---------------------------------- */
/* Other works / gallery grid         */
/* ---------------------------------- */

.other-works {
  padding: 80px 0;
}

.other-works .h2 {
  margin-bottom: 48px;
}

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

.gallery .row {
  display: flex;
  gap: 18px;
}

.gallery .tile {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: 8px;
}

.gallery .tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery .tile--full {
  height: clamp(220px, 50vw, 572px);
}

.gallery .row .tile--half {
  height: clamp(180px, 50vw, 572px);
}

.gallery .row .tile--third {
  height: clamp(110px, 32vw, 366px);
}

/* Natural tiles keep the image's own aspect ratio — nothing is cropped.
   Extra specificity so fixed row heights (incl. responsive ones) never win. */
.gallery .tile.tile--natural,
.gallery .row .tile.tile--natural {
  height: auto;
}

.gallery .tile--natural img {
  height: auto;
}

/* Simple-layout project pages: breathing room before the footer */
.project-head--simple {
  padding-bottom: clamp(96px, 16vh, 180px);
}

a.tile:hover .placeholder span {
  color: #000;
}

/* ---------------------------------- */
/* Footer                             */
/* ---------------------------------- */

.footer {
  border-top: 1px dashed var(--border-subtle);
  padding: 64px 0 48px;
}

.footer .cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer .cta-row h2 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(28px, 4.5vw, 56px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-main);
}

.footer .links {
  display: flex;
  gap: clamp(40px, 7vw, 90px);
  margin-top: 64px;
}

.footer .links a {
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-subtle);
  transition: color 0.2s ease;
}

.footer .links a:hover {
  color: var(--text-main);
}

/* ---------------------------------- */
/* Project detail page                */
/* ---------------------------------- */

.project-page .wrap--narrow {
  max-width: 1000px;
}

.project-head {
  padding-top: clamp(60px, 9vh, 104px);
}

.project-head h1 {
  font-weight: 800;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.project-intro {
  display: flex;
  gap: clamp(24px, 4vw, 56px);
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 24px;
  margin-bottom: clamp(48px, 7vw, 80px);
}

.project-intro .copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.project-facts {
  flex-shrink: 0;
  display: flex;
  gap: 19px;
  border-left: 1px dashed var(--border-subtle);
  padding-left: 19px;
  width: 128px;
}

.project-facts .col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.project-facts .group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-facts .label {
  color: var(--text-subtle);
}

.project-facts .value,
.project-facts .list {
  font-weight: 500;
  color: var(--text-main);
}

.project-facts .list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-subtle);
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

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

.next-project {
  padding: 80px 0;
  text-align: center;
}

.next-project .label {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.next-project a {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: clamp(24px, 3.6vw, 44px);
  letter-spacing: -0.02em;
  color: var(--text-main);
  transition: color 0.2s ease;
}

.next-project a:hover {
  color: var(--text-subtle);
}

/* ---------------------------------- */
/* Case study (rich project page)     */
/* ---------------------------------- */

/* Floating close button (project pages) — appears when scrolling stops */
.close-fab {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
  transition: background 0.2s ease;
}

.close-fab:hover {
  background: rgba(255, 255, 255, 0.28);
}

.cs {
  max-width: 1000px;
}

.cs-hero {
  max-width: 1000px;
  margin-top: clamp(40px, 6vw, 72px);
}

.cs-figure {
  margin: 0;
}

.cs-figure img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

/* Light stroke on every image across the project pages */
.project-page .cs-figure img,
.project-page .cs-side-media img,
.project-page .gallery .tile {
  border: 1px solid var(--border-subtle);
}

.cs-figure figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-subtle);
}

.cs-figure--hero img {
  border-radius: 12px;
}

/* Tall/portrait image shown under its text, centered and constrained */
.cs-figure--narrow {
  max-width: 400px;
  margin: 0 auto;
}

.cs-section {
  padding: clamp(40px, 7vh, 80px) 0;
  border-top: 1px solid var(--border-subtle);
}

.cs-section:first-child {
  border-top: none;
}

.cs-text {
  max-width: none;
}

.cs-h {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 20px;
}

.cs-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: #cccccc;
}

.cs-text + .cs-figure,
.cs-text + .cs-stack,
.cs-section--side .cs-side-media {
  margin-top: 0;
}

.cs-section .cs-text + .cs-figure,
.cs-section .cs-text + .cs-stack {
  margin-top: clamp(48px, 7vw, 80px);
}

.cs-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 48px);
}

/* Side-by-side: text + tall phone image */
.cs-section--side .cs-text {
  max-width: none;
}

.cs-section--side {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.cs-side-media img {
  border-radius: 12px;
  max-height: 620px;
  width: 100%;
  object-fit: contain;
}

/* My role / Skills */
.cs-role {
  max-width: 1000px;
  padding: clamp(48px, 8vh, 88px) 0 clamp(96px, 16vh, 180px);
  border-top: 1px solid var(--border-subtle);
}

.cs-role-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 7vh, 64px);
}

.cs-skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cs-skills li {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-subtle);
  border: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  padding: 7px 14px;
  border-radius: 999px;
}

.cs-role-who {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.cs-role-avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

/* Process phases ("Plan of attack") */
.cs-phases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2vw, 24px);
  margin-top: clamp(28px, 4vw, 44px);
}

.cs-phase {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px;
  background: var(--surface-subtle);
}

.cs-phase-title {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text-main);
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.cs-phase ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-phase li {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-subtle);
}

/* Pull quote */
.cs-quote {
  margin: 0 0 24px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--text-main);
  border-left: 2px solid var(--text-subtle);
  padding-left: clamp(20px, 3vw, 32px);
}

/* Outcome stats ("Aftermath") */
.cs-stats-note {
  margin-top: clamp(28px, 4vw, 40px);
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.5vw, 24px);
}

.cs-stat {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--surface-subtle);
}

.cs-stat-value {
  font-family: var(--font-mono);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.cs-stat-label {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-subtle);
}

@media (max-width: 720px) {
  .cs-phases {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-stats {
    grid-template-columns: 1fr;
  }

  .cs-section--side {
    grid-template-columns: 1fr;
  }

  .cs-side-media {
    max-width: 320px;
  }

  .cs-role-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------- */
/* Responsive                         */
/* ---------------------------------- */

@media (max-width: 720px) {
  .project-intro {
    flex-direction: column;
  }

  .project-facts {
    width: auto;
  }

  .career-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .gallery .row {
    flex-direction: column;
  }

  .gallery .row .tile--half,
  .gallery .row .tile--third {
    height: clamp(180px, 56vw, 366px);
  }

  .footer .links {
    margin-top: 40px;
  }
}
