:root {
  --color-black: #040404;
  --color-ink: #090909;
  --color-panel: rgba(14, 14, 14, 0.76);
  --color-panel-soft: rgba(255, 255, 255, 0.055);
  --color-white: #f7f7f7;
  --color-muted: #b9bcc2;
  --color-red: #f42c34;
  --color-red-deep: #b80f18;
  --color-cyan: #16e8e8;
  --color-yellow: #fff12d;
  --color-border: rgba(255, 255, 255, 0.14);
  --shadow-strong: 0 30px 100px rgba(0, 0, 0, 0.45);
  --radius-large: 34px;
  --radius-medium: 22px;
  --max-width: 1180px;
  --header-height: 82px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

.top-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-white);
  background:
    radial-gradient(circle at 12% 16%, rgba(244, 44, 52, 0.22), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(22, 232, 232, 0.16), transparent 28%),
    linear-gradient(145deg, #000 0%, #060606 46%, #120506 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.82), transparent 76%);
  opacity: 0.32;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: auto -10% -35% -10%;
  height: 58vh;
  background: linear-gradient(90deg, transparent, rgba(244, 44, 52, 0.14), rgba(22, 232, 232, 0.09), transparent);
  filter: blur(24px);
  transform: skewY(-5deg);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
}

.site-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(4, 4, 4, 0.92), rgba(4, 4, 4, 0.62));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(244, 44, 52, 0.22));
}

.brand span {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.brand strong {
  letter-spacing: 0.16em;
  font-size: 0.98rem;
}

.brand small {
  color: var(--color-muted);
  font-size: 0.78rem;
}

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

.main-nav a {
  color: var(--color-muted);
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.92rem;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.12);
  outline: none;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--color-white);
  border-radius: 3px;
}

.hero {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(330px, 0.94fr);
  align-items: center;
  gap: clamp(32px, 6vw, 74px);
  padding: 68px 0 82px;
}

.eyebrow {
  color: var(--color-cyan);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero h1 {
  margin-top: 18px;
  max-width: 780px;
  font-size: clamp(2.7rem, 7vw, 6.2rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.hero h1::after {
  content: "";
  display: block;
  width: min(360px, 62vw);
  height: 4px;
  margin-top: 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-red), var(--color-yellow), var(--color-cyan));
  box-shadow: 0 0 32px rgba(22, 232, 232, 0.28);
}

.hero-text {
  max-width: 660px;
  margin-top: 28px;
  color: #d8d9dd;
  font-size: clamp(1rem, 1.75vw, 1.22rem);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.btn-primary {
  color: #050505;
  background: linear-gradient(135deg, var(--color-yellow), var(--color-cyan));
  box-shadow: 0 18px 46px rgba(22, 232, 232, 0.16);
}

.btn-secondary {
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.055);
}

.hero-visual {
  display: grid;
  place-items: center;
  min-height: 420px;
}

.logo-orbit {
  width: min(470px, 74vw);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018) 54%, transparent 70%);
  box-shadow: var(--shadow-strong);
}

.logo-orbit img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, 0.68));
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  inset: 2%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ring-one {
  border-top-color: var(--color-red);
  border-right-color: rgba(244, 44, 52, 0.36);
  animation: spin 18s linear infinite;
}

.ring-two {
  inset: 10%;
  border-bottom-color: var(--color-cyan);
  border-left-color: rgba(22, 232, 232, 0.32);
  animation: spin 26s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.signal-panel,
.institutional-section,
.work-section,
.site-footer {
  margin-bottom: 26px;
}

.signal-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.signal-panel article,
.text-card,
.tech-card,
.work-item,
.site-footer {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.26);
}

.signal-panel article {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.signal-panel article::before,
.work-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--color-red), var(--color-cyan));
  opacity: 0.85;
}

.signal-panel span {
  color: var(--color-red);
  font-weight: 900;
  letter-spacing: 0.16em;
}

.signal-panel h2,
.work-item h3,
.text-card h3 {
  margin-top: 12px;
  font-size: 1.1rem;
}

.signal-panel p,
.work-item p,
.text-card p,
.tech-card span {
  margin-top: 10px;
  color: var(--color-muted);
  line-height: 1.65;
}

.institutional-section,
.work-section {
  padding: clamp(64px, 8vw, 96px) 0 40px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading.centered {
  margin-inline: auto;
  text-align: center;
}

.section-heading h2 {
  margin-top: 12px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.institutional-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
}

.text-card {
  padding: clamp(26px, 4vw, 40px);
}

.text-card p {
  font-size: 1.02rem;
}

.text-card p + p {
  margin-top: 16px;
}

.tech-card {
  min-height: 300px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(244, 44, 52, 0.16), rgba(22, 232, 232, 0.08)),
    rgba(255, 255, 255, 0.045);
}

.tech-card::before {
  content: "DITE";
  position: absolute;
  top: 24px;
  right: 24px;
  color: rgba(255, 255, 255, 0.08);
  font-size: clamp(3.6rem, 7vw, 6.8rem);
  font-weight: 950;
  letter-spacing: -0.08em;
}

.scan-line {
  position: absolute;
  left: -20%;
  top: 28%;
  width: 140%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(22, 232, 232, 0.86), transparent);
  box-shadow: 0 0 22px rgba(22, 232, 232, 0.5);
  animation: scan 4.5s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% { transform: translateY(-72px); opacity: 0.25; }
  50% { transform: translateY(86px); opacity: 0.85; }
}

.tech-card p {
  color: var(--color-cyan);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 900;
}

.tech-card strong {
  margin-top: 10px;
  font-size: 1.55rem;
  line-height: 1.1;
  position: relative;
  z-index: 2;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.work-item {
  position: relative;
  overflow: hidden;
  padding: 26px;
  min-height: 230px;
}

.work-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--color-cyan);
  background: rgba(22, 232, 232, 0.08);
  border: 1px solid rgba(22, 232, 232, 0.22);
  font-size: 1.25rem;
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(26px, 4vw, 38px);
  margin-top: 62px;
  margin-bottom: 32px;
}

.site-footer h2 {
  margin-top: 8px;
  max-width: 620px;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.site-footer a {
  display: inline-flex;
  margin-top: 16px;
  color: var(--color-yellow);
  font-weight: 900;
}

.footer-copy {
  max-width: 300px;
  color: var(--color-muted);
  line-height: 1.55;
  text-align: right;
}

@media (max-width: 980px) {
  .hero,
  .institutional-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 44px;
  }

  .hero-visual {
    min-height: auto;
    order: -1;
  }

  .logo-orbit {
    width: min(360px, 76vw);
  }

  .signal-panel,
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 22px, var(--max-width));
  }

  .site-header {
    height: 74px;
  }

  .brand small {
    display: none;
  }

  .menu-toggle {
    display: inline-block;
  }

  .main-nav {
    position: fixed;
    top: 74px;
    left: 11px;
    right: 11px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: rgba(5, 5, 5, 0.96);
    box-shadow: var(--shadow-strong);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 13px 14px;
  }

  .hero {
    min-height: auto;
    padding: 34px 0 54px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 15vw, 4.2rem);
  }

  .hero-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .signal-panel,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .site-footer,
  .footer-copy {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Contacto v2 */
.contact-footer {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(320px, 1fr);
}

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
}

.contact-mail {
  width: fit-content;
}

.footer-copy-inline {
  margin-top: 28px;
  text-align: left;
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(244,44,52,.10), rgba(22,232,232,.06)),
    rgba(0,0,0,.22);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: rgba(255,255,255,.76);
  font-size: .82rem;
  font-weight: 900;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(22,232,232,.22);
  border-radius: 16px;
  background: rgba(0,0,0,.32);
  color: var(--color-white);
  font: inherit;
  outline: 0;
  padding: 13px 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.field textarea {
  resize: vertical;
  min-height: 126px;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(22,232,232,.78);
  box-shadow: 0 0 0 4px rgba(22,232,232,.10), 0 0 24px rgba(22,232,232,.10);
}

.contact-submit {
  width: fit-content;
  border: 0;
  cursor: pointer;
}

.contact-alert {
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 900;
  line-height: 1.45;
}

.contact-alert-ok {
  border: 1px solid rgba(34,243,255,.42);
  background: rgba(34,243,255,.10);
  color: #fff;
}

.contact-alert-error {
  border: 1px solid rgba(244,44,52,.48);
  background: rgba(244,44,52,.12);
  color: #fff;
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

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

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

  .contact-submit {
    width: 100%;
  }
}
