/* ==========================================================================
   EMBR Works - Stylesheet
   Based on DESIGN.md
   ========================================================================== */

/* Font Face */
@font-face {
  font-family: 'Digital Serial';
  src: url('../fonts/DigitalSerial-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Digital Serial';
  src: url('../fonts/DigitalSerial-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* CSS Variables */
:root {
  /* Colors - Core */
  --color-void: #1A202C;
  --color-charcoal: #2D3748;
  --color-slate: #4A5568;
  --color-slate-block: #6B7D8A;
  --color-steel: #8B9CAD;
  
  /* Colors - Ember */
  --color-ember: #FF6B5B;
  --color-ember-glow: #FF8C7A;
  --color-ember-hot: #FFAA99;
  --color-ember-deep: #E85A4F;
  --color-ember-tint: #FFF5F3;
  
  /* Colors - Neutrals */
  --color-white: #FFFFFF;
  --color-gray-50: #F7FAFC;
  --color-gray-100: #EDF2F7;
  --color-gray-400: #A0AEC0;
  --color-gray-600: #718096;
  --color-gray-800: #2D3748;
  
  /* Typography */
  --font-display: 'Digital Serial', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  
  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.12);
  --shadow-ember: 0 4px 14px rgba(255,107,91,0.4);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-gray-600);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

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

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-gray-800);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.text-ember {
  color: var(--color-ember);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-ember) 0%, var(--color-ember-deep) 100%);
  color: var(--color-white);
  box-shadow: var(--shadow-ember);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 91, 0.5);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 107, 91, 0.5);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 18px;
}

.btn-full {
  width: 100%;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4) 0;
  transition: all var(--transition-base);
}

.nav.scrolled {
  background: rgba(26, 32, 44, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: var(--space-8);
}

.nav-link {
  color: var(--color-gray-400);
  font-weight: 500;
  font-size: 15px;
  transition: color var(--transition-fast);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-white);
  transition: all var(--transition-base);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--color-void);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 30% 80%, rgba(255, 107, 91, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 20%, rgba(255, 140, 122, 0.1) 0%, transparent 40%),
    linear-gradient(180deg, var(--color-void) 0%, var(--color-charcoal) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: var(--space-24) 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: var(--space-6);
  letter-spacing: 0.02em;
}

.hero-subtitle {
  font-size: clamp(18px, 3vw, 22px);
  color: var(--color-gray-400);
  margin-bottom: var(--space-8);
  max-width: 600px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Services Section */
.services {
  padding: var(--space-24) 0;
  background: var(--color-gray-50);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-title {
  font-size: clamp(32px, 5vw, 48px);
  margin-bottom: var(--space-4);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.section-subtitle {
  font-size: 18px;
  color: var(--color-gray-600);
  max-width: 600px;
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  border: 1px solid var(--color-gray-100);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 107, 91, 0.3);
}

.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-ember-tint);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  color: var(--color-ember);
}

.card-title {
  font-size: 20px;
  margin-bottom: var(--space-3);
  color: var(--color-gray-800);
}

.card-text {
  font-size: 15px;
  color: var(--color-gray-600);
  line-height: 1.6;
}

/* About Section */
.about {
  padding: var(--space-24) 0;
  background: var(--color-charcoal);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.about .section-title {
  color: var(--color-white);
}

.about-text {
  color: var(--color-gray-400);
  font-size: 18px;
  margin-bottom: var(--space-6);
  line-height: 1.7;
}

.about-stats {
  display: flex;
  gap: var(--space-12);
  margin-top: var(--space-12);
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  color: var(--color-ember);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--color-gray-400);
  margin-top: var(--space-2);
  display: block;
}

/* Cube Grid Animation */
.about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cube-grid {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 8px;
  transform: perspective(500px) rotateX(15deg) rotateY(-15deg);
}

.cube {
  width: 80px;
  height: 80px;
  background: var(--color-slate-block);
  border-radius: var(--radius-sm);
  position: relative;
  box-shadow: 
    inset 0 -20px 30px rgba(0,0,0,0.2),
    0 0 20px rgba(255, 107, 91, 0.3);
  animation: pulse 3s ease-in-out infinite;
}

.cube:nth-child(2) { animation-delay: 0.2s; }
.cube:nth-child(3) { animation-delay: 0.4s; }
.cube:nth-child(4) { animation-delay: 0.1s; }
.cube:nth-child(5) { animation-delay: 0.3s; }
.cube:nth-child(6) { animation-delay: 0.5s; }
.cube:nth-child(7) { animation-delay: 0.15s; }
.cube:nth-child(8) { animation-delay: 0.35s; }
.cube:nth-child(9) { animation-delay: 0.25s; }

@keyframes pulse {
  0%, 100% { 
    box-shadow: 
      inset 0 -20px 30px rgba(0,0,0,0.2),
      0 0 20px rgba(255, 107, 91, 0.2);
  }
  50% { 
    box-shadow: 
      inset 0 -20px 30px rgba(0,0,0,0.2),
      0 0 30px rgba(255, 107, 91, 0.5);
  }
}

/* Contact Section */
.contact {
  padding: var(--space-24) 0;
  background: var(--color-void);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: start;
}

.contact .section-title {
  color: var(--color-white);
}

.contact-text {
  color: var(--color-gray-400);
  font-size: 18px;
  margin-bottom: var(--space-8);
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-gray-400);
  transition: color var(--transition-fast);
}

.contact-link:hover {
  color: var(--color-ember);
}

.contact-link svg {
  color: var(--color-ember);
}

.contact-form {
  background: var(--color-charcoal);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-slate);
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  color: var(--color-gray-400);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  background: var(--color-void);
  border: 2px solid var(--color-slate);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 16px;
  color: var(--color-white);
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-ember);
  box-shadow: 0 0 0 3px rgba(255, 107, 91, 0.15);
}

.form-input::placeholder {
  color: var(--color-slate);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-success {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

/* Footer */
.footer {
  padding: var(--space-12) 0;
  background: var(--color-charcoal);
  border-top: 1px solid var(--color-slate);
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  text-align: center;
}

.footer-brand .logo-text {
  font-family: var(--font-display);
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-tagline {
  color: var(--color-gray-400);
  font-size: 14px;
  margin-top: var(--space-2);
}

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

.footer-links a {
  color: var(--color-gray-400);
  font-size: 14px;
  transition: color var(--transition-fast);
}

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

.footer-copy {
  color: var(--color-slate);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-void);
    padding: var(--space-6);
    gap: var(--space-4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
  }

  .nav-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero-content {
    padding: var(--space-16) 0;
  }

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

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .about-visual {
    order: -1;
  }

  .about-stats {
    justify-content: center;
  }

  .cube-grid {
    grid-template-columns: repeat(3, 60px);
  }

  .cube {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .about-stats {
    flex-direction: column;
    gap: var(--space-6);
  }
}

/* Headshot */
.headshot {
  max-width: 350px;
  width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
