/* ═══════════════════════════════════════════════════════════
   ALCARAZ LEGAL — Design Tokens & Component Styles
   Asesoría Jurídica Mercantilista · Valencia
   ═══════════════════════════════════════════════════════════ */

/* ── Type Scale ─────────────────────────────────────────── */
: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.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 200ms 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: 'Playfair Display', 'Georgia', serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
}

/* ── Light Mode (Default) ──────────────────────────────── */
:root,
[data-theme='light'] {
  --color-bg: #FAFAF7;
  --color-surface: #FFFFFF;
  --color-surface-2: #F5F4F0;
  --color-border: #DDD9D1;
  --color-divider: #E8E5DE;

  --color-text: #1B2A4A;
  --color-text-muted: #5A6478;
  --color-text-faint: #9CA3AF;
  --color-text-inverse: #FAFAF7;

  --color-primary: #1B2A4A;
  --color-primary-hover: #0F1D36;
  --color-accent: #B8943E;
  --color-accent-hover: #9A7A2E;
  --color-accent-light: #F5EDDA;

  --shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.06);
  --shadow-md: 0 4px 14px rgba(27, 42, 74, 0.08);
  --shadow-lg: 0 12px 32px rgba(27, 42, 74, 0.12);
}

/* ── Dark Mode ──────────────────────────────────────────── */
[data-theme='dark'] {
  --color-bg: #0F1520;
  --color-surface: #161D2B;
  --color-surface-2: #1C2536;
  --color-border: #2A3548;
  --color-divider: #222D40;

  --color-text: #D4D8E0;
  --color-text-muted: #8B93A5;
  --color-text-faint: #5A6478;
  --color-text-inverse: #0F1520;

  --color-primary: #A8B8D8;
  --color-primary-hover: #C0CEEA;
  --color-accent: #D4AD4B;
  --color-accent-hover: #E8C462;
  --color-accent-light: #2A2518;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* ── Global ─────────────────────────────────────────────── */
a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover {
  color: var(--color-accent-hover);
}

/* ── Skip Link ──────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 100;
  font-size: var(--text-sm);
}
.skip-link:focus {
  top: var(--space-2);
}

/* ── Header ─────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition: 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;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.header__logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.header__logo-text {
  font-family: var(--font-display);
  font-size: clamp(1rem, 0.85rem + 0.6vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.header__logo-sub {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

/* Desktop Nav */
.nav-desktop {
  display: none;
  align-items: center;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }
}
.nav-desktop a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
}
.nav-desktop a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}
.nav-desktop a:hover {
  color: var(--color-text);
}
.nav-desktop a:hover::after {
  width: 100%;
}

/* Header Controls */
.header__controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

/* Mobile hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-md);
}
.hamburger:hover {
  background: var(--color-surface-2);
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all 0.3s ease;
}
@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
}

/* Mobile Nav */
.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  box-shadow: var(--shadow-md);
  padding: var(--space-4) var(--space-6);
}
.nav-mobile.active {
  display: block;
}
.nav-mobile a {
  display: block;
  padding: var(--space-3) 0;
  font-size: var(--text-base);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--color-divider);
}
.nav-mobile a:last-child {
  border-bottom: none;
}
.nav-mobile a:hover,
.nav-mobile a:active {
  color: var(--color-accent);
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(15, 21, 32, 0.88) 0%,
    rgba(27, 42, 74, 0.75) 50%,
    rgba(27, 42, 74, 0.6) 100%
  );
}
.hero__content {
  position: relative;
  z-index: 1;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
  color: #F0EDE6;
}
.hero__tagline {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.hero__tagline::before {
  content: '';
  width: 32px;
  height: 1.5px;
  background: var(--color-accent);
  flex-shrink: 0;
}
.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.08;
  color: #F0EDE6;
  margin-bottom: var(--space-6);
  max-width: 14ch;
}
.hero__desc {
  font-size: var(--text-base);
  line-height: 1.7;
  color: rgba(240, 237, 230, 0.8);
  max-width: 48ch;
  margin-bottom: var(--space-8);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 48px;
}
.btn--primary {
  background: var(--color-accent);
  color: #1B2A4A;
}
.btn--primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 4px 16px rgba(184, 148, 62, 0.3);
}
.btn--outline {
  background: transparent;
  color: #F0EDE6;
  border: 1.5px solid rgba(240, 237, 230, 0.4);
}
.btn--outline:hover {
  background: rgba(240, 237, 230, 0.08);
  border-color: rgba(240, 237, 230, 0.7);
  color: #F0EDE6;
}
.btn--dark {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn--dark:hover {
  background: var(--color-primary-hover);
}

/* ── Sections ───────────────────────────────────────────── */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-6);
}
.section__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}
.section--alt {
  background: var(--color-surface-2);
}

.section__header {
  margin-bottom: var(--space-12);
}
.section__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.section__label::before {
  content: '';
  width: 24px;
  height: 1.5px;
  background: var(--color-accent);
  flex-shrink: 0;
}
.section__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}

/* ── Services Grid ──────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.service-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}
.service-card:hover::before {
  transform: scaleX(1);
}
.service-card__number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-accent);
  opacity: 0.25;
  line-height: 1;
  margin-bottom: var(--space-4);
}
.service-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.service-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ── About Section ──────────────────────────────────────── */
.about-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}
@media (min-width: 768px) {
  .about-layout {
    grid-template-columns: 1fr 1fr;
  }
}
.about__image-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
}
.about__image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.about__image-accent {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--color-accent);
  color: #1B2A4A;
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.about__text p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: var(--space-4);
}
.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}
.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}
.stat__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Approach / Values ──────────────────────────────────── */
.approach-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .approach-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.approach-item {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}
.approach-item__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}
.approach-item__icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}
.approach-item__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.approach-item__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ── Full-bleed Image Divider ───────────────────────────── */
.image-divider {
  width: 100%;
  height: 300px;
  overflow: hidden;
  position: relative;
}
@media (min-width: 768px) {
  .image-divider {
    height: 400px;
  }
}
.image-divider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-divider__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 21, 32, 0.3) 0%,
    rgba(27, 42, 74, 0.5) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-divider__quote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: #F0EDE6;
  text-align: center;
  max-width: 36ch;
  padding: 0 var(--space-6);
  font-style: italic;
}

/* ── Contact ────────────────────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
}
@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr 1fr;
  }
}
.contact__info h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
.contact__info p {
  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);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.contact-detail svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.form-group label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  transition: border-color 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(184, 148, 62, 0.12);
}
.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--color-primary);
  color: rgba(240, 237, 230, 0.75);
  padding: var(--space-12) var(--space-6) var(--space-6);
}
[data-theme='dark'] .footer {
  background: #0A0E17;
}
.footer__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}
.footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}
@media (min-width: 768px) {
  .footer__top {
    grid-template-columns: 2fr 1fr 1fr;
  }
}
.footer__brand-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: #F0EDE6;
  margin-bottom: var(--space-3);
}
.footer__brand-desc {
  font-size: var(--text-sm);
  line-height: 1.7;
  max-width: 38ch;
}
.footer h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}
.footer ul {
  list-style: none;
}
.footer ul li {
  margin-bottom: var(--space-2);
}
.footer ul a {
  font-size: var(--text-sm);
  color: rgba(240, 237, 230, 0.65);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer ul a:hover {
  color: var(--color-accent);
}
.footer__bottom {
  border-top: 1px solid rgba(240, 237, 230, 0.1);
  padding-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: rgba(240, 237, 230, 0.45);
}

/* ── Scroll Animations ──────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive Utilities ───────────────────────────────── */
@media (max-width: 767px) {
  .hero__title {
    font-size: var(--text-2xl);
  }
  .about__stats {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .stat {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
  }
}
