/* ============================================
   detecnico.com — Style System
   Arquitecto Técnico · Palma de Mallorca
   ============================================ */

/* --- Type Scale (Fluid) --- */
:root {
  --text-xs:   clamp(0.6875rem, 0.65rem + 0.2vw,  0.75rem);
  --text-sm:   clamp(0.75rem,   0.7rem  + 0.25vw, 0.875rem);
  --text-base: clamp(0.875rem,  0.85rem + 0.15vw, 1rem);
  --text-lg:   clamp(1rem,      0.9rem  + 0.5vw,  1.175rem);
  --text-xl:   clamp(1.25rem,   1rem    + 1vw,    1.75rem);
  --text-2xl:  clamp(1.5rem,    1rem    + 2vw,    2.5rem);
  --text-3xl:  clamp(2rem,      1rem    + 3vw,    3.375rem);

  /* --- 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;

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

  /* --- Radius --- */
  --radius-sm: 0.25rem;
  --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%;
}

/* ============================================
   Color Palette — Slate/Charcoal + Stone Accent
   Inspired by architecture: stone, shadow, precision
   ============================================ */

:root, [data-theme="light"] {
  --color-bg:             #f5f5f3;
  --color-surface:        #ffffff;
  --color-surface-2:      #fafaf8;
  --color-surface-offset: #eeedeb;
  --color-divider:        #dddcd9;
  --color-border:         #c8c7c4;

  --color-text:           #1a1a1a;
  --color-text-muted:     #5c5c5c;
  --color-text-faint:     #a0a0a0;
  --color-text-inverse:   #f5f5f3;

  --color-primary:        #8a7e72;
  --color-primary-hover:  #6f6459;
  --color-primary-active: #5c5248;
  --color-primary-light:  #ede9e4;

  --color-error:          #b5343a;
  --color-success:        #2d7a3e;

  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.05);
  --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.07);
  --shadow-lg: 0 12px 32px rgba(26, 26, 26, 0.1);
}

[data-theme="dark"] {
  --color-bg:             #131210;
  --color-surface:        #1c1b18;
  --color-surface-2:      #21201d;
  --color-surface-offset: #181714;
  --color-divider:        #2d2b27;
  --color-border:         #3d3a35;

  --color-text:           #e0e0de;
  --color-text-muted:     #8a8a88;
  --color-text-faint:     #5a5a58;
  --color-text-inverse:   #111111;

  --color-primary:        #b5a99a;
  --color-primary-hover:  #c9bfb3;
  --color-primary-active: #d4ccc2;
  --color-primary-light:  #2c2824;

  --color-error:          #e06b70;
  --color-success:        #5fb573;

  --shadow-sm: 0 1px 2px 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);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #131210;
    --color-surface:        #1c1b18;
    --color-surface-2:      #21201d;
    --color-surface-offset: #181714;
    --color-divider:        #2d2b27;
    --color-border:         #3d3a35;

    --color-text:           #e0e0de;
    --color-text-muted:     #8a8a88;
    --color-text-faint:     #5a5a58;
    --color-text-inverse:   #111111;

    --color-primary:        #b5a99a;
    --color-primary-hover:  #c9bfb3;
    --color-primary-active: #d4ccc2;
    --color-primary-light:  #2c2824;

    --color-error:          #e06b70;
    --color-success:        #5fb573;

    --shadow-sm: 0 1px 2px 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);
  }
}


/* ============================================
   Global Dramatic Background
   ============================================ */

body {
  background: url('./assets/hero.png') no-repeat center center fixed;
  background-size: cover;
}

/* Dark overlay for all content sections after hero */
.services,
.contact,
.footer {
  position: relative;
}

.services::before,
.contact::before,
.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 0;
}

.services > .container,
.contact > .container,
.footer > .container,
.footer__inner {
  position: relative;
  z-index: 1;
}


/* ============================================
   Layout & Components
   ============================================ */

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

@media (max-width: 768px) {
  .container {
    padding-inline: var(--space-4);
  }
}


/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.header--scrolled {
  background: rgba(30, 25, 18, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* White header text over hero */
.header:not(.header--scrolled) .header__wordmark,
.header:not(.header--scrolled) .header__logo svg {
  color: rgba(255, 255, 255, 0.9);
}

.header:not(.header--scrolled) .header__links a {
  color: rgba(255, 255, 255, 0.75);
}

.header:not(.header--scrolled) .header__links a:hover {
  color: #ffffff;
}

.header:not(.header--scrolled) .header__links a::after {
  background: rgba(255, 255, 255, 0.8);
}

.header:not(.header--scrolled) .theme-toggle,
.header:not(.header--scrolled) .mobile-toggle {
  color: rgba(255, 255, 255, 0.75);
}

.header:not(.header--scrolled) .theme-toggle:hover,
.header:not(.header--scrolled) .mobile-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

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

@media (max-width: 768px) {
  .header__inner {
    padding-inline: var(--space-4);
  }
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: rgba(255, 255, 255, 0.95);
}

.header--scrolled .header__logo,
.header--scrolled .header__wordmark {
  color: rgba(255, 255, 255, 0.9);
}

.header__logo svg {
  flex-shrink: 0;
}

.header__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 480px) {
  .header__wordmark { display: none; }
}

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

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

.header__links a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  letter-spacing: 0.02em;
  position: relative;
}

.header--scrolled .header__links a {
  color: rgba(255, 255, 255, 0.75);
}

.header--scrolled .header__links a:hover {
  color: #ffffff;
}

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

.header__links a:hover {
  color: #ffffff;
}

.header__links a:hover::after {
  width: 100%;
}

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

.theme-toggle {
  width: 40px;
  height: 40px;
  display: none;  /* Hidden — site is always dark with fixed background */
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile menu toggle */
.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.75);
}

.mobile-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

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

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: rgba(245, 240, 232, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  padding: var(--space-6);
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--space-12);
}

.mobile-menu__close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: #5c4d3e;
}

.mobile-menu__close:hover {
  color: #2a2118;
}

.mobile-menu__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.mobile-menu__links a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: #2a2118;
  text-decoration: none;
}


/* --- Hero --- */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: 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;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.02) 40%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-bottom: clamp(var(--space-12), 6vh, var(--space-20));
  padding-inline: var(--space-6);
  width: 100%;
}

@media (max-width: 768px) {
  .hero {
    height: 100svh;
  }
  .hero__content {
    padding-inline: var(--space-4);
    padding-bottom: var(--space-10);
  }
}

.hero__tagline {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-6);
  margin-inline: auto;
  display: block;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: var(--space-3) var(--space-6);
  text-decoration: none;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.hero__cta:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.8);
  color: #ffffff;
}

.hero__cta:active {
  background: rgba(255, 255, 255, 0.18);
}


/* --- Section Base --- */
.section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}

.section__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.section__label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: rgba(255, 255, 255, 0.7);
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4), 0 0 2px rgba(0, 0, 0, 0.2);
}

.section__desc {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.9);
  max-width: 52ch;
  margin-bottom: var(--space-12);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}


/* --- Services --- */
.services {
  background: transparent;
}

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

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

@media (max-width: 640px) {
  .services__grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

.service-card {
  background: rgba(138, 126, 114, 0.85);
  border: 1px solid rgba(138, 126, 114, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.service-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(138, 126, 114, 0.92);
}

.service-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  background: rgba(138, 126, 114, 0.88);
  border-color: rgba(138, 126, 114, 0.3);
  color: #2a2118;
}

.service-card--featured:hover {
  border-color: rgba(138, 126, 114, 0.4);
  background: rgba(138, 126, 114, 0.93);
}

@media (max-width: 640px) {
  .service-card--featured {
    grid-template-columns: 1fr;
  }
}

.service-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.2);
  color: #3d3228;
  margin-bottom: var(--space-6);
  flex-shrink: 0;
}

.service-card__icon svg {
  width: 24px;
  height: 24px;
}

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

.service-card--featured .service-card__title {
  font-size: var(--text-lg);
}

.service-card__desc {
  font-size: var(--text-base);
  color: #2a2118;
  line-height: 1.6;
  flex-grow: 1;
}

.service-card--featured .service-card__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0;
}

.service-card--featured .service-card__list li {
  font-size: var(--text-sm);
  color: #2a2118;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  line-height: 1.5;
}

.service-card--featured .service-card__list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3d3228;
  flex-shrink: 0;
  margin-top: 8px;
}


/* --- Contact --- */
.contact {
  background: transparent;
}

.contact .section__label {
  color: rgba(255, 255, 255, 0.8);
}

.contact .section__label::before {
  background: rgba(255, 255, 255, 0.7);
}

.contact .section__title {
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4), 0 0 2px rgba(0, 0, 0, 0.2);
}

.contact .section__desc {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

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

@media (max-width: 768px) {
  .contact__grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.contact__detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.contact__detail-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.contact__detail-value {
  font-size: var(--text-base);
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.contact__detail-value a {
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.contact__detail-value a:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.8);
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: #2a2118;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #a09890;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #8a7e72;
  box-shadow: 0 0 0 3px rgba(138, 126, 114, 0.15);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233d3228' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

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

.form-submit {
  align-self: flex-start;
  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;
  color: #ffffff;
  background: rgba(30, 25, 18, 0.85);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.form-submit:hover {
  background: rgba(30, 25, 18, 0.95);
}

.form-submit:active {
  background: rgba(50, 40, 30, 0.9);
}

.form-submit svg {
  width: 16px;
  height: 16px;
}

/* Form success message */
.form-success {
  display: none;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  text-align: center;
}

.form-success.is-visible {
  display: block;
}

.form-success__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.form-success__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-success__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}


/* --- Footer --- */
.footer {
  padding-block: var(--space-10);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

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

.footer__copy {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.footer__legal {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}


/* --- Scroll Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

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