/* ============================================================
   RED RIVER LASER CO. — Design Tokens & Styles
   Palette: Sophisticated deep red + warm neutrals
   Fonts: Cabinet Grotesk (display) + Satoshi (body) via Fontshare
   ============================================================ */

/* --- Type Scale (Fluid) --- */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* --- Spacing (4px base) --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Radius --- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Content widths --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* --- Fonts --- */
  --font-display: 'Cabinet Grotesk', 'Inter', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ============================================================
   LIGHT MODE (Default)
   Deep crimson accent (#8B1A1A) + warm clean neutrals
   ============================================================ */
:root, [data-theme="light"] {
  /* Surfaces — clean white with warm undertone */
  --color-bg:               #fafaf8;
  --color-surface:          #ffffff;
  --color-surface-2:        #f5f4f1;
  --color-surface-offset:   #eeece8;
  --color-surface-offset-2: #e6e3de;
  --color-surface-dynamic:  #ddd9d3;
  --color-divider:          #d4d0ca;
  --color-border:           #c8c3bb;

  /* Text */
  --color-text:          #1a1814;
  --color-text-muted:    #6b6760;
  --color-text-faint:    #a9a59e;
  --color-text-inverse:  #fafaf8;

  /* Primary Accent — Deep River Red */
  --color-primary:         #8B1A1A;
  --color-primary-hover:   #6e1414;
  --color-primary-active:  #520f0f;
  --color-primary-highlight: #f0d9d9;

  /* Success */
  --color-success:       #2d6a2d;
  --color-success-hover: #1e4f1e;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 24, 20, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 24, 20, 0.08);
  --shadow-lg: 0 12px 32px rgba(26, 24, 20, 0.12);
  --shadow-xl: 0 20px 48px rgba(26, 24, 20, 0.16);
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  --color-bg:               #141210;
  --color-surface:          #1c1a17;
  --color-surface-2:        #232019;
  --color-surface-offset:   #1e1c18;
  --color-surface-offset-2: #28251f;
  --color-surface-dynamic:  #302d26;
  --color-divider:          #2e2b25;
  --color-border:           #3d3a33;

  --color-text:          #e0ddd8;
  --color-text-muted:    #908c85;
  --color-text-faint:    #5e5a54;
  --color-text-inverse:  #1a1814;

  --color-primary:         #d45454;
  --color-primary-hover:   #e06b6b;
  --color-primary-active:  #b43c3c;
  --color-primary-highlight: #3d2525;

  --color-success:       #5daa5d;
  --color-success-hover: #4d8f4d;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #141210;
    --color-surface:          #1c1a17;
    --color-surface-2:        #232019;
    --color-surface-offset:   #1e1c18;
    --color-surface-offset-2: #28251f;
    --color-surface-dynamic:  #302d26;
    --color-divider:          #2e2b25;
    --color-border:           #3d3a33;
    --color-text:          #e0ddd8;
    --color-text-muted:    #908c85;
    --color-text-faint:    #5e5a54;
    --color-text-inverse:  #1a1814;
    --color-primary:         #d45454;
    --color-primary-hover:   #e06b6b;
    --color-primary-active:  #b43c3c;
    --color-primary-highlight: #3d2525;
    --color-success:       #5daa5d;
    --color-success-hover: #4d8f4d;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.5);
  }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--content-default);
}

section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow 0.3s ease;
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
  gap: var(--space-4);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  flex-shrink: 0;
}

.header__logo svg {
  width: 40px;
  height: 40px;
}

.header__logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.header__logo-text span {
  display: block;
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.nav__link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  position: relative;
  padding-block: var(--space-1);
}

.nav__link:hover {
  color: var(--color-text);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.nav__link:hover::after {
  width: 100%;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
  border-radius: 1px;
}

.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);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100dvh;
    flex-direction: column;
    align-items: flex-start;
    background: var(--color-bg);
    padding: var(--space-20) var(--space-8) var(--space-8);
    gap: var(--space-4);
    transition: right 0.3s ease;
    box-shadow: var(--shadow-xl);
    z-index: 90;
  }

  .nav__links.open {
    right: 0;
  }

  .nav__link {
    font-size: var(--text-base);
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-bg) 92%, transparent) 0%,
    color-mix(in srgb, var(--color-bg) 70%, transparent) 50%,
    color-mix(in srgb, var(--color-bg) 40%, transparent) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 540px;
  line-height: 1.5;
}

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

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-interactive);
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn--primary:active {
  background: var(--color-primary-active);
  transform: translateY(0);
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-text-muted);
  background: var(--color-surface-offset);
}

.btn--large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* ============================================================
   SERVICES
   ============================================================ */
.services {
  background: var(--color-surface-2);
}

.section-header {
  text-align: center;
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-16));
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  max-width: 560px;
  margin-inline: auto;
}

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

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

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.service-card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.service-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

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

.service-card__content {
  padding: var(--space-6);
}

.service-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.service-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ============================================================
   WHY CHOOSE US
   ============================================================ */
.why-us {
  background: var(--color-bg);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

@media (max-width: 960px) {
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.why-card {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
}

.why-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.why-card__icon svg {
  width: 28px;
  height: 28px;
}

.why-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.why-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  background: var(--color-surface-2);
}

.about__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  align-items: center;
}

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

.about__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.about__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.about__content {
  max-width: 540px;
}

.about__content .section-label {
  text-align: left;
}

.about__content .section-title {
  text-align: left;
  margin-bottom: var(--space-4);
}

.about__text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.about__list {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-6);
}

.about__list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  padding-block: var(--space-2);
}

.about__list li svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  background: var(--color-bg);
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  align-items: start;
}

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

.contact__info {
  max-width: 480px;
}

.contact__info .section-label {
  text-align: left;
}

.contact__info .section-title {
  text-align: left;
  margin-bottom: var(--space-4);
}

.contact__info-text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.contact__detail {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.contact__detail svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.contact__detail a {
  color: var(--color-primary);
  text-decoration: none;
}

.contact__detail a:hover {
  text-decoration: underline;
}

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

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

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}

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

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-faint);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-8);
}

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

.footer__text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.footer__links a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--color-text);
}

/* ============================================================
   SCROLL REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Stagger children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.3s; }
