/* ==========================================================================
   Piyush Das Portfolio — Design System
   Aesthetic: Linear / Vercel-inspired — Dark, precise, typography-first
   Grid: 8px base unit | Max-width: 1200px | Tokens: semantic CSS vars
   ========================================================================== */

/* --------------------------------------------------------------------------
   DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* — Backgrounds — */
  --bg-base: #0a0a0f;
  --bg-elevated: #111118;
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-surface-hover: rgba(255, 255, 255, 0.07);
  --bg-inset: rgba(0, 0, 0, 0.3);

  /* — Borders — */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-emphasis: rgba(255, 255, 255, 0.18);
  --border-accent: rgba(99, 102, 241, 0.35);

  /* — Text — */
  --text-primary: #f1f1f3;
  --text-secondary: #9098a9;
  --text-tertiary: #5a6070;
  --text-accent: #a5b4fc;
  --text-on-accent: #ffffff;

  /* — Accent — single color system —*/
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.20);
  --accent-subtle: rgba(99, 102, 241, 0.10);

  /* — Status colors — */
  --color-success: #34d399;
  --color-success-subtle: rgba(52, 211, 153, 0.10);
  --color-warning: #fbbf24;
  --color-warning-subtle: rgba(251, 191, 36, 0.10);

  /* — Typography — */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* — Type Scale — named roles, not arbitrary px — */
  --text-xs: 0.75rem;      /* 12px — captions, meta */
  --text-sm: 0.875rem;     /* 14px — secondary body */
  --text-base: 1rem;       /* 16px — body */
  --text-lg: 1.125rem;     /* 18px — emphasized body */
  --text-xl: 1.25rem;      /* 20px — small headings */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */

  /* — Spacing — 8px base unit — */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* — Radii — */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* — Elevation — */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(99,102,241,0.12);

  /* — Motion — */
  --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-base: 250ms;
  --duration-slow: 400ms;

  /* — Layout — */
  --max-width: 1200px;
  --max-width-text: 680px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --nav-height: 60px;
}

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

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

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

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

/* --------------------------------------------------------------------------
   AMBIENT BACKGROUND — subtle, not distracting
   -------------------------------------------------------------------------- */
.bg-grain {
  position: fixed;
  inset: 0;
  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)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99,102,241,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(99,102,241,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* --------------------------------------------------------------------------
   NAVIGATION
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border-subtle);
}

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

.nav-logo {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

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

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

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) ease;
  position: relative;
}

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

.nav-cta {
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  color: var(--text-accent);
  transition: all var(--duration-fast) ease;
}

.nav-cta:hover {
  background: rgba(99,102,241,0.18);
  color: var(--text-on-accent);
}

/* --------------------------------------------------------------------------
   LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

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

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

/* Alternate section — subtle tint to break rhythm */
.section-alt {
  background: rgba(255,255,255,0.018);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY SYSTEM
   -------------------------------------------------------------------------- */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--accent);
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-primary);
}

.display-xl {
  font-size: clamp(var(--text-4xl), 7vw, var(--text-6xl));
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.display-lg {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  letter-spacing: -0.03em;
}

.display-md {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  letter-spacing: -0.025em;
}

.heading-lg { font-size: var(--text-2xl); }
.heading-md { font-size: var(--text-xl); }
.heading-sm { font-size: var(--text-lg); font-weight: 600; }

.body-lg { font-size: var(--text-lg); color: var(--text-secondary); line-height: 1.7; }
.body-md { font-size: var(--text-base); color: var(--text-secondary); line-height: 1.65; }
.body-sm { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }

.gradient-text {
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nav-height) + var(--space-16));
  padding-bottom: var(--space-24);
  position: relative;
  overflow: hidden;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-2);
  background: var(--color-success-subtle);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-success);
  margin-bottom: var(--space-8);
  width: fit-content;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  margin-bottom: var(--space-6);
}

.hero-bio {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 580px;
  margin-bottom: var(--space-10);
}

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

.hero-socials {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.hero-scroll {
  position: absolute;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: float-scroll 3s ease-in-out infinite;
}

@keyframes float-scroll {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-emphasis);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

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

/* Icon button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) ease;
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-emphasis);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   BADGES
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid;
}

.badge-default {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.badge-accent {
  background: var(--accent-subtle);
  color: var(--text-accent);
  border-color: var(--border-accent);
}

.badge-success {
  background: var(--color-success-subtle);
  color: var(--color-success);
  border-color: rgba(52,211,153,0.2);
}

.badge-warning {
  background: var(--color-warning-subtle);
  color: var(--color-warning);
  border-color: rgba(251,191,36,0.2);
}

/* --------------------------------------------------------------------------
   SECTION HEADERS
   -------------------------------------------------------------------------- */
.section-header {
  margin-bottom: var(--space-12);
}

.section-header.centered {
  text-align: center;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.section-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
}

/* --------------------------------------------------------------------------
   FEATURED PROJECTS — Large cards, visuals first
   -------------------------------------------------------------------------- */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.project-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-elevated);
  transition: all var(--duration-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  position: relative;
}

.project-card:hover {
  border-color: var(--border-emphasis);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Visual area — the "screenshot zone" */
.project-visual {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-visual-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-3);
}

/* Stash AI — deep indigo gradient */
.project-visual-stash {
  background: linear-gradient(135deg, #0f0f20 0%, #1a1040 40%, #0d1530 100%);
}

/* Mock UI inside the visual for Stash AI */
.stash-mock {
  width: 85%;
  max-width: 320px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(165,180,252,0.7);
}

.stash-mock-bar {
  display: flex;
  gap: 5px;
  margin-bottom: var(--space-3);
}

.stash-mock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.stash-mock-line {
  height: 6px;
  border-radius: 3px;
  background: rgba(99,102,241,0.2);
  margin-bottom: 6px;
}

.stash-mock-line.w-full { width: 100%; }
.stash-mock-line.w-3q { width: 75%; }
.stash-mock-line.w-half { width: 50%; background: rgba(165,180,252,0.15); }
.stash-mock-line.w-2q { width: 60%; }
.stash-mock-tag {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(99,102,241,0.15);
  border-radius: 3px;
  color: rgba(165,180,252,0.9);
  font-size: 9px;
  margin-right: 4px;
}

/* GhostScreen — dark green/slate Android feel */
.project-visual-ghost {
  background: linear-gradient(135deg, #0a0f0d 0%, #0d1a14 50%, #080c0a 100%);
}

.ghost-mock {
  display: flex;
  gap: var(--space-3);
  width: 85%;
  max-width: 300px;
}

.ghost-phone {
  width: 90px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(52,211,153,0.15);
  border-radius: 12px;
  padding: var(--space-3);
  flex-shrink: 0;
}

.ghost-phone-screen {
  width: 100%;
  aspect-ratio: 9/16;
  background: rgba(0,0,0,0.5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ghost-overlay-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px dashed rgba(52,211,153,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ghost-pulse 2.5s ease-in-out infinite;
}

@keyframes ghost-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; border-color: rgba(52,211,153,0.8); }
}

.ghost-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.ghost-info-line {
  height: 5px;
  border-radius: 3px;
  background: rgba(52,211,153,0.12);
}

.ghost-info-line.w-full { width: 100%; }
.ghost-info-line.w-3q { width: 70%; }
.ghost-info-line.w-half { width: 50%; background: rgba(52,211,153,0.07); }

/* Project body */
.project-body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.project-name {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.project-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-4);
  flex: 1;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.stack-chip {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  padding: 3px var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.project-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) ease;
  text-decoration: none;
}

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

.project-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.project-link.primary {
  color: var(--text-accent);
}

.project-link.primary:hover {
  color: var(--text-on-accent);
}

/* --------------------------------------------------------------------------
   MORE PROJECTS — Smaller grid
   -------------------------------------------------------------------------- */
.more-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.project-card-sm {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--bg-elevated);
  transition: all var(--duration-base) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.project-card-sm:hover {
  border-color: var(--border-emphasis);
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
}

.project-card-sm:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-card-sm .project-name {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.project-card-sm .project-desc {
  font-size: var(--text-sm);
  flex: 1;
}

.project-card-sm .project-links {
  gap: var(--space-4);
  padding-top: var(--space-4);
}

/* --------------------------------------------------------------------------
   HIGHLIGHTS — Condensed achievement rows
   -------------------------------------------------------------------------- */
.highlights-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--duration-fast) ease;
}

.highlight-item:last-child {
  border-bottom: none;
}

.highlight-item:hover .highlight-icon {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.highlight-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--duration-fast) ease;
}

.highlight-icon.gold {
  background: var(--color-warning-subtle);
  border-color: rgba(251,191,36,0.2);
  color: var(--color-warning);
}

.highlight-content {
  flex: 1;
}

.highlight-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  letter-spacing: -0.01em;
}

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

.highlight-date {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   SKILLS — Categorized columns
   -------------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-8);
}

.skill-category {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.skill-category-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-1);
}

.skill-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) ease;
}

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

.skill-item svg {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   ARTICLES — Card layout
   -------------------------------------------------------------------------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-5);
}

.article-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--bg-elevated);
  transition: all var(--duration-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.article-card:hover {
  border-color: var(--border-emphasis);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.article-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.article-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.article-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.article-summary {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: var(--space-5);
}

.article-read {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-accent);
  margin-top: auto;
  transition: gap var(--duration-fast) ease;
}

.article-card:hover .article-read {
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   CONTACT SECTION
   -------------------------------------------------------------------------- */
.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--duration-fast) ease;
}

.contact-link:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-emphasis);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.contact-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   AWARD BANNER
   -------------------------------------------------------------------------- */
.award-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(135deg, rgba(251,191,36,0.08) 0%, rgba(245,158,11,0.04) 100%);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-12);
}

.award-banner svg {
  color: var(--color-warning);
  flex-shrink: 0;
}

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

.award-banner-text strong {
  color: var(--color-warning);
  font-weight: 600;
}

.award-banner-link {
  color: var(--color-warning);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   STATUS CARD — for active projects (no progress bars)
   -------------------------------------------------------------------------- */
.status-phase {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.status-phase-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-1);
}

.phase-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.phase-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-dot.active {
  background: var(--color-success);
  box-shadow: 0 0 6px rgba(52,211,153,0.5);
}

.phase-dot.done {
  background: var(--accent);
}

.phase-dot.pending {
  background: var(--border-default);
}

/* --------------------------------------------------------------------------
   PAGE CARDS — /now, /uses, /articles, /resume section
   -------------------------------------------------------------------------- */
.more-pages-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  max-width: 820px;
  margin: 0 auto;
}

.page-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--duration-base) var(--ease-out);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.page-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration-base) ease;
}

.page-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.page-card:hover::before {
  opacity: 1;
}

.page-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page-card:hover .page-card-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

.page-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--duration-fast) ease;
}

.page-card:hover .page-card-icon {
  background: var(--accent-subtle);
  border-color: var(--border-accent);
  color: var(--accent);
}

.page-card-content {
  flex: 1;
  min-width: 0;
}

.page-card-label {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.page-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.page-card-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-card-arrow {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out),
              color var(--duration-fast) ease;
}

@media (max-width: 600px) {
  .more-pages-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-12) 0;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

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

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

.footer-link {
  color: var(--text-tertiary);
  transition: color var(--duration-fast) ease;
  text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   BACK LINK — for sub-pages
   -------------------------------------------------------------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: var(--space-8);
  transition: all var(--duration-fast) ease;
}

.back-link:hover {
  color: var(--text-primary);
  gap: var(--space-1);
}

.back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   USES PAGE — Icon-row layout
   -------------------------------------------------------------------------- */
.uses-section {
  margin-bottom: var(--space-12);
}

.uses-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.uses-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.uses-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.uses-item:last-child {
  border-bottom: none;
}

.uses-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.uses-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.uses-value {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   RESUME PAGE
   -------------------------------------------------------------------------- */
.resume-section {
  margin-bottom: var(--space-12);
}

.resume-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.resume-entry {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.resume-entry:last-child {
  border-bottom: none;
}

.resume-entry-meta {
  width: 120px;
  flex-shrink: 0;
}

.resume-entry-date {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  line-height: 1.5;
}

.resume-entry-content {
  flex: 1;
}

.resume-entry-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-1);
}

.resume-entry-sub {
  font-size: var(--text-sm);
  color: var(--text-accent);
  margin-bottom: var(--space-3);
}

.resume-entry-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

.resume-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-6);
}

.resume-skill-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.resume-skill-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.resume-skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------------
   NOW PAGE
   -------------------------------------------------------------------------- */
.now-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--bg-elevated);
  margin-bottom: var(--space-5);
}

.now-card.active {
  border-color: var(--border-accent);
  background: linear-gradient(135deg, rgba(99,102,241,0.05) 0%, var(--bg-elevated) 100%);
}

.now-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.now-phase-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------------
   SCROLL REVEAL ANIMATIONS
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

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

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* --------------------------------------------------------------------------
   INLINE SVG ICONS
   -------------------------------------------------------------------------- */
.icon {
  display: inline-block;
  flex-shrink: 0;
  line-height: 1;
}

.icon svg {
  display: block;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .section { padding: var(--space-16) 0; }
  .section-sm { padding: var(--space-12) 0; }

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

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

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .highlights-list .highlight-date {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .resume-entry {
    flex-direction: column;
    gap: var(--space-3);
  }

  .resume-entry-meta {
    width: auto;
  }

  .contact-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-link {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  .more-projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .featured-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}
