/* =================================================================
   TecnoMedina - Hoja de estilos principal
   Paleta, tipografía y componentes. Sin dependencias externas.
   ================================================================= */

/* ---------- 1. Variables de tema ---------- */
:root {
  --bg:          #070b14;
  --bg-alt:      #0a1120;
  --surface:     rgba(255, 255, 255, .035);
  --surface-2:   rgba(255, 255, 255, .06);
  --border:      rgba(255, 255, 255, .10);
  --border-soft: rgba(255, 255, 255, .06);
  --text:        #e9eefb;
  --heading:     #ffffff;
  --muted:       #94a3bc;
  --brand:       #38bdf8;
  --brand-2:     #6366f1;
  --brand-soft:  rgba(56, 189, 248, .13);
  --ok:          #34d399;
  --warn:        #fbbf24;
  --shadow:      0 24px 60px -22px rgba(0, 0, 0, .85);
  --radius:      18px;
  --radius-sm:   12px;
  --maxw:        1180px;
  --ease:        cubic-bezier(.22, .8, .3, 1);
}

[data-theme="light"] {
  --bg:          #ffffff;
  --bg-alt:      #f4f7fc;
  --surface:     #ffffff;
  --surface-2:   #f7f9fd;
  --border:      rgba(15, 27, 48, .11);
  --border-soft: rgba(15, 27, 48, .07);
  --text:        #33415c;
  --heading:     #0d1729;
  --muted:       #5d6b85;
  --brand:       #0284c7;
  --brand-2:     #4f46e5;
  --brand-soft:  rgba(2, 132, 199, .09);
  --ok:          #059669;
  --warn:        #d97706;
  --shadow:      0 22px 50px -26px rgba(13, 23, 41, .35);
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "Inter", -apple-system, "Segoe UI", sans-serif;
  color: var(--heading);
  line-height: 1.18;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-weight: 600;
}

h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.12rem; }

p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
strong { color: var(--heading); font-weight: 600; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

::selection { background: var(--brand); color: #04121f; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 999;
  background: var(--brand);
  color: #04121f;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { left: 16px; }

/* ---------- 3. Botones ---------- */
.btn {
  --btn-py: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: var(--btn-py) 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease),
              background-color .22s var(--ease), border-color .22s var(--ease);
}

.btn svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .22s var(--ease);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #04121f;
  box-shadow: 0 10px 30px -12px rgba(56, 189, 248, .65);
}
[data-theme="light"] .btn-primary { color: #ffffff; }

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(56, 189, 248, .75); }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--heading);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--brand); transform: translateY(-2px); }

.btn-sm  { --btn-py: 9px; padding-inline: 18px; font-size: .875rem; }
.btn-block { display: flex; width: 100%; }

/* ---------- 4. Cabecera ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 16px 0;
  transition: padding .3s var(--ease), background-color .3s var(--ease),
              border-color .3s var(--ease), box-shadow .3s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  padding: 9px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--border-soft);
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, .8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-text {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--heading);
}
.brand-accent {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav { display: flex; align-items: center; gap: 6px; }

.nav > a:not(.btn) {
  position: relative;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: .94rem;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav > a:not(.btn):hover { color: var(--heading); background: var(--surface); }
.nav > a.active { color: var(--heading); }
.nav > a.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.nav-cta { margin-left: 8px; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--heading);
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--brand); }
.icon-btn svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

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

.burger { display: none; flex-direction: column; gap: 4.5px; }
.burger span {
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .28s var(--ease), opacity .2s var(--ease);
}
.burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 104px;
  overflow: hidden;
  isolation: isolate;
}

.hero-glow {
  position: absolute;
  z-index: -2;
  top: -320px; left: 50%;
  width: 1100px; height: 780px;
  transform: translateX(-52%);
  background:
    radial-gradient(circle at 30% 40%, rgba(56, 189, 248, .28), transparent 62%),
    radial-gradient(circle at 72% 34%, rgba(99, 102, 241, .26), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}
[data-theme="light"] .hero-glow { opacity: .55; }

.hero-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 88% 62% at 50% 20%, #000 35%, transparent 82%);
  -webkit-mask-image: radial-gradient(ellipse 88% 62% at 50% 20%, #000 35%, transparent 82%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 60px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 7px 16px 7px 12px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--brand);
  text-transform: none;
}
.eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }

.hero-title {
  font-size: clamp(2.3rem, 5.2vw, 4rem);
  font-weight: 700;
  margin-bottom: 22px;
}
.grad {
  display: block;
  background: linear-gradient(110deg, var(--brand), var(--brand-2) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.09rem;
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: 32px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 36px; }

.hero-badges { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.hero-badges li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: var(--muted);
}
.hero-badges svg {
  width: 16px; height: 16px;
  flex: none;
  fill: none; stroke: var(--ok);
  stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
}

/* Panel de consola decorativo */
.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow: hidden;
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 50% { transform: translateY(-11px); } }

.panel-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.pd { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.pd:first-child { background: #ff5f57; }
.pd:nth-child(2) { background: #febc2e; }
.pd:nth-child(3) { background: #28c840; }
.panel-title {
  margin-left: 8px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .76rem;
  color: var(--muted);
}

.panel-body { padding: 18px 20px 22px; }

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: .88rem;
}
.panel-row:last-of-type { border-bottom: 0; }
.pl { color: var(--muted); }

.pill {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.pill.ok   { background: color-mix(in srgb, var(--ok) 15%, transparent);   color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }

.panel-meter {
  height: 6px;
  margin: 14px 0 16px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.panel-meter i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  animation: grow 1.6s var(--ease) both;
}
@keyframes grow { from { width: 0; } }

.panel-code {
  display: block;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .76rem;
  line-height: 1.85;
  color: var(--muted);
  overflow-x: auto;
}
.c-com { color: #64748b; }
.c-key { color: var(--brand); }
.c-fn  { color: var(--brand-2); }
.c-ok  { color: var(--ok); }

/* ---------- 6. Secciones ---------- */
.section { padding: 104px 0; }
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border-soft);
}

.section-head {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-sub { color: var(--muted); font-size: 1.04rem; margin: 0; }

/* ---------- 7. Tarjetas de servicio ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  padding: 30px 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
  box-shadow: var(--shadow);
}
.card:hover::before { transform: scaleX(1); }

.card-icon {
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent);
  border-radius: 14px;
  color: var(--brand);
}
.card-icon svg {
  width: 25px; height: 25px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

.card h3 { font-size: 1.16rem; margin-bottom: 10px; }
.card > p { color: var(--muted); font-size: .96rem; margin-bottom: 18px; }

.card-list { display: grid; gap: 9px; }
.card-list li {
  position: relative;
  padding-left: 22px;
  font-size: .91rem;
  color: var(--muted);
}
.card-list li::before {
  content: "";
  position: absolute;
  left: 2px; top: .62em;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.card-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--brand) 13%, transparent),
    color-mix(in srgb, var(--brand-2) 13%, transparent));
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
}
.card-cta h3 { font-size: 1.28rem; }

/* ---------- 8. Metodología ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 22px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.step:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }

.step-num {
  display: block;
  margin-bottom: 14px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: .9;
}
.step p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- 9. Tecnologías ---------- */
.tech {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.tech-group {
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tech-group h3 {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: .83rem;
  color: var(--muted);
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.chips li:hover {
  color: var(--heading);
  border-color: var(--brand);
  transform: translateY(-2px);
}

/* ---------- 10. Nosotros ---------- */
.about {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 56px;
  align-items: start;
}
.about-copy > p { color: var(--muted); }

.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 22px;
  margin-top: 34px;
}
.value { display: flex; gap: 14px; }
.value svg {
  width: 30px; height: 30px;
  flex: none;
  padding: 6px;
  background: var(--brand-soft);
  border-radius: 9px;
  fill: none; stroke: var(--brand);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.value h3 { font-size: 1rem; margin-bottom: 3px; }
.value p { margin: 0; font-size: .89rem; color: var(--muted); }

.about-card {
  position: sticky;
  top: 108px;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.about-card h3 { font-size: 1.25rem; }
.about-card > p { color: var(--muted); font-size: .95rem; }

.check-list { display: grid; gap: 11px; margin: 20px 0 26px; }
.check-list li {
  position: relative;
  padding-left: 28px;
  font-size: .92rem;
  color: var(--muted);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .35em;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.note { margin: 14px 0 0; font-size: .82rem; color: var(--muted); text-align: center; }

/* ---------- 11. Contacto ---------- */
.contact {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 30px;
  align-items: start;
}

.contact-form {
  padding: 34px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: .87rem;
  font-weight: 500;
  color: var(--heading);
}
.opt { color: var(--muted); font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 118px; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3bc' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 17px;
  padding-right: 42px;
  cursor: pointer;
}
.field input::placeholder,
.field textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field .invalid { border-color: #f87171; }

.checkbox {
  display: flex;
  gap: 11px;
  margin: 4px 0 22px;
  font-size: .85rem;
  color: var(--muted);
  cursor: pointer;
}
.checkbox input {
  width: 17px; height: 17px;
  margin-top: 3px;
  flex: none;
  accent-color: var(--brand);
  cursor: pointer;
}

.form-msg {
  margin: 14px 0 0;
  font-size: .88rem;
  text-align: center;
  min-height: 1.2em;
}
.form-msg.ok    { color: var(--ok); }
.form-msg.error { color: #f87171; }

.contact-info {
  padding: 32px 28px;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--brand) 11%, transparent),
    color-mix(in srgb, var(--brand-2) 11%, transparent));
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  border-radius: var(--radius);
}
.contact-info h3 { font-size: 1.14rem; margin-bottom: 22px; }

.info-item {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-soft);
  transition: transform .2s var(--ease);
}
.info-item:last-of-type { border-bottom: 0; }
a.info-item:hover { transform: translateX(3px); }
.info-item svg {
  width: 21px; height: 21px;
  flex: none;
  margin-top: 4px;
  fill: none; stroke: var(--brand);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.info-label {
  display: block;
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-value { display: block; font-size: .95rem; color: var(--heading); font-weight: 500; }

.info-note {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.info-note strong { display: block; margin-bottom: 5px; font-size: .92rem; }
.info-note p { margin: 0; font-size: .85rem; color: var(--muted); }

/* ---------- 12. Pie ---------- */
.site-footer {
  padding: 68px 0 26px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border-soft);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 42px;
  padding-bottom: 42px;
}
.footer-brand .brand { margin-bottom: 16px; }
.footer-brand p { max-width: 34ch; font-size: .9rem; color: var(--muted); }

.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 {
  margin-bottom: 4px;
  font-size: .8rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-col a, .footer-col span { font-size: .92rem; color: var(--text); }
.footer-col a { transition: color .2s var(--ease); }
.footer-col a:hover { color: var(--brand); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}
.footer-bottom p { margin: 0; font-size: .84rem; color: var(--muted); }
.footer-legal a { transition: color .2s var(--ease); }
.footer-legal a:hover { color: var(--brand); }

/* ---------- 13. Volver arriba ---------- */
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 90;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 13px;
  color: #04121f;
  box-shadow: 0 12px 28px -12px rgba(56, 189, 248, .8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
}
[data-theme="light"] .to-top { color: #fff; }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { transform: translateY(-3px); }
.to-top svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 14. Animación de aparición ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 15. Responsive ---------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-panel { max-width: 520px; }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .about-card { position: static; }
  .contact { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 820px) {
  .burger { display: flex; }

  /* El logotipo y los botones deben quedar por encima del panel desplegable */
  .brand, .header-actions { position: relative; z-index: 2; }

  .nav {
    position: fixed;
    z-index: 1;
    inset: 0 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 92px 24px 30px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-102%);
    transition: transform .38s var(--ease);
  }
  .nav.open { transform: translateY(0); }
  .nav > a:not(.btn) { padding: 13px 14px; font-size: 1rem; border-radius: var(--radius-sm); }
  .nav > a.active::after { display: none; }
  .nav > a.active { background: var(--surface); }
  .nav-cta { margin: 10px 0 0; }

  .hero { padding: 132px 0 76px; }
  .section { padding: 76px 0; }
  .section-head { margin-bottom: 40px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .container { padding-inline: 18px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-form { padding: 26px 20px; }
  .hero-cta .btn { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { justify-content: center; text-align: center; }
}

/* ---------- 16. Accesibilidad e impresión ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .to-top, .hero-panel, .hero-glow, .hero-grid { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 24px 0; }
}
