/* ============================================
   KEITH VILLANUEVA — PORTFOLIO
   ============================================
   1.  Reset & Base
   2.  Custom Properties
   3.  Typography Utilities
   4.  Layout Utilities / Buttons
   5.  Navigation
   6.  Hero
   7.  About
   8.  Work / Case Studies
   9.  Philosophy Quote
   10. Skills
   11. Experience & Education
   12. Contact
   13. Footer
   14. Scroll Animations
   15. Responsive
   ============================================ */


/* ============================================
   1. Reset & Base
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

ul { list-style: none; }
em { font-style: italic; }


/* ============================================
   2. Custom Properties
   ============================================ */
:root {
  /* Brand — pulled from headshot background */
  --teal:        #1ABDB7;
  --teal-dark:   #0F8A86;
  --teal-mid:    #7ED9D5;
  --teal-light:  #E4F7F6;

  /* Surfaces */
  --bg:          #FAFAF8;
  --surface:     #FFFFFF;
  --surface-alt: #F5F5F2;

  /* Text */
  --text-primary:   #1A1A1A;
  --text-secondary: #595959;
  --text-muted:     #9A9A9A;

  /* Borders */
  --border:         #E6E6E4;
  --border-light:   #F0F0EE;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --section-pad:      clamp(80px, 10vw, 140px);
  --container-width:  1200px;
  --container-pad:    clamp(24px, 5vw, 64px);

  /* Motion */
  --ease-fast: 0.15s ease;
  --ease-base: 0.3s ease;
  --ease-slow: 0.6s ease;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.11), 0 4px 14px rgba(0,0,0,0.06);
}


/* ============================================
   3. Typography Utilities
   ============================================ */
.section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: 16px;
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.08;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.section-intro {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 520px;
  font-weight: 300;
}


/* ============================================
   4. Layout Utilities / Buttons
   ============================================ */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.025em;
  transition: background var(--ease-base), color var(--ease-base),
              border-color var(--ease-base), transform var(--ease-base),
              box-shadow var(--ease-base);
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.btn--primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.btn--primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn--ghost:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  transform: translateY(-2px);
}

.btn--large {
  padding: 16px 32px;
  font-size: 15px;
}

.tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: var(--teal-light);
  padding: 4px 10px;
  border-radius: 2px;
}


/* ============================================
   5. Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 22px 0;
  transition: background var(--ease-base), box-shadow var(--ease-base), padding var(--ease-base);
}

.nav--scrolled {
  background: rgba(250, 250, 248, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
  padding: 15px 0;
}

.nav__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  transition: color var(--ease-fast);
  flex-shrink: 0;
}
.nav__logo:hover { color: var(--teal-dark); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
  transform: translateX(100px);
}

.nav__link {
  font-size: 28px;
  font-weight: 400;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.02em;
  position: relative;
  transition: color var(--ease-fast);
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 100%;
  height: 1.5px;
  background: #ffffff;
  transition: right var(--ease-base);
}
.nav__link:hover,
.nav__link--active { color: #ffffff; }
.nav__link:hover::after,
.nav__link--active::after { right: 0; }

.nav__social-link {
  display: inline-flex;
  width: 40px;
  height: 40px;
  color: #ffffff;
  transition: color var(--ease-fast), transform var(--ease-fast);
}
.nav__social-link svg {
  width: 100%;
  height: 100%;
  display: block;
}
.nav__social-link rect {
  fill: currentColor;
  stroke: none;
}
.nav__social-link path {
  fill: var(--text-primary);
}
.nav__social-link:hover {
  color: rgba(255,255,255,0.7);
  transform: translateY(-1px);
}

/* Restore dark colors once background fades in */
.nav--scrolled .nav__link { color: var(--text-secondary); }
.nav--scrolled .nav__link::after { background: var(--teal); }
.nav--scrolled .nav__link:hover,
.nav--scrolled .nav__link--active { color: var(--text-primary); }
.nav--scrolled .nav__social-link { color: var(--text-secondary); }
.nav--scrolled .nav__social-link path { fill: var(--bg); }
.nav--scrolled .nav__social-link:hover { color: var(--text-primary); }

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 201;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform var(--ease-base), opacity var(--ease-base);
  transform-origin: center;
}

/* Open state */
.nav--open .nav__toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav--open .nav__toggle span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav--open .nav__toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav--open .nav__links {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  inset: 0;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  gap: 48px;
  z-index: 200;
}
.nav--open .nav__link {
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 400;
  color: var(--text-primary);
}
.nav--open .nav__link::after { display: none; }


/* ============================================
   6. Hero
   ============================================ */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 55% 45%;
}

.hero__content {
  display: flex;
  align-items: center;
  /* Align left edge to container boundary */
  padding-top: 120px;
  padding-bottom: 80px;
  padding-right: 60px;
  padding-left: max(var(--container-pad), calc((100vw - var(--container-width)) / 2 + var(--container-pad)));
}

.hero__text {
  max-width: 520px;
}

/* "Available for Work" badge */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: var(--teal-light);
  padding: 7px 16px;
  border-radius: 100px;
  margin-bottom: 40px;
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  animation: dot-pulse 2.2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(60px, 7.5vw, 100px);
  font-weight: 300;
  line-height: 0.96;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 22px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.4vw, 30px);
  font-weight: 400;
  font-style: italic;
  color: var(--teal-dark);
  line-height: 1.3;
  margin-bottom: 34px;
}

.hero__quote {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.8;
  border-left: 2px solid var(--teal-mid);
  padding-left: 20px;
  margin-bottom: 52px;
  max-width: 400px;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* Image panel — bg matches headshot exactly */
.hero__image-panel {
  background: #1ABDB7;
  overflow: hidden;
  position: relative;
}

.hero__image-wrap {
  width: 100%;
  height: 100%;
}

.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
  display: block;
}

/* Fallback when no image */
.hero__image-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1ABDB7 0%, #0F8A86 100%);
  z-index: 0;
}
.hero__photo { position: relative; z-index: 1; }


/* ============================================
   7. About
   ============================================ */
.about {
  padding: var(--section-pad) 0;
  background: var(--surface);
}

.about__inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 80px;
  align-items: start;
}

.about__sidebar {
  position: sticky;
  top: 100px;
}

.about__meta {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about__detail-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.about__detail-value {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.55;
}

.about__body {
  max-width: 640px;
}

.about__lead {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 28px;
}

.about__body > p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 22px;
}
.about__body > p:last-child { margin-bottom: 0; }


/* ============================================
   8. Toolbox
   ============================================ */
.toolbox {
  padding: var(--section-pad) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.toolbox__header {
  margin-bottom: 64px;
}

.toolbox__item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
  padding: 64px 0;
  border-top: 1px solid var(--border);
}
.toolbox__item:last-child {
  border-bottom: 1px solid var(--border);
}

.toolbox__item--flip .toolbox__text { order: 2; }
.toolbox__item--flip .toolbox__media { order: 1; }

.toolbox__use-in {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.toolbox__use-in-topic {
  color: var(--teal-dark);
}

.toolbox__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 20px;
}

.toolbox__desc {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-secondary);
  font-weight: 300;
}

.toolbox__media img {
  width: 100%;
  border-radius: 3px;
  display: block;
}

.toolbox__media figure figcaption {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Diagonal three-image stack */
.toolbox__eye-stack {
  position: relative;
  padding-bottom: 44px;
  padding-right: 44px;
}

.toolbox__eye-stack img {
  width: calc(100% - 44px);
  border-radius: 4px;
  display: block;
}

.toolbox__eye-stack img:nth-child(1) {
  position: relative;
  z-index: 3;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}

.toolbox__eye-stack img:nth-child(2) {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 2;
  box-shadow: 0 4px 18px rgba(0,0,0,0.13);
}

.toolbox__eye-stack img:nth-child(3) {
  position: absolute;
  top: 44px;
  left: 44px;
  z-index: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.toolbox__media-caption {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.toolbox__media--trio {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: flex-start;
}
.toolbox__media--trio img {
  flex: 1 1 0;
  width: 0 !important;
  min-width: 0;
}

.toolbox__media--duo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}
.toolbox__media--duo img:last-child {
  width: 120px;
}

/* ============================================
   9. Work / Case Studies
   ============================================ */
.work {
  padding: var(--section-pad) 0;
  background: var(--bg);
}

.work__header {
  margin-bottom: 60px;
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.work__grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.case-card {
  background: var(--surface);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform var(--ease-base), box-shadow var(--ease-base);
  position: relative;
}
.case-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.case-card--accent {
  background: var(--teal-light);
}
.case-card--accent .tag {
  background: rgba(255,255,255,0.75);
}

.case-card__number {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.case-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-card__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 27px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
}

.case-card__org {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.case-card__desc {
  font-size: 15px;
  line-height: 1.78;
  color: var(--text-secondary);
  font-weight: 300;
  flex: 1;
}

.case-card__outcomes {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 20px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.outcome {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}
.outcome::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--teal);
}

.case-card__cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--teal-dark);
  letter-spacing: 0.02em;
  align-self: flex-start;
  transition: color var(--ease-fast), letter-spacing var(--ease-base);
  margin-top: 4px;
}
.case-card__cta:hover {
  color: var(--teal);
  letter-spacing: 0.04em;
}


/* ============================================
   9. Philosophy Quote
   ============================================ */
.philosophy {
  padding: var(--section-pad) 0;
  background: var(--text-primary);
}

.philosophy__inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.philosophy__quote-mark {
  display: block;
  font-family: var(--font-display);
  font-size: 140px;
  line-height: 0.6;
  color: var(--teal);
  opacity: 0.5;
  margin-bottom: 40px;
  user-select: none;
}

.philosophy__text {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 36px;
}

.philosophy__attribution {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-mid);
}


/* ============================================
   10. Skills
   ============================================ */
.skills {
  padding: var(--section-pad) 0;
  background: var(--surface);
}

.skills .section-title {
  margin-bottom: 64px;
}

.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 64px;
}

.skills__group-title {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.skills__list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.skills__list li {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: color var(--ease-fast);
}
.skills__list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  opacity: 0.7;
}
.skills__list li:hover { color: var(--text-primary); }


/* ============================================
   11. Experience & Education
   ============================================ */
.experience {
  padding: var(--section-pad) 0;
  background: var(--bg);
}

.timeline {
  margin-top: 60px;
}

.timeline__item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 60px;
  padding: 52px 0;
  border-top: 1px solid var(--border);
}
.timeline__item:last-of-type {
  border-bottom: 1px solid var(--border);
}

.timeline__date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding-top: 6px;
  line-height: 1.5;
}

.timeline__role {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.1;
}

.timeline__org {
  font-size: 13px;
  font-weight: 400;
  color: var(--teal-dark);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.timeline__bullets {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.timeline__bullets li {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
}
.timeline__bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--teal);
}

/* Education */
.education {
  padding-top: 8px;
}

.education__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 32px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.education__degree {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.education__school {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.5;
}


/* ============================================
   12. Contact
   ============================================ */
.contact {
  padding: var(--section-pad) 0;
  background: var(--surface);
}

.contact__inner {
  max-width: 680px;
}

.contact__title {
  font-family: var(--font-display);
  font-size: clamp(52px, 6.5vw, 88px);
  font-weight: 300;
  line-height: 1.0;
  color: var(--text-primary);
  margin: 16px 0 28px;
}

.contact__text {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 48px;
}

.contact__actions {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: flex-start;
}

.contact__social {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.social-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  position: relative;
  transition: color var(--ease-fast);
}
.social-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 100%;
  height: 1px;
  background: var(--teal);
  transition: right var(--ease-base);
}
.social-link:hover { color: var(--text-primary); }
.social-link:hover::after { right: 0; }


/* ============================================
   13. Footer
   ============================================ */
.footer {
  padding: 28px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
}

.footer__copy {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}


/* ============================================
   14. Scroll Animations
   ============================================ */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

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

/* Stagger children inside a visible parent */
.work__grid .case-card.is-visible:nth-child(2) { transition-delay: 0.1s; }

.skills__grid .skills__group.is-visible:nth-child(2) { transition-delay: 0.1s; }
.skills__grid .skills__group.is-visible:nth-child(3) { transition-delay: 0.2s; }


/* ============================================
   15. Responsive
   ============================================ */

/* — Tablet landscape — */
@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 58% 42%;
  }
  .about__inner {
    grid-template-columns: 180px 1fr;
    gap: 56px;
  }
}

/* — Tablet portrait — */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero__image-panel {
    height: 55vw;
    min-height: 280px;
    order: -1;
  }
  .hero__content {
    padding: 60px var(--container-pad) 80px;
    padding-left: var(--container-pad);
  }
  .hero__text { max-width: 100%; }

  .about__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about__sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 40px;
    align-items: start;
  }
  .about__sidebar .section-label {
    grid-column: 1 / -1;
  }
  .about__meta {
    display: contents;
  }

  .toolbox__item {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 48px 0;
  }
  .toolbox__item--flip .toolbox__text { order: 1; }
  .toolbox__item--flip .toolbox__media { order: 2; }
  .toolbox__media--duo {
    grid-template-columns: 1fr;
  }
  .toolbox__media--duo img:last-child {
    width: 100%;
  }

  .work__grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .skills__grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .timeline__item {
    grid-template-columns: 130px 1fr;
    gap: 32px;
  }

  .education__grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

/* — Mobile — */
@media (max-width: 640px) {
  :root {
    --section-pad: 72px;
  }

  .nav__links { display: none; }
  .nav__social-link { display: none; }
  .nav__toggle { display: flex; }

  .hero__image-panel {
    height: 65vw;
  }

  .skills__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .education__grid {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .contact__social {
    flex-direction: column;
    gap: 14px;
  }

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

  .btn { width: 100%; justify-content: center; }
}

/* ============================================
   16. Case Study Pages
   ============================================ */
.cs-hero {
  padding: calc(var(--section-pad) + 80px) 0 var(--section-pad);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.cs-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 48px;
  transition: color var(--ease-fast);
}
.cs-hero__back:hover { color: var(--teal-dark); }

.cs-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.cs-hero__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 400;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.cs-hero__org {
  font-size: 14px;
  font-weight: 400;
  color: var(--teal-dark);
  letter-spacing: 0.03em;
  margin-bottom: 40px;
}

.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.cs-meta__item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cs-meta__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cs-meta__value {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.55;
}

.cs-body {
  padding: var(--section-pad) 0;
  background: var(--bg);
}

.cs-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 80px;
  align-items: start;
}

.cs-toc {
  position: sticky;
  top: 100px;
}

.cs-toc__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: block;
}

.cs-toc__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cs-toc__link {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
  transition: color var(--ease-fast);
}
.cs-toc__link:hover { color: var(--teal-dark); }

.cs-content {
  max-width: 700px;
}

.cs-section {
  margin-bottom: 72px;
  padding-bottom: 72px;
  border-bottom: 1px solid var(--border-light);
}
.cs-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cs-section__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: 12px;
  display: block;
}

.cs-section__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 24px;
  line-height: 1.15;
}

.cs-subsection-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 36px 0 14px;
}

.cs-section p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 20px;
}
.cs-section p:last-child { margin-bottom: 0; }

.cs-quote {
  border-left: 2px solid var(--teal);
  padding: 16px 24px;
  margin: 28px 0;
  background: var(--surface);
  border-radius: 0 3px 3px 0;
}

.cs-quote__text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.55;
  margin-bottom: 8px !important;
}

.cs-quote__attr {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.cs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.cs-list li {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.65;
  padding-left: 20px;
  position: relative;
}
.cs-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--teal);
}

.cs-findings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin: 28px 0;
}

.cs-findings__group {
  background: var(--surface);
  padding: 28px 32px;
}
.cs-findings__group--good { border-top: 3px solid var(--teal); }
.cs-findings__group--bad  { border-top: 3px solid var(--border); }

.cs-findings__title {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.cs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.cs-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.cs-table td {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  background: var(--surface);
}
.cs-table tr:last-child td { border-bottom: none; }

.cs-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 28px;
  background: var(--surface);
  border-left: 3px solid var(--teal);
}

.cs-stat__number {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  color: var(--teal-dark);
  line-height: 1;
}

.cs-stat__label {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cs-stats-row {
  display: flex;
  gap: 2px;
  margin: 24px 0;
}
.cs-stats-row .cs-stat { flex: 1; }

.cs-hero-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-bottom: 1px solid var(--border);
}

.cs-img {
  width: 100%;
  display: block;
  border-radius: 3px;
  margin: 28px 0 8px;
}

.cs-img--contained {
  max-width: 480px;
}

.cs-img-caption {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  line-height: 1.5;
  margin-bottom: 20px;
}

.cs-img-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 28px 0;
}

.cs-img-group figure,
.cs-img-group-3 figure {
  margin: 0;
}

.cs-img-group-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}

.cs-img-group figure img,
.cs-img-group-3 figure img {
  width: 100%;
  display: block;
  border-radius: 3px;
}

.cs-img-group figcaption,
.cs-img-group-3 figcaption {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

.cs-participants {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 28px 0;
}

.cs-participant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.cs-participant img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.cs-participant__name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.cs-inline-img {
  float: right;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  margin: 0 0 16px 28px;
}

@media (max-width: 900px) {
  .cs-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .cs-toc { display: none; }
  .cs-findings { grid-template-columns: 1fr; }
  .cs-stats-row { flex-direction: column; }
  .cs-content { max-width: 100%; }
  .cs-img-group,
  .cs-img-group-3 { grid-template-columns: 1fr; }
  .cs-participants { grid-template-columns: repeat(2, 1fr); }
  .cs-inline-img { float: none; display: block; margin: 0 auto 20px; }
}


/* — Small mobile — */
@media (max-width: 400px) {
  .hero__name {
    font-size: clamp(44px, 13vw, 60px);
  }
}
