/* ========================================
   CSS Custom Properties
   ======================================== */

@property --gradient-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  /* Brand Colors (OKLCH) */
  --brand: oklch(0.45 0.12 250);
  --brand-light: oklch(0.65 0.08 250);
  --brand-dark: oklch(0.25 0.15 250);
  --secondary: oklch(0.35 0.02 280);
  --secondary-light: oklch(0.55 0.01 280);
  --accent: oklch(0.68 0.18 35);

  /* Surfaces (Tinted Neutrals) */
  --surface-1: oklch(0.98 0.004 250);
  --surface-2: oklch(0.93 0.006 250);
  --surface-3: oklch(0.88 0.008 250);
  --surface-dark: oklch(0.18 0.012 250);

  /* Text */
  --text-primary: oklch(0.12 0.01 250);
  --text-secondary: oklch(0.42 0.015 250);
  --text-on-dark: oklch(0.96 0.005 250);

  /* Typography */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Instrument Sans', 'Helvetica Neue', sans-serif;

  /* Spacing (8px base grid) */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 128px;

  /* Layout */
  --max-width: 1400px;
  --nav-height: 80px;
}

/* ========================================
   Base Styles
   ======================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--surface-1);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

::selection {
  background: color-mix(in oklab, var(--accent) 30%, white);
  color: var(--text-primary);
}

/* ========================================
   Navigation
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-md) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in oklab, var(--brand) 10%, transparent);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-dark);
}

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

.nav-phone {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 150ms ease-out;
}

.nav-phone:hover {
  color: var(--brand);
}

.nav-cta {
  padding: 12px 24px;
  background: var(--brand);
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 4px;
  border: 2px solid var(--brand);
  transition: all 150ms ease-out;
}

.nav-cta:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-cta:active {
  transform: scale(0.98);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 300ms ease;
}

.nav-links {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  bottom: 0;
  width: 280px;
  background: var(--surface-dark);
  list-style: none;
  padding: var(--space-xl) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links.open {
  transform: translateX(0);
}

.nav-links a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-on-dark);
  padding: var(--space-sm) 0;
  transition: color 150ms ease-out;
}

.nav-links a:hover {
  color: var(--accent);
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
  position: relative;
  height: 100vh;
  min-height: 650px;
  display: flex;
  align-items: flex-end;
  padding: var(--space-2xl) var(--space-xl);
  overflow: hidden;
  background: var(--surface-dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('images/hero.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
  animation: parallax linear;
  animation-timeline: scroll();
}

@keyframes parallax {
  to { transform: translateY(-20%); }
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--gradient-angle), oklch(0.1 0.01 250) 0%, transparent 70%);
  animation: rotate-gradient 12s linear infinite;
}

@keyframes rotate-gradient {
  to { --gradient-angle: 180deg; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--text-on-dark);
  margin-bottom: var(--space-md);
  clip-path: inset(0 100% 0 0);
  animation: title-reveal 600ms cubic-bezier(0.16, 1, 0.3, 1) 200ms forwards;
}

@keyframes title-reveal {
  to { clip-path: inset(0 0 0 0); }
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 400;
  line-height: 1.6;
  color: color-mix(in oklab, var(--text-on-dark) 75%, transparent);
  max-width: 600px;
  margin-bottom: var(--space-xl);
  opacity: 0;
  animation: fade-in-up 600ms cubic-bezier(0.16, 1, 0.3, 1) 500ms forwards;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-cta {
  display: inline-block;
  padding: 16px 40px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 4px;
  border: 2px solid var(--accent);
  transition: all 150ms ease-out;
  opacity: 0;
  animation: fade-in-up 600ms cubic-bezier(0.16, 1, 0.3, 1) 700ms forwards;
}

.hero-cta:hover {
  background: color-mix(in oklab, var(--accent) 85%, black);
  border-color: color-mix(in oklab, var(--accent) 85%, black);
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.hero-cta:active {
  transform: scale(0.98);
}

.hero-scroll {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: color-mix(in oklab, var(--text-on-dark) 50%, transparent);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 2;
}

.hero-scroll-line {
  width: 1px;
  height: 60px;
  background: color-mix(in oklab, var(--text-on-dark) 30%, transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(1); opacity: 0.3; }
  50% { transform: scaleY(0.6); opacity: 0.7; }
}

/* ========================================
   Section Shared Styles
   ======================================== */

.section {
  padding: var(--space-3xl) var(--space-xl);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  opacity: 0;
  animation: reveal-label linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 60%;
}

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

.section-label::before {
  content: '';
  width: 40px;
  height: 2px;
  background: var(--brand);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  max-width: 900px;
  margin-bottom: var(--space-2xl);
  clip-path: inset(0 100% 0 0);
  animation: heading-wipe linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 70%;
}

@keyframes heading-wipe {
  to { clip-path: inset(0 0 0 0); }
}

.about .section-heading,
.about .section-label {
  color: var(--text-on-dark);
}

.about .section-label::before {
  background: var(--accent);
}

/* ========================================
   Services Section
   ======================================== */

.services {
  background: var(--surface-1);
}

.services-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: repeat(2, auto);
  gap: var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

.service-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--brand) 10%, transparent);
  transition: all 150ms ease-out;
  opacity: 0;
  animation: card-reveal linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 80%;
}

@keyframes card-reveal {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.service-card:nth-child(2) {
  animation-delay: 100ms;
}

.service-card:nth-child(3) {
  animation-delay: 200ms;
}

.service-card:nth-child(4) {
  animation-delay: 300ms;
}

.service-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 150ms ease-out;
}

.service-card:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
}

.service-card:hover img {
  transform: scale(1.05);
}

.service-card-featured {
  grid-row: 1 / 3;
}

.service-card-featured img {
  height: 280px;
}

.service-content {
  padding: var(--space-md);
}

.service-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.service-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.service-price {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  padding: 6px 12px;
  background: color-mix(in oklab, var(--brand) 10%, white);
  border-radius: 4px;
}

/* ========================================
   About Section
   ======================================== */

.about {
  background: var(--surface-dark);
  color: var(--text-on-dark);
  padding: var(--space-2xl) var(--space-xl);
}

.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
  align-items: center;
}

.about-image-wrapper {
  position: relative;
}

.about-image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  opacity: 0;
  animation: img-reveal linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 70%;
}

@keyframes img-reveal {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.about-stats-overlay {
  position: absolute;
  bottom: var(--space-md);
  left: var(--space-md);
  right: var(--space-md);
  display: flex;
  gap: var(--space-md);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  padding: var(--space-md);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
  flex: 1;
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.4;
  color: color-mix(in oklab, var(--text-on-dark) 70%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.about-content {
  opacity: 0;
  animation: content-reveal linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 60%;
}

@keyframes content-reveal {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.about-text {
  font-size: 1rem;
  line-height: 1.8;
  color: color-mix(in oklab, var(--text-on-dark) 85%, transparent);
  margin-bottom: var(--space-md);
}

/* ========================================
   Testimonials Section
   ======================================== */

.testimonials {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  padding: var(--space-2xl) var(--space-md);
}

.testimonials-scroll {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.testimonial-card {
  background: white;
  padding: var(--space-lg);
  border-radius: 8px;
  border: 1px solid color-mix(in oklab, var(--brand) 10%, transparent);
  opacity: 0;
  animation: card-reveal linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 80%;
}

.testimonial-card:nth-child(2) {
  animation-delay: 100ms;
}

.testimonial-card:nth-child(3) {
  animation-delay: 200ms;
}

.testimonial-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-style: italic;
}

.testimonial-author {
  padding-top: var(--space-sm);
  border-top: 1px solid var(--surface-3);
}

.testimonial-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.testimonial-location {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========================================
   Contact CTA Section
   ======================================== */

.contact-cta {
  position: relative;
  padding: var(--space-3xl) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 500px;
  overflow: hidden;
}

.contact-cta-bg {
  position: absolute;
  inset: 0;
  background-image: url('images/cta-bg.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.contact-cta-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: oklch(0.15 0.01 250);
  opacity: 0.85;
}

.contact-cta-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.contact-heading {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--text-on-dark);
  margin-bottom: var(--space-md);
}

.contact-subheading {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: color-mix(in oklab, var(--text-on-dark) 75%, transparent);
  margin-bottom: var(--space-xl);
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
}

.contact-phone {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  transition: color 150ms ease-out;
}

.contact-phone:hover {
  color: color-mix(in oklab, var(--accent) 85%, white);
}

.contact-address {
  font-size: 1.1rem;
  color: color-mix(in oklab, var(--text-on-dark) 70%, transparent);
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background: var(--surface-dark);
  color: var(--text-on-dark);
  padding: var(--space-xl) var(--space-xl) var(--space-md);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--space-md);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.footer-tagline {
  font-size: 0.9rem;
  color: color-mix(in oklab, var(--text-on-dark) 60%, transparent);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  text-align: right;
}

.footer-contact a {
  font-weight: 500;
  transition: color 150ms ease-out;
}

.footer-contact a:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: color-mix(in oklab, var(--text-on-dark) 50%, transparent);
}

/* ========================================
   Responsive Design
   ======================================== */

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

  .service-card-featured {
    grid-row: auto;
  }

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

  .testimonials-scroll {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

@media (max-width: 768px) {
  .nav {
    padding: var(--space-sm) var(--space-md);
  }

  .nav-contact {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: var(--space-lg) var(--space-md);
    align-items: center;
    justify-content: center;
  }

  .hero-content {
    text-align: center;
  }

  .hero-scroll {
    display: none;
  }

  .section {
    padding: var(--space-2xl) var(--space-md);
  }

  .services,
  .about,
  .testimonials {
    padding: var(--space-2xl) var(--space-md);
  }

  .about-stats-overlay {
    position: static;
    margin-top: var(--space-md);
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .footer-contact {
    text-align: left;
  }
}

@media (pointer: coarse) {
  .nav-cta,
  .hero-cta {
    padding: 16px 32px;
  }

  .nav-links a {
    padding: var(--space-md) 0;
  }
}

/* ========================================
   Reduced Motion
   ======================================== */

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

  .hero-bg {
    animation: none;
  }

  .service-card:hover,
  .nav-cta:hover,
  .hero-cta:hover {
    transform: none;
  }
}
