:root {
  color-scheme: light;
  --ink: #0b1020;        /* primary text */
  --ink-soft: #161d33;
  --paper: #f7f8fc;      /* page background */
  --muted: #5b6270;      /* secondary text (AA with headroom) */
  --line: #e6e8f0;       /* borders */
  --accent: #4f6bff;
  --accent-2: #00d4b3;
  --white: #ffffff;      /* card surface */
  /* Theme-aware surfaces that must NOT flip with text */
  --surface-alt: #eef1fb;        /* alt section wash */
  --invert-bg: #0b1020;          /* dark buttons / nav CTA */
  --invert-bg-hover: #161d33;
  --invert-text: #ffffff;
  --band-bg: #0b1020;            /* CTA band */
  --band-text: #ffffff;
  --band-muted: #aeb6d4;
  --legal-text: #2b3245;         /* legal body */
  --shadow: 11, 16, 32;          /* rgb for elevation shadows */
  /* Radius scale */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius: 16px;
  --radius-lg: 24px;
  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-1: 0.15s;
  --dur-2: 0.2s;
  --maxw: 1080px;
  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", monospace;
  /* Type scale (~1.25 modular, fluid) */
  --text-2xs:  0.72rem;                          /* micro labels (mono tags) */
  --text-xs:   0.8125rem;                        /* 13px — micro / legal meta */
  --text-sm:   0.9375rem;                        /* 15px — nav, captions */
  --text-base: 1rem;                             /* 16px — body */
  --text-md:   0.98rem;                          /* buttons */
  --text-lead: clamp(1.1rem, 1.5vw, 1.3rem);     /* intros, lead */
  --text-lg:   clamp(1.15rem, 1.4vw, 1.3rem);    /* h3 / subheading */
  --text-xl:   clamp(1.4rem, 2.4vw, 1.8rem);     /* featured h3 */
  --text-2xl:  clamp(1.7rem, 3.6vw, 2.4rem);     /* section h2 */
  --text-3xl:  clamp(1.9rem, 7vw, 4.6rem);       /* hero h1 */
  /* Line height */
  --lh-tight:   1.04;
  --lh-snug:    1.18;
  --lh-relaxed: 1.5;
  --lh-body:    1.65;
  /* Weights */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  /* Spacing scale — fluid */
  --space-xs: 0.75rem;
  --space-sm: clamp(1rem, 2vw, 1.5rem);
  --space-md: clamp(1.75rem, 4vw, 2.75rem);
  --space-lg: clamp(3rem, 7vw, 5rem);
  --space-xl: clamp(4.5rem, 10vw, 7.5rem);
}

/* ---------- Dark theme ---------- */
/* Shared dark token values: applied automatically by system preference,
   or manually via .theme-dark on <html>. .theme-light forces light. */
.theme-dark {
  color-scheme: dark;
  --ink: #eceffa;
  --ink-soft: #c5cbe0;
  --paper: #0a0e1a;
  --muted: #99a2bd;
  --line: #232a42;
  --accent: #7488ff;
  --white: #11162b;
  --surface-alt: #0d1322;
  --invert-bg: #eceffa;
  --invert-bg-hover: #ffffff;
  --invert-text: #0a0e1a;
  --band-bg: #141b33;
  --band-text: #ffffff;
  --band-muted: #b6bdd6;
  --legal-text: #c5cbe0;
  --shadow: 0, 0, 0;
}
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    color-scheme: dark;
    --ink: #eceffa;
    --ink-soft: #c5cbe0;
    --paper: #0a0e1a;
    --muted: #99a2bd;
    --line: #232a42;
    --accent: #7488ff;
    --white: #11162b;
    --surface-alt: #0d1322;
    --invert-bg: #eceffa;
    --invert-bg-hover: #ffffff;
    --invert-text: #0a0e1a;
    --band-bg: #141b33;
    --band-text: #ffffff;
    --band-muted: #b6bdd6;
    --legal-text: #c5cbe0;
    --shadow: 0, 0, 0;
  }
}
/* Logo is dark-on-transparent → render as white wordmark on dark surfaces */
.theme-dark .brand img { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) .brand img { filter: brightness(0) invert(1); }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--paper);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .brand { font-family: var(--font-display); }
h1, h2, h3 {
  line-height: var(--lh-snug);
  font-weight: var(--fw-bold);
  text-wrap: balance;
}
p { text-wrap: pretty; }

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

/* Keyboard focus — WCAG AA visible focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link — first focusable, hidden until focused */
.skip-link {
  position: absolute; left: 12px; top: -64px; z-index: 200;
  background: var(--invert-bg); color: var(--invert-text);
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold); font-size: var(--text-sm);
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: 12px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img { height: 32px; width: auto; display: block; }
.foot .brand img { height: 34px; }
.nav-links { display: flex; gap: 28px; font-size: var(--text-sm); color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: var(--invert-bg);
  color: var(--invert-text);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
}
.nav-cta:hover { background: var(--invert-bg-hover); }

/* Theme toggle — 44px touch target, icon swaps with resolved theme */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; margin-left: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.theme-toggle:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); border-color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle .icon-sun { display: none; }
/* Resolved-dark → show sun (action: go light); else show moon */
.theme-dark .theme-toggle .icon-sun { display: block; }
.theme-dark .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) .theme-toggle .icon-sun { display: block; }
  :root:not(.theme-light) .theme-toggle .icon-moon { display: none; }
}
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(5rem, 11vw, 8.5rem) 0 clamp(4.5rem, 9vw, 7rem);
  background: radial-gradient(900px 460px at 80% -20%, color-mix(in srgb, var(--accent) 10%, transparent), transparent);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: var(--text-3xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.035em;
  max-width: 14ch;
  overflow-wrap: break-word;
}
.hero h1 span { color: var(--accent); }
.hero p.lead {
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
  font-size: var(--text-lead);
  line-height: var(--lh-relaxed);
  color: var(--muted);
  max-width: 52ch;
}
.hero-actions { margin-top: clamp(2rem, 3vw, 2.5rem); display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 400px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
}

/* Hero circuit signature */
.hero-deco {
  position: absolute; top: 50%; right: clamp(-60px, -3vw, -20px);
  --tx: 0px; --ty: 0px; --rot: 0deg;
  transform: translateY(-50%) translate3d(var(--tx), var(--ty), 0) rotate(var(--rot));
  width: min(600px, 52%);
  pointer-events: none;
  will-change: transform;
}
.hero-deco svg { width: 100%; height: auto; display: block; overflow: visible; }
@media (max-width: 880px) { .hero-deco { display: none; } }

/* Entrance choreography */
@keyframes heroDraw { to { stroke-dashoffset: 0; } }
@keyframes heroPop { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }
@keyframes heroRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.hero-content > * { opacity: 0; animation: heroRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.hero-content > *:nth-child(1) { animation-delay: 0.05s; }
.hero-content > *:nth-child(2) { animation-delay: 0.18s; }
.hero-content > *:nth-child(3) { animation-delay: 0.30s; }

.hero-deco .traces path {
  stroke-dasharray: 1200; stroke-dashoffset: 1200;
  animation: heroDraw 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-deco .traces path:nth-child(2) { animation-delay: 0.12s; }
.hero-deco .traces path:nth-child(3) { animation-delay: 0.24s; }
.hero-deco .traces path:nth-child(4) { animation-delay: 0.36s; }
.hero-deco .traces path:nth-child(5) { animation-delay: 0.48s; }
.hero-deco .traces path:nth-child(6) { animation-delay: 0.60s; }
.hero-deco .traces path:nth-child(7) { animation-delay: 0.72s; }
.hero-deco .nodes circle {
  opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: heroPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-deco .nodes circle:nth-child(1) { animation-delay: 0.7s; }
.hero-deco .nodes circle:nth-child(2) { animation-delay: 0.8s; }
.hero-deco .nodes circle:nth-child(3) { animation-delay: 0.9s; }
.hero-deco .nodes circle:nth-child(4) { animation-delay: 1.0s; }
.hero-deco .nodes circle:nth-child(5) { animation-delay: 1.1s; }
.hero-deco .nodes circle:nth-child(6) { animation-delay: 1.2s; }
.hero-deco .nodes circle:nth-child(7) { animation-delay: 1.3s; }

/* Living circuit — signal pulses ride the traces, live nodes glow */
.hero-deco .pulse { opacity: 0; }
@keyframes signal {
  0%   { offset-distance: 0%;   opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
@keyframes nodeGlow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.28); } }

@supports (offset-path: path("M0 0")) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-deco .pulse {
      filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 90%, transparent));
      animation: signal 3s linear infinite;
    }
    .hero-deco .pulse:nth-child(1) { animation-duration: 3.2s; animation-delay: 1.0s; }
    .hero-deco .pulse:nth-child(2) { animation-duration: 4.0s; animation-delay: 1.8s; }
    .hero-deco .pulse:nth-child(3) { animation-duration: 2.6s; animation-delay: 2.6s; }
    .hero-deco .pulse:nth-child(4) { animation-duration: 2.2s; animation-delay: 1.3s; }
    .hero-deco .pulse:nth-child(5) { animation-duration: 3.6s; animation-delay: 2.2s; }
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-deco .nodes circle[stroke] {
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 70%, transparent));
    animation: heroPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards,
               nodeGlow 2.8s ease-in-out infinite;
  }
  .hero-deco .nodes circle:nth-child(3) { animation-delay: 0.9s, 1.6s; }
  .hero-deco .nodes circle:nth-child(7) { animation-delay: 1.3s, 2.0s; }
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--radius-md);
  font-weight: var(--fw-semibold); font-size: var(--text-md);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.btn-primary { background: var(--invert-bg); color: var(--invert-text); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(var(--shadow), 0.25); }
.btn-ghost { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Sections ---------- */
section.block { padding: var(--space-xl) 0; }
.section-head { max-width: 640px; margin-bottom: var(--space-lg); }
.section-head h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}
.section-head p { margin-top: 14px; color: var(--muted); font-size: var(--text-lead); line-height: var(--lh-relaxed); max-width: 60ch; }

/* ---------- Servicios: editorial split ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.split-head h2 { font-size: var(--text-2xl); letter-spacing: -0.02em; }
.split-head p { margin-top: 14px; color: var(--muted); font-size: var(--text-lead); line-height: var(--lh-relaxed); }
@media (min-width: 861px) { .split-head { position: sticky; top: 96px; } }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: var(--space-md); } }

.features { list-style: none; display: flex; flex-direction: column; }
.feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--line);
}
.feature:first-child { border-top: 0; padding-top: 0; }
.feature:last-child { padding-bottom: 0; }
.feature-num {
  font-family: var(--font-mono);
  font-size: var(--text-sm); font-weight: var(--fw-semibold); letter-spacing: 0.02em;
  color: var(--accent); font-variant-numeric: tabular-nums;
  padding-top: 0.35rem;
}
.feature h3 { font-size: var(--text-lg); letter-spacing: -0.01em; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: var(--text-base); max-width: 56ch; }

/* ---------- Soluciones: featured + supporting ---------- */
.solutions { display: flex; flex-direction: column; gap: var(--space-sm); }
.sol-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
.sol-feature-media {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 10;
  display: grid; place-items: center;
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  perspective: 900px;
}
/* Gastus product mock */
.gastus-mock {
  --rx: 0deg; --ry: 0deg;
  width: 100%; max-width: 340px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(var(--shadow), 0.16);
  padding: clamp(0.9rem, 2.2vw, 1.3rem);
  display: flex; flex-direction: column; gap: 0.75rem;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.25s var(--ease-out);
}
.gm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gm-head picture { display: contents; }
.gm-logo { height: 24px; width: auto; }
.gm-chip {
  font-family: var(--font-mono); font-size: var(--text-2xs);
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.gm-balance {
  font-family: var(--font-display); font-weight: var(--fw-bold);
  font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.02em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.gm-bars { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.gm-bar { display: flex; flex-direction: column; gap: 4px; }
.gm-bar span { font-size: var(--text-2xs); color: var(--muted); }
.gm-bar i {
  display: block; height: 7px; border-radius: 999px; width: var(--w);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.gm-spark { width: 100%; height: 40px; margin-top: 2px; display: block; }
.gm-spark path { stroke-dasharray: 320; stroke-dashoffset: 0; }

/* Reveal-gated mock animations (full/static by default → no-JS & reduced-motion safe) */
.reveal-on .sol-feature .gm-bar i { width: 0; transition: width 0.9s var(--ease-out); }
.reveal-on .sol-feature.is-visible .gm-bar i { width: var(--w); }
.reveal-on .sol-feature .gm-bar:nth-child(2) i { transition-delay: 0.08s; }
.reveal-on .sol-feature .gm-bar:nth-child(3) i { transition-delay: 0.16s; }
.reveal-on .sol-feature .gm-spark path {
  stroke-dashoffset: 320; transition: stroke-dashoffset 1.1s var(--ease-out) 0.2s;
}
.reveal-on .sol-feature.is-visible .gm-spark path { stroke-dashoffset: 0; }
.sol-feature-body h3 { font-size: var(--text-xl); letter-spacing: -0.02em; margin: 12px 0 10px; }
.sol-feature-body p { color: var(--muted); font-size: var(--text-base); }
.feat-pills {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.feat-pills li {
  font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.01em;
  color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px 5px 9px;
  display: inline-flex; align-items: center; gap: 5px;
}
.feat-pills li::before {
  content: "✓"; color: var(--accent); font-weight: var(--fw-bold);
}
@media (max-width: 720px) { .sol-feature { grid-template-columns: 1fr; } }

.sol-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--space-sm); }
@media (max-width: 520px) { .sol-grid { grid-template-columns: 1fr; } }

/* ---------- Nosotros: trust columns ---------- */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
.trust-item { padding-left: var(--space-sm); border-left: 2px solid var(--accent); }
.trust-item h3 { font-size: var(--text-lg); letter-spacing: -0.01em; margin-bottom: 8px; }
.trust-item p { color: var(--muted); font-size: var(--text-base); }
@media (max-width: 860px) {
  .trust { grid-template-columns: 1fr; }
  .trust-item { border-left: 0; border-top: 2px solid var(--accent); padding-left: 0; padding-top: var(--space-sm); }
}

/* Alternate section background */
section.block.alt {
  background: linear-gradient(180deg, var(--surface-alt) 0%, var(--paper) 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Solution card tag pill */
.card .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-2xs); font-weight: var(--fw-medium); letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 4px 10px; border-radius: var(--radius-xs);
  margin-bottom: 14px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(var(--shadow), 0.10); border-color: transparent; }
.card h3 { font-size: var(--text-lg); letter-spacing: -0.01em; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: var(--text-base); }
.card-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; font-weight: var(--fw-semibold); font-size: var(--text-sm);
  color: var(--accent);
  transition: gap var(--dur-1) var(--ease-out);
}
.card-link:hover { gap: 11px; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  background: var(--band-bg);
  color: var(--band-text);
  border-radius: var(--radius-lg);
  padding: clamp(2.25rem, 6vw, 56px) clamp(1.25rem, 5vw, 48px);
  text-align: center;
}
.cta-band > *:not(.cta-circuit) { position: relative; z-index: 1; }
.cta-circuit {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.cta-circuit path { stroke-dasharray: 800; stroke-dashoffset: 0; }
.reveal-on .cta-band .cta-circuit path {
  stroke-dashoffset: 800; transition: stroke-dashoffset 1.2s var(--ease-out);
}
.reveal-on .cta-band.is-visible .cta-circuit path { stroke-dashoffset: 0; }
.reveal-on .cta-band .cta-circuit path:nth-child(2) { transition-delay: 0.08s; }
.reveal-on .cta-band .cta-circuit path:nth-child(3) { transition-delay: 0.16s; }
.reveal-on .cta-band .cta-circuit path:nth-child(4) { transition-delay: 0.10s; }
.reveal-on .cta-band .cta-circuit path:nth-child(5) { transition-delay: 0.18s; }
.reveal-on .cta-band .cta-circuit path:nth-child(6) { transition-delay: 0.24s; }
.magnetic { transform: translate(var(--mx, 0px), var(--my, 0px)); will-change: transform; }
.cta-band h2 { font-size: var(--text-2xl); letter-spacing: -0.02em; }
.cta-band p { color: var(--band-muted); margin-top: 14px; font-size: var(--text-lead); line-height: var(--lh-relaxed); max-width: 48ch; margin-inline: auto; }
.cta-band .btn-primary { background: var(--band-text); color: var(--band-bg); margin-top: 28px; max-width: 100%; overflow-wrap: anywhere; }
.cta-band .btn-primary:hover { box-shadow: 0 12px 30px rgba(0,0,0,0.4); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  margin-top: 40px;
}
.foot {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 28px;
}
.foot .brand { margin-bottom: 12px; }
.foot p { color: var(--muted); font-size: var(--text-sm); max-width: 320px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 14px 26px; font-size: var(--text-sm); color: var(--muted); }
.foot-links a:hover { color: var(--ink); }
.foot-bottom {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: var(--text-xs); color: var(--muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.foot-bottom span { overflow-wrap: anywhere; }
.foot-bottom a { color: inherit; }
.foot-bottom a:hover { color: var(--ink); }

/* ---------- Legal pages ---------- */
.legal { padding: 64px 0 40px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: var(--text-2xl); letter-spacing: -0.02em; margin-bottom: 8px; }
.legal .updated { color: var(--muted); font-size: var(--text-sm); margin-bottom: 40px; }
.legal h2 { font-size: var(--text-lg); margin: 36px 0 12px; letter-spacing: -0.01em; }
.legal p, .legal li { color: var(--legal-text); font-size: var(--text-base); margin-bottom: 12px; max-width: 70ch; }
.legal ul { padding-left: 22px; }
.legal a { color: var(--accent); }
.legal a:hover { text-decoration: underline; }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: var(--text-sm); margin-bottom: 28px;
}
.back:hover { color: var(--ink); }

/* ---------- Delight: micro-interactions ---------- */
/* Tactile button press */
.btn:active { transform: translateY(1px) scale(0.992); }
.btn-primary:active { box-shadow: 0 4px 12px rgba(var(--shadow), 0.22); }

/* Nav links: underline that wipes in from the left */
.nav-links a { position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-2) var(--ease-out);
}
.nav-links a:hover::after { transform: scaleX(1); }

/* Card hover: accent edge instead of vanishing border */
.card:hover { border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); }

/* Scroll reveal (added by scripts.js only when motion is welcome) */
.reveal-on .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.6s var(--ease-out),
              transform 0.6s var(--ease-out);
}
.reveal-on .reveal.is-visible { opacity: 1; transform: none; }
.reveal-on .feature:nth-child(2).reveal { transition-delay: 0.06s; }
.reveal-on .feature:nth-child(3).reveal { transition-delay: 0.12s; }
.reveal-on .feature:nth-child(4).reveal { transition-delay: 0.18s; }
.reveal-on .sol-grid > *:nth-child(2).reveal { transition-delay: 0.08s; }
.reveal-on .sol-grid > *:nth-child(3).reveal { transition-delay: 0.16s; }
.reveal-on .trust-item:nth-child(2).reveal { transition-delay: 0.08s; }
.reveal-on .trust-item:nth-child(3).reveal { transition-delay: 0.16s; }

/* ---------- App-grade scroll chrome ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 100;
}
@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: scrollProgress linear both;
    animation-timeline: scroll(root block);
  }
  @keyframes scrollProgress { to { transform: scaleX(1); } }
}
/* Scrollspy active nav link (toggled by scripts.js) */
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { transform: scaleX(1); }

/* ---------- Cinematic theme switch (View Transitions) ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;            /* replace default cross-fade with the JS clip reveal */
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 0; }
::view-transition-new(root) { z-index: 1; }

/* ---------- Reduced motion ---------- */
@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;
  }
  .card:hover, .btn-primary:hover { transform: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .scroll-progress { display: none; }
}

/* ---------- High-contrast / forced colors ---------- */
@media (forced-colors: active) {
  .card, .sol-feature-media, .trust-item { border: 1px solid CanvasText; }
  .scroll-progress { background: Highlight; }
  :focus-visible { outline-color: Highlight; }
}

/* ---------- Print ---------- */
@media print {
  .scroll-progress, .hero-deco, .nav-links, .nav-cta, .skip-link { display: none !important; }
  header { position: static; border: none; }
  .hero { background: none; padding: 1rem 0; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  body { color: #000; background: #fff; }
  a { color: #000; }
  .card { break-inside: avoid; box-shadow: none; }
}
