/* ═══════════════════════════════════════════════════════
   HENRIQUE TERUYA — PORTFOLIO
   Design System + Components + Responsive
   ═══════════════════════════════════════════════════════ */

/* ─── Reset ─────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

ul, ol {
  list-style: none;
}

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

button {
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

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

/* ─── Custom Properties (Design Tokens) ─────────────── */

:root {
  /* Colors — Apple-inspired binary palette */
  --bg-dark: #0a0a0a;
  --bg-dark-surface: #151517;
  --bg-dark-surface-hover: #1c1c1e;
  --bg-light: #f5f5f7;
  --bg-light-surface: #ebebed;

  /* Text */
  --text-on-dark: #f5f5f7;
  --text-on-dark-secondary: rgba(245, 245, 247, 0.55);
  --text-on-light: #1d1d1f;
  --text-on-light-secondary: rgba(29, 29, 31, 0.55);

  /* Accent — single color, interactive only */
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-on-dark: #2997ff;

  /* Typography */
  --font-display: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing scale (4pt base) */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --space-5xl: 128px;

  /* Layout */
  --max-width: 980px;
  --nav-height: 52px;
  --section-padding: clamp(80px, 12vw, 140px);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-fast: 180ms;
  --duration-normal: 350ms;
  --duration-slow: 700ms;
  --duration-reveal: 900ms;

  /* Depth */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* ─── Base Typography ───────────────────────────────── */

body {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--text-on-dark);
  background: var(--bg-dark);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
}

/* ─── Layout ────────────────────────────────────────── */

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

.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
  position: relative;
}

.section--dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.section--light {
  background: var(--bg-light);
  color: var(--text-on-light);
}

.section-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.section--dark .section-label {
  color: var(--accent-on-dark);
}

.section--light .section-label {
  color: var(--accent);
}

.section-title {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.10;
  margin-bottom: var(--space-lg);
}

.section-subtitle {
  font-size: 17px;
  line-height: 1.55;
  max-width: 540px;
}

.section--dark .section-subtitle {
  color: var(--text-on-dark-secondary);
}

.section--light .section-subtitle {
  color: var(--text-on-light-secondary);
}

/* ─── Buttons ───────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  padding: 14px 28px;
  border-radius: 980px;
  transition:
    background var(--duration-fast) var(--ease-out-quart),
    color var(--duration-fast) var(--ease-out-quart),
    transform var(--duration-fast) var(--ease-out-quart),
    box-shadow var(--duration-fast) var(--ease-out-quart);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(0, 113, 227, 0.35);
}

.btn--outline {
  background: transparent;
  color: var(--text-on-dark);
  border: 1.5px solid rgba(245, 245, 247, 0.3);
}

.btn--outline:hover {
  border-color: rgba(245, 245, 247, 0.6);
  background: rgba(245, 245, 247, 0.06);
}

.section--light .btn--outline {
  color: var(--text-on-light);
  border-color: rgba(29, 29, 31, 0.25);
}

.section--light .btn--outline:hover {
  border-color: rgba(29, 29, 31, 0.5);
  background: rgba(29, 29, 31, 0.04);
}

.btn--small {
  font-size: 14px;
  padding: 10px 20px;
}

.btn--large {
  font-size: 18px;
  padding: 18px 40px;
}

/* Focus states for accessibility */
.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ─── Navigation ────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: 
    background var(--duration-normal) var(--ease-out-quart),
    backdrop-filter var(--duration-normal) var(--ease-out-quart),
    border-color var(--duration-normal) var(--ease-out-quart);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: rgba(245, 245, 247, 0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-on-dark);
  transition: opacity var(--duration-fast);
}

.nav-logo:hover {
  opacity: 0.7;
}

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

.nav-links a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: rgba(245, 245, 247, 0.8);
  letter-spacing: -0.01em;
  transition: color var(--duration-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-on-dark);
  transition: width var(--duration-normal) var(--ease-out-expo);
}

.nav-links a:hover {
  color: var(--text-on-dark);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  width: 28px;
  height: 28px;
  position: relative;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-on-dark);
  position: absolute;
  left: 4px;
  transition:
    transform var(--duration-normal) var(--ease-out-expo),
    opacity var(--duration-fast);
}

.nav-toggle span:first-child {
  top: 10px;
}

.nav-toggle span:last-child {
  top: 18px;
}

.nav-toggle.is-active span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle.is-active span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    visibility var(--duration-slow);
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 600;
  color: var(--text-on-dark);
  letter-spacing: -0.03em;
  padding: var(--space-sm) var(--space-lg);
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo),
    color var(--duration-fast);
}

.mobile-menu a:hover {
  color: var(--accent-on-dark);
}

.mobile-menu.is-open a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.is-open a:nth-child(1) { transition-delay: 80ms; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: 140ms; }
.mobile-menu.is-open a:nth-child(3) { transition-delay: 200ms; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: 260ms; }

/* ─── Hero Section ──────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
  background-color: #000;
}

.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: #000;
}

#hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
    rgba(0,0,0,0.4) 0%, 
    rgba(0,0,0,0.2) 50%, 
    rgba(0,0,0,0.6) 85%, 
    var(--bg-light) 100%
  );
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-label {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  margin-bottom: var(--space-lg);
}

.hero-title {
  font-size: clamp(38px, 6.5vw, 76px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--text-on-dark);
  margin-bottom: var(--space-lg);
  max-width: 820px;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 400;
  line-height: 1.50;
  color: var(--text-on-dark-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 520px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.scroll-indicator span {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-on-dark-secondary);
}

.scroll-line {
  width: 1px;
  height: 36px;
  background: rgba(245, 245, 247, 0.12);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent-on-dark);
  animation: scroll-pulse 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes scroll-pulse {
  0%   { top: -100%; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ─── About Section ─────────────────────────────────── */

.about-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.about-image {
  border-radius: 12px;
  overflow: hidden;
  background: #e8e8ea;
  aspect-ratio: 4 / 5;
  max-width: 340px;
  margin: 0 auto;
  grid-row: 1;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform var(--duration-slow) var(--ease-out-expo);
}

.about-image:hover img {
  transform: scale(1.03);
}

.about-text p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-on-light-secondary);
  margin-bottom: var(--space-md);
  max-width: 65ch;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: var(--space-2xl);
}

.stat {
  position: relative;
  padding: var(--space-xl) var(--space-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.stat::before,
.stat::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}



/* Vertical corner strokes (multi-cell handling) */
.stat::after {
  border-left: 1px solid rgba(29, 29, 31, 0.15);
}

.stat:last-child::after {
  border-right: 1px solid rgba(29, 29, 31, 0.15);
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-on-light);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-on-light-secondary);
  letter-spacing: -0.01em;
}

/* ─── Projects Section ──────────────────────────────── */

.projects-header {
  margin-bottom: var(--space-3xl);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.project-card {
  background: var(--bg-dark-surface);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    background var(--duration-normal) var(--ease-out-quart),
    transform var(--duration-normal) var(--ease-out-expo);
}

.project-card:hover {
  background: var(--bg-dark-surface-hover);
  transform: translateY(-3px);
}

/* Project image mosaic */
.project-mosaic {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #0d0d0f;
  display: grid;
  gap: 2px;
}

/* 3-image mosaic: main (60%) + two stacked (40%) */
.mosaic-3 {
  grid-template-columns: 1.4fr 1fr;
  aspect-ratio: 16 / 9;
}

.mosaic-3 .mosaic-main {
  grid-row: 1 / 1;
  overflow: hidden;
}

.mosaic-3 .mosaic-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform var(--duration-slow) var(--ease-out-expo);
}

.mosaic-3 .mosaic-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
}

/* 2-image mosaic: side by side */
.mosaic-2 {
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 2 / 1;
}

.mosaic-item {
  overflow: hidden;
}

.mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform var(--duration-slow) var(--ease-out-expo);
}

/* Hover zoom on all mosaic images */
.project-card:hover .mosaic-main img,
.project-card:hover .mosaic-item img {
  transform: scale(1.04);
}

/* Subtle vignette on mosaic bottom for continuity with card body */
.project-mosaic::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32%;
  background: linear-gradient(to top, var(--bg-dark-surface) 0%, transparent 100%);
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
}

/* Card body content */
.project-card-body {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.project-number {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-on-dark-secondary);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  margin-top: 4px;
}

.project-name {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-on-dark);
}

.project-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-on-dark-secondary);
  max-width: 55ch;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-2xs);
}

.project-tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 6px 14px;
  border-radius: 980px;
  background: rgba(245, 245, 247, 0.06);
  color: var(--text-on-dark-secondary);
  transition: background var(--duration-fast), color var(--duration-fast);
}

.project-card:hover .project-tag {
  background: rgba(245, 245, 247, 0.1);
  color: var(--text-on-dark);
}

.project-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: auto;
  padding-top: var(--space-sm);
}

.project-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-on-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--duration-normal) var(--ease-out-expo);
}

.project-link:hover {
  gap: 10px;
}

.project-link-arrow {
  font-size: 16px;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.project-link:hover .project-link-arrow {
  transform: translateX(2px);
}

/* ─── Skills Section ────────────────────────────────── */

.skills-header {
  margin-bottom: var(--space-3xl);
}

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

.skill-category h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-on-light);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(29, 29, 31, 0.12);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.skill-item {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-on-light);
  padding: 10px 20px;
  border-radius: 980px;
  background: rgba(29, 29, 31, 0.04);
  transition:
    background var(--duration-fast) var(--ease-out-quart),
    color var(--duration-fast);
  letter-spacing: -0.01em;
}

.skill-item:hover {
  background: var(--text-on-light);
  color: var(--bg-light);
}

/* ─── Contact Section ───────────────────────────────── */

.contact {
  text-align: center;
}

.contact-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.035em;
  color: var(--text-on-dark);
  margin-bottom: var(--space-lg);
}

.contact-subtitle {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-on-dark-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 440px;
}

.contact-cta {
  margin-bottom: var(--space-2xl);
}

.contact-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  justify-content: center;
}

.contact-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent-on-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity var(--duration-fast);
}

.contact-link:hover {
  opacity: 0.75;
}

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

/* ─── Footer ────────────────────────────────────────── */

.footer {
  border-top: 1px solid rgba(245, 245, 247, 0.06);
  padding: var(--space-xl) 0;
  background: var(--bg-dark);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-text {
  font-size: 13px;
  color: var(--text-on-dark-secondary);
  letter-spacing: -0.01em;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: 13px;
  color: var(--text-on-dark-secondary);
  transition: color var(--duration-fast);
}

.footer-links a:hover {
  color: var(--text-on-dark);
}

/* ─── Floating Contact CTA ──────────────────────────── */

.floating-cta {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition:
    opacity var(--duration-normal) var(--ease-out-expo),
    transform var(--duration-normal) var(--ease-out-expo),
    background var(--duration-fast),
    box-shadow var(--duration-fast);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);
}

.floating-cta.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.floating-cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px rgba(0, 113, 227, 0.45);
  transform: translateY(-2px) scale(1.05);
}

.floating-cta:active {
  transform: scale(0.95);
}

.floating-cta svg {
  width: 22px;
  height: 22px;
}

/* ─── Scroll Reveal Animations ──────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--duration-reveal) var(--ease-out-expo),
    transform var(--duration-reveal) var(--ease-out-expo);
}

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

/* Stagger utility classes */
.reveal-d1 { transition-delay: 80ms; }
.reveal-d2 { transition-delay: 160ms; }
.reveal-d3 { transition-delay: 240ms; }
.reveal-d4 { transition-delay: 320ms; }
.reveal-d5 { transition-delay: 400ms; }
.reveal-d6 { transition-delay: 480ms; }

/* Hero-specific stagger (faster on load) */
.hero .reveal {
  transition-duration: var(--duration-slow);
}

/* ─── Reduced Motion ────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .scroll-line::after {
    animation: none;
  }
}

/* ─── Vertical Cut Reveal ────────────────────────────── */

h2.vertical-cut-reveal.reveal {
  opacity: 1 !important;
  transform: none !important;
}

.v-cut-outer {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.v-cut-space {
  display: inline-block;
  width: 0.25em; 
}

.v-cut-inner {
  display: inline-block;
  transform: translateY(110%);
  /* Custom spring-like bezier matching stiffness 200, damping 21 */
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.vertical-cut-reveal.is-visible .v-cut-inner {
  transform: translateY(0);
}

/* ─── Responsive: Tablet (640px+) ───────────────────── */

@media (min-width: 640px) {
  .about-top {
    grid-template-areas: "text image";
    grid-template-columns: 1.3fr 0.7fr;
    align-items: center;
    gap: var(--space-3xl);
  }

  .about-text {
    grid-area: text;
  }

  .about-image {
    grid-area: image;
    max-width: none;
    margin: 0;
  }

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

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

/* ─── Responsive: Desktop (1024px+) ─────────────────── */

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }

  .nav-toggle {
    display: none !important;
  }

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

  .project-card-body {
    padding: var(--space-2xl);
  }
}

/* ─── Responsive: Mobile (<640px) ───────────────────── */

@media (max-width: 639px) {
  :root {
    --section-padding: clamp(60px, 10vw, 80px);
    --nav-height: 48px;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    min-height: 100svh;
    padding-bottom: var(--space-4xl);
  }

  .hero-ctas {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .hero-ctas .btn {
    width: 100%;
    text-align: center;
  }

  .section-title {
    font-size: clamp(24px, 6vw, 32px);
    margin-bottom: var(--space-md);
  }

  .about-top {
    display: block;
  }

  .about-text {
    grid-area: text;
  }

  .about-text p {
    font-size: 15px;
    margin-bottom: var(--space-sm);
  }

  .about-image {
    display: none;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    margin-top: var(--space-lg);
  }

  .stat {
    padding: var(--space-lg) var(--space-2xs);
  }

  .stat-value {
    font-size: clamp(11px, 3.3vw, 16px);
    margin-bottom: 4px;
    word-break: break-word;
  }
  
  .stat-label {
    font-size: clamp(9px, 2.5vw, 11px);
    letter-spacing: -0.02em;
    line-height: 1.25;
  }

  .projects-grid {
    gap: var(--space-md);
  }

  .project-card-body {
    padding: var(--space-lg);
  }

  .mosaic-3 {
    grid-template-columns: 1fr;
    aspect-ratio: 4 / 3;
  }

  .mosaic-3 .mosaic-stack {
    grid-template-rows: none;
    grid-template-columns: 1fr 1fr;
  }

  .contact-links {
    flex-direction: column;
    gap: var(--space-md);
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-sm);
  }

  .scroll-indicator {
    bottom: 24px;
  }
}

/* ─── Responsive: Large Desktop (1440px+) ───────────── */

@media (min-width: 1440px) {
  :root {
    --max-width: 1080px;
  }
}

/* ─── Lightbox ─────────────────────────────────────── */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-out-quart),
              visibility var(--duration-normal);
}

.lightbox.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  width: 90%;
  max-width: 1100px;
  height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform var(--duration-normal) var(--ease-out- quart);
}

.lightbox.is-active .lightbox-content img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  font-size: 32px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast);
  z-index: 2100;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  font-size: 40px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
  z-index: 2100;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev { left: 40px; }
.lightbox-next { right: 40px; }

@media (max-width: 639px) {
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-close { top: 20px; right: 20px; }
  .lightbox-content { width: 95%; height: 70%; }
}

/* Body scroll lock */
body.menu-open,
body.lightbox-open {
  overflow: hidden;
}
