/* ============================================================
   JOANA SANTOS — PORTFOLIO
   Kanso-inspired editorial design
   ============================================================ */

/* ------------------------------------------------------------
   CUSTOM PROPERTIES
------------------------------------------------------------ */
:root {
  --bg:        #FFFFFF;
  --bg-alt:    #F5F3EE;
  --text:      #0A0A0A;
  --muted:     #6B6862;
  --border:    #E0DDD8;

  --sans:      'Inter', sans-serif;

  --nav-h:     64px;
  --max-w:     1280px;
  --gutter:    clamp(1.25rem, 5vw, 4rem);

  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  font-family: 'Inter', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

img,
svg {
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
}

ul {
  list-style: none;
}

/* ------------------------------------------------------------
   LAYOUT UTILS
------------------------------------------------------------ */
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  display: block;
  font-size: 0.675rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ------------------------------------------------------------
   FADE-IN SCROLL ANIMATIONS
------------------------------------------------------------ */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity  0.75s var(--ease-out),
    transform 0.75s var(--ease-out);
  will-change: opacity, transform;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------------------
   NAV
------------------------------------------------------------ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.nav.is-scrolled {
  border-bottom-color: var(--border);
}

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.nav__logo {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.nav__logo:hover { opacity: 0.5; }

/* Desktop links */
.nav__links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav__link {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text);
  position: relative;
  padding-bottom: 3px;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.35s var(--ease-out);
}
.nav__link:hover::after { width: 100%; }

/* Hamburger */
.nav__hamburger {
  display: none;
  /* shown via media query */
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 8px;
  margin-right: -8px;
  z-index: 201;
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text);
  transition: transform 0.35s var(--ease-out), opacity 0.2s ease;
  transform-origin: center;
}

.nav__hamburger.is-open span:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}
.nav__hamburger.is-open span:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Mobile overlay */
.nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.3);
  backdrop-filter: blur(2px);
  z-index: 198;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.nav__overlay.is-visible {
  opacity: 1;
}

/* ------------------------------------------------------------
   HERO
------------------------------------------------------------ */
.hero {
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100dvh - var(--nav-h));
  padding: clamp(2rem, 5vw, 4rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
}

.hero__top {
  align-self: flex-start;
}

.hero__desc {
  max-width: 520px;
  font-size: 16px;
  font-weight: 400;
  color: #111111;
  line-height: 1.6;
}

.hero__roles {
  font-size: 13px;
  font-weight: 400;
  color: #999999;
  margin-top: 16px;
}

.hero__name {
  align-self: flex-start;
  font-family: 'Inter', sans-serif;
  font-size: clamp(60px, 11vw, 150px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: #0A0A0A;
  margin: 0;
}

.hero__name br {
  display: none;
}




/* ------------------------------------------------------------
   WORK
------------------------------------------------------------ */
.work {
  background: #FFFFFF;
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.work-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
}

.work-item--featured {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 7;
}

.work-placeholder {
  width: 100%;
  height: 100%;
}

.work-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.work-item:hover .work-overlay {
  opacity: 1;
}

.work-title {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: #ffffff;
}

.work-meta {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
}

/* ------------------------------------------------------------
   FOOTER
------------------------------------------------------------ */
.footer {
  background: var(--text);
  color: var(--bg);
  padding: clamp(5rem, 10vw, 10rem) 0 clamp(2rem, 4vw, 3rem);
}

.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: clamp(3rem, 5vw, 5rem);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 2.5rem;
}

.footer__heading {
  font-family: 'Inter', sans-serif;
  font-size: clamp(3.5rem, 9vw, 10rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--bg);
}

.footer__heading em {
  font-style: normal;
  opacity: 0.4;
}

.footer__email {
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 4px;
  transition: color 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
  align-self: flex-end;
}

.footer__email:hover {
  color: var(--bg);
  border-bottom-color: var(--bg);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer__wordmark {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--bg);
}

.footer__contact {
  display: flex;
  gap: 1.5rem;
}

.footer__contact-link {
  font-size: 14px;
  font-weight: 400;
  color: inherit;
  text-decoration: none;
}

.footer__contact-link:hover {
  text-decoration: underline;
}

.footer__copy {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------
   CASE STUDY — VISUAL GALLERY COMPONENTS
   Used across all project case study pages
------------------------------------------------------------ */

/* Hero figure — replaces plain colour div once images are ready */
.cs-hero-fig {
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  margin-bottom: clamp(4rem, 8vw, 7rem);
  background: var(--bg-alt);
}
.cs-hero-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Full-bleed visual — sits outside any section-inner */
.cs-vis-full {
  width: 100%;
  overflow: hidden;
  margin: clamp(3.5rem, 7vw, 6rem) 0;
  background: var(--bg-alt);
}
.cs-vis-full img {
  width: 100%;
  height: auto;
  display: block;
  min-height: 400px;
  object-fit: cover;
}

/* Wide visual — inside section-inner but outside cs-body (up to ~1280px) */
.cs-vis-wide {
  overflow: hidden;
  margin-top: clamp(3rem, 6vw, 5rem);
  background: var(--bg-alt);
}
.cs-vis-wide img {
  width: 100%;
  height: auto;
  display: block;
  min-height: 300px;
  object-fit: cover;
}

/* 2-column pair */
.cs-vis-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: clamp(3rem, 6vw, 5rem);
}
.cs-vis-pair figure {
  background: var(--bg-alt);
  overflow: hidden;
}
.cs-vis-pair figure img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
}

/* 3-column trio */
.cs-vis-trio {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: clamp(3rem, 6vw, 5rem) 0;
}
.cs-vis-trio figure {
  background: var(--bg-alt);
  overflow: hidden;
}
.cs-vis-trio figure img {
  width: 100%;
  height: auto;
  display: block;
  min-height: 280px;
  object-fit: cover;
}

/* Caption */
.cs-vis-caption {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   RESPONSIVE — TABLET (≤ 900px)
------------------------------------------------------------ */
@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-item--featured {
    grid-column: 1;
    aspect-ratio: 4 / 3;
  }

  /* Switch to hamburger */
  .nav__hamburger {
    display: flex;
  }

  /* Full-screen overlay menu */
  .nav__links {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 var(--gutter) clamp(2.5rem, 6vh, 4rem);
    gap: clamp(1rem, 3vh, 2rem);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease-out);
    z-index: 199;
  }

  .nav__links.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav__overlay {
    display: none; /* not needed — menu IS the overlay */
  }

  .nav__link {
    font-size: clamp(2rem, 10vw, 3.5rem);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
  }

  .nav__link::after {
    display: none;
  }

  /* Hamburger turns white when menu is open */
  .nav__hamburger.is-open span {
    background: var(--text);
  }
}

/* ------------------------------------------------------------
   RESPONSIVE — MOBILE (≤ 680px)
------------------------------------------------------------ */
@media (max-width: 680px) {

  /* Visual gallery — stack on mobile */
  .cs-vis-pair,
  .cs-vis-trio {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* HERO */
  .hero {
    padding: calc(var(--nav-h) + 1.5rem) 16px 3rem;
    gap: 0;
  }

  .hero__desc {
    max-width: 100%;
    font-size: 15px;
  }

  .hero__name {
    font-size: clamp(72px, 22vw, 120px);
    margin-top: clamp(6rem, 25vw, 10rem);
  }

  .hero__name br {
    display: block;
  }

  /* WORK GRID */
  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-item--featured {
    grid-column: 1;
    aspect-ratio: 4 / 3;
  }

  /* Always show overlay on mobile (no hover) */
  .work-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.35);
  }

  .work-title {
    font-size: 18px;
  }

  .work-meta {
    font-size: 11px;
  }

  /* STAT STRIP — stack vertically */
  .cs-stat-strip {
    grid-template-columns: 1fr !important;
  }

  .cs-stat-strip > div {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    padding: 2rem 0 !important;
  }

  .cs-stat-strip > div:last-child {
    border-bottom: none;
  }

  /* CASE STUDY — shared components */

  /* Header */
  .cs-header {
    padding: 2rem 0 2.5rem;
  }

  /* Section spacing */
  .cs-section {
    margin-bottom: clamp(2.5rem, 6vw, 4rem);
  }

  /* Insight bleed — use fixed 16px gutter on mobile */
  .cs-insight {
    margin-left: -16px !important;
    margin-right: -16px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Full-bleed visual — reduce min-height */
  .cs-vis-full img {
    min-height: 220px;
  }

  /* 2x2 dark screens grid → single column */
  .cs-screens-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Next project — tighten */
  .cs-next {
    padding: 2rem 0;
    gap: 1rem;
  }

  .cs-next__title {
    font-size: 1rem;
  }
}

/* ------------------------------------------------------------
   REDUCED MOTION
------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
