/* ============================================
   AEGIS — Sistema de diseño "squishy shield"
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,450;9..144,600;9..144,700;9..144,900&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color — paleta oscura: carbón cálido, verde escudo, óxido/ámbar */
  --bg: #15130F;
  --bg-soft: #1B1814;
  --surface: #1F1C17;
  --surface-raised: #26221B;
  --ink: #EDE7D8;
  --ink-soft: #B6AF9C;
  --ink-faint: #7C7666;
  --shield: #4F8560;
  --shield-deep: #2E4C38;
  --shield-bright: #8FC49E;
  --shield-pale: #24352A;
  --coral: #D97D3D;
  --coral-deep: #A8582A;
  --coral-bright: #F0A05C;
  --coral-pale: #3A2A1C;
  --line: #34301F;

  /* Type */
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Motion */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft: cubic-bezier(0.22, 1.12, 0.42, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* subtle grain texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

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

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

::selection {
  background: var(--coral);
  color: var(--surface);
}

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shield-bright);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  display: inline-block;
}

p.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

code, .mono {
  font-family: var(--font-mono);
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(21, 19, 15, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
}

.nav-brand .logo-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  position: relative;
}

.nav-links a {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 9px 16px;
  border-radius: 999px;
  transition: background var(--ease), color var(--ease), transform var(--spring);
  display: inline-block;
}

.nav-links a:hover {
  background: var(--shield-pale);
  color: var(--shield-bright);
  transform: translateY(-1px) scale(1.03);
}

.nav-links a.active {
  background: var(--shield);
  color: var(--surface);
  position: relative;
  z-index: 1;
}

.nav-cta {
  background: var(--coral);
  color: var(--surface) !important;
  font-weight: 600;
  padding: 10px 20px !important;
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--coral-deep);
}

.nav-cta:hover {
  background: var(--coral) !important;
  color: var(--surface) !important;
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow: 0 5px 0 var(--coral-deep);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform var(--spring), opacity var(--ease);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 15px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--spring), background var(--ease);
}

.btn-primary {
  background: var(--coral);
  color: var(--surface);
  box-shadow: 0 5px 0 var(--coral-deep);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.035) rotate(-1deg);
  box-shadow: 0 8px 0 var(--coral-deep);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 0 var(--coral-deep);
}

.btn-secondary {
  background: var(--surface-raised);
  color: var(--shield-bright);
  border: 2px solid var(--shield);
  box-shadow: 0 5px 0 var(--shield-deep);
}

.btn-secondary:hover {
  transform: translateY(-3px) scale(1.035) rotate(1deg);
  background: var(--shield-pale);
  box-shadow: 0 8px 0 var(--shield-deep);
}

.btn-secondary:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 0 var(--shield-deep);
}

.btn svg { width: 20px; height: 20px; }

.btn-primary { position: relative; overflow: visible; }

.confetti-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 999;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .confetti-particle { display: none; }
}

/* ---------- Blob shapes ---------- */

.blob-card {
  background: var(--surface);
  border-radius: 42px 38px 46px 34px;
  border: 1px solid var(--line);
  transition: transform 0.4s var(--spring), border-radius 0.4s var(--spring), box-shadow 0.4s var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
}

.blob-card:hover {
  border-radius: 34px 46px 38px 42px;
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(143, 196, 158, 0.15);
}

/* Default (non-JS-tilt) hover fallback */
.blob-card:hover:not(.tilt-active) {
  transform: translateY(-6px) scale(1.015);
}

.blob-card .icon-wrap,
.blob-card h3,
.blob-card p,
.blob-card .feature-tag {
  transform: translateZ(24px);
}

@media (prefers-reduced-motion: reduce) {
  .blob-card { transform: none !important; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 100px 0 90px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1.04;
  margin: 20px 0 22px;
}

.hero h1 em {
  font-style: italic;
  color: var(--shield-bright);
}

/* Hero load-in sequence */
.hero-enter {
  opacity: 0;
  transform: translateY(18px);
  animation: hero-in 0.85s var(--spring-soft) forwards;
}
.hero-enter.d1 { animation-delay: 0.05s; }
.hero-enter.d2 { animation-delay: 0.18s; }
.hero-enter.d3 { animation-delay: 0.32s; }
.hero-enter.d4 { animation-delay: 0.46s; }

@keyframes hero-in {
  to { opacity: 1; transform: translateY(0); }
}

/* floaty + shield-hero override the generic transform/animation above
   with more specific rules below, so they animate their own way */

.shield-hero.hero-enter {
  transform: translateY(12px) scale(0.94);
}
@keyframes hero-in-visual {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.shield-hero.hero-enter { animation-name: hero-in-visual; }

/* .floaty already has its own infinite `float` animation; fade it in
   without fighting that animation by animating opacity only, via a
   separate pseudo-timing (opacity starts at 0, floaty anim unaffected) */
.floaty.hero-enter {
  opacity: 0;
  animation: float 7s ease-in-out infinite, floaty-fade-in 0.7s ease forwards;
}
.floaty.hero-enter.d2 { animation-delay: 0s, 0.18s; }
.floaty.hero-enter.d3 { animation-delay: -2s, 0.32s; }
.floaty.hero-enter.d4 { animation-delay: -4s, 0.46s; }
@keyframes floaty-fade-in {
  to { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-enter { opacity: 1; transform: none; animation: none; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--coral-pale);
  color: var(--coral-bright);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  margin-bottom: 24px;
  border: 1px solid var(--coral-deep);
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
}

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

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

.shield-orbit {
  position: absolute;
  inset: 0;
}

.shield-hero {
  width: 100%;
  max-width: 340px;
  cursor: pointer;
  filter: drop-shadow(0 0 46px rgba(143, 196, 158, 0.35)) drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
  animation: breathe 5s ease-in-out infinite;
  transition: transform 0.15s var(--ease);
}

@keyframes breathe {
  0%, 100% { transform: scale(1) rotate(-1.5deg); }
  50% { transform: scale(1.035) rotate(1.5deg); }
}

.shield-hero.squish {
  animation: none !important;
  transition: transform 0.55s var(--spring);
}

.floaty {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.5;
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-18px) translateX(8px); }
}

/* ---------- Sections ---------- */

section {
  padding: 88px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 52px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  margin-top: 14px;
  line-height: 1.1;
}

.section-alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-shield {
  background: var(--shield-deep);
  color: var(--ink);
  border-top: 1px solid var(--shield);
  border-bottom: 1px solid var(--shield);
}

.section-shield .eyebrow { color: var(--shield-bright); }
.section-shield h2, .section-shield h3 { color: var(--ink); }
.section-shield p { color: #C9DBCC; }

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--spring-soft), transform 0.7s var(--spring-soft);
}

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

.reveal-stagger.is-visible > * {
  transition-delay: calc(var(--i, 0) * 90ms);
}

/* ---------- Cards grids ---------- */

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 32px 28px;
}

.feature-card .icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 16px 20px 18px 14px;
  background: var(--shield-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: transform 0.4s var(--spring), border-radius 0.4s var(--spring);
}

.feature-card:hover .icon-wrap {
  transform: rotate(-8deg) scale(1.08);
  border-radius: 20px 14px 16px 18px;
}

.feature-card .icon-wrap svg {
  width: 28px;
  height: 28px;
  stroke: var(--shield-bright);
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.feature-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--coral-bright);
  background: var(--coral-pale);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  border: 1px solid var(--coral-deep);
}

/* ---------- Pillars (philosophy) ---------- */

.pillar {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.pillar:last-child { border-bottom: 1px solid var(--line); }

.pillar-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 300;
  color: var(--coral);
  line-height: 1;
}

.pillar h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.pillar p {
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- Story block ---------- */

.story-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 46px 40px 50px 36px;
  padding: 56px;
  position: relative;
}

.story-block p {
  color: var(--ink-soft);
  font-size: 1.06rem;
  margin-bottom: 18px;
}

.story-block p:last-child { margin-bottom: 0; }

.story-block .quote-mark {
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--shield-deep);
  line-height: 0.6;
  display: block;
  margin-bottom: 8px;
}

.pull-quote {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--shield-bright);
  line-height: 1.35;
  margin: 28px 0;
  padding-left: 24px;
  border-left: 3px solid var(--coral);
}

/* ---------- Steps (guide) ---------- */

.steps {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.steps-progress {
  position: absolute;
  left: 29px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  background: var(--line);
  z-index: 0;
}

.steps-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--coral);
  transition: height 0.15s linear;
}

@media (max-width: 680px) {
  .steps-progress { left: 23px; }
}

.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 22px;
  padding: 28px 0;
  position: relative;
}

.step-num {
  width: 60px;
  height: 60px;
  border-radius: 20px 24px 22px 18px;
  background: var(--shield);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.4s var(--spring), border-radius 0.4s var(--spring), background 0.3s var(--ease);
  z-index: 1;
  position: relative;
}

.step-num.step-passed {
  background: var(--coral);
}

.step:hover .step-num {
  transform: scale(1.1) rotate(-6deg);
  border-radius: 24px 18px 20px 22px;
}

.step-body h3 {
  font-size: 1.18rem;
  margin-bottom: 8px;
}

.step-body p {
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.step-cmd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--shield-bright);
  padding: 4px 12px;
  border-radius: 8px;
}

.step-note {
  background: var(--coral-pale);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--coral-bright);
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--coral-deep);
}

.step-note svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: var(--coral-bright);
}

/* ---------- Stat strip ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stat-strip .stat {
  text-align: left;
}

.stat .num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 600;
  color: var(--shield);
}

.stat .label {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 4px;
}

/* ---------- Command table ---------- */

.cmd-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.cmd-table td {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 16px 20px;
  vertical-align: top;
}

.cmd-table tr td:first-child {
  border-radius: 16px 0 0 16px;
  border-right: none;
  font-family: var(--font-mono);
  color: var(--shield-bright);
  font-weight: 600;
  white-space: nowrap;
  width: 1%;
}

.cmd-table tr td:last-child {
  border-radius: 0 16px 16px 0;
  border-left: none;
  color: var(--ink-soft);
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--shield-deep);
  border: 1px solid var(--shield);
  border-radius: 48px;
  padding: 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-band h2 {
  color: var(--ink);
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  margin-bottom: 14px;
}

.cta-band p {
  color: #C9DBCC;
  max-width: 50ch;
  margin: 0 auto 30px;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 36px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
}

.footer-brand .logo-mark { width: 24px; height: 24px; }

footer .footer-meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.footer-links {
  display: flex;
  gap: 22px;
  list-style: none;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Page hero (secondary pages) ---------- */

.page-hero {
  padding: 64px 0 56px;
  position: relative;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.2rem);
  margin-top: 16px;
  max-width: 18ch;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; min-height: 260px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stat-strip { grid-template-columns: 1fr; gap: 32px; }
  .story-block { padding: 36px; }
  .cta-band { padding: 44px 28px; }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.mobile-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--line);
    gap: 6px;
  }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .pillar { grid-template-columns: 56px 1fr; }
  .pillar-num { font-size: 1.7rem; }
  .step { grid-template-columns: 48px 1fr; gap: 16px; }
  .step-num { width: 48px; height: 48px; font-size: 1.1rem; }
  .step:not(:last-child)::after { left: 23px; top: 50px; }
  .wrap { padding: 0 20px; }
  .cmd-table, .cmd-table tbody, .cmd-table tr, .cmd-table td { display: block; width: 100%; }
  .cmd-table tr { margin-bottom: 10px; }
  .cmd-table tr td:first-child, .cmd-table tr td:last-child { border-radius: 16px; border: 1px solid var(--line); }
}
