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

html {
  scroll-behavior: smooth;
}

:root {
  /* Senior-tier color palette */
  --color-bg: #FAFAFA;
  --color-bg-pure: #FFFFFF;
  --color-bg-subtle: #F5F5F5;
  --color-bg-elevated: #FFFFFF;
  --color-text-primary: #0D0D0D;
  --color-text-secondary: #555555;
  --color-text-tertiary: #888888;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-hover: rgba(0, 0, 0, 0.15);
  --color-accent: #1a1a1a;
  
  /* Strategic accent colors - categorized by project type */
  --color-sage: #E8EDE9;      /* Platform/System projects */
  --color-sand: #F5F3EF;      /* Design System projects */
  --color-clay: #F2EBE6;      /* Growth/Monetization projects */
  --color-mist: #EAEEF2;      /* Retention/Lifecycle projects */
  --color-cream: #FAF9F7;     /* Creative/Illustration projects */
  
  /* Squircle radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;
  
  /* Subtle shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.03);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-elevated: 0 20px 40px -12px rgb(0 0 0 / 0.08);
  
  /* Fluid transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', 'Georgia', serif;
  
  /* Type Scale — Consolidated (7 sizes) */
  --text-xs: 12px;      /* Tiny labels, captions */
  --text-sm: 14px;      /* Small labels, metadata */
  --text-base: 17px;    /* Body text */
  --text-lg: 19px;      /* Lead paragraphs */
  --text-xl: 22px;      /* Subheadings */
  --text-2xl: 28px;     /* Section titles */
  --text-3xl: 44px;     /* Hero titles */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  font-size: var(--text-base);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 48px 64px;
}

/* Header */
/* Site Header — Centered Logo Style with Frosted Glass */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 16px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.site-header .header-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-header .header-center {
  display: flex;
  justify-content: center;
}

.site-header .header-center a {
  display: flex;
  padding: 8px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.site-header .header-center a:hover {
  background: rgba(0, 0, 0, 0.04);
}

.site-header .header-logo {
  width: 64px;
  height: 64px;
  transition: opacity 0.2s ease;
}

.site-header .header-center a:hover .header-logo {
  opacity: 0.7;
}

.site-header .header-nav {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.site-header .header-nav a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 100px;
  transition: all 0.2s ease;
}

.site-header .header-nav a:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.05);
}

/* Download CV Button */
.site-header .header-nav .header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-text-primary);
  color: var(--color-bg);
  padding: 8px 16px;
  border-radius: 100px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.site-header .header-nav .header-btn:hover {
  background: var(--color-text-secondary);
  color: var(--color-bg);
  transform: translateY(-1px);
}

.site-header .header-nav .header-btn svg {
  width: 14px;
  height: 14px;
}

/* Legacy header styles - keeping for compatibility */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 100px;
  opacity: 0;
  transform: translateY(-8px);
  animation: fadeIn 0.6s ease forwards;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
  box-shadow: var(--shadow-sm);
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

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

.nav {
  display: flex;
  gap: 40px;
}

.nav-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  position: relative;
  padding: 10px 0;
  transition: color var(--transition-fast);
  letter-spacing: 0.02em;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-text-primary);
  transition: width var(--transition-medium);
  border-radius: 1px;
}

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

/* Hero */
.hero {
  text-align: center;
  margin-top: 60px;
  margin-bottom: 100px;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeIn 0.6s ease 0.15s forwards;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.hero-title strong {
  font-weight: 600;
}

/* Portfolio Grid */
.portfolio {
  margin-bottom: 100px;
}

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

/* Card - OpenAI Style */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  text-decoration: none;
  transition: 
    transform var(--transition-medium),
    box-shadow var(--transition-medium),
    border-color var(--transition-medium);
}

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

.card.animate-in {
  animation: cardFadeIn 0.3s ease forwards;
}

/* Subtle background tints for cards */
.card--peach { background: var(--color-clay); }
.card--lavender { background: var(--color-mist); }
.card--mint { background: var(--color-sage); }
.card--yellow { background: var(--color-sand); }
.card--gradient { background: var(--color-cream); }

.card--wide {
  grid-column: 1 / 2;
}

.card-content {
  padding: 36px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.card-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Impact-first card title structure */
.card-impact {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.card-subtitle {
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.card-link {
  font-size: 17px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  transition: gap var(--transition-fast), opacity var(--transition-fast);
}

.card-link:hover {
  opacity: 0.7;
}

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

.card-image {
  position: relative;
  margin-top: auto;
  margin-left: 32px;
  height: 280px;
  border-radius: var(--radius-lg) 0 0 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-right: 0;
  border-bottom: 0;
  background: var(--color-bg);
  transition: transform var(--transition-medium);
}

.card:hover .card-image {
  /* Image hover handled by inner img scale */
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-image img {
  transform: scale(1.02);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--color-border);
  margin-bottom: 100px;
  transform: scaleX(0);
  animation: expandLine 0.8s ease 0.8s forwards;
}

/* Contact */
.contact {
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
}

.contact.animate-in {
  animation: fadeIn 0.5s ease forwards;
}

.contact-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.contact-text {
  font-size: var(--text-lg);
  line-height: 1.7;
  margin-bottom: 48px;
  color: var(--color-text-secondary);
}

.contact-email {
  color: var(--color-text-primary);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  transition: border-color var(--transition-fast), opacity var(--transition-fast);
}

.contact-email:hover {
  border-color: var(--color-text-primary);
  opacity: 0.8;
}

/* Social Links - Stroke Style */
.social-links {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.social-link {
  color: var(--color-text-secondary);
  padding: 14px;
  border-radius: var(--radius-md);
  transition: 
    color var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.social-link:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-subtle);
  transform: translateY(-1px);
}

.social-link svg {
  display: block;
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes expandLine {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Staggered card animations */
.card:nth-child(1).animate-in { animation-delay: 0s; }
.card:nth-child(2).animate-in { animation-delay: 0.05s; }
.card:nth-child(3).animate-in { animation-delay: 0.1s; }
.card:nth-child(4).animate-in { animation-delay: 0.15s; }
.card:nth-child(5).animate-in { animation-delay: 0.2s; }

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 80px 24px 40px;
  }
  
  .site-header {
    padding: 12px 16px;
  }
  
  .site-header .header-logo {
    width: 48px;
    height: 48px;
  }
  
  .site-header .header-nav {
    gap: 2px;
  }
  
  .site-header .header-nav a {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .card--wide {
    grid-column: auto;
  }
  
  .nav {
    gap: 24px;
  }
  
  .hero-title {
    font-size: 32px;
  }
  
  .hero {
    margin-bottom: 64px;
  }
  
  .card {
    min-height: 380px;
  }
  
  .card-content {
    padding: 24px;
  }
  
  .card-image {
    height: 200px;
    margin-left: 24px;
  }
  
  .card-impact {
    font-size: 22px;
  }
  
  .card-title {
    font-size: 12px;
  }
  
  .card-subtitle {
    font-size: 15px;
  }
  
  .contact-title {
    font-size: 28px;
  }
}

/* Selection styling */
::selection {
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-text-primary);
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Smooth scroll indicator pulse */
@keyframes subtlePulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
