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

:root {
  --bg: #fbfbfb;
  --black: #000;
  --muted: #7d7983;
  --pink-light: #ffd8e4;
  --pink-light-subtle: rgba(255, 216, 228, 0.16);
  --pink-dark: #633b48;
  --pink-ruby: #56303d;
  --footer-bg: #31101d;
  --footer-text: #ffd8e4;
  --card-radius: 24px;
  --tag-radius: 16px;
}

:root {
  /* Neutrals */
  --color-bg-page: #fbfbfb;
  --color-text-primary: #000000;
  --color-text-secondary: #7d7983;

  /* Pink accent palette (literal + semantic) */
  --color-pink-fill: #ffd8e4;
  --color-pink-fill-subtle: rgba(255, 216, 228, 0.16);
  --color-pink-text: #633b48;
  --color-pink-text-strong: #56303d;

  /* Footer / dark surface */
  --color-bg-footer: #31101d;
  --color-text-footer: #ffd8e4;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
}

@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }
}

/* ── LAYOUT ── */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  /* clip allows sticky to work; hidden would break it */
  overflow-x: clip;
}

.main-content {
  display: flex;
  gap: 41px;
  padding: 0 40px 120px 40px;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* SPA content panels: one visible at a time, sidebar never reloads */
.content-panels {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.content-panel.is-visible {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.content-panel.is-visible.about-content-wrapper {
  display: flex;
}

.content-panel.is-visible.work-grid {
  display: grid;
}

.content-panel.is-hidden,
html.init-about .content-panel[data-section="work"] {
  display: none !important;
}

html.init-about .content-panel[data-section="about"] {
  display: flex !important;
}

.content-panel.content-transition-in {
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .content-panel.content-transition-in {
    animation: none;
  }
}

/* ── SIDEBAR ── */
.sidebar-wrapper {
  width: 382px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: flex-start;
}

/* Desktop: reorder so nav appears below divider (Figma: name, bio, tags, divider, nav) */
.sidebar-overlay {
  display: contents;
}

.sidebar {
  display: contents;
}

.sidebar-header { order: 1; }
.sidebar-top { order: 2; }
.divider { order: 3; }
.nav { order: 4; }

/* Above 1100px: left nav stays fixed while page content scrolls */
@media (min-width: 1101px) {
  .sidebar-wrapper {
    position: sticky;
    top: 40px;
  }
}

.sidebar-header {
  display: block;
}

/* Case study: sidebar collapse/expand (desktop only) */
@media (min-width: 1025px) {
  .page-cs .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.page-cs .sidebar-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-cs .sidebar-collapse {
  display: none;
  padding: 8px;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.page-cs .sidebar-collapse:hover {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.05);
}

.sidebar-expand {
  position: fixed;
  top: 40px;
  left: 40px;
  z-index: 1000;
  padding: 8px;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 8px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.sidebar-expand:hover {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.08);
}

@media (min-width: 1025px) {
  .page-cs .sidebar-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Sidebar: sticky so it scrolls with page (like work/about); content expands over it when collapsed */
  .page-cs .sidebar-wrapper {
    position: sticky;
    top: 40px;
    width: 382px;
    flex-shrink: 0;
    z-index: 998;
    pointer-events: auto;
    align-self: flex-start;
  }

  .page-cs.sidebar-collapsed .sidebar-wrapper {
    width: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
  }

  .page-cs.sidebar-collapsed .main-content--cs {
    gap: 0;
  }

  .page-cs.sidebar-collapsed .sidebar-collapse {
    visibility: hidden;
    position: absolute;
    pointer-events: none;
  }

  /* Main content: flex layout positions it; expands when sidebar collapsed */
  .page-cs .main-content--cs .cs-content-wrapper {
    position: relative;
    z-index: 999;
    align-self: flex-start;
    flex: 1;
    margin-top: 0;
    background: var(--color-bg-page);
  }

  /* Expand button visibility (opacity for smoother swap) */
  .page-cs .sidebar-expand {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .page-cs.sidebar-collapsed .sidebar-expand {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 1024px) {
  .page-cs .sidebar-collapse {
    display: none;
  }

  .sidebar-expand {
    display: none !important;
  }
}

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

.name {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.bio {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-primary);
}

.bio-link {
  color: inherit;
  text-decoration: underline;
  transition: color 0.2s ease;
}
.bio-link:hover { color: var(--color-pink-text-strong); }

.tags {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tag {
  background: var(--color-pink-fill);
  color: var(--color-pink-text);
  font-size: 16px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--tag-radius);
  text-decoration: none;
  transition: opacity 0.2s ease;
  cursor: pointer;
}
.tag:hover { background: #f5c0d3; }

.tag--has-tooltip {
  position: relative;
}
.tag--has-tooltip:hover {
  background: #f5c0d3;
}

.tag-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--color-text-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tag--has-tooltip:hover .tag-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.divider {
  width: 100%;
  height: 1px;
  background: #e0e0e0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-decoration: none;
  padding: 12px 0;
  margin: 0;
  border-radius: 12px;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.nav a:hover { color: var(--color-pink-text-strong); }

.nav a.nav__link--current {
  background: var(--color-pink-fill-subtle);
  color: var(--color-pink-text-strong);
  margin-left: -12px;
  padding-left: 12px;
}
.nav a.nav__link--current:hover {
  opacity: 0.85;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-primary);
  transition: transform 0.2s ease;
}
.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ── WORK GRID ── */
.work-grid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 53px 45px;
  align-items: start;
  width: 100%;
}

/* Medium desktop: sidebar + single column cards */
@media (min-width: 1025px) {
  .work-grid { margin-top: 40px; }
}

/* 1024px and below: keep 40px between sidebar (linkedin/email) and projects */
@media (max-width: 1024px) {
  .work-grid { margin-top: 40px; }
}

/* Large desktop: sidebar + two column cards */
@media (min-width: 1281px) {
  .work-grid { grid-template-columns: 1fr 1fr; }
}

/* ── ABOUT PAGE ── */
/* Match case study structure: fill container, center content, maintain padding */
.about-content-wrapper {
  flex: 1;
  min-width: 0;
  width: 100%;
  align-self: stretch;
  display: flex;
  justify-content: center;
  padding-top: 40px;
}

.main-content--about .about-content {
  width: 100%;
  max-width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  gap: 80px;
  box-sizing: border-box;
}

@media (min-width: 1025px) {
  .main-content--about .about-content { margin-top: 40px; }
}

/* >1100px: about content spaced so "My design story" baseline aligns with "Natasha Tang" */
@media (min-width: 1101px) {
  .main-content--about .about-content { margin-top: 0; }
  /* Name uses line-height 1.1, about-heading uses 1.3; add ~6px so baselines align */
  .page-about .about-content-wrapper { padding-top: 38px; }
}

.name--about {
  font-size: 24px;
}

.about-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-heading {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
}

.about-subheading {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary);
  margin: 0;
}

/* Match sidebar bio: 16px between paragraphs, same line-height */
.about-body-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-body {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-primary);
  margin: 0;
}

.hobbies-grid {
  display: flex;
  flex-direction: row;
  gap: 24px;
  flex-wrap: wrap;
}

.page-about .hobbies-grid {
  margin-top: 20px;
}

.hobby-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.25s ease;
}

.hobby-card:hover {
  transform: rotate(-3deg);
}

.hobby-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.hobby-card__label {
  display: inline-flex;
  align-self: center;
  background: var(--color-pink-fill);
  color: var(--color-pink-text-strong);
  font-size: 16px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--tag-radius);
}

.skills-grid,
.tools-grid {
  display: flex;
  flex-direction: row;
  gap: 16px;
  flex-wrap: wrap;
}

.page-about .skills-grid {
  margin-top: 20px;
}

.page-about .tools-grid {
  margin-top: 20px;
}

.skills-column,
.tools-column {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skills-column__title,
.tools-column__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.skills-column__list,
.tools-column__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.tool-item__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 4px;
}

.tool-item__label {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-primary);
}

.skills-column__list li {
  margin-bottom: 4px;
}

.skills-column__list li:last-child {
  margin-bottom: 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
}

.card--link {
  text-decoration: none;
  color: inherit;
}

.card-media {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.card:hover .card-media {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.card-image {
  width: 100%;
  border-radius: var(--card-radius);
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.card:hover > .card-image {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.card-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  border: none;
  border-radius: 16px;
  pointer-events: none;
}

.card-video--phone {
  max-width: 38%;
  border: none;
  border-radius: 16px;
}

.card-video--fill {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: 100%;
  max-width: none;
  border: none;
  border-radius: 0;
  display: block;
  object-fit: cover;
  aspect-ratio: 590 / 437;
}

.card-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card-media:hover .card-controls {
  opacity: 1;
}

.card-controls__play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.card-controls__icon {
  width: 18px;
  height: 18px;
}

.card-controls__icon--play {
  display: none;
}

.card-controls--paused .card-controls__icon--pause {
  display: none;
}

.card-controls--paused .card-controls__icon--play {
  display: block;
}

.card-controls__time {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  min-width: 30px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-controls__range {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.card-controls__range::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border-radius: 2px;
}

.card-controls__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 0;
  border: none;
  background: transparent;
}

/* staggered aspect ratios like Figma design */
.card:nth-child(1) .card-image { aspect-ratio: 590 / 440; }
.card:nth-child(2) .card-image { aspect-ratio: 590 / 588; }
.card:nth-child(3) .card-image { aspect-ratio: 590 / 437; }
.card:nth-child(4) .card-image { aspect-ratio: 590 / 588; }

.card:nth-child(2) .card-video--fill { aspect-ratio: 1 / 1; }

.card-body { display: flex; flex-direction: column; gap: 16px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.card-desc {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.card-year {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-top: 16px;
}

/* View work pill — overlays on first card */
.view-pill {
  position: absolute;
  bottom: calc(32px + 16px);
  right: 0;
  background: var(--color-pink-fill);
  color: var(--color-pink-text);
  font-size: 20px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--tag-radius);
  text-decoration: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  pointer-events: none;
}
.card:hover .view-pill {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── FOOTER ── */
.site-footer {
  background: var(--color-bg-footer);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.footer-tagline {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-footer);
  line-height: 1.4;
}

.footer-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-footer);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.footer-link:hover { opacity: 0.7; }

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-footer);
  opacity: 0.6;
  text-align: right;
  line-height: 1.5;
}


/* ── PASSWORD GATE ── */
.pw-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--color-bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: auto;
}

.pw-gate * {
  cursor: auto;
}

.pw-gate a,
.pw-gate button,
.pw-gate input,
.pw-gate .pw-gate__submit {
  cursor: pointer;
}

.pw-gate--visible {
  opacity: 1;
  pointer-events: auto;
}

.pw-gate--unlocked {
  opacity: 0;
  pointer-events: none;
}

.pw-gate__card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 440px;
  width: 100%;
}

.pw-gate__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pw-gate__headline {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.pw-gate__sub {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.pw-gate__field-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pw-gate__input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pw-gate__input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.pw-gate__input {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-primary);
  background: transparent;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 14px 48px 14px 18px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease;
}

.pw-gate__toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 4px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.pw-gate__toggle:hover {
  color: var(--color-text-primary);
}

.pw-gate__eye {
  width: 18px;
  height: 18px;
}

.pw-gate__input::placeholder {
  color: var(--color-text-secondary);
}

.pw-gate__input:focus {
  border-color: var(--color-pink-text);
}

.pw-gate__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: var(--color-pink-text-strong);
  border: none;
  border-radius: 12px;
  color: var(--color-pink-fill);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.pw-gate__submit:hover {
  background: var(--color-pink-text);
  color: var(--color-pink-fill);
}

.pw-gate__submit svg {
  width: 18px;
  height: 18px;
}

.pw-gate__error {
  font-size: 14px;
  color: var(--color-pink-text);
}

.pw-gate__footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pw-gate__ask {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.pw-gate__pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@keyframes pw-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

.pw-gate__input--shake {
  animation: pw-shake 0.4s ease;
  border-color: var(--color-pink-text);
}

.pw-gate--active .custom-cursor {
  display: none;
}

/* ── CUSTOM CURSOR ── */
.custom-cursor {
  position: fixed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--color-pink-text);
  color: transparent;
  font-size: 16px;
  font-weight: 500;
  pointer-events: none;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  transition:
    transform 0.12s ease-out,
    opacity 0.18s ease-out,
    padding 0.12s ease-out,
    width 0.12s ease-out,
    height 0.12s ease-out,
    background 0.12s ease-out,
    color 0.12s ease-out,
    border-radius 0.12s ease-out;
  z-index: 9999;
}

.custom-cursor--hidden {
  opacity: 0;
}

.custom-cursor--link-hover {
  transform: translate(-50%, -50%) scale(1.3);
}

.custom-cursor--pill {
  padding: 8px 16px;
  width: auto;
  height: auto;
  border-radius: var(--tag-radius);
  background: var(--color-pink-fill);
  color: var(--color-pink-text);
  transform: translate(-50%, -50%);
}

.custom-cursor--link-hover.custom-cursor--pill {
  transform: translate(-50%, -50%);
}

/* ── ENTRANCE ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Sidebar sequence: name → bio/tags → divider → nav links */
.sidebar-header                { animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both; }
.sidebar-top                   { animation: fadeUp 0.6s  cubic-bezier(0.16, 1, 0.3, 1) 0.18s both; }
.divider                       { animation: fadeIn 0.4s  ease                           0.32s both; }
.nav__link:nth-child(1)        { animation: fadeUp 0.5s  cubic-bezier(0.16, 1, 0.3, 1) 0.38s both; }
.nav__link:nth-child(2)        { animation: fadeUp 0.5s  cubic-bezier(0.16, 1, 0.3, 1) 0.48s both; }
.nav__link:nth-child(3)        { animation: fadeUp 0.5s  cubic-bezier(0.16, 1, 0.3, 1) 0.58s both; }

/* Cards cascade in slightly after sidebar starts */
.card:nth-child(1) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both; }
.card:nth-child(2) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.42s both; }
.card:nth-child(3) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.56s both; }
.card:nth-child(4) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.70s both; }

/* About page: sections cascade in */
.about-content > .about-section:nth-child(1) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both; }
.about-content > .about-section:nth-child(2) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.42s both; }
.about-content > .about-section:nth-child(3) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.56s both; }
.about-content > .about-section:nth-child(4) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.70s both; }

/* Case study page: hero + sections cascade in */
.cs-back     { animation: fadeUp 0.5s  cubic-bezier(0.16, 1, 0.3, 1) 0.20s both; }
.cs-hero     { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both; }
.cs-content > .about-section:nth-child(1) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.38s both; }
.cs-content > .about-section:nth-child(2) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.48s both; }
.cs-content > .about-section:nth-child(3) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.58s both; }
.cs-content > .about-section:nth-child(4) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.68s both; }
.cs-content > .about-section:nth-child(5) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.78s both; }
.cs-content > .about-section:nth-child(6) { animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.88s both; }

/* Footer */
.site-footer { animation: fadeIn 0.6s ease 0.5s both; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .sidebar-header, .sidebar-top, .divider,
  .nav__link, .card, .about-content > .about-section,
  .cs-back, .cs-hero, .cs-content > .about-section,
  .site-footer {
    animation: none;
  }
  .hobby-card {
    transition: none;
  }
  .hobby-card:hover {
    transform: none;
  }
}

/* ── RESPONSIVE ── */
/* Mobile overlay: ≤1100px (matches hamburger toggle breakpoint) */
@media (max-width: 1100px) {
  .main-content { flex-direction: column; gap: 0; padding-top: 88px; }
  .sidebar-wrapper { width: 100%; position: static; }
  .sidebar-overlay { display: flex; }
  .sidebar { display: flex; width: 100%; position: static; }
  .divider { display: none; }
  .work-grid { grid-template-columns: 1fr; margin-top: 40px; }

  /* About page: hide bio and tags in sidebar (show only on selected work page) */
  .page-about .sidebar-top { display: none; }
  /* Case study page: same — bio/tags not needed in mobile header */
  .page-cs .sidebar-top { display: none; }

  /* About page: center content on wide screens, stretch to fit on narrow; no extra gap below nav */
  .main-content--about {
    align-items: center;
  }
  .page-about .about-content-wrapper {
    align-self: stretch;
    width: 100%;
    padding-top: 0;
  }
  .main-content--about .about-content {
    max-width: min(720px, 100%);
    gap: 60px;
  }

  /* Case study page: same — center content when top nav is shown */
  .main-content--cs {
    align-items: center;
  }
  .page-cs .cs-content-wrapper {
    align-self: stretch;
    width: 100%;
  }

  /* Reset nav selected state indent in overlay */
  .nav a.nav__link--current {
    margin-left: 0;
    padding-left: 0;
  }

  /* Overlay: one block (header + nav), fixed, layers over content */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    background: rgba(251, 251, 251, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0;
    transition: background 0.2s ease, backdrop-filter 0.2s ease, border-radius 0.2s ease;
  }
  .sidebar-wrapper--nav-open .sidebar-overlay,
  .sidebar-wrapper--nav-closing .sidebar-overlay {
    background: var(--color-pink-text);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0 0 24px 24px;
  }
  .sidebar-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
  }
  .nav-toggle {
    display: flex;
  }
  .nav {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    padding: 0 40px;
    gap: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0.2s ease, padding 0.2s ease;
  }
  .sidebar-wrapper--nav-open .nav {
    max-height: 280px;
    opacity: 1;
    visibility: visible;
    padding: 0 40px 40px 40px;
    gap: 0;
  }
  /* Keep overlay styles during close transition — avoids flash to sidebar style */
  .sidebar-wrapper--nav-closing .nav a,
  .sidebar-wrapper--nav-closing .nav a.nav__link--current {
    color: var(--color-text-footer);
    background: transparent;
  }
  .sidebar-wrapper--nav-closing .sidebar-header .name,
  .sidebar-wrapper--nav-closing .nav-toggle {
    color: var(--color-text-footer);
  }
  .sidebar-wrapper--nav-closing .nav-toggle__bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .sidebar-wrapper--nav-closing .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .sidebar-wrapper--nav-closing .nav-toggle__bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  /* Skip nav close transition when link clicked — instant hide */
  .sidebar-wrapper--nav-closing-instant .nav {
    transition: none;
  }
  .sidebar-wrapper--nav-open .nav a {
    color: var(--color-text-footer);
    font-size: 32px;
    font-weight: 500;
    margin: 0;
  }
  .sidebar-wrapper--nav-open .nav a.nav__link--current {
    background: transparent;
    color: var(--color-text-footer);
  }
  .sidebar-wrapper--nav-open .sidebar-header .name,
  .sidebar-wrapper--nav-open .nav-toggle {
    color: var(--color-text-footer);
  }
  .sidebar-wrapper--nav-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .sidebar-wrapper--nav-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .sidebar-wrapper--nav-open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* About page: mobile layout per Figma (node 132-385) */
  .page-about .hobbies-grid {
    flex-direction: row;
    gap: 24px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .page-about .hobby-card {
    flex: 0 0 224px;
    min-width: 224px;
  }
  .page-about .hobby-card__image {
    width: 224px;
    height: 224px;
    aspect-ratio: unset;
  }
  .page-about .skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .page-about .tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .page-about .skills-column {
    min-width: 0;
    flex: none;
  }
  .page-about .tools-column {
    min-width: 0;
    flex: none;
  }
}

@media (max-width: 600px) {
  .sidebar-header { padding: 20px 20px; }
  .sidebar-wrapper--nav-open .nav,
  .sidebar-wrapper--nav-closing .nav { padding: 0 20px 40px 20px; }
  .sidebar-wrapper--nav-open .nav a { font-size: 36px; }
  .main-content { padding: 88px 20px 80px 20px; }
  .page-about .about-content-wrapper { padding-top: 0; }
  .site-footer { padding: 24px 20px; gap: 40px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 32px; }
  .footer-meta { text-align: left; }
}

/* ── CASE STUDY ── */

.name--cs {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: inherit;
  text-decoration: none;
  display: block;
}

.main-content--cs {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 48px;
  padding-top: 0;
}

.cs-content-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  padding-top: 40px;
}

.cs-content {
  width: 100%;
  max-width: min(680px, 100%);
  display: flex;
  flex-direction: column;
  gap: 80px;
  box-sizing: border-box;
}

/* Hero media */
.cs-hero-media {
  width: 100%;
  border-radius: var(--card-radius);
  overflow: hidden;
}

.cs-hero-media__bg {
  aspect-ratio: 590 / 440;
}

.cs-hero-media--fill {
  background: #e8e8e8;
}
.cs-hero-media--fill .card-video--fill {
  position: relative;
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
}

/* Time off: use same aspect ratio as card on Selected work (590/437) */
.page-timeoff .cs-hero-media--fill .card-video--fill {
  aspect-ratio: 590 / 437;
}

/* Solution section feature videos */
.cs-feature-media {
  position: relative;
  width: 100%;
  aspect-ratio: 590 / 440;
  background: #e8e8e8;
  border-radius: var(--card-radius);
  overflow: hidden;
  margin-top: 12px;
  margin-bottom: 12px;
}

.cs-feature-media .card-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  border: none;
  pointer-events: none;
}

.cs-feature-media:hover .card-controls {
  opacity: 1;
}

/* Fill variant: video fills container (no device frame, for web) */
.cs-feature-media--fill .card-video--fill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: none;
  pointer-events: none;
}

.cs-feature-media--fill .cs-feature-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Team app: two images stacked; gap between cells matches spacing above first label (16px + 12px) */
.cs-feature-media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.cs-feature-media-item {
  position: relative;
  aspect-ratio: 590 / 440;
  border-radius: var(--card-radius);
  overflow: hidden;
}

.cs-feature-media-item--no-bg {
  background: transparent;
}

.cs-feature-media-item .cs-feature-image--fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-feature-media-cell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-feature-media-label {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.2px;
}


/* Back link */
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 500;
  color: #999;
  text-decoration: none;
  transition: color 0.2s ease;
  margin-bottom: -56px;
}
.cs-back:hover { color: #1a1a1a; }

/* Case study prev/next navigation */
.cs-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.cs-nav__link {
  font-size: 16px;
  font-weight: 500;
  color: #999;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cs-nav__link:hover {
  color: #1a1a1a;
}

.cs-nav__link--next:only-child {
  margin-left: auto;
}

.cs-nav__link--prev:only-child {
  margin-right: auto;
}

/* Hero */
.cs-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.cs-title {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.8px;
  line-height: 1.1;
  color: #1a1a1a;
  margin: 0;
}

.cs-oneliner {
  font-size: 17px;
  line-height: 1.5;
  color: #777;
  margin: 0;
}

.cs-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 40px;
  padding-top: 12px;
}

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

.cs-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
}

.cs-meta-value {
  font-size: 15px;
  font-weight: 400;
  color: #444;
  line-height: 1.4;
}

/* Demo video banner */
.cs-demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background: rgba(99, 59, 72, 0.08);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  margin-top: 24px;
  transition: background 0.2s ease;
}

.cs-demo-banner:hover {
  background: rgba(99, 59, 72, 0.12);
}

.cs-demo-banner__text {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-primary);
}

.cs-demo-banner__btn {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  background: var(--color-pink-text-strong);
  color: #fff;
  border-radius: 12px;
  transition: opacity 0.2s ease;
}

.cs-demo-banner:hover .cs-demo-banner__btn {
  opacity: 0.9;
}

/* Feature blocks inside Solution */
.cs-feature {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}
.cs-feature:first-child { margin-top: 8px; }

.cs-feature-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

/* Rule applies (secondary text below rule card) */
.cs-rule-applies {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: #777;
  margin: 12px 0 0 0;
}

.cs-rule-applies__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b3a52;
}

.cs-rule-applies__icon svg {
  width: 16px;
  height: 16px;
}

/* Before / After */
.cs-before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cs-ba-card {
  background: rgba(0,0,0,0.035);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-ba-card--after {
  background: rgba(99, 59, 72, 0.07);
}

.cs-ba-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
}

.cs-ba-label--after {
  color: #8b3a52;
}

.cs-ba-body {
  font-size: 15px;
  line-height: 1.55;
  color: #444;
  margin: 0;
}

/* Impact cards (Problem section) */
.cs-impact-intro {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.2px;
  margin: 0;
}

.cs-impact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.cs-impact-intro + .cs-impact-cards {
  margin-top: 8px;
}

.cs-impact-card {
  background: rgba(0,0,0,0.035);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.cs-impact-card__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b3a52;
}

.cs-impact-card__icon svg {
  width: 24px;
  height: 24px;
}

.cs-impact-card__text {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-primary);
  margin: 0;
}

@media (max-width: 600px) {
  .cs-impact-cards {
    grid-template-columns: 1fr;
  }
}

/* Stats */
.cs-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.cs-stat {
  flex: 1;
  min-width: 140px;
  background: rgba(99, 59, 72, 0.07);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-stat__number {
  font-size: 30px;
  font-weight: 600;
  color: #8b3a52;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.cs-stat__label {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

.cs-ship-date {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0 0 24px 0;
}

/* Numbered list (Problem / Learnings) */
.cs-numbered-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
  counter-reset: cs-counter;
  margin-top: 8px;
}

.cs-numbered-item {
  counter-increment: cs-counter;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 40px;
  position: relative;
}

.cs-numbered-item::before {
  content: counter(cs-counter);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(99, 59, 72, 0.1);
  color: #8b3a52;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-numbered-item__title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.2px;
}

.cs-numbered-item__body {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  color: #777;
  margin: 0;
}

/* Bullet list (Role / Outcomes) */
.cs-bullet-list {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-bullet-list li {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-primary);
  padding-left: 20px;
  position: relative;
}

.cs-bullet-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c97a9a;
}

/* Responsive — case study */
@media (max-width: 1024px) {
  .main-content--cs {
    flex-direction: column;
    padding-top: 72px;
  }

  .cs-content-wrapper {
    padding-top: 40px;
  }

  .cs-content {
    max-width: min(720px, 100%);
    gap: 60px;
  }

  .cs-title { font-size: 32px; }
}

@media (max-width: 600px) {
  .cs-content-wrapper {
    padding-top: 32px;
  }

  .cs-meta-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cs-demo-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

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

  .cs-stats {
    flex-direction: column;
  }

  .name--cs { font-size: 36px; }
}
