/* 1. Variables y base */
:root {
  --brand: #a30d32;
  --brand-hover: #800a27;
  --ink: #202327;
  --muted: #595e63;
  --paper: #faf9f6;
  --white: #ffffff;
  --line: #d9d8d3;
  --soft: #efeee9;
  --font-body: "Inter", Arial, sans-serif;
  --font-heading: "Space Grotesk", Arial, sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --h1: clamp(2.5rem, 5.5vw, 5rem);
  --h2: clamp(2rem, 3.5vw, 3.25rem);
  --h3: clamp(1.25rem, 2vw, 1.5rem);
  --section-space: clamp(4rem, 8vw, 7rem);
  --header-height: 7rem;
  --radius: 0.35rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  padding-top: var(--header-height);
  background: var(--paper);
  color: var(--ink);
  font: var(--text-base) / 1.7 var(--font-body);
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h1 {
  font-size: var(--h1);
  max-width: 16ch;
}

h2 {
  font-size: var(--h2);
  max-width: 23ch;
}

h3 {
  font-size: var(--h3);
  letter-spacing: -0.025em;
}

p,
dd {
  max-width: 65ch;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid #076978;
  outline-offset: 5px;
}

::selection {
  background: #a30d32;
  color: white;
}

.container {
  width: min(100% - 2.5rem, 78rem);
  margin-inline: auto;
}

.section {
  padding-block: var(--section-space);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* 2. Boutons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 0.85rem 1.35rem;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.button:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.button-outline {
  color: var(--brand);
  background: transparent;
}

.button-outline:hover:not(:disabled) {
  color: var(--white);
}

.button:disabled {
  cursor: not-allowed;
  color: #555;
  background: #e7e5e0;
  border-color: #b8b6b0;
}

/* 3. Cabecera fija y navegación */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand img {
  width: 145px;
  height: auto;
}

.navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding-bottom: 0.75rem;
  font-size: var(--text-sm);
}

.navigation a:not(.button),
.site-footer nav a {
  padding-block: 0.5rem;
  text-decoration: none;
  transition: color 160ms ease;
}

.navigation a:not(.button):hover,
.site-footer nav a:hover {
  color: var(--brand);
}

.button-small {
  min-height: 44px;
  padding: 0.6rem 0.9rem;
}

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin-block: 5px;
  background: var(--ink);
}

/* Mejora progresiva: menú accesible incluso sin JavaScript. */
@media (max-width: 47.99rem) {
  .js {
    --header-height: 4.6rem;
  }

  .js .menu-toggle {
    display: block;
  }

  .js .navigation {
    display: none;
    padding-block: 1rem;
  }

  .js .navigation.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .js .navigation a {
    padding: 0.75rem;
  }
}

/* 4. Portada */
.hero {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero-copy {
  animation: enter 650ms ease-out both;
}

.hero-intro {
  margin-bottom: 1.5rem;
  color: var(--brand);
  font-size: var(--text-sm);
  font-weight: 600;
}

.hero-description {
  margin-top: 1.5rem;
  max-width: 44ch;
  color: var(--muted);
  font-size: var(--text-lg);
}

.hero-copy .button {
  margin-top: 2rem;
}

.hero-location {
  margin-top: 1.25rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.brand-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  aspect-ratio: 1.1;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--soft);
  background-image:
    linear-gradient(#20232709 1px, transparent 1px),
    linear-gradient(90deg, #20232709 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid var(--line);
}

.brand-panel::before {
  content: "";
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border: 1px solid #a30d322b;
  border-radius: 50%;
  z-index: -1;
}

.brand-panel::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 1px;
  background: #a30d322b;
  transform: rotate(-34deg);
  z-index: -1;
}

.hero-logo {
  width: 100%;
  height: auto;
}

.panel-label {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.panel-bottom {
  position: absolute;
  inset: auto 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.panel-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
}

.drawing-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--brand);
  border-style: solid;
}

.corner-top {
  top: 0.75rem;
  right: 0.75rem;
  border-width: 1px 1px 0 0;
}

.corner-bottom {
  bottom: 0.75rem;
  left: 0.75rem;
  border-width: 0 0 1px 1px;
}

/* 5. Servicios */
.services {
  border-top: 1px solid var(--line);
  background: var(--white);
}

.section-heading {
  display: grid;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.section-heading p {
  max-width: 40ch;
  color: var(--muted);
}

.services-grid {
  display: grid;
}

.service {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.service-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 1.5rem;
  color: var(--brand);
}

.service h3 {
  max-width: 24ch;
}

.service p {
  margin-top: 1rem;
  color: var(--muted);
}

/* 6. Sobre TKZ */
.about-grid {
  display: grid;
  gap: 3rem;
}

.about-lead {
  margin-block: 1.75rem 1rem;
  font-size: var(--text-lg);
}

.about p:not(.about-lead) {
  color: var(--muted);
}

.approach {
  padding-left: 1.5rem;
  border-left: 2px solid var(--brand);
}

.approach dl {
  margin-top: 1.5rem;
}

.approach dl > div + div {
  margin-top: 1.5rem;
}

.approach dt {
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.approach dd {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* 7. Contacto y formulario */
.contact {
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  align-items: start;
  gap: 3rem;
}

.contact-copy > p {
  margin-top: 1.5rem;
  color: var(--muted);
}

.contact-details {
  display: grid;
  gap: 1rem;
  margin-block: 2rem;
  font-size: var(--text-sm);
  font-style: normal;
}

.contact-details strong,
.contact-details span {
  display: block;
}

.contact-details span {
  color: var(--muted);
}

.contact-form {
  min-width: 0;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-intro {
  margin-block: 0.75rem 1.5rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.form-row {
  display: grid;
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  min-width: 0;
}

.field label {
  font-size: var(--text-sm);
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  min-width: 0;
  padding: 0.8rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #888b8c;
  border-radius: 3px;
}

.field input {
  min-height: 48px;
}

.field textarea {
  resize: vertical;
}

.field textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.form-note {
  margin-block: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* 8. Pie de página */
.site-footer {
  padding-top: 2.5rem;
  background: var(--paper);
}

.footer-main {
  display: grid;
  align-items: center;
  gap: 1rem;
  padding-bottom: 2rem;
}

.footer-main p {
  max-width: 35ch;
  color: var(--muted);
  font-size: var(--text-sm);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: var(--text-sm);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

/* 9. Tablet y escritorio */
@media (min-width: 40rem) {
  .container {
    width: min(100% - 4rem, 78rem);
  }

  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.5rem;
  }

  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-panel {
    max-width: 34rem;
    width: 100%;
    justify-self: center;
  }
}

@media (min-width: 48rem) {
  :root {
    --header-height: 5rem;
  }

  .header-inner {
    min-height: var(--header-height);
    flex-wrap: nowrap;
  }

  .navigation {
    width: auto;
    padding-bottom: 0;
    gap: 2rem;
  }

  .section-heading,
  .about-grid,
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
  }

  .footer-main {
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
  }
}

@media (min-width: 64rem) {
  .hero-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 4rem;
  }

  .brand-panel {
    max-width: none;
  }

  .services-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 2rem;
  }

  .about-grid,
  .contact-grid {
    gap: 6rem;
  }

  .approach {
    padding-left: 2.5rem;
  }
}

/* 10. Única animación de entrada y reducción de movimiento */
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-copy {
    animation: none;
  }

  .button,
  .navigation a,
  .site-footer nav a {
    transition: none;
  }
}