/* ==============================================
   CRITICAL CSS - Above-the-fold styles only
   Keep this file minimal for fast FCP/LCP
   ============================================== */

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

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

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-main, #2d2d2d);
  background: var(--bg-page-flat, #fff7ed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Theme Variables - Critical Only */
:root {
  --text-main: #5a3214;
  --text-secondary: #8B6F47;
  --text-muted: #a89073;
  --bg-page-flat: #fff7ed;
  --surface-1: #fafafa;
  --bg-card: rgba(255, 255, 255, 0.2);
  --bg-header: rgba(255, 255, 255, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.4);
  --accent: #059669;
  --glass-border: rgba(255, 255, 255, 0.3);
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --radius-md: 16px;
  --radius-pill: 999px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

[data-theme="dark"] {
  --text-main: #eef2ff;
  --text-secondary: #cbd5e1;
  --text-muted: rgba(203, 213, 225, 0.6);
  --bg-page-flat: #060912;
  --surface-1: #0a0a0a;
  --bg-card: rgba(20, 25, 40, 0.3);
  --bg-header: rgba(6, 9, 18, 0.5);
  --border-subtle: rgba(140, 182, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 100000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Header - Floating Nav Critical */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  padding: 16px;
}

.site-header.floating-nav .container,
.site-header.floating-nav #site-header-container {
  max-width: 820px;
  margin: 0 auto;
  height: 60px;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.88));
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 24px;
}

[data-theme="dark"] .site-header.floating-nav .container,
[data-theme="dark"] .site-header.floating-nav #site-header-container {
  background: linear-gradient(to bottom, rgba(15, 22, 41, 0.95), rgba(20, 27, 45, 0.92));
  border-color: rgba(140, 182, 255, 0.1);
}

.site-header .site-logo {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle {
  display: none;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero Section Critical */
.section.hero {
  min-height: 100vh;
  padding-top: 120px;
  padding-bottom: 4rem;
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 720px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

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

/* CTA Button */
.cta-link,
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #d97706, #e8a960);
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .cta-link,
[data-theme="dark"] .hero-cta {
  background: linear-gradient(135deg, #c4d7ff, #8cb6ff);
  color: #060912;
}

/* Selected Work Grid - First Card Above Fold */
.selected-work-section {
  padding: 6rem 0;
}

.selected-work-header {
  margin-bottom: 3rem;
}

.selected-work-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text-main);
}

/* Card Skeleton */
.spotlight-work-card {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  min-height: 320px;
}

/* Loading Placeholder */
.card-peek-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile Critical */
@media (max-width: 900px) {
  .nav-menu {
    display: none !important;
  }

  .nav-toggle {
    display: flex !important;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
  }

  .nav-toggle-bar {
    width: 20px;
    height: 2px;
    background: var(--text-main);
    position: relative;
  }

  .nav-toggle-bar::before,
  .nav-toggle-bar::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--text-main);
    left: 0;
  }

  .nav-toggle-bar::before {
    top: -6px;
  }

  .nav-toggle-bar::after {
    top: 6px;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
}

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

/* Print */
@media print {
  .site-header,
  .nav-toggle {
    display: none !important;
  }
}
