/* =====================================================================
   Ingeniería O3A · estilos complementarios a Tailwind
   Sistema de radios: elementos interactivos (botones, dock, selector) en
   cápsula; superficies (tarjetas, paneles, diálogos) 20px; inputs 12px.
   Acento único de acción: ember #FF5722. Azul técnico solo estructural.
   ===================================================================== */

:root {
  --obsidian: #050505;
  --carbon: #0B0D11;
  --steel: #12151B;
  --tech: #0F4C81;
  --tech-hi: #5B9BD8;
  --titanium: #F4F4F5;
  --ember: #FF5722;
  --grid: rgba(255, 255, 255, 0.06);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Este archivo carga DESPUÉS de tailwind.css: las reglas de componente que comparten propiedad
   con utilidades (position, display) usan :where() para no pisarlas. */
[hidden] { display: none !important; }
html { background: var(--obsidian); color-scheme: dark; }
body { background: var(--obsidian); overflow-x: hidden; }

/* ---------- Lenis (smooth inertia scroll) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Grano fijo (no repinta al hacer scroll) ---------- */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Cuadrícula blueprint ---------- */
.bp-grid {
  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),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 240px 240px, 240px 240px, 48px 48px, 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 40%, transparent 100%);
}
.bp-grid--faint { opacity: 0.55; }
.hero-vignette {
  background:
    radial-gradient(60% 55% at 78% 45%, rgba(15, 76, 129, 0.28), transparent 70%),
    radial-gradient(40% 40% at 85% 70%, rgba(255, 87, 34, 0.08), transparent 70%),
    linear-gradient(to bottom, transparent 70%, var(--obsidian));
}

/* ---------- Glassmorphism con borde metálico de 1px ----------
   Aproximación web (backdrop-filter + borde degradado enmascarado). */
:where(.glass) { position: relative; }
.glass {
  background: linear-gradient(180deg, rgba(26, 30, 38, 0.62), rgba(11, 13, 17, 0.58));
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0.06) 28%, rgba(255,255,255,0.03) 62%, rgba(91,155,216,0.38));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--steel); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Dock ---------- */
.dock { transition: transform 0.6s var(--ease-out), opacity 0.4s; }
.dock.is-hidden { transform: translateY(calc(-100% - 28px)); }
.dock-progress { position: absolute; left: 28px; right: 28px; bottom: -1px; height: 1px; pointer-events: none; overflow: hidden; border-radius: 1px; }
.dock-progress::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--tech-hi), var(--ember)); transform-origin: left; transform: scaleX(var(--p, 0)); }
.nav-link {
  position: relative; display: inline-flex; height: 2.5rem; align-items: center; border-radius: 999px;
  padding: 0 0.9rem; font-size: 0.875rem; font-weight: 500; color: rgba(244,244,245,0.72);
  transition: color 0.25s, background-color 0.25s;
}
.nav-link:hover { color: var(--titanium); background: rgba(255,255,255,0.05); }
.nav-link.is-active { color: var(--titanium); }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 5px; width: 14px; height: 2px; margin-left: -7px;
  border-radius: 2px; background: var(--ember);
}
.mobile-sheet { background: var(--carbon); -webkit-backdrop-filter: none; backdrop-filter: none; }
.mobile-link { display: block; border-radius: 14px; padding: 0.75rem 1rem; color: rgba(244,244,245,0.85); }
.mobile-link:hover { background: rgba(255,255,255,0.05); color: var(--titanium); }

.lang-switch { border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); }
.lang-btn { height: 1.9rem; min-width: 2.2rem; border-radius: 999px; padding: 0 0.55rem; color: rgba(244,244,245,0.6); transition: background-color 0.25s, color 0.25s; }
.lang-btn[aria-pressed="true"] { background: var(--titanium); color: var(--obsidian); font-weight: 600; }

/* ---------- Botón con borde de brillo animado ---------- */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.btn-glow { position: relative; isolation: isolate; }
.btn-glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle), rgba(255,87,34,0.25) 0deg, rgba(255,87,34,0.25) 220deg, #FF5722 300deg, #FFE0D4 330deg, #FF5722 345deg, rgba(255,87,34,0.25) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: o3a-spin 3.6s linear infinite;
}
@keyframes o3a-spin { to { --angle: 360deg; } }
.btn-primary { box-shadow: 0 10px 30px -12px rgba(255, 87, 34, 0.55); transition: box-shadow 0.4s, filter 0.3s; }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 16px 40px -14px rgba(255, 87, 34, 0.7); }
.magnetic { will-change: transform; }
.magnetic:active { scale: 0.98; }

/* ---------- Hero ---------- */
.word-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.word { display: inline-block; will-change: transform; }
/* Entrada del hero en CSS puro: arranca en el primer pintado (mejor LCP), sin esperar librerías */
.js #hero-title:not(.is-split) { visibility: hidden; }
#hero-title.is-split .word { animation: o3a-rise 0.85s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms + 60ms); }
#hero-title.no-anim .word { animation: none; }
.hero-in { animation: o3a-fade-up 1s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 80ms + 220ms); }
#dock-wrap { animation: o3a-drop 0.9s var(--ease-out) both; }
.js .metric { opacity: 0; }
@keyframes o3a-rise { from { transform: translateY(110%); } to { transform: none; } }
@keyframes o3a-fade-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes o3a-drop { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: none; } }
.hud { box-shadow: 0 20px 40px -20px rgba(0,0,0,0.8); }
/* Sin WebGL: plano CAD estático del engranaje */
.gear-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--tech-hi); }
.gear-fallback svg { width: 82%; max-width: 520px; }
.gear-fallback [data-draw] { stroke-dashoffset: 0 !important; }
.gear-fallback .cad-fade { opacity: 1; }

.metric { padding: 1.25rem 0 1.4rem; border-left: 1px solid rgba(255,255,255,0.06); padding-left: 1.25rem; }
.metric:nth-child(odd) { border-left: 0; padding-left: 0; }
@media (min-width: 1024px) {
  .metric { padding: 1.6rem 0 1.8rem 1.75rem; }
  .metric:nth-child(odd) { border-left: 1px solid rgba(255,255,255,0.06); padding-left: 1.75rem; }
  .metric:first-child { border-left: 0; padding-left: 0; }
}
@media (max-width: 1023px) { .metric:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.06); } }
.metric-label { font-family: "JetBrains Mono", monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(244,244,245,0.6); }
.metric-value { margin-top: 0.4rem; font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: clamp(1.75rem, 3vw, 2.6rem); letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Revelado al hacer scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); }

/* ---------- Bento ---------- */
.bento-card {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 20px;
  background: var(--steel); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.bento-card::after { /* borde spotlight que sigue al cursor */
  content: ""; position: absolute; inset: 0; z-index: 4; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(255,87,34,0.9), rgba(91,155,216,0.35) 45%, transparent 75%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s;
}
.bento-card:is(:hover, :focus-within)::after { opacity: 1; }
.bento-media { position: absolute; inset: 0; z-index: 0; }
.bento-media img {
  max-width: none; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.8) brightness(0.72);
  transform: scale(1.02);
  transition: transform 1.4s var(--ease-out), filter 0.7s var(--ease-out);
}
.bento-card:is(:hover, :focus-within) .bento-media img { transform: scale(1.07); filter: grayscale(0.85) brightness(0.32) contrast(1.1); }
.bento-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(5,5,5,0.94) 8%, rgba(5,5,5,0.55) 48%, rgba(5,5,5,0.08) 100%);
}
.bento-blueprint {
  background-color: #0A1726;
  background-image:
    linear-gradient(rgba(91,155,216,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,155,216,0.12) 1px, transparent 1px);
  background-size: 22px 22px;
}
.bento-tech { background: radial-gradient(120% 90% at 100% 0%, rgba(15,76,129,0.75), rgba(15,76,129,0.15) 55%, var(--steel) 100%); }
.bento-body { position: relative; z-index: 3; padding: 1.5rem; }
@media (min-width: 768px) { .bento-body { padding: 1.9rem; } }
.bento-icon {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; margin-bottom: 1.1rem;
  border-radius: 999px; color: var(--ember);
  background: rgba(5,5,5,0.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.bento-title { font-family: "Space Grotesk", sans-serif; font-weight: 600; line-height: 1.08; letter-spacing: -0.015em; max-width: 22ch; }
.bento-desc { margin-top: 0.6rem; max-width: 46ch; font-size: 0.95rem; line-height: 1.6; color: rgba(244,244,245,0.72); }
.bento-layers {
  display: grid; gap: 0.35rem; margin-top: 1rem;
  font-family: "JetBrains Mono", monospace; font-size: 12px; color: rgba(244,244,245,0.82);
}
.bento-layers li { display: flex; align-items: flex-start; gap: 0.6rem; }
.bento-layers li::before { content: ""; width: 14px; height: 1px; margin-top: 0.75em; background: var(--ember); flex-shrink: 0; }
@media (hover: hover) and (pointer: fine) {
  .bento-layers { opacity: 0; transform: translateY(10px); max-height: 0; transition: opacity 0.45s var(--ease-out), transform 0.6s var(--ease-out), max-height 0.6s var(--ease-out); }
  .bento-card:is(:hover, :focus-within) .bento-layers { opacity: 1; transform: none; max-height: 120px; }
}

/* Enlace de tarjeta completa + flecha */
.bento-link { position: absolute; inset: 0; z-index: 5; border-radius: inherit; }
.bento-link:focus-visible { outline: 2px solid var(--ember); outline-offset: -2px; }
.bento-arrow {
  position: absolute; top: 1.25rem; right: 1.25rem; z-index: 4; display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border-radius: 999px; color: var(--titanium);
  background: rgba(5,5,5,0.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color 0.35s, color 0.35s, transform 0.5s var(--ease-out);
}
.bento-arrow svg { width: 1rem; height: 1rem; }
.bento-card:is(:hover, :focus-within) .bento-arrow { background: var(--ember); color: var(--obsidian); transform: rotate(45deg); }

/* Capa CAD / wireframe */
.cad-layer {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; align-items: flex-start; justify-content: flex-end; padding: 1.25rem 4.25rem 1.25rem 1.25rem;
  opacity: 0; transition: opacity 0.6s var(--ease-out);
}
.cad-layer.is-static { opacity: 0.55; }
.bento-card:is(:hover, :focus-within) .cad-layer, .bento-card.is-drawn .cad-layer { opacity: 1; }
.cad { width: 62%; max-width: 420px; color: var(--tech-hi); }
.cad-layer.is-static .cad { width: 70%; }
.cad svg { width: 100%; height: auto; overflow: visible; }
.cad [data-draw] {
  fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: var(--len, 1000); stroke-dashoffset: var(--len, 1000);
  transition: stroke-dashoffset 1.5s cubic-bezier(0.65, 0, 0.35, 1) calc(var(--i, 0) * 35ms);
}
.cad .cad-accent { stroke: var(--ember); }
.cad .cad-fade { opacity: 0; transition: opacity 0.6s 0.7s; }
.cad text { font-family: "JetBrains Mono", monospace; font-size: 10px; fill: rgba(244,244,245,0.8); stroke: none; }
.cad .cad-dim { fill: none; stroke: rgba(244,244,245,0.45); stroke-width: 0.8; stroke-dasharray: 3 3; }
.bento-card:is(:hover, :focus-within) .cad [data-draw], .bento-card.is-drawn .cad [data-draw] { stroke-dashoffset: 0; }
.bento-card:is(:hover, :focus-within) .cad .cad-fade, .bento-card.is-drawn .cad .cad-fade { opacity: 1; }
.bento-card .bento-media + .bento-shade + .cad-layer .cad { width: 52%; }

/* ---------- Proyectos (pan horizontal) ---------- */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.pan-section.is-pinned .pan-wrap { height: 100dvh; }
.pan-section.is-pinned .pan-track { overflow: visible; scroll-snap-type: none; padding-top: 0; padding-bottom: 0; height: 100%; align-items: center; }
.project-card {
  position: relative; flex-shrink: 0; overflow: hidden; border-radius: 20px; background: var(--steel);
  width: 85vw; height: 72vh; min-height: 460px; max-height: 760px; scroll-snap-align: start;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
@media (min-width: 768px) { .project-card { width: min(74vw, 900px); } }
@media (min-width: 1024px) { .project-card { width: min(62vw, 900px); } }
.project-card .proj-img-wrap { position: absolute; inset: 0; overflow: hidden; }
.project-card .proj-img { max-width: none; position: absolute; top: 0; left: -8%; width: 116%; height: 100%; object-fit: cover; filter: saturate(0.85); transition: filter 0.8s; }
.project-card:hover .proj-img { filter: saturate(1); }
.project-card .proj-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(5,5,5,0.97) 12%, rgba(5,5,5,0.55) 52%, rgba(5,5,5,0.05) 100%); }
.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 14px; background: rgba(255,255,255,0.08); }
@media (min-width: 1024px) { .spec-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.spec-grid > div { background: rgba(11,13,17,0.82); padding: 0.85rem 1rem; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.spec-k { font-family: "JetBrains Mono", monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(244,244,245,0.58); }
.spec-v { margin-top: 0.3rem; font-size: 0.9rem; font-weight: 500; color: var(--titanium); line-height: 1.35; }

/* ---------- Metodología ---------- */
.step-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; padding: 0.25rem 0.5rem 1rem; text-align: center; border-radius: 16px; transition: background-color 0.3s; }
@media (max-width: 767px) { .step-btn { flex-direction: row; text-align: left; padding: 0.75rem; background: rgba(255,255,255,0.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07); } }
.step-node {
  position: relative; z-index: 1; display: grid; place-items: center; width: 3rem; height: 3rem; flex-shrink: 0; border-radius: 999px;
  background: var(--carbon); color: rgba(244,244,245,0.7); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
  transition: background-color 0.35s, color 0.35s, box-shadow 0.35s, transform 0.5s var(--ease-out);
}
.step-name { font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 0.98rem; color: rgba(244,244,245,0.65); transition: color 0.3s; }
.step-btn:hover .step-node { box-shadow: inset 0 0 0 1px rgba(255,87,34,0.6); color: var(--titanium); }
.step-btn[aria-selected="true"] .step-node { background: var(--ember); color: var(--obsidian); box-shadow: 0 0 0 6px rgba(255,87,34,0.14); transform: scale(1.06); }
.step-btn[aria-selected="true"] .step-name { color: var(--titanium); }
.step-btn.is-done .step-node { color: var(--ember); box-shadow: inset 0 0 0 1px rgba(255,87,34,0.5); }
.step-btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 4px; }
.step-panel { display: grid; gap: 2rem; padding: 1.75rem; }
@media (min-width: 768px) { .step-panel { grid-template-columns: 1.4fr 1fr; padding: 2.75rem; gap: 3rem; } }
.step-title { font-family: "Space Grotesk", sans-serif; font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 600; letter-spacing: -0.015em; }
.step-desc { margin-top: 0.9rem; max-width: 52ch; color: rgba(244,244,245,0.72); line-height: 1.7; }
.step-deliv { border-radius: 16px; background: rgba(5,5,5,0.45); padding: 1.4rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
.step-deliv-label { font-family: "JetBrains Mono", monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--ember); }
.step-deliv ul { margin-top: 0.9rem; display: grid; gap: 0.7rem; font-family: "JetBrains Mono", monospace; font-size: 13px; color: rgba(244,244,245,0.85); }
.step-deliv li { display: flex; gap: 0.7rem; }
.step-deliv li::before { content: ">"; color: var(--tech-hi); }

/* ---------- Acordeón ---------- */
.acc-item { border-bottom: 1px solid rgba(255,255,255,0.08); }
.acc-trigger { display: flex; width: 100%; align-items: center; gap: 1rem; padding: 1.15rem 0; text-align: left; font-family: "Space Grotesk", sans-serif; font-size: 1.1rem; font-weight: 500; color: rgba(244,244,245,0.82); transition: color 0.25s; }
.acc-trigger:hover, .acc-trigger[aria-expanded="true"] { color: var(--titanium); }
.acc-trigger > span { flex: 1; }
.acc-icon { width: 1.15rem; height: 1.15rem; color: var(--tech-hi); flex-shrink: 0; }
.acc-plus { width: 1.1rem; height: 1.1rem; color: rgba(244,244,245,0.6); transition: transform 0.45s var(--ease-out), color 0.3s; flex-shrink: 0; }
.acc-trigger[aria-expanded="true"] .acc-plus { transform: rotate(45deg); color: var(--ember); }
.acc-trigger:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 8px; }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--ease-out); }
.acc-body > div { overflow: hidden; }
.acc-body p { padding: 0 0 1.25rem 2.15rem; max-width: 56ch; color: rgba(244,244,245,0.68); line-height: 1.7; }
.acc-trigger[aria-expanded="true"] + .acc-body { grid-template-rows: 1fr; }

/* ---------- Formulario ---------- */
.field { display: grid; gap: 0.5rem; align-content: start; }
.field label { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: 0.04em; color: rgba(244,244,245,0.82); }
.field-opt { margin-left: 0.35rem; color: rgba(244,244,245,0.55); font-size: 11px; }
.field input, .field select, .field textarea {
  width: 100%; border-radius: 12px; border: 1px solid rgba(255,255,255,0.14); background: rgba(5,5,5,0.5);
  padding: 0.8rem 1rem; color: var(--titanium); font-size: 0.95rem; outline: none; appearance: none;
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}
.field select { padding-right: 2.5rem; cursor: pointer; }
.field select option { background: var(--carbon); color: var(--titanium); }
.field textarea { resize: vertical; min-height: 7rem; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255,255,255,0.24); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(255,87,34,0.22); background: rgba(5,5,5,0.7); }
.field[data-invalid] input, .field[data-invalid] textarea { border-color: #FF7A61; }
.field.is-prefilled select { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(255,87,34,0.22); }
.field-error { min-height: 0; font-size: 12.5px; color: #FF9B85; }
.field-error:empty { display: none; }
.field-help { font-size: 12.5px; color: rgba(244,244,245,0.6); }
.link-u { color: var(--titanium); text-decoration: underline; text-decoration-color: rgba(255,255,255,0.25); text-underline-offset: 4px; transition: text-decoration-color 0.25s; }
.link-u:hover { text-decoration-color: var(--ember); }
.copy-btn { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; flex-shrink: 0; border-radius: 999px; color: rgba(244,244,245,0.7); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); transition: color 0.25s, box-shadow 0.25s; }
.copy-btn:hover { color: var(--titanium); box-shadow: inset 0 0 0 1px var(--ember); }
.copy-btn.is-copied { color: var(--ember); box-shadow: inset 0 0 0 1px var(--ember); }
.iso-badge {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 2.25rem; padding: 0 0.95rem; border-radius: 999px;
  font-size: 12px; color: var(--titanium); background: rgba(255,255,255,0.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

/* ---------- Diálogos ---------- */
.o3a-dialog {
  width: min(920px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px);
  padding: 0; border: 0; background: transparent; color: var(--titanium); overflow: visible;
}
.o3a-dialog::backdrop { background: rgba(5,5,5,0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.o3a-dialog .dialog-panel { max-height: calc(100dvh - 24px); overflow-y: auto; background: linear-gradient(180deg, rgba(20,23,30,0.96), rgba(11,13,17,0.97)); }
.o3a-dialog[open] .dialog-panel { animation: o3a-pop 0.5s var(--ease-out); }
@keyframes o3a-pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog-close { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex-shrink: 0; border-radius: 999px; background: rgba(5,5,5,0.6); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); transition: box-shadow 0.25s; }
.dialog-close:hover { box-shadow: inset 0 0 0 1px var(--ember); }
.spec-tile { border-radius: 14px; background: rgba(5,5,5,0.45); padding: 1rem 1.1rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
.ficha-li { display: flex; gap: 0.6rem; }
.ficha-li::before { content: ""; width: 10px; height: 1px; margin-top: 0.7em; background: var(--ember); flex-shrink: 0; }

/* ---------- Foco visible global ---------- */
a:focus-visible, button:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  .js .metric, .js [data-reveal] { opacity: 1; transform: none; }
  .js #hero-title { visibility: visible; }
}

/* ---------- Impresión de la ficha técnica ---------- */
@media print {
  html.print-ficha body > *:not(#ficha-dialog) { display: none !important; }
  html.print-ficha #ficha-dialog { position: static; display: block; width: 100%; max-height: none; color: #000; }
  html.print-ficha #ficha-dialog .dialog-panel { background: #fff !important; box-shadow: none; max-height: none; overflow: visible; }
  html.print-ficha #ficha-dialog .glass::before, html.print-ficha .dialog-close, html.print-ficha #ficha-print { display: none !important; }
  html.print-ficha #ficha-dialog * { color: #000 !important; }
  html.print-ficha .spec-tile { background: #f4f4f5 !important; }
  html.print-ficha, html.print-ficha body { background: #fff !important; }
  html.print-ficha #ficha-dialog a[data-close], html.print-ficha .grain { display: none !important; }
  html.print-ficha #ficha-dialog::backdrop { background: #fff; }
}
