/* ============================================
   SNBO S.A.S. — Sierra Nevada Backoffice
   Design: Monochrome, time-aware theme
   ============================================ */

:root {
  /* Type Scale */
  --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 */
  --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;

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

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

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ========================
   LIGHT MODE (Day)
   ======================== */
:root, [data-theme="light"] {
  --color-bg: #ffffff;
  --color-surface: #fafafa;
  --color-surface-2: #f5f5f5;
  --color-border: #e0e0e0;
  --color-divider: #ebebeb;
  --color-text: #0a0a0a;
  --color-text-muted: #666666;
  --color-text-faint: #a0a0a0;
  --color-accent: #0a0a0a;
  --color-accent-hover: #333333;
  --color-accent-subtle: rgba(10, 10, 10, 0.08);
  --color-card-bg: #ffffff;
  --color-card-border: #e8e8e8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
}

/* 
   LOGO STRATEGY: Both logos are JPGs with opaque white backgrounds.
   - logo-negro.jpg = black text on white background (for light mode)
   - logo-blanco.jpg = white text on white background (invisible alone)
   
   Solution: Always use the black logo (logo-negro.jpg / logo--light class).
   In dark mode, apply CSS filter: invert(1) to flip it to white text on black bg.
*/

/* Always hide the white-text logo file (it's white-on-white JPG, unusable) */
.logo--dark,
.footer__logo--dark,
.about-visual__logo--dark {
  display: none !important;
}

/* Always show the black-text logo */
.logo--light,
.footer__logo--light,
.about-visual__logo--light {
  display: block;
}

/* In dark mode, invert the black logo to get white text on dark background */
[data-theme="dark"] .logo--light,
[data-theme="dark"] .footer__logo--light {
  filter: invert(1);
}

/* ========================
   DARK MODE (Night)
   ======================== */
[data-theme="dark"] {
  --color-bg: #0a0a0a;
  --color-surface: #111111;
  --color-surface-2: #1a1a1a;
  --color-border: #2a2a2a;
  --color-divider: #1f1f1f;
  --color-text: #f5f5f5;
  --color-text-muted: #999999;
  --color-text-faint: #555555;
  --color-accent: #f5f5f5;
  --color-accent-hover: #cccccc;
  --color-accent-subtle: rgba(245, 245, 245, 0.08);
  --color-card-bg: #111111;
  --color-card-border: #2a2a2a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}



/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a0a0a;
    --color-surface: #111111;
    --color-surface-2: #1a1a1a;
    --color-border: #2a2a2a;
    --color-divider: #1f1f1f;
    --color-text: #f5f5f5;
    --color-text-muted: #999999;
    --color-text-faint: #555555;
    --color-accent: #f5f5f5;
    --color-accent-hover: #cccccc;
    --color-accent-subtle: rgba(245, 245, 245, 0.08);
    --color-card-bg: #111111;
    --color-card-border: #2a2a2a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  }
  :root:not([data-theme]) .logo--light,
  :root:not([data-theme]) .footer__logo--light {
    filter: invert(1);
  }
}

/* ========================
   HEADER
   ======================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
  transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

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

.header__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

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

.nav-link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-text);
  transition: width 0.3s ease;
}

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

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

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

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--color-text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-accent-subtle);
}

/* Show/hide sun/moon icons based on theme */
:root .icon-moon,
[data-theme="light"] .icon-moon {
  display: none;
}
:root .icon-sun,
[data-theme="light"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: none;
}
[data-theme="dark"] .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .icon-sun {
    display: none;
  }
  :root:not([data-theme]) .icon-moon {
    display: block;
  }
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .header__nav { display: none; }
  .hamburger { display: flex; }
}

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  text-align: center;
}

.mobile-nav__link {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mobile-nav__link:hover {
  opacity: 0.6;
}

/* ========================
   HERO
   ======================== */
.hero {
  min-height: 85vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
  gap: var(--space-12);
}

.hero__tag {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

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

.hero__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 480px;
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

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

.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__graphic {
  width: 100%;
  max-width: 400px;
}

.hero__svg {
  width: 100%;
  height: auto;
  color: var(--color-text);
  animation: rotate-slow 60s linear infinite;
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: var(--space-16) var(--space-6) var(--space-12);
    gap: var(--space-8);
  }
  .hero__visual { order: -1; }
  .hero__graphic { max-width: 240px; margin: 0 auto; }
  .hero__title { font-size: clamp(2rem, 1rem + 4vw, 3.5rem); }
}

/* ========================
   BUTTONS
   ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  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);
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

.btn--primary {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn--primary:hover {
  opacity: 0.85;
}

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

.btn--outline:hover {
  border-color: var(--color-text);
  background: var(--color-accent-subtle);
}

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

/* ========================
   SECTIONS
   ======================== */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) 0;
}

.section--alt {
  background: var(--color-surface);
  transition: background-color 0.4s ease;
}

.section__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section__header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-12);
}

.section__tag {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

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

.section__desc {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin: 0 auto;
}

/* ========================
   SERVICES GRID
   ======================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.service-card {
  padding: var(--space-8);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  background: var(--color-card-bg);
  transition: all 0.3s ease;
}

.service-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-text-faint);
  transform: translateY(-2px);
}

.service-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

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

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

@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr; }
  .service-card { padding: var(--space-6); }
}

/* ========================
   ABOUT
   ======================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.about-text__body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-5);
}

.about-stats {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-divider);
}

.stat__number {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.stat__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-visual__box {
  padding: var(--space-10);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-xl);
  background: var(--color-card-bg);
  text-align: center;
  width: 100%;
  max-width: 380px;
}

/* Logo images are JPGs with white backgrounds, so we need special handling */
.about-visual__logo {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.about-visual__logo {
  margin: 0 auto var(--space-6);
  width: 200px;
  height: auto;
  object-fit: contain;
}

.about-visual__name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.about-visual__nit {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .about-visual { order: -1; }
  .about-stats {
    flex-wrap: wrap;
    gap: var(--space-6);
  }
}

/* ========================
   COVERAGE
   ======================== */
.coverage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.coverage-card {
  text-align: center;
  padding: var(--space-8);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  background: var(--color-card-bg);
  transition: all 0.3s ease;
}

.coverage-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.coverage-card svg {
  margin: 0 auto var(--space-4);
  color: var(--color-text);
}

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

.coverage-card p {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

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

/* ========================
   CTA SECTION
   ======================== */
.section--cta {
  background: var(--color-surface-2);
  transition: background-color 0.4s ease;
}

.cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-content__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.cta-content__desc {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

/* ========================
   CONTACT
   ======================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

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

.contact-card svg {
  margin: 0 auto var(--space-4);
  color: var(--color-text);
}

.contact-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.contact-card__link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-card__link:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

.contact-card__text {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

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

/* ========================
   FOOTER
   ======================== */
.footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-12) 0 var(--space-8);
  transition: border-color 0.4s ease;
}

.footer__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.footer__top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

.footer__logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  margin-bottom: var(--space-3);
}

.footer__company {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.footer__nit {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__links a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__contact a,
.footer__contact span {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.footer__bottom p {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__attribution {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

@media (max-width: 768px) {
  .footer__top {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .footer__bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}
