@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&family=Space+Grotesk:wght@300..700&display=swap');

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

:root {
  font-size: 100%;

  /* ── Apple Grey Scale ──────────────────── */
  --grey-25:  #fafafa;
  --grey-50:  #f5f5f7;
  --grey-100: #e8e8ed;
  --grey-200: #d2d2d7;
  --grey-300: #b8b8bd;
  --grey-400: #98989d;
  --grey-500: #6e6e73;
  --grey-600: #515154;
  --grey-700: #3a3a3c;
  --grey-800: #2c2c2e;
  --grey-900: #1d1d1f;

  /* ── Semantic aliases (light) ──────────── */
  --bg-color:           #ffffff;
  --bg-grey:            var(--grey-25);
  --bg-color-card:      var(--grey-900);
  --bg-color-section:   var(--grey-25);
  --bg-footer:          var(--grey-25);
  --footer-bg:          var(--grey-25);

  --text-color:         var(--grey-700);
  --text-white:         #ffffff;
  --text-button-primary:#ffffff;
  --text-color-grey:    var(--grey-600);
  --text-metrics:       var(--grey-900);
  --text-brand:         var(--grey-900);

  --grid-color:         hsl(0, 0%, 86%);
  --nav-bg:             hsla(0, 0%, 97%, 0.243);

  /* Borders */
  --border-text:        var(--grey-900);
  --border-grey-100:    var(--grey-200);
  --border-grey-200:    var(--grey-100);
  --border-link-grey:   var(--grey-500);

  /* Buttons */
  --bg-button-primary:  var(--grey-900);
  --bg-btn-sec:         var(--grey-200);
  --btn-hover-sec:      var(--grey-300);

  /* Badge */
  --bg-badge:           var(--grey-100);
  --text-badge:         var(--grey-600);

  /* Blinker */
  --bg-color-circleblinker: hsl(93, 77%, 42%);

  /* Shadows */
  --boxshadow-button:   var(--grey-900);

  /* Legacy aliases kept for compatibility */
  --brand-color:        var(--grey-900);
  --text-color-eversend: var(--grey-700);
  --border-link-eversend: var(--grey-400);
}

.dark-mode {
  /* ── Dark semantic overrides ───────────── */
  --bg-color:           hsl(0, 0%, 8%);
  --bg-grey:            hsl(0, 0%, 12%);
  --bg-color-card:      hsl(0, 0%, 14%);
  --bg-color-section:   hsl(0, 0%, 12%);
  --bg-footer:          hsl(0, 0%, 10%);
  --footer-bg:          hsl(0, 0%, 10%);

  --text-color:         hsl(0, 0%, 72%);
  --text-white:         #ffffff;
  --text-button-primary:#ffffff;
  --text-color-grey:    hsl(0, 0%, 60%);
  --text-metrics:       #ffffff;
  --text-brand:         #ffffff;

  --grid-color:         hsl(0, 0%, 18%);
  --nav-bg:             hsla(0, 0%, 8%, 0.7);

  --border-text:        hsl(0, 0%, 80%);
  --border-grey-100:    hsl(0, 0%, 22%);
  --border-grey-200:    hsl(0, 0%, 18%);
  --border-link-grey:   hsl(0, 0%, 45%);
  --border-link-eversend: hsl(0, 0%, 45%);

  --bg-button-primary:  #ffffff;
  --bg-btn-sec:         hsl(0, 0%, 22%);
  --btn-hover-sec:      hsl(0, 0%, 28%);

  --bg-badge:           hsl(0, 0%, 18%);
  --text-badge:         hsl(0, 0%, 65%);

  --bg-color-circleblinker: hsl(93, 77%, 52%);
  --boxshadow-button:   hsl(0, 0%, 5%);

  /* Legacy */
  --brand-color:        #ffffff;
  --text-color-eversend: hsl(0, 0%, 75%);
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  line-height: 1.5;
  background: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.5s, color 0.5s;
}

.main-container {
  scroll-snap-type: y proximity;
  overflow-y: scroll;
  height: 100vh;
}

.page-section {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

/* Body Mode Classes */
body.hero-mode {
  overflow: auto;
  height: auto;
}

body.portfolio-mode {
  overflow: auto;
  height: auto;
}

/* Theme switcher icon visibility — show only the relevant icon */
.dark-icon,
.light-icon {
  transition: color 0.15s ease;
}

/* Main container */
.main-container {
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.grid-background {
  --grid-line-alpha: 35%;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, color-mix(in srgb, var(--grid-color) var(--grid-line-alpha), transparent) 1px, transparent 1px),
    linear-gradient(to right, color-mix(in srgb, var(--grid-color) var(--grid-line-alpha), transparent) 1px, transparent 1px);
  background-position: 
    0 0,    
    24px 0; 
  background-size: 
    299px 100%,  
    299px 100%;  
  z-index: -999;
  pointer-events: none;
  opacity: 0; 
  animation: gridFadeIn 1.2s ease-out forwards; 
  animation-delay: 0.3s; 
}

.h1Copy {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5em;
  line-height: 130%;
  font-weight: 700;
  color: var(--text-color);
  max-width: 100%;
  margin: 0;
}

p {
  font-size: 1em;
  font-weight: 400;
  color: var(--text-color);
}

ul {
  margin: 0;
  padding-left: 1em;
}

li {
  color: var(--text-color);
  font-size: 0.875em;
  font-weight: 300;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.3s ease;
}

/*  NAVIGATION */

nav {
  width: 100%;
  height: 60px;
  margin: 0;
  padding: 0 2rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  background-color: hsla(0, 0%, 100%, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid hsla(0, 0%, 0%, 0.06);
  transition: background-color 0.3s ease;
}

.dark-mode nav {
  background-color: hsla(0, 0%, 10%, 0.82);
  border-bottom-color: hsla(0, 0%, 100%, 0.08);
}

.navContainer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  height: 100%;
  padding: 0;
  margin: 0 auto;
}

.Mslogo {
  list-style-type: none;
}

.Mslogo img {
  height: 30px;
  width: auto;
  display: block;
}

/* Social icons */
.socials {
  display: flex;
  align-items: center;
  gap: 2px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--grey-500);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.social-links a:hover {
  background-color: hsla(0, 0%, 0%, 0.05);
  color: var(--grey-900);
}

.dark-mode .social-links a {
  color: var(--grey-400);
}

.dark-mode .social-links a:hover {
  background-color: hsla(0, 0%, 100%, 0.08);
  color: #fff;
}

.nav-icon,
.theme-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--grey-800);
  transition: color 0.15s ease;
}

.nav-icon {
  display: block;
}

.social-links a:hover .nav-icon,
.theme-btn:hover .nav-icon {
  color: var(--grey-900);
}

.dark-mode .nav-icon {
  color: var(--grey-500);
}

.dark-mode .social-links a:hover .nav-icon,
.dark-mode .theme-btn:hover .nav-icon {
  color: #fff;
}

.theme-btn {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.theme-btn:hover {
  background-color: hsla(0, 0%, 0%, 0.06);
}

.dark-mode .theme-btn:hover {
  background-color: hsla(0, 0%, 100%, 0.1);
}

.theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Show only the correct icon per theme */
.theme-icon .light-icon { display: none; }
.theme-icon .dark-icon  { display: block; }

.dark-mode .theme-icon .dark-icon  { display: none; }
.dark-mode .theme-icon .light-icon { display: block; }

/* BACK BUTTON*/

.backBtnWrapper {
  display: flex;
  align-items: center;
  gap: 0.25em;
  margin: 0 0 1em 0;
  text-decoration: none;
  cursor: pointer;
  position: relative;
}

.bckBtn, .bckBtn a {
  border: none;
  padding: 0.5em 0;
  color: var(--text-color);
  text-decoration: none;
  transition: transform 0.4s ease-out;
  cursor: pointer;
  position: relative;
}

.bckBtn:hover {
  transform: translateX(4px);
}

.backBtnWrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 2.5em;
  width: 0;
  height: 2px;
  background-color: var(--bg-btn-sec);
  transition: width 0.4s ease-out;
  z-index: 1;
}

.backBtnWrapper:hover::after {
  width: fit-content;
}

.backBtnWrapper:hover .bckBtn {
  transform: translateX(4px);
}

.backIcon {
  transition: transform 0.4s ease-out;
  width: 24px;
  height: 24px;
}

.backBtnWrapper:hover .backIcon {
  transform: translateX(-4px);
}

/* Badge */
.ring-container {
  position: relative;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle {
  width: 10px;
  height: 10px;
  background-color: var(--bg-color-circleblinker);
  border-radius: 50%;
  position: absolute;
  z-index: 2;
}

.ringring {
  border: 2px solid var(--bg-color-circleblinker);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  position: absolute;
  animation: pulsate 1.5s ease-out infinite;
  opacity: 0;
  z-index: 1;
}

.workStatusContainer {
  color: var(--text-badge);
  background-color: var(--bg-badge);
  padding: 0.2em 0.8em 0.2em 0.3em;
  font-size: 0.875em;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 0.2em;
  white-space: nowrap;
}

.workstatusText {
  margin: 0;
  font-size: 0.8125em;
  font-weight: 500;
}

/* ========================================
   HAMBURGER BUTTON
   ======================================== */

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   MOBILE DRAWER
   ======================================== */

.mobile-drawer {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.drawer-panel {
  position: fixed;
  top: 8px;
  right: 8px;
  bottom: 8px;
  width: min(86vw, 360px);
  max-height: calc(100dvh - 16px);
  background: color-mix(in srgb, var(--bg-color) 92%, #ffffff 8%);
  z-index: 1999;
  transform: translateX(calc(100% + 16px));
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  box-shadow:
    0 22px 46px rgba(8, 15, 32, 0.2),
    0 8px 20px rgba(8, 15, 32, 0.12);
  overflow: hidden;
}

.mobile-drawer.open .drawer-backdrop {
  opacity: 1;
  pointer-events: all;
}

.mobile-drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  border-bottom: none;
  flex-shrink: 0;
}

.drawer-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-grey) 75%, transparent 25%);
  border: none;
  border-radius: 0;
  cursor: pointer;
  color: var(--text-color);
  padding: 4px;
  width: 40px;
  height: 40px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.drawer-close-btn:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--bg-grey) 88%, transparent 12%);
}

.drawer-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.drawer-list {
  display: flex;
  flex-direction: column;
  border-radius: 0;
  overflow: hidden;
  border: none;
  background: color-mix(in srgb, var(--bg-grey) 58%, transparent 42%);
}

.drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 14px 16px;
  color: var(--text-color);
  font-family: 'Manrope', sans-serif;
  font-size: 1.03rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.drawer-item + .drawer-item {
  border-top: none;
}

.drawer-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.drawer-item-left span {
  white-space: nowrap;
}

.drawer-theme-row {
  cursor: default;
}

.drawer-social-links {
  display: flex;
  flex-direction: column;
}

.drawer-social-links .drawer-item {
  cursor: pointer;
}

.drawer-social-links .drawer-item:hover {
  background: color-mix(in srgb, var(--bg-grey) 86%, transparent 14%);
}

.drawer-theme-row .theme-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: color-mix(in srgb, var(--bg-color) 76%, transparent 24%);
}

.drawer-switch {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.drawer-switch-track {
  width: 46px;
  height: 28px;
  border-radius: 0;
  border: none;
  background: rgba(120, 120, 128, 0.22);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.drawer-switch-thumb {
  width: 22px;
  height: 22px;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transform: translateX(0);
  transition: transform 0.2s ease;
}

.dark-mode .drawer-switch-track {
  background: #34C759;
  border-color: #34C759;
}

.dark-mode .drawer-switch-thumb {
  transform: translateX(18px);
}

.drawer-social-links .social-icon {
  width: 30px;
  height: 30px;
  border-radius: 0;
  flex-shrink: 0;
}

/* ========================================
   PAGE SECTIONS — viewport-height stages
   ======================================== */

.page-section {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* padding-top = nav height so flex centering lands below the nav, not behind it */
  padding: 52px clamp(1.5rem, 4vw, 3rem) 0;
  box-sizing: border-box;
  overflow: hidden;
}

/* Projects has many cards — expands naturally, snaps to top */
.page-section--projects {
  height: auto;
  min-height: 100vh;
  align-items: flex-start;
  overflow: visible;
  padding-top: 72px;
  padding-bottom: 4rem;
}

.section-content {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Hero: card has its own max-width */
.page-section--hero .section-content {
  max-width: 920px;
}

/* Metrics: stretch children to fill the content width */
.page-section--metrics .section-content {
  align-items: stretch;
}

/* Projects: wider grid */
.page-section--projects .section-content {
  max-width: 1100px;
  align-items: stretch;
}

/* Scroll indicator */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--grey-400);
  animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-indicator-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%       { opacity: 0.9; transform: translateY(5px); }
}

/* Wrapper to center the intro card */
.intro-card-wrapper {
  width: 100%;
  max-width: 920px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Chips Container */
.intro-chips {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.875rem;
  flex-wrap: wrap;
  padding: 0;
}

/* Individual Chip */
.chip {
  background-color: var(--bg-grey);
  color: var(--text-color);
  padding: 0.2rem 0.75rem;
  border-radius: 24px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.8;
  white-space: nowrap;
  border: 1px solid var(--border-grey-200);
}

.dark-mode .chip {
  background-color: hsl(230, 15%, 25%);
  color: var(--text-color);
}

/* Intro Card */
.intro-card {
  max-width: 920px;
  width: 100%;
  position: relative;
  border-radius: 28px;
  overflow: hidden;
}

.intro-card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.introAbout {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(145deg, hsl(215, 16%, 14%), hsl(218, 18%, 11%));
  border: 1px solid hsla(0, 0%, 100%, 0.08);
  padding: 1.5rem;
  border-radius: 28px 28px 0 0;
  position: relative;
  z-index: 2;
}

/* Video Container */
.introVideoContainer {
  width: 200px;
  height: auto;
  align-self: stretch;
  border-radius: 34px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  background-color: #000;
  border: 1px solid hsla(0, 0%, 100%, 0.12);
}

.introVideo {
  width: 100%;
  height: 100%;
  min-height: 156px;
  object-fit: cover;
  border-radius: 34px;
  display: block;
}

.introVideoContainer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1);
  pointer-events: none;
  border-radius: 32px;
}

.introImage {
  width: 80px;
  height: 80px;
  border-radius: 32px;
  flex-shrink: 0;
}

.hero-copy {
  flex: 1;
  max-width: 58ch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

.hero-headline {
  margin: 0;
  color: var(--text-white);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-support {
  margin: 0;
  color: hsl(0, 0%, 68%);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.hero-support--closer {
  color: hsl(0, 0%, 78%);
  font-style: italic;
}

.hero-inline-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: hsla(0, 0%, 100%, 0.35);
  transition: text-decoration-color 0.2s ease;
}

.hero-inline-link:hover {
  text-decoration-color: hsla(0, 0%, 100%, 0.9);
}

.experience-text {
  color: hsl(0, 0%, 70%);
}

.text {
  font-weight: 700;
  color: var(--text-white);
}
.years {
  font-weight: 700;
  color: var(--text-white);
}

/* Impact Button (Grey Version) */
.impact-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  background-color: var(--grey-700);
  color: var(--text-white);
  border: none;
  border-top: 1px solid hsla(0, 0%, 100%, 0.08);
  padding: 1.125rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.22s ease;
  font-family: inherit;
  border-radius: 0;
  position: relative;
  z-index: 1;
}

.impact-button:hover {
  background-color: var(--grey-700);
}

.impact-button:active {
  background-color: var(--grey-800);
}

.impact-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.impact-icon {
  display: flex;
  align-items: center;
  width: 20px;
  height: 20px;
}

.impact-icon img {
  width: 100%;
  height: 100%;
}

.impact-text {
  font-size: 1rem;
  font-weight: 600;
}

.impact-arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.impact-button:hover .impact-arrow {
  transform: translateX(2px);
}

/* Hero intro CTA bar only */
#showPortfolioBtnHero {
  width: calc(100% - 48px);
  margin: 0 24px;
  border-radius: 18px;
  background-color: #6b6b6d;
  border-top: none;
  padding: 1.15rem 1.6rem;
}

#showPortfolioBtnHero .impact-left {
  gap: 0.75rem;
}

#showPortfolioBtnHero .impact-icon {
  width: 24px;
  height: 24px;
}

#showPortfolioBtnHero .impact-text {
  font-weight: 700;
}

#showPortfolioBtnHero:hover {
  background-color: #666669;
}

#showPortfolioBtnHero:active {
  background-color: #5f5f62;
}

.hero-secondary-link {
  margin: 0.75rem 0 0 1rem;
  width: fit-content;
  color: var(--text-color);
  opacity: 0.68;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.hero-secondary-link:hover {
  opacity: 1;
  border-bottom-color: var(--text-color);
}

/* ========================================
   THUMBNAIL GALLERY - MOVED TO BOTTOM
   ======================================== */

.thumbnail-gallery {
  width: 100%;
  text-align: left;
  padding: 2.5rem 2.5rem 0;
  background: var(--grey-25);
  border-radius: 24px;
  margin-top: 0;
}

.dark-mode .thumbnail-gallery {
  background: hsl(230, 15%, 12%);
}

.thumbnail-gallery-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.thumbnail-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--grey-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.dark-mode .thumbnail-title {
  color: #f5f5f7;
}

.thumbnail-subtitle {
  font-size: 0.875rem;
  color: var(--grey-500);
  margin: 0;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.thumbnail-card {
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--grey-100);
  border: 1px solid var(--grey-100);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.thumbnail-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s ease;
  pointer-events: none;
}

.thumbnail-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.1);
}

.thumbnail-card:hover::after {
  background: rgba(0, 0, 0, 0.06);
}

.dark-mode .thumbnail-card {
  background-color: hsl(228, 14%, 18%);
  border-color: rgba(255, 255, 255, 0.12);
}

.dark-mode .thumbnail-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  filter: saturate(1.06) contrast(1.02);
}

.thumbnail-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.start-gallery-btn {
  grid-column: 1 / -1;
  width: fit-content;
  justify-self: start;
  aspect-ratio: unset;
  background: var(--grey-900);
  color: var(--text-white);
  border: none;
  padding: 0.8rem 1.35rem;
  border-radius: 980px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.01em;
}

.start-gallery-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* ========================================
   FULL PORTFOLIO SECTION (Hidden by Default)
   ======================================== */

.full-portfolio-section {
  width: 100%;
  display: none;
  padding-top: 80px;
}

.full-portfolio-section.active {
  display: block;
}

/* ========================================
   CASE STUDIES SECTION
   ======================================== */

.case-studies-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}

.case-studies-header {
  margin-bottom: 1.5rem;
  text-align: left;
}

.case-studies-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--grey-900);
  margin: 0 0 0.25rem 0;
}
.dark-mode .case-studies-title {
  color: var(--text-color);
}

.case-studies-subtitle {
  font-size: 0.875rem;
  color: var(--grey-500);
  margin: 0;
}

.case-studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 3rem;
  width: 100%;
}

.case-study-card-link {
  display: flex;
  flex-direction: column;
}

.case-study-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  background-color: #ffffff;
  border: 1px solid #e8e8ed;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.dark-mode .case-study-card {
  background-color: var(--bg-grey);
  border-color: var(--border-grey-200);
}

.case-study-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.project-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
}

.project-tag--case-study {
  background-color: var(--grey-900);
  color: #fff;
}

.project-tag--read-time {
  background-color: var(--grey-100);
  color: var(--grey-600);
}

.project-tag--ui-screens {
  background-color: var(--grey-100);
  color: var(--grey-600);
}

.case-study-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--bg-grey);
  padding: 1.5rem;
}

.case-study-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.case-study-content {
  padding: 2rem 1.5rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
}

.case-study-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: #000;
  margin: 0;
}
.dark-mode .case-study-title {
  color: var(--text-color);
}

.case-study-description {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #6e6e73;
  margin: 0;
}
.dark-mode .case-study-description {
  color: var(--text-color-grey);
}

.case-study-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-brand);
  text-decoration: none;
  margin-top: auto;
  transition: all 0.3s ease;
}

.case-study-link:hover {
  gap: 1.25rem;
}

.case-study-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.case-study-link:hover svg {
  transform: translateX(4px);
}

.dark-mode .case-study-image {
  background-color: hsl(230, 15%, 12%);
}

/* ========================================
   ACHIEVEMENT SECTION
   ======================================== */

.achievement-section-wrapper {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 3rem 3rem 3.5rem;
  background: var(--grey-25);
  border-radius: 24px;
}

.dark-mode .achievement-section-wrapper {
  background: hsl(230, 15%, 12%);
}

/* Hero entrance animations handled by GSAP in homepage-scroll.js */

.achievement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0 0 2.5rem 0;
  width: 100%;
  gap: 2rem;
}

.achievement-title-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.achievement-subtitle {
  font-size: 0.9375rem;
  color: var(--text-color);
  opacity: 0.55;
  margin: 0;
  font-weight: 400;
}

.close-achievements-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background-color: var(--grey-900);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.close-achievements-btn:hover {
  background-color: var(--grey-700);
  transform: scale(1.1);
}

.close-achievements-btn:active {
  transform: scale(0.95);
}

.close-achievements-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-white);
}

.achievement-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.achievement-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.achievement-item {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  gap: 0.4rem;
}

.achievement-metric {
  font-size: 2.75rem;
  font-weight: 700;
  color: #1d1d1f;
  line-height: 1;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.dark-mode .achievement-metric {
  color: #f5f5f7;
}

.achievement-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 0.25rem;
  display: block;
  line-height: 1.3;
}

.dark-mode .achievement-label {
  color: #f5f5f7;
}

.achievement-description {
  font-size: 0.875rem;
  font-weight: 400;
  color: #6e6e73;
  line-height: 1.55;
  margin: 0;
}

/* ========================================
   TOOLS SECTION
   ======================================== */

.tools {
  background-color: var(--bg-color-section);
  margin: 0 5em;
  padding: 2em 2em 4em 2em;
  border-radius: 8px 8px 0 0;
}

.ToolsTitle {
  font-size: 1.5rem;
  line-height: 120%;
  font-weight: 400;
  color: var(--text-color);
  margin-bottom: 1em;
}

.toolListContainer {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolIcon {
  width: 18px;
  height: auto;
}

.toolIconTextContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--border-grey-100);
  padding: 0.5em 1em;
  border-radius: 8px;
}

.toolName {
  margin: 0;
}

/* ========================================
   FOOTER — rendered and styled by layout.js mountSiteFooter()
   ======================================== */

.main-container .site-footer {
  scroll-snap-align: start;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
}

@media (max-width: 1024px) {
  .page-section {
    padding: 80px 20px 2rem;
  }

  .case-studies-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 900px) {
}

@media (max-width: 768px) {
  body.hero-mode {
    overflow: auto;
    height: auto;
  }

  .page-section {
    padding: 80px 16px 3rem;
    min-height: auto;
  }

  .page-section--hero {
    min-height: 100vh;
  }

  /* Hero */
  .intro-card-wrapper {
    padding: 0;
    max-width: 100%;
  }

  .intro-card {
    border-radius: 20px;
  }

  .introAbout {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
    gap: 1rem;
    border-radius: 0;
  }

  .introVideoContainer {
    width: 80px;
    height: 80px;
    border-radius: 20px;
  }

  .introVideo {
    border-radius: 20px;
  }

  .hero-headline {
    font-size: 1.25rem;
    line-height: 1.35;
  }

  .hero-support {
    font-size: 0.875rem;
  }

  .intro-chips {
    gap: 0.4rem;
  }

  .chip {
    font-size: 0.7rem;
    padding: 0.2rem 0.625rem;
  }

  /* Metrics */
  .achievement-section-wrapper {
    padding: 1.75rem 1.25rem 2rem;
    border-radius: 20px;
  }

  .achievement-header {
    padding: 0;
    margin-bottom: 1.25rem;
  }

  .achievement-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 0;
  }

  .achievement-item {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    gap: 0.35rem;
  }

  .achievement-metric {
    font-size: 2rem;
  }

  .achievement-label {
    font-size: 0.8125rem;
  }

  .achievement-description {
    font-size: 0.75rem;
    line-height: 1.5;
  }

  /* Past projects */
  .case-studies-wrapper {
    padding: 0;
  }

  .case-studies-header {
    margin-bottom: 1.25rem;
  }

  .case-studies-title {
    font-size: 1.25rem;
  }

  .case-studies-subtitle {
    font-size: 0.8125rem;
  }

  .case-studies-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .case-study-image {
    padding: 1rem;
  }

  .case-study-content {
    padding: 1.25rem 1.25rem 1.5rem;
    gap: 1rem;
  }

  .case-study-title {
    font-size: 1rem;
  }

  .case-study-description {
    font-size: 0.8125rem;
  }

  .project-tags {
    gap: 0.375rem;
  }

  .project-tag {
    font-size: 0.625rem;
    padding: 0.2rem 0.5rem;
  }

  /* Nav */
  nav {
    padding: 0 16px;
  }

  .hamburger-btn {
    display: flex;
  }

  .mobile-drawer {
    display: block;
  }

  .theme-btn {
    display: none;
  }

  .social-links {
    display: none;
  }

}

@media (max-width: 480px) {
  .page-section {
    padding: 72px 12px 2.5rem;
  }

  .intro-card {
    border-radius: 18px;
  }

  .introAbout {
    padding: 1rem;
    gap: 0.875rem;
  }

  .introVideoContainer {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }

  .introVideo {
    border-radius: 16px;
  }

  .hero-headline {
    font-size: 1.1rem;
  }

  .hero-support {
    font-size: 0.8125rem;
  }

  .achievement-section-wrapper {
    padding: 1.25rem 1rem 1.75rem;
    border-radius: 18px;
  }

  .achievement-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .achievement-metric {
    font-size: 1.75rem;
  }

  .case-studies-grid {
    gap: 1rem;
  }

  .case-study-image {
    padding: 0.75rem;
  }

  .case-study-content {
    padding: 1rem;
    gap: 0.875rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .intro-chips,
  .introAbout,
  .impact-button,
  .hero-secondary-link {
    animation: none;
  }
}

@media (max-width: 360px) {
  .hero-headline {
    font-size: 1rem;
  }

  .hero-support {
    font-size: 0.8rem;
  }
}
