/* ============================================
   SARA TABRIZI PORTFOLIO — DESIGN SYSTEM
   Rebuilt 2026. Clean, modern, confident.
   ============================================ */

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

/* --- Design Tokens --- */
:root {
  /* Colors — Light */
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f3f4f6;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.5rem;
  --text-6xl: 4.5rem;
  --leading-tight: 1.15;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;

  /* Spacing — 4px grid */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --text-primary: #e5e5e5;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.1);
    --border: #262626;
    --border-light: #1f1f1f;
    --overlay: rgba(0, 0, 0, 0.8);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.5);
  }
}

[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1f1f1f;
  --text-primary: #e5e5e5;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.1);
  --border: #262626;
  --border-light: #1f1f1f;
  --overlay: rgba(0, 0, 0, 0.8);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f3f4f6;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12);
}

/* ============================================
   BASE
   ============================================ */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lenis smooth scroll requires this */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling {
  /* optional: can add custom styles while scrolling */
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--duration-normal) var(--ease-in-out),
              color var(--duration-normal) var(--ease-in-out);
}

::selection {
  background-color: var(--accent);
  color: white;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-in-out);
}

a:hover {
  color: var(--accent-hover);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--accent);
  color: white;
  font-weight: 600;
  border-radius: var(--radius-md);
  z-index: 1000;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: var(--space-4);
  color: white;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 700;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
}

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 65ch;
}

.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

main {
  flex: 1;
}

section {
  padding: var(--space-24) 0;
}

section + section {
  border-top: 1px solid var(--border-light);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.header__brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
}

.header__brand a {
  color: inherit;
}

.header__brand a:hover {
  color: inherit;
  opacity: 0.8;
}

.header__right {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: var(--space-2) 0;
  transition: color var(--duration-fast) var(--ease-in-out);
}

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

.nav__link--active {
  color: var(--text-primary);
}

/* active state handled in Phase 2 nav animation block */

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: color var(--duration-fast), background-color var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }

[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

@media (prefers-color-scheme: dark) {
  .theme-toggle .icon-moon { display: none; }
  .theme-toggle .icon-sun { display: block; }
}

[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--text-primary);
  z-index: 200;
}

.hamburger svg {
  width: 24px;
  height: 24px;
  transition: transform var(--duration-normal) var(--ease-out);
}

.hamburger .icon-close { display: none; }
.hamburger.is-active .icon-menu { display: none; }
.hamburger.is-active .icon-close { display: block; }

/* Mobile nav overlay */
.mobile-nav {
  display: none;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--accent);
  color: white;
}

.btn--primary:hover {
  background-color: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--text-primary);
  transform: translateY(-1px);
}

.btn--ghost {
  background-color: transparent;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-4);
}

.btn--ghost:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.btn--lg {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  padding: var(--space-32) 0 var(--space-24);
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero__content {
  max-width: 860px;
  position: relative;
  z-index: 1;
}

.hero__label {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
  margin-bottom: var(--space-8);
  display: block;
}

.hero__title {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  margin-bottom: var(--space-8);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 540px;
  margin-bottom: var(--space-10);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Giant background text */
.hero__bg-text {
  position: absolute;
  right: -5%;
  bottom: 10%;
  font-family: var(--font-display);
  font-size: clamp(10rem, 20vw, 28rem);
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0.03;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

[data-theme="dark"] .hero__bg-text {
  opacity: 0.04;
}

/* Scroll hint */
.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  z-index: 1;
}

.hero__scroll-hint span {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
}

.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50%      { opacity: 0.3; transform: scaleY(0.6); }
}

/* ============================================
   HORIZONTAL SCROLL PORTFOLIO — The WOW
   ============================================ */

.work-section {
  padding: var(--space-24) 0 var(--space-16);
}

.work-section + section {
  border-top: none;
}

.hscroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 var(--space-6);
  cursor: grab;
}

.hscroll::-webkit-scrollbar {
  display: none;
}

.hscroll:active {
  cursor: grabbing;
}

.hscroll__track {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-4) 0 var(--space-12);
  width: max-content;
}

.hscroll__card {
  flex-shrink: 0;
  width: clamp(320px, 40vw, 520px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s;
  transform-style: preserve-3d;
  perspective: 800px;
  cursor: none;
}

.hscroll__card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
  color: inherit;
}

.hscroll__card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-tertiary);
}

.hscroll__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.hscroll__card:hover .hscroll__card-image img {
  transform: scale(1.08);
}

.hscroll__card-body {
  padding: var(--space-6);
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
}

.hscroll__card-num {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--bg-tertiary);
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.3s;
}

.hscroll__card:hover .hscroll__card-num {
  color: var(--accent);
}

.hscroll__card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.hscroll__card-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  margin-left: auto;
  flex-shrink: 0;
}

/* ============================================
   STATS COUNTER SECTION
   ============================================ */

.stats {
  padding: var(--space-20) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  text-align: center;
}

.stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.stats__number {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  display: inline;
}

.stats__suffix {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  display: inline;
}

.stats__label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Third contact orb */
.contact__orb--3 {
  width: 200px;
  height: 200px;
  background: #8b5cf6;
  top: 50%;
  left: 60%;
  animation-delay: 5s;
}

/* Contact email wrap */
.contact__email-wrap {
  margin-top: var(--space-10);
}

/* ============================================
   SELECTED WORK / PORTFOLIO GRID
   ============================================ */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-12);
}

.section-header__title {
  margin-bottom: 0;
}

.section-header__subtitle {
  margin-top: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-lg);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.work-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
  color: inherit;
}

.work-card__image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--bg-tertiary);
}

.work-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.work-card:hover .work-card__image img {
  transform: scale(1.04);
}

.work-card__body {
  padding: var(--space-6);
}

.work-card__tag {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
  margin-bottom: var(--space-3);
  display: block;
}

.work-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: var(--leading-tight);
}

.work-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.work-card__arrow {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translate(-8px, 8px);
  transition: all var(--duration-normal) var(--ease-out);
  border: 1px solid var(--border);
}

.work-card__arrow svg {
  width: 16px;
  height: 16px;
  color: var(--text-primary);
}

.work-card:hover .work-card__arrow {
  opacity: 1;
  transform: translate(0, 0);
}

/* Featured card — spans full width */
.work-card--featured {
  grid-column: 1 / -1;
}

.work-card--featured .work-card__image {
  aspect-ratio: 21 / 9;
}

/* ============================================
   CASE STUDY / DETAIL PAGE
   ============================================ */

.case-hero {
  padding: var(--space-16) 0 var(--space-12);
}

.case-hero__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  transition: color var(--duration-fast);
}

.case-hero__back:hover {
  color: var(--text-primary);
}

.case-hero__back svg {
  width: 16px;
  height: 16px;
}

.case-hero__tag {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
  margin-bottom: var(--space-4);
  display: block;
}

.case-hero__title {
  font-size: clamp(2rem, 5vw, var(--text-5xl));
  margin-bottom: var(--space-6);
}

.case-hero__desc {
  font-size: var(--text-lg);
  max-width: 640px;
}

/* Meta grid (Role, Timeline, Tools) */
.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-8);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: var(--space-12) 0;
}

.case-meta__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.case-meta__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
}

.case-meta__value {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
}

/* Case study banner image */
.case-banner {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-16);
  box-shadow: var(--shadow-lg);
}

.case-banner img,
.case-banner video {
  width: 100%;
  height: auto;
  display: block;
}

/* Video in case studies */
.case-video {
  margin: var(--space-12) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.case-video video {
  width: 100%;
  height: auto;
  display: block;
}

/* Phone video showcase — centered, constrained, with mock frame */
.phone-video-showcase {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-16) 0;
  margin: var(--space-8) 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
}

.phone-video-frame {
  width: 280px;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: var(--shadow-xl),
              0 0 0 8px var(--bg-secondary),
              0 0 0 10px var(--border);
  position: relative;
  background: #000;
}

.phone-video-frame video {
  width: 100%;
  height: auto;
  display: block;
}

/* Notch */
.phone-video-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #000;
  border-radius: 0 0 18px 18px;
  z-index: 2;
}

@media (max-width: 480px) {
  .phone-video-frame {
    width: 220px;
    border-radius: 28px;
  }

  .phone-video-frame::before {
    width: 90px;
    height: 22px;
    border-radius: 0 0 14px 14px;
  }
}

/* App icon + info header for iOS apps */
.case-app-header {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.case-app-header__icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.case-app-header__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-app-header__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.case-app-header__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
}

.case-app-header__company {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* Screenshot phone grid — for small phone screenshots */
.phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin: var(--space-12) 0;
}

.phone-grid img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .phone-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .case-app-header__icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }
}

/* Case study content sections */
.case-section {
  padding: var(--space-16) 0;
}

.case-section + .case-section {
  border-top: 1px solid var(--border-light);
}

.case-section__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

.case-section__title {
  margin-bottom: var(--space-6);
}

.case-section__text {
  margin-bottom: var(--space-6);
}

.case-section__text:last-child {
  margin-bottom: 0;
}

/* Case study image */
.case-image {
  margin: var(--space-12) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.case-image img {
  width: 100%;
  height: auto;
}

.case-image--full {
  margin-left: calc(-1 * var(--space-6));
  margin-right: calc(-1 * var(--space-6));
  border-radius: 0;
}

/* Case image grid — 2-up layout */
.case-image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin: var(--space-12) 0;
}

.case-image-grid .case-image {
  margin: 0;
}

/* What I Did list */
.task-list {
  list-style: none;
  padding: 0;
}

.task-list li {
  position: relative;
  padding-left: var(--space-8);
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.task-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
}

/* Persona card */
.persona-card {
  display: flex;
  gap: var(--space-8);
  padding: var(--space-8);
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  margin: var(--space-8) 0;
}

.persona-card__image {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
}

.persona-card__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.persona-card__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
}

.persona-card__detail {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Competitive analysis table */
.comp-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-8) 0;
  font-size: var(--text-sm);
}

.comp-table th,
.comp-table td {
  padding: var(--space-4);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.comp-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  padding-bottom: var(--space-4);
}

.comp-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
}

.comp-table tr:last-child td {
  border-bottom: none;
}

/* Next project navigation */
.next-project {
  padding: var(--space-24) 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.next-project__label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

.next-project__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--text-primary);
  transition: color var(--duration-fast);
}

.next-project a:hover .next-project__title {
  color: var(--accent);
}

/* ============================================
   ABOUT PAGE
   ============================================ */

.about-hero {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-16);
  align-items: center;
  padding: var(--space-24) 0;
}

.about-hero__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.about-hero__image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.about-hero__title {
  font-size: clamp(2rem, 4vw, var(--text-4xl));
  margin-bottom: var(--space-6);
}

.about-hero__text {
  margin-bottom: var(--space-8);
}

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}

.skill-card {
  padding: var(--space-6);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration-fast);
}

.skill-card:hover {
  border-color: var(--accent);
}

.skill-card__icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-4);
  color: var(--accent);
}

.skill-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.skill-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Experience timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.timeline__item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-6);
}

.timeline__year {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  padding-top: var(--space-1);
}

.timeline__content {
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border-light);
}

.timeline__item:last-child .timeline__content {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline__role {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.timeline__company {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact {
  text-align: center;
  padding: var(--space-32) 0;
}

.contact__title {
  font-size: clamp(2rem, 5vw, var(--text-5xl));
  margin-bottom: var(--space-6);
}

.contact__text {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin: 0 auto var(--space-10);
  max-width: 480px;
}

.contact__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Social links */
.social-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--duration-fast) var(--ease-in-out);
}

.social-link:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
  transform: translateY(-2px);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0;
}

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

.footer__copy {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.footer__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  transition: color var(--duration-fast);
}

.footer__links a:hover {
  color: var(--text-primary);
}

/* ============================================
   SCROLL ANIMATIONS — Phase 2 Enhanced
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out),
              transform 0.7s var(--ease-out);
}

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

/* Staggered children — set via JS data-delay or nth-child */
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }

/* Slide from left variant */
.reveal--left {
  transform: translateX(-32px);
}

.reveal--left.is-visible {
  transform: translateX(0);
}

/* Scale up variant */
.reveal--scale {
  transform: scale(0.95);
}

.reveal--scale.is-visible {
  transform: scale(1);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================
   NAV LINK HOVER UNDERLINE ANIMATION
   ============================================ */

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-normal) var(--ease-out);
}

.nav__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__link--active::after {
  transform: scaleX(1);
}

/* ============================================
   ENHANCED BUTTON EFFECTS — Phase 2
   ============================================ */

.btn {
  position: relative;
  overflow: hidden;
}

.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn--primary:hover::after {
  opacity: 1;
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn--secondary:active {
  transform: translateY(0);
}

/* ============================================
   ENHANCED WORK CARD EFFECTS — Phase 2
   ============================================ */

.work-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.04) 100%);
  z-index: 1;
  transition: opacity var(--duration-normal);
}

.work-card:hover .work-card__image::after {
  opacity: 0;
}

.work-card__image {
  position: relative;
}

.work-card__tag {
  transition: color var(--duration-fast);
}

.work-card:hover .work-card__tag {
  color: var(--accent-hover);
}

/* Description line clamp for tidiness */
.work-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   ENHANCED CONTACT — Phase 2
   ============================================ */

.contact {
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

.contact__title {
  position: relative;
}

.contact__email {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, var(--text-3xl));
  font-weight: 600;
  color: var(--text-primary);
  display: inline-block;
  position: relative;
  transition: color var(--duration-fast);
}

.contact__email:hover {
  color: var(--accent);
}

.contact__email::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-normal) var(--ease-out);
}

.contact__email:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ============================================
   ENHANCED FOOTER — Phase 2
   ============================================ */

.footer {
  padding: var(--space-16) 0 var(--space-8);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-8);
  align-items: start;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: center;
}

.footer__nav a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}

.footer__nav a:hover {
  color: var(--text-primary);
}

.footer__social {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.footer__bottom {
  max-width: var(--max-width);
  margin: var(--space-8) auto 0;
  padding: var(--space-6) var(--space-6) 0;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color var(--duration-fast);
}

.back-to-top:hover {
  color: var(--text-primary);
}

.back-to-top svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   DARK MODE POLISH — Phase 2
   ============================================ */

[data-theme="dark"] .work-card,
[data-theme="dark"] .skill-card {
  background-color: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .work-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .case-banner,
[data-theme="dark"] .case-image {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .about-hero__image {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .contact::before {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
}

[data-theme="dark"] img {
  filter: brightness(0.92) contrast(1.02);
}

[data-theme="dark"] .header {
  background-color: rgba(20, 20, 20, 0.85);
}

/* Same for prefers dark when no data-theme set */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .work-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.08);
  }

  :root:not([data-theme="light"]) img {
    filter: brightness(0.92) contrast(1.02);
  }

  :root:not([data-theme="light"]) .header {
    background-color: rgba(20, 20, 20, 0.85);
  }
}

/* ============================================
   SCROLL PROGRESS BAR — Phase 2
   ============================================ */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--accent);
  z-index: 200;
  transform-origin: left;
  transform: scaleX(0);
  transition: none;
  pointer-events: none;
}

/* ============================================
   CASE STUDY IMAGE HOVER — Phase 2
   ============================================ */

.case-image {
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.case-image:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   NEXT PROJECT ENHANCED — Phase 2
   ============================================ */

.next-project a {
  display: inline-block;
  transition: transform var(--duration-normal) var(--ease-out);
}

.next-project a:hover {
  transform: translateX(8px);
}

/* ============================================
   SKILL CARD HOVER ENHANCED — Phase 2
   ============================================ */

.skill-card {
  transition: border-color var(--duration-fast),
              transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.skill-card__icon {
  transition: transform var(--duration-normal) var(--ease-out);
}

.skill-card:hover .skill-card__icon {
  transform: scale(1.1);
}

/* ============================================
   VIEW TRANSITIONS — Phase 3
   ============================================ */

@view-transition {
  navigation: auto;
}

/* ============================================
   WOW ANIMATIONS — Cinematic Experience
   ============================================ */

/* --- Page Load Overlay --- */
.page-loader {
  position: fixed;
  inset: 0;
  background-color: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__bar {
  width: 60px;
  height: 2px;
  background-color: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.page-loader__bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background-color: var(--accent);
  animation: loader-slide 0.8s ease-in-out infinite;
}

@keyframes loader-slide {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* --- Noise Grain Texture --- */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

[data-theme="dark"] .noise {
  opacity: 0.04;
}

/* --- Hero Animated Gradient Mesh --- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero__gradient {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.4;
  background:
    radial-gradient(ellipse 80% 60% at 10% 40%, rgba(37, 99, 235, 0.15), transparent),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(168, 85, 247, 0.12), transparent),
    radial-gradient(ellipse 50% 50% at 50% 80%, rgba(236, 72, 153, 0.08), transparent);
  animation: gradient-drift 12s ease-in-out infinite alternate;
}

[data-theme="dark"] .hero__gradient {
  opacity: 0.25;
}

@keyframes gradient-drift {
  0% {
    transform: translate(0, 0) scale(1);
    filter: blur(60px);
  }
  33% {
    transform: translate(30px, -20px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 30px) scale(0.98);
  }
  100% {
    transform: translate(10px, -10px) scale(1.02);
    filter: blur(80px);
  }
}

.hero__content {
  position: relative;
  z-index: 1;
}

/* --- Split Text Animation (words clip-reveal) --- */
.anim-split .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.05em;
}

.anim-split .word-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-split.is-animated .word-inner {
  transform: translateY(0);
}

/* Stagger each word */
.anim-split .word:nth-child(1) .word-inner  { transition-delay: 0.3s; }
.anim-split .word:nth-child(2) .word-inner  { transition-delay: 0.36s; }
.anim-split .word:nth-child(3) .word-inner  { transition-delay: 0.42s; }
.anim-split .word:nth-child(4) .word-inner  { transition-delay: 0.48s; }
.anim-split .word:nth-child(5) .word-inner  { transition-delay: 0.54s; }
.anim-split .word:nth-child(6) .word-inner  { transition-delay: 0.60s; }
.anim-split .word:nth-child(7) .word-inner  { transition-delay: 0.66s; }
.anim-split .word:nth-child(8) .word-inner  { transition-delay: 0.72s; }
.anim-split .word:nth-child(9) .word-inner  { transition-delay: 0.78s; }
.anim-split .word:nth-child(10) .word-inner { transition-delay: 0.84s; }
.anim-split .word:nth-child(11) .word-inner { transition-delay: 0.90s; }

/* --- Fade-up animation (for subtitle, buttons) --- */
.anim-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-fade.is-animated {
  opacity: 1;
  transform: translateY(0);
}

/* --- Text Scramble on label --- */
.anim-scramble {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.anim-scramble.is-animated {
  opacity: 1;
}

/* --- Marquee Strip --- */
.marquee {
  overflow: hidden;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-secondary);
  white-space: nowrap;
}

.marquee__track {
  display: inline-flex;
  gap: var(--space-8);
  animation: marquee-scroll 30s linear infinite;
  will-change: transform;
}

.marquee__item {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

.marquee__sep {
  color: var(--text-tertiary);
  font-size: var(--text-2xl);
  flex-shrink: 0;
}

@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- 3D Perspective Tilt on Cards --- */
.work-card {
  transform-style: preserve-3d;
  perspective: 800px;
  will-change: transform;
}

.work-card__image img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Image Curtain Reveal --- */
.curtain-reveal {
  position: relative;
  overflow: hidden;
}

.curtain-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--accent);
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.9s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 2;
}

.curtain-reveal.is-revealed::after {
  transform: scaleX(0);
  transform-origin: left;
}

/* --- Magnetic Button --- */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Header entrance --- */
.header {
  transform: translateY(-100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.header.is-loaded {
  transform: translateY(0) !important;
}

/* After entrance, let scroll behavior take over */
.header.is-scrolling {
  transition: transform 0.3s ease !important;
}

/* --- Contact section floating shapes --- */
.contact {
  position: relative;
}

.contact__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.15;
  animation: orb-float 8s ease-in-out infinite alternate;
}

.contact__orb--1 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: -100px;
  right: -100px;
}

.contact__orb--2 {
  width: 300px;
  height: 300px;
  background: #ec4899;
  bottom: -80px;
  left: -80px;
  animation-delay: 3s;
  animation-direction: alternate-reverse;
}

@keyframes orb-float {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -30px) scale(1.1); }
}

[data-theme="dark"] .contact__orb {
  opacity: 0.08;
}

/* Remove old contact::before (replaced by orbs) */
.contact::before {
  display: none;
}

::view-transition-old(root) {
  animation: fade-out 0.2s ease-in;
}

::view-transition-new(root) {
  animation: fade-in 0.3s ease-out;
}

@keyframes fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Named transitions for hero elements */
.hero__title {
  view-transition-name: page-title;
}

.header__brand {
  view-transition-name: brand;
}

/* ============================================
   CUSTOM CURSOR — Phase 3
   ============================================ */

.work-card {
  cursor: none;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out),
              height 0.3s var(--ease-out),
              opacity 0.2s,
              background-color 0.2s;
  mix-blend-mode: difference;
}

.cursor-dot.is-visible {
  opacity: 1;
}

.cursor-dot.is-active {
  width: 64px;
  height: 64px;
  background-color: white;
  mix-blend-mode: difference;
}

.cursor-dot__text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: black;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.cursor-dot.is-active .cursor-dot__text {
  opacity: 1;
}

/* Hide custom cursor on touch devices */
@media (hover: none), (pointer: coarse) {
  .work-card {
    cursor: pointer;
  }

  .cursor-dot {
    display: none;
  }
}

/* ============================================
   IMAGE SKELETON LOADING — Phase 3
   ============================================ */

.work-card__image,
.case-banner,
.case-image,
.about-hero__image {
  position: relative;
  background-color: var(--bg-tertiary);
}

.work-card__image::before,
.case-banner::before,
.case-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--border-light) 40%,
    var(--bg-tertiary) 80%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  z-index: 0;
}

.work-card__image img,
.case-banner img,
.case-image img {
  position: relative;
  z-index: 1;
}

/* Hide skeleton once image is loaded (handled by JS adding .is-loaded) */
.work-card__image.is-loaded::before,
.case-banner.is-loaded::before,
.case-image.is-loaded::before {
  display: none;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   404 PAGE — Phase 3
   ============================================ */

.error-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16);
}

.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 12rem);
  font-weight: 700;
  color: var(--bg-tertiary);
  line-height: 1;
  margin-bottom: var(--space-4);
  user-select: none;
}

.error-page__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.error-page__text {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 440px;
}

/* ============================================
   PRINT STYLESHEET — Phase 3
   ============================================ */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
  }

  .header,
  .mobile-nav,
  .hamburger,
  .theme-toggle,
  .scroll-progress,
  .cursor-dot,
  .footer__social,
  .footer__nav,
  .back-to-top,
  .btn--primary,
  .btn--secondary,
  .next-project {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .contact::before {
    display: none;
  }

  a {
    text-decoration: underline;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: '';
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  .about-hero {
    grid-template-columns: 150px 1fr;
    gap: 1.5rem;
  }

  .about-hero__image img {
    width: 150px;
    height: auto;
    aspect-ratio: auto;
  }

  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .skill-card {
    border: 1px solid #ccc;
    padding: 0.5rem;
  }

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

  .footer {
    padding: 1rem 0;
    border-top: 1px solid #ccc;
  }

  .footer__brand {
    display: none;
  }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

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

@media (max-width: 1024px) {
  .work-grid {
    gap: var(--space-4);
  }

  .about-hero {
    gap: var(--space-10);
  }
}

@media (max-width: 768px) {
  /* Header mobile */
  .hamburger {
    display: flex;
  }

  .nav {
    display: none;
  }

  .mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background-color: var(--bg-secondary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
  }

  .mobile-nav.is-open {
    display: flex;
  }

  .mobile-nav__link {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    color: var(--text-primary);
    font-weight: 600;
    transition: color var(--duration-fast);
  }

  .mobile-nav__link:hover {
    color: var(--accent);
  }

  /* Layout */
  .hero {
    padding: var(--space-20) 0 var(--space-16);
    min-height: auto;
  }

  .hero__bg-text {
    font-size: 12rem;
    right: -10%;
  }

  .hero__scroll-hint {
    display: none;
  }

  h1 {
    font-size: var(--text-4xl);
  }

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

  .work-card--featured .work-card__image {
    aspect-ratio: 16 / 10;
  }

  .hscroll__card {
    width: 300px;
  }

  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .about-hero {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding: var(--space-16) 0;
  }

  .about-hero__image {
    max-width: 400px;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

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

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

  section {
    padding: var(--space-16) 0;
  }

  .contact {
    padding: var(--space-20) 0;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-6);
  }

  .footer__social {
    justify-content: center;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header__inner {
    height: 60px;
    padding: 0 var(--space-4);
  }

  .container {
    padding: 0 var(--space-4);
  }

  .hero {
    padding: var(--space-16) 0 var(--space-12);
  }

  h1 {
    font-size: var(--text-3xl);
  }

  .work-card__body {
    padding: var(--space-4);
  }

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

  .hero__bg-text {
    font-size: 8rem;
  }

  .hscroll__card {
    width: 280px;
  }

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

  .persona-card {
    flex-direction: column;
  }

  .persona-card__image {
    width: 100%;
    height: 200px;
  }
}
