/* ============================================================
   Home page — 6-section cinematic scroll experience
   ============================================================ */

/* Shared section base — svh keeps bottom-anchored content (hero name,
   scroll hint, S2 footer) clear of the mobile browser chrome */
.home-section {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  border-bottom: var(--border);
}

/* Match the 80px black dividers between bordered blocks on the inner pages. */
.home-section + .home-section {
  margin-top: 80px;
  border-top: var(--border);
}

.home-section-label {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--pink);
  text-transform: uppercase;
}

.home-item-subtitle {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-muted);
  font-style: italic;
}

/* Nav starts invisible on home; GSAP fades it in on load */
body.home .site-nav {
  opacity: 0;
}

/* ============================================================
   S0 — Parallax hero
   ============================================================ */
.s0 {
  background: transparent;
  /* Vanta injects a canvas child with z-index:-1; isolation creates a stacking
     context so the canvas is contained within this section rather than leaking. */
  isolation: isolate;
}

.s0-tagline {
  position: absolute;
  top: 115px;
  left: 32px;
  max-width: 230px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* TODO: swap .s0-photo-inner for <img> with object-fit: cover once character
   reference imagery is supplied. Remove fixed width/height on .s0-photo. */
.s0-photo {
  position: absolute;
  top: 72px;
  right: 10%;
  width: 260px;
  height: 420px;
  will-change: transform;
}

.s0-photo-inner {
  width: 100%;
  height: 100%;
  background: #dce8f0;
  border: var(--border);
  position: relative;
  --placeholder-color: rgba(55, 90, 118, 0.45);
}

.s0-name {
  position: absolute;
  bottom: 48px;
  left: 32px;
  font-family: var(--font-serif);
  font-size: clamp(72px, 10vw, 128px);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 0.86;
  letter-spacing: -0.02em;
  pointer-events: none;
}

.s0-name-surname {
  display: block;
  color: var(--pink);
}

@media (max-width: 480px) {
  .s0-tagline {
    left: 24px;
  }

  /* Keep "Popescu" inside a 320–480px viewport */
  .s0-name {
    left: 24px;
    bottom: 40px;
    font-size: clamp(56px, 19vw, 72px);
  }

}

/* ============================================================
   S1 — Full-screen statement
   ============================================================ */
.s1 {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.s1-inner {
  max-width: 760px;
  padding: 0 64px;
}

@media (max-width: 767px) {
  .s1-inner {
    padding: 0 28px;
  }
}

.s1-quote {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.4vw, 28px);
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  line-height: 1.85;
  letter-spacing: 0.01em;
}

.s1-quote em {
  color: var(--pink);
}

/* ============================================================
   S2 — AI Art: scrolling image strip
   ============================================================ */
.s2 {
  background: var(--bg-s2);
}

/* Drag window — full-bleed strip between header and footer */
.s2-viewport {
  position: absolute;
  top: 58px;
  bottom: 88px;
  left: 0;
  right: 0;
  overflow: hidden;
  z-index: 1;
  cursor: grab;
  touch-action: pan-y; /* horizontal swipes drag the reel; vertical still scrolls the page */
  user-select: none;
  -webkit-user-select: none;
}

.s2-viewport.is-dragging {
  cursor: grabbing;
}

/* The reel — infinite horizontal strip translated by JS */
.s2-reel {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  will-change: transform;
}

/* Each artwork card — width follows the image's natural aspect ratio,
   so nothing is ever cropped and every card renders at full size */
.s2-card {
  flex-shrink: 0;
  height: 74%;
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.s2-card img {
  height: 100%;
  width: auto;
  display: block;
  -webkit-user-drag: none;
}

.s2-card--ph {
  aspect-ratio: 2 / 3;
  background: #e4ecf4;
  border: 0.5px solid #b8ccd8;
  --placeholder-color: rgba(55, 90, 120, 0.4);
}

/* Edge vignettes fade the reel smoothly into the section background */
.s2-vignette {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8%;
  z-index: 3;
  pointer-events: none;
}

.s2-vignette--l {
  left: 0;
  background: linear-gradient(to right, rgba(var(--bg-s2-rgb), 0.38) 0%, transparent 100%);
}

.s2-vignette--r {
  right: 0;
  background: linear-gradient(to left, rgba(var(--bg-s2-rgb), 0.38) 0%, transparent 100%);
}

.s2-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: var(--border);
  background: var(--bg-s2);
  z-index: 2;
}

.s2-nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.s2-nav {
  background: none;
  border: 0.5px solid #2a1a2a;
  color: #dbbdca;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}

.s2-nav:hover {
  color: var(--pink);
  border-color: var(--pink);
}

.s2-count {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #dbbdca;
  min-width: 52px;
  text-align: center;
  font-family: var(--font-sans);
}

.s2-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 22px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: var(--border);
  background: var(--bg-s2);
  z-index: 2;
}

.s2-title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.6vw, 32px);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.2s;
}

.s2-title:hover {
  color: var(--pink);
}

.s2-ghost-num {
  font-family: var(--font-serif);
  font-size: clamp(40px, 5vw, 64px);
  color: #dbbdca;
  font-weight: 400;
  line-height: 1;
  user-select: none;
}

@media (max-width: 767px) {
  .s2-header {
    padding: 18px 20px;
  }

  .s2-footer {
    padding: 22px 20px;
    gap: 16px;
  }

  .s2-title {
    min-width: 0;
  }

  /* Comfortable touch targets for the reel arrows */
  .s2-nav {
    padding: 10px 14px;
  }
}

/* ============================================================
   Shared placeholder labels — PLACEHOLDER text injected via ::after.
   Shared properties live here; per-element tint set via --placeholder-color.
   ============================================================ */
.s0-photo-inner::after,
.s2-card--ph::after,
.s3-image--placeholder::after,
.s4-image--placeholder::after {
  content: 'PLACEHOLDER';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--placeholder-color, rgba(55, 90, 118, 0.45));
  text-transform: uppercase;
  font-family: var(--font-sans);
  white-space: nowrap;
}

/* Portrait cards rotate the label 90deg for tall format */
.s2-card--ph::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* ============================================================
   S3 — Articles & Essays, staggered text cascade
   ============================================================ */
.s3 {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
}

.s3 > .article-split {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-bottom: none;
}

.s3 .article-item-foot {
  flex-direction: column;
  align-items: flex-start;
}

.s3 .article-item-read {
  margin-top: 24px;
}

.s3-body {
  flex: 1;
  overflow: hidden;
}

.s3-left {
  padding: 64px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .s3-left {
    border-right: var(--border);
  }
}

.s3-cat-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.s3-rule-line {
  flex: 1;
  height: 0.5px;
  background: #1e1618;
}

.s3-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5vw, 64px);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.02;
  display: flex;
  flex-direction: column;
}

.s3-title-line {
  display: block;
}

.s3-title em {
  color: var(--pink);
  font-style: normal;
}

.s3-excerpt {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.95;
  margin-top: 20px;
  letter-spacing: 0.01em;
  max-width: 380px;
}

.s3-right {
  background: #0d090b;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* TODO: replace with <img> when article cover imagery is supplied */
.s3-image {
  width: 72%;
  aspect-ratio: 3 / 4;
  background: #dceae4;
  border: 0.5px solid #aecabc;
  position: relative;
  --placeholder-color: rgba(55, 100, 78, 0.45);
}

/* Stacked layout — section grows with content instead of clipping at 100vh */
@media (max-width: 767px) {
  .s3 {
    height: auto;
    min-height: 100svh;
  }

  .s3 > .article-split {
    height: auto;
    min-height: auto;
  }

  .s3-body {
    overflow: visible;
  }

  .s3-left {
    padding: 56px 24px 40px;
  }

  .s3-right {
    padding: 40px 0;
  }

}

/* ============================================================
   S4 — Clients & Projects, split-panel entrance
   ============================================================ */
.s4 {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
}

.s4 > .project-item {
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  border-top: none;
  border-bottom: none;
}

.s4-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.s4-left {
  width: min(480px, 50vw);
  padding: 64px 32px;
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
}

.s4-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 24px;
  display: block;
}

.s4-client-name {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 60px);
  color: var(--text-secondary);
  line-height: 1.02;
  font-weight: 400;
}

.s4-client-name em {
  display: block;
  font-style: normal;
  color: var(--pink);
}

.s4-scope {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  line-height: 2.1;
  margin-top: 20px;
}

.s4-right {
  flex: 1;
  background: var(--bg-s2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 48px;
  overflow: hidden;
  min-height: 0;
}

/* TODO: replace with <img> when project imagery is supplied */
.s4-image {
  width: min(340px, 52vw);
  aspect-ratio: 3 / 4;
  background: #ece6da;
  border: 0.5px solid #c8bcaa;
  position: relative;
  --placeholder-color: rgba(105, 85, 60, 0.45);
}

/* Stacked layout — the fixed-width left rail collapses to ~150px on phones
   otherwise; section grows with content instead of clipping at 100vh */
@media (max-width: 767px) {
  .s4 {
    height: auto;
    min-height: 100svh;
  }

  .s4 > .project-item {
    height: auto;
    min-height: auto;
    max-height: none;
  }

  .s4-body {
    flex-direction: column;
    overflow: visible;
  }

  .s4-left {
    width: 100%;
    border-right: none;
    border-bottom: var(--border);
    padding: 56px 24px 40px;
  }

  .s4-right {
    padding: 48px 24px;
  }

  .s4-image {
    width: min(340px, 72vw);
  }

  .s4-image {
    width: 100%;
  }
}

/* ============================================================
   S5 — Contact, scramble resolve + line draw
   ============================================================ */
.s5 {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: auto;
}

.s5-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 80px 32px calc(20px + env(safe-area-inset-bottom));
}

@media (max-width: 767px) {
  .s5-body {
    padding: 64px 24px calc(32px + env(safe-area-inset-bottom));
  }
}

.s5-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 32px;
  display: block;
}

.s5-email {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4.5vw, 56px);
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.2;
  overflow-wrap: anywhere; /* long addresses break instead of overflowing on phones */
}

.s5-rule {
  height: 0.5px;
  background: var(--pink);
  margin-top: 20px;
  transform: scaleX(0);
  transform-origin: left center;
}

.s5-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 36px;
  margin-top: 40px;
}

.s5-soc-link {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}

.s5-soc-muted {
  color: var(--text-muted);
}

.s5-soc-muted:hover {
  color: var(--text-secondary);
}

.s5-soc-pink {
  color: var(--pink);
}

.s5-soc-pink:hover {
  opacity: 0.7;
}
