:root {
  color-scheme: dark;
  --bg: #0d0d12;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --ink: #ffffff;
  --muted: #a1a1aa;
  
  /* Accents */
  --accent-1: #6366f1; /* Indigo */
  --accent-2: #ec4899; /* Pink */
  --accent-3: #14b8a6; /* Teal */
  
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-blur: blur(16px);
  --max: 1180px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-1) var(--bg);
}

/* Custom WebKit Scrollbar (Chromium/Safari) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-hover);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-1);
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .eyebrow, .brand {
  font-family: 'Outfit', sans-serif;
  text-wrap: balance;
}

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

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

/* Background Animated Blobs */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

@supports (animation-timeline: scroll()) {
  @keyframes parallax-bg {
    to { transform: translateY(-20%); }
  }
  .bg-blobs {
    height: 120vh;
    animation: parallax-bg linear both;
    animation-timeline: scroll();
  }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(99,102,241,0.6) 0%, rgba(99,102,241,0) 70%);
}

.blob-2 {
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(236,72,153,0.5) 0%, rgba(236,72,153,0) 70%);
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 30%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(20,184,166,0.4) 0%, rgba(20,184,166,0) 70%);
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(5%, 5%) scale(1.1); }
  66% { transform: translate(-5%, 10%) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Glassmorphism Panel Utilities */
.glass-panel {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.3s ease, 
              background 0.3s ease;
}

.site-wrapper {
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 24px;
  
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 2px 10px rgba(236,72,153,0.3);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 99px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--surface-hover);
  color: var(--ink);
}

/* Main Content */
main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

/* Hero Section */
.hero-section {
  display: flex;
  align-items: center;
  min-height: min(70vh, 700px);
  padding: 80px 0 40px;
}

.hero-copy {
  max-width: 800px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  color: var(--accent-3);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin-bottom: 24px;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1.1;
  letter-spacing: -1px;
  background: linear-gradient(to right, #fff, #a1a1aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  max-width: 600px;
  margin-bottom: 40px;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.hero-text strong {
  color: #fff;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.button, .filter-button {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 14px 24px;
  font-size: 1rem;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}

.button.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
  backdrop-filter: blur(10px);
}

.button.secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

/* Summary Band */
.summary-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 100px;
}

.summary-band .glass-panel {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric {
  background: linear-gradient(135deg, var(--accent-3), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 3rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
}

.summary-band span:last-child {
  color: var(--muted);
  font-weight: 500;
}

/* Section Headings */
.section-heading {
  margin-bottom: 40px;
}

.section-heading h2 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* Workspaces */
.workspaces-section {
  padding: 60px 0 100px;
}

.workspaces-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.workspaces-grid.unified-workspace {
  grid-template-columns: 1fr;
  max-width: 700px;
  margin: 0 auto;
}

.unified-avatar {
  width: 72px;
  height: 72px;
}

.unified-desc {
  font-size: 1.05rem;
  line-height: 1.6;
}

.unified-stats {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.workspace-card {
  padding: 32px;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.workspace-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.05), transparent 70%);
  z-index: 0;
}

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

.workspace-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.workspace-card.accent-primary:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 10px 40px rgba(99,102,241,0.15);
}

.workspace-card.accent-secondary:hover {
  border-color: rgba(236,72,153,0.3);
  box-shadow: 0 10px 40px rgba(236,72,153,0.15);
}

.workspace-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.workspace-header .avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.1);
}

.workspace-title h3 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.workspace-title a {
  color: var(--accent-1);
  font-weight: 600;
}

.workspace-card.accent-secondary .workspace-title a {
  color: var(--accent-2);
}

.workspace-desc {
  color: var(--muted);
  margin-bottom: 24px;
}

.workspace-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.workspace-stats div {
  background: rgba(0,0,0,0.2);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.workspace-stats dt {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}

.workspace-stats dd {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}

/* Projects */
.projects-section {
  padding: 60px 0 100px;
  content-visibility: auto;
  contain-intrinsic-size: auto 1000px;
}

.filter-bar {
  display: inline-flex;
  padding: 8px;
  gap: 8px;
  margin-bottom: 32px;
  border-radius: 16px;
}

.filter-button {
  background: transparent;
  color: var(--muted);
  padding: 10px 20px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-button:hover {
  color: var(--ink);
  background: rgba(255,255,255,0.05);
}

.filter-button.active {
  background: var(--ink);
  color: var(--bg);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 400px;
  overflow: hidden;
  will-change: transform;
}

.project-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--accent-1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(99,102,241,0.2);
}

.project-card.featured {
  grid-column: span 1;
}

.project-card.hidden {
  display: none;
}

.project-visual {
  height: 180px;
  display: grid;
  place-items: center;
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.9);
  position: relative;
}

.project-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, var(--bg));
  opacity: 0.8;
}

.project-visual span {
  position: relative;
  z-index: 1;
  background: rgba(0,0,0,0.3);
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
}

/* Distinct Project Visuals */
.anime { background: linear-gradient(135deg, #1e3a8a, #9d174d); }
.terminal { background: linear-gradient(135deg, #064e3b, #022c22); }
.commerce { background: linear-gradient(135deg, #854d0e, #3f6212); }
.civic { background: linear-gradient(135deg, #831843, #1e3a8a); }
.media { background: linear-gradient(135deg, #312e81, #0f172a); }
.music { background: linear-gradient(135deg, #4c1d95, #1d4ed8); }
.security { background: linear-gradient(135deg, #7f1d1d, #450a0a); }
.android { background: linear-gradient(135deg, #065f46, #3f6212); }
.kernel { background: linear-gradient(135deg, #78350f, #451a03); }
.recovery { background: linear-gradient(135deg, #1e3a8a, #115e59); }
.mobile { background: linear-gradient(135deg, #be123c, #831843); }
.finance { background: linear-gradient(135deg, #047857, #064e3b); }

.project-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
}

.tag.highlight {
  color: var(--accent-3);
  border-color: rgba(20,184,166,0.3);
  background: rgba(20,184,166,0.1);
}

.project-body h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.project-body p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.project-link {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 700;
  color: var(--accent-1);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-link:hover {
  color: #fff;
}

/* Stack Section */
.stack-section {
  padding: 60px 0 100px;
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stack-grid article {
  padding: 32px;
}

.stack-grid article:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.stack-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

.web-icon { background: linear-gradient(135deg, var(--accent-1), var(--accent-3)); }
.script-icon { background: linear-gradient(135deg, var(--accent-2), var(--accent-1)); }
.sys-icon { background: linear-gradient(135deg, var(--accent-3), var(--accent-2)); }

.stack-grid h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.stack-grid p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  padding-bottom: 40px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  gap: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a:hover {
  color: var(--ink);
}

/* Scroll Progress Indicator */
@supports (animation-timeline: scroll()) {
  @keyframes grow-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }

  #scroll-progress {
    position: fixed;
    left: 0; top: 0;
    width: 100%; height: 4px;
    background: linear-gradient(to right, var(--accent-1), var(--accent-2));
    transform-origin: 0 50%;
    animation: grow-progress auto linear;
    animation-timeline: scroll();
    z-index: 1000;
  }
}

/* Reveal Animations Class */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 980px) {
  .summary-band,
  .workspaces-grid,
  .project-grid,
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  main {
    padding-bottom: 80px;
  }

  .site-header {
    justify-content: center;
    padding: 12px;
  }
  
  .nav-links {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(13, 13, 18, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    justify-content: space-around;
    gap: 0;
    z-index: 1000;
  }
  
  .nav-links a {
    flex: 1;
    border-radius: 12px;
  }

  .hero-copy h1 {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-actions .button {
    width: 100%;
    text-align: center;
  }

  .summary-band,
  .workspaces-grid,
  .project-grid,
  .stack-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    width: calc(100vw - 32px);
  }
  
  .filter-bar::-webkit-scrollbar {
    display: none;
  }
  
  .filter-button {
    scroll-snap-align: start;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}

/* Project Detail Pages */
.project-detail-header {
  margin-bottom: 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--ink);
}

.project-hero {
  padding: 40px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.project-hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: 16px;
  background: linear-gradient(to right, #fff, #a1a1aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.project-hero p.description {
  color: var(--muted);
  font-size: 1.2rem;
  max-width: 800px;
  margin-bottom: 32px;
}

.media-gallery {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.media-container {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.4);
  box-shadow: var(--shadow);
}

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

.project-content {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 60px;
}

.project-content > * {
  max-width: 800px;
}

.project-content h2 {
  color: var(--ink);
  margin: 40px 0 20px;
  font-size: 2rem;
}

.project-content ul {
  margin-left: 24px;
  margin-bottom: 24px;
}

.project-content li {
  margin-bottom: 12px;
}


