/* ============================================
   PORTFOLIO — CSS MASTERPIECE
   ============================================ */

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

:root {
  /* Dark theme (default) */
  --bg: #0a0a0b;
  --bg-raised: #131316;
  --bg-card: #18181c;
  --bg-card-hover: #1e1e23;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #f0f0f3;
  --text-secondary: #8a8a96;
  --text-muted: #55555f;
  --accent: #6C5CE7;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-hover: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 60px rgba(108,92,231,0.15);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --nav-height: 72px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-raised: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f3;
  --border: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);
  --text: #1a1a2e;
  --text-secondary: #6b6b80;
  --text-muted: #9b9bab;
  --accent: #6C5CE7;
  --accent-glow: rgba(108, 92, 231, 0.15);
  --glass: rgba(0, 0, 0, 0.02);
  --glass-hover: rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 60px rgba(108,92,231,0.08);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

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

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

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

/* --- Cursor Glow --- */
.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}

body:hover .cursor-glow {
  opacity: 1;
}

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

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  z-index: 1000;
  background: transparent;
  transition: background var(--transition-smooth), box-shadow var(--transition-smooth), backdrop-filter var(--transition-smooth);
}

.nav.scrolled {
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .nav.scrolled {
  background: rgba(245, 245, 247, 0.8);
}

.nav-logo {
  flex-shrink: 0;
}

.logo-text {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
}

.logo-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px;
}

.nav-link {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

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

.nav-link.active {
  color: var(--text);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--glass-hover);
  border-color: var(--border-hover);
  transform: rotate(15deg);
}

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

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
  box-shadow: 0 0 20px var(--accent-glow);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 30px var(--accent-glow);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-height) + 40px) clamp(20px, 4vw, 48px) 40px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  opacity: 0.4;
  animation: heroPulse 8s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.4; }
  50% { transform: translateX(-50%) scale(1.15); opacity: 0.6; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  animation: fadeInUp 0.8s ease both;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #00B894;
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(0, 184, 148, 0); }
}

.hero-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -3px;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(-15deg);
  animation: wordReveal 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes wordReveal {
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent), #a29bfe, #fd79a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(16px, 2vw, 22px);
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 36px;
  animation: fadeInUp 0.8s ease 0.2s both;
  line-height: 1.7;
}

.hero-socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  animation: fadeInUp 0.8s ease 0.3s both;
  position: relative;
}

.copy-notice {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  z-index: 10;
}

.copy-notice.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.social-link:hover {
  color: var(--text);
  background: var(--glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: fadeInUp 1s ease 0.6s both;
}

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

@keyframes scrollBounce {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.6); opacity: 0.4; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Main Content --- */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 80px;
}

/* --- Tile Grid --- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 100px;
}

/* --- Tiles Base --- */
.tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-smooth);
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  animation: tileReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition-smooth);
  z-index: 0;
  pointer-events: none;
}

.tile:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
  z-index: 5;
}

.tile:hover::before {
  opacity: 1;
}

.tile.hidden {
  opacity: 0 !important;
  transform: scale(0.9) !important;
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

@keyframes tileReveal {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tile sizes */
.tile[data-size="large"] {
  grid-column: span 2;
  grid-row: span 2;
}

.tile[data-size="medium"] {
  grid-column: span 2;
}

.tile[data-size="small"] {
  grid-column: span 1;
}

/* --- Project Tile --- */
.tile-project {
  display: flex;
  flex-direction: column;
}

.tile-project .tile-image-wrapper {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.tile[data-size="large"] .tile-image-wrapper {
  height: 280px;
}

.tile[data-size="medium"] .tile-image-wrapper {
  height: 200px;
}

.tile[data-size="small"] .tile-image-wrapper {
  height: 140px;
}

.tile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.tile-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.7));
  z-index: 1;
}

.tile-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.tile-year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.tile-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.tile[data-size="large"] .tile-title {
  font-size: 28px;
  letter-spacing: -0.5px;
}

.tile-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tile-tag {
  padding: 4px 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tile:hover .tile-tag {
  border-color: var(--border-hover);
}

/* Project tile accent glow on hover */
.tile-project::before {
  background: radial-gradient(ellipse at top left, var(--tile-color-glow, var(--accent-glow)), transparent 60%);
}

/* View Project indicator */
.tile-project::after {
  content: 'View Project →';
  position: absolute;
  bottom: 20px;
  right: 20px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition-smooth);
  z-index: 10;
  pointer-events: none;
}

.tile-project:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* --- Stat Tile --- */
.tile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  min-height: 180px;
}

.tile-stat .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 22px;
  transition: transform var(--transition-spring);
}

.tile-stat:hover .stat-icon {
  transform: scale(1.15) rotate(-5deg);
}

.stat-value {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Quote Tile --- */
.tile-quote {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 32px;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(108, 92, 231, 0.05) 100%);
}

.quote-mark {
  font-size: 48px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.5;
  font-family: Georgia, serif;
  margin-bottom: 12px;
}

.quote-text {
  font-size: 17px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--text);
}

.quote-author {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.quote-author::before {
  content: '— ';
}

/* --- Now Playing Tile --- */
.tile-music {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  min-height: 100px;
}

.music-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
  flex-shrink: 0;
}

.music-bar {
  width: 4px;
  border-radius: 2px;
  animation: musicBar 1.2s ease-in-out infinite;
}

.music-bar:nth-child(1) { animation-delay: 0s; height: 60%; }
.music-bar:nth-child(2) { animation-delay: 0.15s; height: 100%; }
.music-bar:nth-child(3) { animation-delay: 0.3s; height: 40%; }
.music-bar:nth-child(4) { animation-delay: 0.45s; height: 80%; }
.music-bar:nth-child(5) { animation-delay: 0.6s; height: 50%; }

@keyframes musicBar {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.4); }
}

.music-info {
  min-width: 0;
}

.music-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.music-track {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-artist {
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- Skills Section --- */
.skills-section, .experience-section {
  margin-bottom: 100px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 48px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.skill-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition-smooth);
  opacity: 0;
  transform: translateY(20px);
}

.skill-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.skill-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.skill-name {
  font-size: 15px;
  font-weight: 600;
}

.skill-level {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.skill-bar {
  height: 4px;
  background: var(--glass);
  border-radius: 100px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a29bfe);
  border-radius: 100px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-item.visible .skill-bar-fill {
  transition-delay: 0.2s;
}

/* --- Timeline / Experience --- */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  border-radius: 100px;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -40px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  z-index: 1;
  transition: all var(--transition-fast);
}

.timeline-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all var(--transition-smooth);
}

.timeline-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.timeline-role {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-company {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.timeline-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Contact Section --- */
.contact-section {
  margin-bottom: 80px;
  text-align: center;
}

.contact-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(48px, 6vw, 80px);
  position: relative;
  overflow: hidden;
}

.contact-inner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  opacity: 0.3;
}

.contact-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 20px;
  position: relative;
}

.contact-title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent), #fd79a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.contact-text {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.7;
  position: relative;
}

.contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 700;
  transition: all var(--transition-smooth);
  box-shadow: 0 0 40px var(--accent-glow);
  position: relative;
}

.contact-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 50px var(--accent-glow);
}

.contact-cta svg {
  transition: transform var(--transition-fast);
}

.contact-cta:hover svg {
  transform: translateX(4px);
}

/* --- Footer --- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-time {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow: hidden;
  overflow-y: auto;
  transform: translateY(30px) scale(0.96);
  transition: transform var(--transition-spring);
  position: relative;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  z-index: 10;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: rotate(90deg);
}

.modal-image {
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: 32px;
}

.modal-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.modal-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.modal-tag {
  padding: 6px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.modal-year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

.modal-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  transition: all var(--transition-fast);
}

.modal-link:hover {
  color: #a29bfe;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* --- Selection --- */
::selection {
  background: var(--accent);
  color: #fff;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
  .tile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tile[data-size="large"] {
    grid-column: span 2;
    grid-row: span 1;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

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

  .tile[data-size="large"],
  .tile[data-size="medium"] {
    grid-column: span 1;
    grid-row: span 1;
  }

  .hero-title {
    letter-spacing: -2px;
  }

  .section-title {
    flex-direction: column;
    gap: 4px;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .nav-actions .cta-button span {
    display: none;
  }
  .nav-actions .cta-button svg {
    margin: 0;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Loading State --- */
.tile.loading {
  background: linear-gradient(110deg, var(--bg-card) 8%, var(--bg-card-hover) 18%, var(--bg-card) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

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

/* --- Tilt effect class --- */
.tile-tilt-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
}
