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

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

body {
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

em {
  font-style: italic;
}

/* ===================================================
   DESIGN TOKENS
   Apple's exact web palette
   =================================================== */
:root {
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --radius-card: 20px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================
   HERO — very subtle top radial wash, like apple.com
   =================================================== */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -5%, rgba(0, 113, 227, 0.16) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero>* {
  position: relative;
  z-index: 1;
}

/* Bottom fade — blobs dissolve smoothly into the about section's gray */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent 0%, #f5f5f7 100%);
  pointer-events: none;
  z-index: 0;
}

/* Particles canvas sits behind hero content */
#hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ===================================================
   TYPOGRAPHY UTILITIES
   =================================================== */
.section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.section-heading {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text-primary);
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

/* ===================================================
   BUTTONS
   Apple uses filled blue pill + ghost/outline pill only.
   No gradients.
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.5rem;
  border-radius: 980px;
  font-family: inherit;
  font-weight: 400;
  font-size: 17px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}

.btn--filled {
  background: #000;
  color: #fff;
}

.btn--filled:hover {
  background: #333;
  transform: none;
}

.btn--outline {
  background: transparent;
  color: #000;
  border: 1.5px solid #000;
}

.btn--outline:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #000;
}

.btn--full {
  width: 100%;
}

/* ===================================================
   HEADER — always-on liquid glass nav, Apple-style
   44px height, 12px nav links
   =================================================== */
.site-header {
  border-bottom: 1px solid var(--border);
}

/* Isolate frosted glass into its own background layer to prevent WebKit clipping */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* ===================================================
   WORDMARK
   =================================================== */
.wordmark {
  text-decoration: none;
}

@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotation {
  0% {
    --gradient-angle: 0deg;
  }

  100% {
    --gradient-angle: 360deg;
  }
}

@keyframes drift {
  0% {
    background-position: 0% 50%;
  }

  33% {
    background-position: 100% 80%;
  }

  66% {
    background-position: 50% 10%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.wordmark__tm {
  font-size: .42em;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: super;
  display: inline-block;
  transform: translateY(0.24em);
  color: #1d1d1f;
  -webkit-text-fill-color: #1d1d1f;
}

@keyframes tm-header-shift {
  0% { color: #4da2ff; -webkit-text-fill-color: #4da2ff; }
  12.5% { color: #7f93f3; -webkit-text-fill-color: #7f93f3; }
  25% { color: #ba83e7; -webkit-text-fill-color: #ba83e7; }
  37.5% { color: #dc68b8; -webkit-text-fill-color: #dc68b8; }
  50% { color: #ff4d88; -webkit-text-fill-color: #ff4d88; }
  62.5% { color: #ff816b; -webkit-text-fill-color: #ff816b; }
  75% { color: #ffb54d; -webkit-text-fill-color: #ffb54d; }
  87.5% { color: #a9ac9f; -webkit-text-fill-color: #a9ac9f; }
  100% { color: #4da2ff; -webkit-text-fill-color: #4da2ff; }
}

.site-header.is-scrolled .wordmark__tm {
  animation: tm-header-shift 14s ease-in-out infinite;
}




/* Desktop nav — flex row; hidden on mobile via media query below */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  /* equivalent to Tailwind gap-7 */
}

/* ===================================================
   NAV LINKS — Apple uses 12px, very restrained
   =================================================== */
.nav-link {
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.85);
  transition: color .15s;
  letter-spacing: -0.01em;
}

.nav-link:hover {
  color: #000;
}

.nav-link.active {
  color: #000;
  font-weight: 700;
}

/* ===================================================
   NAV TOGGLE
   =================================================== */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .2s var(--ease), opacity .2s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ===================================================
   SKILL LABELS & CHIPS
   =================================================== */
.skill-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.skill-chip {
  display: inline-block;
  padding: .3rem .85rem;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 400;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  transition: background .15s, border-color .15s, color .15s;
  cursor: default;
}

.skill-chip:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff;
}

/* ===================================================
   FEATURE EXPLORER — projects section
   Left text col + right media col, stacked vertically
   =================================================== */
.feature-list {
  display: flex;
  flex-direction: column;
}

.feature-item {
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: clamp(40px, 5vw, 80px);
  padding: 72px 0;
  border-top: 1px solid var(--border);
  align-items: center;
}

.feature-item:last-child {
  border-bottom: 1px solid var(--border);
}

.feature-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-item-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.feature-item-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-primary);
}

.feature-item-desc {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.feature-item-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-top: 0.25rem;
}

.feature-media {
  border-radius: 18px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.10);
}

@media (max-width: 768px) {
  .feature-item {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 36px 0;
  }
}

/* ===================================================
   CHAPTERS — Apple-style sticky scroll, projects section
   =================================================== */
.chapters-outer {
  position: relative;
  height: calc(6 * 85vh);
}

.chapters-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  gap: 20px;
  overflow: hidden;
}

/* Left text column */
.chapters-text-col {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.chapter-panel {
  position: absolute;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  pointer-events: none;
}

.chapter-panel.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.chapter-panel.is-exit {
  opacity: 0;
  transform: translateY(-28px);
}

.chapter-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--apple-blue);
  margin-bottom: 0.75rem;
}

.chapter-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  margin: 0.4rem 0 1rem;
}

.chapter-copy {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 360px;
  margin-bottom: 1.75rem;
}

.chapter-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

/* Right laptop column */
.chapters-laptop-col {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#laptop-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Progress dots */
.chapters-dots {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.chapter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.3s, transform 0.3s;
}

.chapter-dot.is-active {
  background: var(--apple-blue);
  transform: scale(1.5);
}

@media (max-width: 768px) {
  .chapters-outer {
    height: calc(6 * 110vh);
  }

  .chapters-sticky {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    padding: 50px 16px 0;
    gap: 0;
  }

  .chapters-laptop-col {
    height: 40vh;
  }

  .chapter-title {
    font-size: 1.6rem;
  }

  .chapter-copy {
    font-size: 15px;
    margin-bottom: 1.25rem;
  }
}


.link-primary {
  font-size: 15px;
  font-weight: 400;
  color: var(--apple-blue);
  text-decoration: none;
  transition: opacity .15s;
}

.link-primary:hover {
  opacity: .75;
}

.link-secondary {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color .15s;
}

.link-secondary:hover {
  color: var(--text-primary);
}


/* ===================================================
   CASE STUDY MODALS — frosted mini-webpage overlays
   =================================================== */
body.modal-open {
  overflow: hidden;
}

.case-modal-overlay[hidden] {
  display: none;
}

.case-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 36px);
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.case-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.case-modal {
  position: relative;
  width: min(980px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(251, 251, 253, 0.80);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.case-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
}

.case-modal__content {
  padding: clamp(20px, 3vw, 34px);
  display: grid;
  gap: 16px;
}

.case-modal__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-right: 56px;
}

.case-modal__title {
  font-size: clamp(1.6rem, 2.7vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.case-modal__intro {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

.case-modal__images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.case-modal__image {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #e2e2e7;
  aspect-ratio: 16 / 10;
}

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

.case-modal__keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-modal__pill {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.72);
  padding: 7px 11px;
  border-radius: 999px;
}

.case-modal__text-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.case-modal__story {
  display: grid;
  gap: 10px;
}

.case-modal__story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.case-modal__story-card {
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.case-modal__story-card h4 {
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.case-modal__story-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .case-modal {
    max-height: 92vh;
    border-radius: 16px;
  }

  .case-modal__images {
    grid-template-columns: 1fr;
  }

  .case-modal__story-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================================
   CONTACT LINKS
   =================================================== */
.contact-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}

.contact-link:hover {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.contact-link__icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ===================================================
   FORM ELEMENTS — Apple-style inputs
   Clean bordered, blue focus ring
   =================================================== */
.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.form-input {
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.form-input::placeholder {
  color: rgba(0, 0, 0, 0.28);
}

.form-input:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.form-status.success {
  color: #1d8348;
}

.form-status.error {
  color: #c0392b;
}

/* ===================================================
   FOOTER
   =================================================== */
#site-footer {
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
  padding: 7rem 1rem 4rem;
  user-select: none;
}

/* Wrapper sets the reference font-size for both word + TM */
.footer-brand-wrap {
  font-size: clamp(5rem, 21vw, 18rem);
  display: inline-block;
  position: relative;
  line-height: 1;
}

.footer-word {
  font-size: 1em;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1d1d1f;
  display: inline-block;
  line-height: 1;
  vertical-align: bottom;
}

/* Zero-width slot so TM floats freely to the right of "baldeo" */
.footer-tm-slot {
  display: inline-block;
  width: 0;
  overflow: visible;
  vertical-align: bottom;
  position: relative;
}

/* TM positioned absolutely — JS drives `bottom` in px */
#footer-tm {
  position: absolute;
  bottom: 0;
  left: 0.08em;
  font-size: 0.21em;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  z-index: 1;
  background: linear-gradient(var(--gradient-angle),
      #4da2ff, #ba83e7, #ff4d88, #ffb54d, #4da2ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: rotation 12.25s linear infinite, drift 16.1s ease-in-out infinite;
}

#footer-tm::after {
  content: "TM";
  position: absolute;
  left: -0.5em;
  top: -0.5em;
  padding: 0.5em;
  z-index: -1;
  background: linear-gradient(var(--gradient-angle),
      #4da2ff, #ba83e7, #ff4d88, #ffb54d, #4da2ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  filter: blur(0.3em);
  animation: rotation 12.25s linear infinite, drift 16.1s ease-in-out infinite;
  opacity: 0.935;
}


/* ===================================================
   HERO TYPING ANIMATION
   =================================================== */

/* The h1 container */
.hero-heading {
  font-size: clamp(3rem, 13vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #1d1d1f;
  margin-bottom: 1.75rem;
  white-space: nowrap;
  /* keeps baldeo+TM on one line */
}

/* Allow wrapping on very small phones so heading doesn't overflow */
@media (max-width: 380px) {
  .hero-heading {
    white-space: normal;
  }
}

/* Blinking cursor bar */
.hero-cursor {
  display: inline-block;
  width: 0.055em;
  height: 0.82em;
  background: #1d1d1f;
  vertical-align: -0.04em;
  margin-left: 0.04em;
  border-radius: 1px;
  animation: cursor-blink 0.65s step-end infinite;
}

.hero-cursor.is-hidden {
  display: none;
}

/* TM — starts full-size at baseline (same as surrounding letters) */
.hero-tm {
  display: inline-block;
  opacity: 0;
  font-size: 1em;
  /* same size as h1 text on appear */
  font-weight: 700;
  letter-spacing: -0.02em;
  vertical-align: baseline;
  transform: translateY(0);
  position: relative;
  z-index: 1;
  background: linear-gradient(var(--gradient-angle),
      #4da2ff, #ba83e7, #ff4d88, #ffb54d, #4da2ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  /* Start solid black text over the gradient */
  color: #1d1d1f;
  -webkit-text-fill-color: #1d1d1f;
  /* Animate size + position; spring easing for the lift */
  /* Fade text color to transparent to reveal gradient perfectly */
  transition:
    font-size 0.65s cubic-bezier(0.34, 1.40, 0.64, 1),
    transform 0.65s cubic-bezier(0.34, 1.40, 0.64, 1),
    opacity 0.22s ease,
    color 0.65s ease,
    -webkit-text-fill-color 0.65s ease;
}

.hero-tm::after {
  content: "TM";
  position: absolute;
  left: -0.5em;
  top: -0.5em;
  padding: 0.5em;
  z-index: -1;
  background: linear-gradient(var(--gradient-angle),
      #4da2ff, #ba83e7, #ff4d88, #ffb54d, #4da2ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  filter: blur(0.42em);
  opacity: 0;
  transition: opacity 1s ease;
}

/* Step 1 — TM fades in at full size, at baseline */
.hero-tm.is-visible {
  opacity: 1;
}

/* Step 2 — TM shrinks and lifts to cap-height of "baldeo"
   translateY is in the TM's OWN em after font-size changes.
   -1.15em × 0.40em-of-h1 ≈ -0.46 × h1, landing near the d/b ascender top. */
.hero-tm.is-super {
  font-size: 0.40em;
  transform: translateY(-1.15em);
  /* Make text transparent to reveal gradient smoothly */
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Step 3 — shimmer + matching outer glow kick in */
.hero-tm.is-glowing {
  animation: rotation 12.25s linear infinite, drift 16.1s ease-in-out infinite;
}

.hero-tm.is-glowing::after {
  animation: rotation 12.25s linear infinite, drift 16.1s ease-in-out infinite;
  opacity: 0.935;
}

/* Elements that appear after the typing animation */
.hero-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

.hero-reveal.visible {
  opacity: 1;
  transform: none;
}

/* ===================================================
   GALLERY STRIP
   Horizontal auto-scrolling frames, Apple marquee style.
   Swapping in real photos: replace the <svg> inside each
   .gallery-frame with <img src="…" alt="…" />
   =================================================== */
.gallery-wrapper {
  overflow: hidden;
  /* Fade edges out so frames appear to emerge from nothing */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
}

.gallery-track {
  display: flex;
  gap: 14px;
  width: max-content;
  padding: 4px 0 8px;
  will-change: transform;
}

/* All frames share the same height */
.gallery-frame {
  height: 280px;
  flex-shrink: 0;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  /* Subtle lift shadow — very Apple */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}

.gallery-frame:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13);
}

/* Aspect-ratio widths at 280px height */
.gallery-frame--landscape {
  width: 373px;
}

/* 4 : 3  */
.gallery-frame--portrait {
  width: 210px;
}

/* 3 : 4  */
.gallery-frame--square {
  width: 280px;
}

/* 1 : 1  */
.gallery-frame--wide {
  width: 498px;
}

/* 16 : 9 */

/* Real photo fills the frame */
.gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder icon — centred, hidden once img is added */
.gallery-placeholder {
  width: 35px;
  height: 35px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: .5;
}

@keyframes gallery-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }

  /* moves exactly one set width */
}

/* Mobile gallery — touch-scrollable, infinite-looping strip */
@media (max-width: 768px) {
  .gallery-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    /* momentum scroll on iOS */
    /* Remove fade-mask — it clips the scrolling content on mobile */
    -webkit-mask-image: none;
    mask-image: none;
    scrollbar-width: none;
    /* Firefox */
  }

  .gallery-wrapper::-webkit-scrollbar {
    display: none;
  }

  /* Prevent the scroll-driven JS transform from fighting touch scroll */
  .gallery-track {
    transform: none !important;
  }
}

/* Mobile gallery — shorter frames, proportional widths */
@media (max-width: 640px) {
  .gallery-frame {
    height: 190px;
  }

  .gallery-frame--landscape {
    width: 253px;
  }

  .gallery-frame--portrait {
    width: 143px;
  }

  .gallery-frame--square {
    width: 190px;
  }

  .gallery-frame--wide {
    width: 338px;
  }
}

/* ===================================================
   SCROLL FADE-UP
   =================================================== */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .75s var(--ease), transform .75s var(--ease);
}

.fade-up.visible {
  opacity: 1;
  transform: none;
}

/* ===================================================
   MOBILE NAV
   =================================================== */
@media (max-width: 768px) {
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(251, 251, 253, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
  }

  .primary-nav .nav-link {
    font-size: 15px;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
  }

  .primary-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 640px) {
  .project-card__cover {
    height: 160px;
  }
}

/* ===================================================
   KEYFRAMES
   =================================================== */

/* Blinking cursor during typing */
@keyframes cursor-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Apple Intelligence iridescent shimmer — flows continuously in one direction.
   Gradient starts and ends with the same colour so the loop is seamless. */
@keyframes intelligence-shimmer {
  from {
    background-position: 0% center;
  }

  to {
    background-position: 100% center;
  }
}

/* Outer glow that tracks the gradient — runs in sync with intelligence-shimmer.
   Each stop matches the corresponding colour in the shared gradient. */
@keyframes intelligence-glow {
  0% {
    filter: drop-shadow(0 0 6px rgba(59, 169, 254, 0.5)) drop-shadow(0 0 14px rgba(59, 169, 254, 0.2));
  }

  25% {
    filter: drop-shadow(0 0 6px rgba(106, 76, 252, 0.5)) drop-shadow(0 0 14px rgba(106, 76, 252, 0.2));
  }

  50% {
    filter: drop-shadow(0 0 6px rgba(222, 45, 137, 0.5)) drop-shadow(0 0 14px rgba(222, 45, 137, 0.2));
  }

  75% {
    filter: drop-shadow(0 0 6px rgba(249, 114, 2, 0.5)) drop-shadow(0 0 14px rgba(249, 114, 2, 0.2));
  }

  100% {
    filter: drop-shadow(0 0 6px rgba(59, 169, 254, 0.5)) drop-shadow(0 0 14px rgba(59, 169, 254, 0.2));
  }
}

@keyframes hero-glow {
  0% {
    filter: drop-shadow(0 0 12px rgba(59, 169, 254, 0.85)) drop-shadow(0 0 32px rgba(59, 169, 254, 0.5));
  }

  25% {
    filter: drop-shadow(0 0 12px rgba(106, 76, 252, 0.85)) drop-shadow(0 0 32px rgba(106, 76, 252, 0.5));
  }

  50% {
    filter: drop-shadow(0 0 12px rgba(222, 45, 137, 0.85)) drop-shadow(0 0 32px rgba(222, 45, 137, 0.5));
  }

  75% {
    filter: drop-shadow(0 0 12px rgba(249, 114, 2, 0.85)) drop-shadow(0 0 32px rgba(249, 114, 2, 0.5));
  }

  100% {
    filter: drop-shadow(0 0 12px rgba(59, 169, 254, 0.85)) drop-shadow(0 0 32px rgba(59, 169, 254, 0.5));
  }
}

/* ===================================================
   SCROLL HINT — larger chevron in lower-mid hero
   =================================================== */
.scroll-hint {
  position: absolute;
  bottom: 8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(0, 0, 0, 0.30);
  animation: scroll-hint-bob 2.2s ease-in-out infinite;
  transition: opacity 0.5s ease;
}

.scroll-hint svg {
  width: 35px;
  height: 35px;
  display: block;
}

.scroll-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes scroll-hint-bob {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(6px);
  }
}

/* ===================================================
   BACK TO TOP BUTTON
   =================================================== */
#back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 850;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: #1d1d1f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.15s;
  pointer-events: none;
}

#back-to-top svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

#back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

#back-to-top:hover {
  background: #fff;
}

/* ===================================================
   MOBILE LAYOUT FIXES
   =================================================== */

/* iOS Safari: 100vh includes browser chrome, cutting off hero.
   dvh = "dynamic viewport height" which excludes the browser UI. */
@supports (min-height: 100dvh) {
  #home {
    min-height: 100dvh;
  }
}

/* Mobile header — 20% taller than the default 44px (h-11) */
@media (max-width: 768px) {
  .site-header>div {
    height: 53px;
  }
}

/* Tighten section vertical padding on phones */
@media (max-width: 640px) {

  #about,
  #projects,
  #contact {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  /* Footer: less top padding on mobile */
  #site-footer {
    padding-top: 4rem;
  }
}

/* ===================================================
   REDUCED MOTION
   =================================================== */
@media (prefers-reduced-motion: reduce) {
  .wordmark__tm {
    animation: none;
  }

  .gallery-track {
    animation: none;
  }

  .hero-cursor {
    animation: none;
  }

  .hero-tm.is-glowing {
    animation: none;
  }

  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-tm {
    transition: none;
  }

  .project-card:hover {
    transform: none;
  }

  .gallery-frame:hover {
    transform: none;
  }
}