/* =========================================================
   Fourvexa Solutions · estilos
   Colores y tipografía según el manual de marca v1.0
   ========================================================= */

:root {
  /* Marca */
  --violet: #9B6BFF;        /* acentos, textos sobre fondo oscuro */
  --violet-dark: #7439EF;   /* botones con texto blanco, links sobre claro */
  --violet-light: #F1EBFF;  /* fondos de destacados */
  --ink: #0E1525;           /* textos sobre claro */
  --black: #000000;
  --white: #FFFFFF;
  --paper: #F4F5F7;
  --gray: #9AA4B8;          /* SOLO sobre fondos oscuros */

  /* Derivados para la interfaz */
  --bg: var(--black);
  --surface: #0A0E18;
  --surface-2: #111726;
  --border: rgba(154, 164, 184, .16);
  --border-strong: rgba(154, 164, 184, .3);
  --text: #E9ECF2;
  --muted: var(--gray);
  --ink-muted: #4A5468;     /* texto secundario sobre fondo claro (7,6:1) */

  --font: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1180px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--violet); color: var(--black); }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.mono { font-family: var(--mono); }
.accent { color: var(--violet); }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--violet-dark); color: var(--white);
  padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 16px; }

.diamond {
  display: inline-block; width: 9px; height: 9px;
  background: var(--violet); border-radius: 2px; transform: rotate(45deg);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 500; font-size: .95rem; line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
  white-space: nowrap;
}
.btn--primary { background: var(--violet-dark); color: var(--white); }
.btn--primary:hover { background: #8150F5; box-shadow: 0 8px 30px -8px rgba(116, 57, 239, .7); transform: translateY(-1px); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--violet); color: var(--white); background: rgba(155, 107, 255, .08); }
.btn--sm { padding: 9px 16px; font-size: .875rem; }
.btn--lg { padding: 16px 28px; font-size: 1rem; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.header__logo { flex: none; }
.header__logo img { width: 200px; height: auto; } /* mínimo del manual: 200 px */

.nav { display: flex; align-items: center; gap: 32px; }
.nav__list { display: flex; gap: 28px; }
.nav__list a { font-size: .9rem; color: var(--muted); transition: color .2s; position: relative; }
.nav__list a:hover, .nav__list a.is-active { color: var(--white); }
.nav__list a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -8px;
  width: 5px; height: 5px; background: var(--violet); border-radius: 1px;
  transform: translateX(-50%) rotate(45deg);
}
/* Selector de idioma (ES / EN) */
.lang { font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .08em; }

.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border-strong); cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 2px; background: var(--white);
  border-radius: 2px; transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 24px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 19.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 19.5px; transform: rotate(-45deg); }

/* ---------- Secciones ---------- */
.section { padding: 120px 0; position: relative; }
.section__head { max-width: 680px; margin-bottom: 56px; }
.section__head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.section__head--row > div:first-child { max-width: 680px; }
.kicker {
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--violet);
  margin-bottom: 16px;
}
.section__title { font-size: clamp(2rem, 4vw, 2.9rem); }
.section__lead { margin-top: 18px; color: var(--muted); font-size: 1.075rem; max-width: 60ch; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .08em;
  color: var(--gray);
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(155, 107, 255, .05);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- 1 · Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 48px) 0 80px;
  position: relative; overflow: hidden;
}
.hero__grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(154,164,184,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154,164,184,.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; width: 640px; height: 640px; right: -120px; top: 6%;
  background: radial-gradient(circle, rgba(116, 57, 239, .28), transparent 65%);
  filter: blur(20px); pointer-events: none;
}
.hero__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.2fr .9fr; gap: 56px; align-items: center;
}
/* Sin esto, las líneas largas del editor ensanchan la columna y en el celular el texto se corta */
.hero__inner > * { min-width: 0; }
.hero__title { font-size: clamp(2.3rem, 4.6vw, 3.7rem); margin: 24px 0 22px; letter-spacing: -.035em; }
.hero__lead { font-size: 1.125rem; color: var(--muted); max-width: 54ch; }
.hero__actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 44px; color: var(--muted); font-size: .875rem; }
.hero__facts .mono { color: var(--violet); margin-right: 6px; font-size: .75rem; }

.hero__visual { position: relative; }

/* Cuatro trazos que se cruzan (motivo del logo) */
.cross { position: absolute; inset: -12% -8%; pointer-events: none; }
.cross__line {
  position: absolute; left: 50%; top: 50%; width: 75%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155, 107, 255, .55));
  transform-origin: 0 50%;
  animation: draw 1.6s var(--ease) both;
}
.cross__line--1 { transform: rotate(-135deg) scaleX(var(--s, 1)); }
.cross__line--2 { transform: rotate(-45deg) scaleX(var(--s, 1)); animation-delay: .1s; }
.cross__line--3 { transform: rotate(45deg) scaleX(var(--s, 1)); animation-delay: .2s; }
.cross__line--4 { transform: rotate(135deg) scaleX(var(--s, 1)); animation-delay: .3s; }
.cross__diamond {
  position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  background: var(--violet); border-radius: 3px; transform: rotate(45deg);
  box-shadow: 0 0 0 6px rgba(155, 107, 255, .15), 0 0 40px rgba(155, 107, 255, .6);
}
@keyframes draw { from { opacity: 0; --s: 0; } to { opacity: 1; --s: 1; } }
@property --s { syntax: "<number>"; inherits: false; initial-value: 1; }

.editor {
  position: relative; z-index: 1;
  background: rgba(10, 14, 24, .88);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(155, 107, 255, .06);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.editor__bar {
  display: flex; align-items: center; gap: 7px; padding: 13px 16px;
  border-bottom: 1px solid var(--border); background: rgba(17, 23, 38, .7);
}
.editor__bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #2A3245; }
.editor__file { margin-left: 10px; font-family: var(--mono); font-size: .78rem; color: var(--gray); }
.editor__code {
  margin: 0; padding: 22px 22px 26px;
  font-family: var(--mono); font-size: .85rem; line-height: 1.85;
  color: #C9D0DD; min-height: 342px; white-space: pre; overflow: hidden;
}
.editor__code .c { color: #5F6A80; }
.editor__code .k { color: var(--violet); }
.editor__code .s { color: #8EE3B5; }
.editor__code .n { color: #F6C177; }
.editor__code .f { color: #7FB7FF; }
.editor__code .ln { display: inline-block; width: 2ch; margin-right: 18px; color: #3A4358; text-align: right; user-select: none; }
.caret {
  display: inline-block; width: 8px; height: 1.1em; vertical-align: -3px;
  background: var(--violet); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.chip-float {
  position: absolute; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .75rem; color: var(--text);
  padding: 9px 14px; border-radius: 10px;
  background: rgba(17, 23, 38, .92); border: 1px solid var(--border-strong);
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .7);
  animation: float 6s ease-in-out infinite;
}
.chip-float--a { right: -18px; top: -18px; }
.chip-float--b { left: -28px; bottom: -20px; animation-delay: -3s; }
.chip-float .ok { color: #8EE3B5; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #8EE3B5; box-shadow: 0 0 0 0 rgba(142, 227, 181, .6); animation: pulse 2s infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(142, 227, 181, 0); } 100% { box-shadow: 0 0 0 0 rgba(142, 227, 181, 0); } }

/* ---------- 2 · Servicios ---------- */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.service {
  padding: 28px 24px 30px; position: relative; overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, background .35s;
}
.service::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(155, 107, 255, .12), transparent 45%);
  transition: opacity .35s;
}
.service:hover { transform: translateY(-4px); border-color: rgba(155, 107, 255, .45); background: var(--surface-2); }
.service:hover::before { opacity: 1; }
.service__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(155, 107, 255, .1); border: 1px solid rgba(155, 107, 255, .22);
  margin-bottom: 22px; transition: background .35s, transform .35s var(--ease);
}
.service__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--violet); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.service:hover .service__icon { background: rgba(155, 107, 255, .2); transform: rotate(-6deg) scale(1.05); }
.service h4 { font-size: 1.075rem; margin-bottom: 10px; }
.service p { color: var(--muted); font-size: .925rem; line-height: 1.6; }

/* Grupos de servicios: desarrollo / infraestructura y seguridad */
.services__group {
  display: flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gray);
}
.services__group::before {
  content: ""; width: 7px; height: 7px; flex: none;
  background: var(--violet); border-radius: 1px; transform: rotate(45deg);
}
.services + .services__group { margin-top: 56px; }

/* ---------- 3 · Proyectos ---------- */
.section--projects { background: linear-gradient(180deg, var(--black), #05070D 30%, #05070D 70%, var(--black)); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  padding: 8px 15px; border-radius: 999px; font-size: .85rem; cursor: pointer;
  background: transparent; border: 1px solid var(--border-strong); color: var(--muted);
  transition: all .2s;
}
.filter:hover { color: var(--white); border-color: var(--gray); }
.filter.is-active { background: var(--white); color: var(--black); border-color: var(--white); }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project {
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s;
}
.project:hover { transform: translateY(-5px); border-color: rgba(155, 107, 255, .45); }
.project.is-hidden { display: none; }
.project__media {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.project__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s var(--ease); }
.project:hover .project__media img { transform: scale(1.04); }
.project__media .tag { position: absolute; top: 14px; left: 14px; }
.project__body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.project__type { font-family: var(--mono); font-size: .75rem; color: var(--violet); letter-spacing: .06em; text-transform: uppercase; }
.project__body h3 { font-size: 1.2rem; margin: 8px 0 10px; }
.project__body p { color: var(--muted); font-size: .925rem; flex: 1; }
.techs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 20px; }
.techs li {
  font-family: var(--mono); font-size: .72rem; color: #C9D0DD;
  padding: 4px 9px; border-radius: 6px; background: rgba(154, 164, 184, .08); border: 1px solid var(--border);
}
.project__more {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-weight: 500; font-size: .925rem; color: var(--violet);
}
.project__more span { transition: transform .25s var(--ease); }
.project__more:hover span { transform: translateX(4px); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 6px;
}
.tag--demo { background: rgba(0, 0, 0, .78); color: var(--violet); border: 1px solid rgba(155, 107, 255, .4); backdrop-filter: blur(6px); }
.tag--client { background: rgba(0, 0, 0, .78); color: #8EE3B5; border: 1px solid rgba(142, 227, 181, .4); }
.tag--study { background: rgba(0, 0, 0, .78); color: #E9ECF2; border: 1px solid rgba(155, 107, 255, .5); backdrop-filter: blur(6px); }
.tag--study i { color: var(--violet); font-style: normal; }
.tag--inline { vertical-align: 1px; font-size: .68rem; padding: 2px 7px; }

/* Modal de detalle */
.modal {
  width: min(100% - 32px, 820px); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: 18px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .8);
}
.modal::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); }
.modal[open] { animation: modalIn .35s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal__inner { position: relative; }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  background: rgba(0, 0, 0, .7); border: 1px solid var(--border-strong); font-size: 1.5rem; line-height: 1;
}
.modal__close:hover { border-color: var(--violet); }
.modal__media { aspect-ratio: 16 / 10; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.modal__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.modal__thumbs { display: flex; gap: 10px; padding: 14px 32px 0; overflow-x: auto; }
.thumb { flex: none; width: 104px; aspect-ratio: 16 / 10; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface-2); border: 2px solid transparent; opacity: .6; transition: opacity .2s, border-color .2s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb:hover { opacity: 1; }
.thumb.is-active { opacity: 1; border-color: var(--violet); }
.modal__body { padding: 30px 32px 34px; }
.modal__body h3 { font-size: 1.6rem; margin: 10px 0 14px; }
.modal__body > p { color: var(--muted); }
.modal__note {
  margin-top: 20px; padding: 12px 16px; border-radius: 10px; font-size: .875rem;
  background: rgba(155, 107, 255, .08); border: 1px solid rgba(155, 107, 255, .25); color: var(--text);
}
.modal__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 28px; }
.modal__cols h4 { font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--gray); margin: 0 0 12px; }
.modal__cols li { position: relative; padding-left: 18px; margin-bottom: 8px; font-size: .925rem; }
.modal__cols li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; background: var(--violet); border-radius: 1px; transform: rotate(45deg); }
.modal__links { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.modal__cols .techs { margin: 0; }
.modal__cols .techs li { padding: 4px 9px; margin: 0; }
.modal__cols .techs li::before { display: none; }
body:has(.modal[open]) { overflow: hidden; }

/* ---------- 4 · Proceso (fondo claro) ---------- */
.section--light { background: var(--paper); color: var(--ink); }
.section--light .kicker { color: var(--violet-dark); }
.section--light .section__lead { color: var(--ink-muted); }

.process { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; position: relative; counter-reset: step; }
.process::before {
  content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 2px;
  background: linear-gradient(90deg, var(--violet-dark), var(--violet) 50%, rgba(155, 107, 255, .2));
}
.process__step { position: relative; padding-top: 44px; }
.process__node {
  position: absolute; top: 0; left: 0; width: 20px; height: 20px;
  background: var(--paper); border: 2px solid var(--violet-dark); border-radius: 4px;
  transform: rotate(45deg); transition: background .3s, transform .3s var(--ease);
}
.process__step:hover .process__node { background: var(--violet-dark); transform: rotate(45deg) scale(1.15); }
.process__num { font-family: var(--mono); font-size: 2.6rem; font-weight: 500; color: var(--violet-dark); line-height: 1; letter-spacing: -.04em; }
.process__step h3 { font-size: 1.2rem; margin: 14px 0 10px; }
.process__step p { color: var(--ink-muted); font-size: .925rem; }

/* ---------- 5 · Tecnologías ---------- */
/* Las líneas entre columnas son el gap de 1px sobre el fondo del contenedor */
.stack {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.stack__group { padding: 30px 24px 34px; background: var(--black); transition: background .3s; }
.stack__group:hover { background: var(--surface); }
.stack__title { font-size: .875rem; font-weight: 500; color: var(--violet); margin-bottom: 22px; letter-spacing: 0; }
.stack__list li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; font-size: 1.05rem; font-weight: 500;
  border-bottom: 1px dashed var(--border);
}
.stack__list li:last-child { border-bottom: 0; }
.stack__list li::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--gray); transform: rotate(45deg); transition: background .2s; flex: none; }
.stack__list li:hover::before { background: var(--violet); }

/* ---------- 6 · Nosotros ---------- */
.section--about { border-top: 1px solid var(--border); }
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; align-items: center; }
.about__x { width: 100%; max-width: 380px; margin-inline: auto; overflow: visible; }
/* La x del logo, rellena como en la marca. La anima js/anim/trazo.js (un pincel pinta los dos trazos y
   el rombo se arma con píxeles); sin JavaScript o con "reducir movimiento" queda así, quieta. */
.about__strokes { fill: var(--white); }
.about__diamond { fill: var(--violet); }

.about__copy > p:not(.kicker) { color: var(--muted); font-size: 1.075rem; margin-top: 20px; max-width: 62ch; }
.about__copy .section__title { margin-bottom: 4px; }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 36px; }
.values li { padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.values strong { display: block; font-weight: 600; margin-bottom: 4px; }
.values span { color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* ---------- 7 · Preguntas frecuentes ---------- */
.section--faq { border-top: 1px solid var(--border); }
.faq { max-width: 880px; border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px 4px; cursor: pointer; list-style: none;
  font-weight: 500; font-size: 1.075rem; transition: color .2s;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 6px;
  border-right: 2px solid var(--violet); border-bottom: 2px solid var(--violet);
  transform: translateY(-3px) rotate(45deg); transition: transform .25s var(--ease);
}
.faq__item[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq__item summary:hover { color: var(--white); }
.faq__item p { color: var(--muted); padding: 0 4px 24px; max-width: 70ch; }

/* ---------- 8 · Contacto ---------- */
.contact { padding-top: 40px; }
.contact__box {
  position: relative; overflow: hidden; text-align: center;
  padding: 96px 32px 72px; border-radius: 24px;
  background: linear-gradient(180deg, #0B0F1B, #05070D);
  border: 1px solid var(--border-strong);
}
.contact__glow {
  position: absolute; left: 50%; top: -40%; width: 900px; height: 600px; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(116, 57, 239, .35), transparent 60%); pointer-events: none;
}
/* El brillo queda fuera de esta regla: si fuera relative, ocuparía lugar y empujaría el contenido */
.contact__box > :not(.contact__glow) { position: relative; }
.contact__title { font-size: clamp(2.2rem, 5.5vw, 4rem); letter-spacing: -.035em; }
.contact__lead { color: var(--muted); font-size: 1.1rem; margin: 22px auto 0; max-width: 48ch; }
.contact__meta {
  margin: 18px auto 0; max-width: 52ch;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; color: var(--gray);
}
.contact__meta .diamond { margin-right: 10px; vertical-align: 1px; }
.contact__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 40px; }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.socials a { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: .925rem; transition: color .2s; }
.socials a:hover { color: var(--white); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.socials svg.icon-line { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Footer ---------- */
.footer { padding: 48px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.footer__inner img { width: 120px; height: auto; } /* mínimo del manual para el compacto */
.footer__top:hover { color: var(--white); }

/* ---------- Animación de entrada ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .stack { grid-template-columns: repeat(2, 1fr); }
  .stack__group:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .nav, .nav__list { gap: 20px; } /* con el botón de idioma, así entra todo sin achicar el logo */
  .hero__inner { grid-template-columns: 1fr; gap: 72px; }
  .hero__visual { max-width: 620px; }
  .about { grid-template-columns: 1fr; gap: 48px; }
  .about__x { max-width: 260px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; z-index: 2; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 20px;
    padding: 24px 16px 32px;
    background: var(--black);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__list a { display: block; padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .nav__list a.is-active::after { display: none; }
  .nav .lang { align-self: flex-start; }
  .header:has(.nav.is-open) { background: var(--black); backdrop-filter: none; -webkit-backdrop-filter: none; }

  .process { grid-template-columns: 1fr; gap: 0; }
  .process::before { left: 9px; right: auto; top: 10px; bottom: 10px; width: 2px; height: auto; background: linear-gradient(180deg, var(--violet-dark), rgba(155, 107, 255, .25)); }
  .process__step { padding: 0 0 36px 52px; }
  .process__step:last-child { padding-bottom: 0; }
  .process__num { font-size: 1.9rem; }
  .process__step h3 { margin-top: 6px; }
}

@media (max-width: 640px) {
  .section { padding: 84px 0; }
  .section__head { margin-bottom: 40px; }
  .header__logo img { width: 200px; }
  .services, .projects, .values { grid-template-columns: 1fr; }
  .stack { grid-template-columns: 1fr; }
  .faq__item summary { font-size: 1rem; padding: 18px 2px; }
  .hero { padding-top: calc(var(--header-h) + 32px); }
  .hero__actions .btn { flex: 1 1 auto; }
  .editor__code { font-size: .72rem; padding: 18px 14px; min-height: 290px; }
  .editor__code .ln { margin-right: 10px; }
  .chip-float--a { right: 8px; top: -18px; }
  .chip-float--b { left: 8px; bottom: -18px; }
  .contact__box { padding: 72px 20px 56px; }
  .contact__actions .btn { width: 100%; }
  .modal__body { padding: 24px 20px 28px; }
  .modal__thumbs { padding: 12px 20px 0; }
  .thumb { width: 88px; }
  .modal__cols { grid-template-columns: 1fr; gap: 20px; }
  .footer__inner { flex-direction: column; text-align: center; }
}

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

/* =========================================================
   MODO CLARO / OSCURO
   El sitio es oscuro por defecto. El botón del diamante (junto al idioma)
   lo pasa a claro; la elección se guarda en el navegador y el <head> la
   aplica antes de dibujar. Acá solo se cambian colores.
   ========================================================= */
/* Idioma, modo claro y Rayos X: sin caja, en el gris del menú y separados de él por una línea fina */
.nav__tools { display: flex; align-items: center; gap: 2px; padding-left: 14px; border-left: 1px solid var(--border); }
.lang, .theme-toggle, .xray-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; min-width: 34px; padding: 0 8px; cursor: pointer;
  color: var(--muted); background: transparent; border: 0; border-radius: 8px;
  transition: color .2s, background-color .2s;
}
.lang:hover, .theme-toggle:hover, .xray-toggle:hover { color: var(--white); background: rgba(154, 164, 184, .1); }
.theme-toggle svg, .xray-toggle svg { width: 16px; height: 16px; }
.no-js .theme-toggle, .no-js .xray-toggle { display: none; }
/* En el menú del celular, sin la línea y con un fondo suave: más fáciles de tocar */
@media (max-width: 900px) {
  .nav__tools { align-self: flex-start; gap: 8px; padding-left: 0; border-left: 0; }
  .lang, .theme-toggle, .xray-toggle { height: 42px; min-width: 42px; background: rgba(154, 164, 184, .08); }
}
/* Justo antes de pasar al menú del celular, el menú completo entra apretando un poco los espacios */
@media (min-width: 901px) and (max-width: 1000px) {
  .header__inner { gap: 16px; }
  .nav { gap: 14px; }
  .nav__list { gap: 12px; }
  .nav__list a { font-size: .84rem; }
  .nav__tools { padding-left: 10px; }
  .nav > .btn--sm { padding-inline: 12px; }
}

/* Cada logo tiene su versión para fondo oscuro y para fondo claro */
.on-light { display: none; }
:root[data-theme="light"] .on-light { display: block; }
:root[data-theme="light"] .on-dark { display: none; }

/* Al cambiar de modo, el nuevo se abre como un diamante desde el botón (lo anima main.js) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: var(--paper);
  --surface: #FFFFFF;
  --surface-2: #ECEEF3;
  --border: rgba(14, 21, 37, .12);
  --border-strong: rgba(14, 21, 37, .22);
  --text: var(--ink);
  --muted: var(--ink-muted);
}

/* Textos en violeta: sobre claro va el violeta oscuro (contraste AA) */
:root[data-theme="light"] .accent,
:root[data-theme="light"] .kicker,
:root[data-theme="light"] .hero__facts .mono,
:root[data-theme="light"] .project__type,
:root[data-theme="light"] .project__more,
:root[data-theme="light"] .stack__title { color: var(--violet-dark); }

/* Lo que en oscuro se resalta en blanco, en claro se resalta en tinta */
:root[data-theme="light"] .nav__list a:hover,
:root[data-theme="light"] .nav__list a.is-active,
:root[data-theme="light"] .lang:hover,
:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .xray-toggle:hover,
:root[data-theme="light"] .btn--ghost:hover,
:root[data-theme="light"] .filter:hover,
:root[data-theme="light"] .faq__item summary:hover,
:root[data-theme="light"] .socials a:hover,
:root[data-theme="light"] .footer__top:hover { color: var(--ink); }
:root[data-theme="light"] .nav-toggle span { background: var(--ink); }
:root[data-theme="light"] :is(.lang, .theme-toggle, .xray-toggle):hover { background: rgba(14, 21, 37, .06); }
@media (max-width: 900px) {
  :root[data-theme="light"] :is(.lang, .theme-toggle, .xray-toggle) { background: rgba(14, 21, 37, .05); }
}
:root[data-theme="light"] .filter.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Grises pensados solo para fondo oscuro */
:root[data-theme="light"] .eyebrow,
:root[data-theme="light"] .services__group,
:root[data-theme="light"] .modal__cols h4,
:root[data-theme="light"] .contact__meta { color: var(--ink-muted); }
:root[data-theme="light"] .eyebrow { background: rgba(116, 57, 239, .06); }

/* Encabezado y menú del celular */
:root[data-theme="light"] .header.is-scrolled { background: rgba(244, 245, 247, .85); }
@media (max-width: 900px) {
  :root[data-theme="light"] .nav,
  :root[data-theme="light"] .header:has(.nav.is-open) { background: var(--paper); }
}

/* Inicio: grilla y brillo más suaves; el editor queda oscuro, como una ventana de código */
:root[data-theme="light"] .hero__grid-bg {
  background-image:
    linear-gradient(rgba(14, 21, 37, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 21, 37, .06) 1px, transparent 1px);
}
:root[data-theme="light"] .hero::after { background: radial-gradient(circle, rgba(116, 57, 239, .16), transparent 65%); }
:root[data-theme="light"] .editor { box-shadow: 0 30px 70px -24px rgba(14, 21, 37, .45); }
:root[data-theme="light"] .chip-float { color: #E9ECF2; box-shadow: 0 14px 34px -12px rgba(14, 21, 37, .4); }

/* Proyectos y detalle */
:root[data-theme="light"] .section--projects { background: none; }
:root[data-theme="light"] .techs li { color: var(--ink-muted); background: rgba(14, 21, 37, .04); }
:root[data-theme="light"] .modal { box-shadow: 0 40px 120px rgba(14, 21, 37, .35); }
:root[data-theme="light"] .modal::backdrop { background: rgba(14, 21, 37, .5); }
:root[data-theme="light"] .modal__close { background: rgba(255, 255, 255, .92); color: var(--ink); }

/* Proceso: en oscuro es la franja clara; en claro pasa a ser la franja oscura */
:root[data-theme="light"] .section--light { background: var(--ink); color: var(--paper); }
:root[data-theme="light"] .section--light .kicker { color: var(--violet); }
:root[data-theme="light"] .section--light .section__lead,
:root[data-theme="light"] .process__step p { color: var(--gray); }
:root[data-theme="light"] .process__node { background: var(--ink); border-color: var(--violet); }
:root[data-theme="light"] .process__step:hover .process__node { background: var(--violet); }
:root[data-theme="light"] .process__num { color: var(--violet); }

/* Tecnologías, Nosotros y contacto */
:root[data-theme="light"] .stack__group { background: var(--surface); }
:root[data-theme="light"] .stack__group:hover { background: var(--surface-2); }
:root[data-theme="light"] .about__strokes { fill: var(--ink); }
:root[data-theme="light"] .contact__box { background: linear-gradient(180deg, #FFFFFF, var(--violet-light)); }
:root[data-theme="light"] .contact__glow { background: radial-gradient(ellipse, rgba(116, 57, 239, .16), transparent 60%); }

/* =========================================================
   Formulario de contacto (popup)
   Se abre como un diamante que crece desde el centro (el vértice del logo)
   y se cierra encogiéndose al mismo punto. En el celular sube como hoja.
   ========================================================= */
.cmodal {
  padding: 16px; border: 0; margin: 0; background: transparent; color: var(--text);
  width: 100%; max-width: none; height: 100%; max-height: none; overflow-y: auto;
  overscroll-behavior: contain;
}
/* margin: auto en el panel (y no place-items: center): si el panel es más alto que la pantalla,
   arranca desde arriba y se puede scrollear entero, en vez de quedar cortado */
.cmodal[open] { display: grid; }
.cmodal::backdrop { background: rgba(0, 0, 0, .74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: cmFade .45s var(--ease); }
.cmodal.is-closing::backdrop { animation: cmFade .3s ease-in reverse forwards; }
body:has(.cmodal[open]) { overflow: hidden; }

.cmodal__panel {
  position: relative; isolation: isolate; overflow: hidden;
  width: min(100%, 700px); margin: auto;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  padding: 44px 44px 36px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 22px;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(155, 107, 255, .08);
  animation: cmOpen .65s var(--ease) backwards;
}
.cmodal__panel::before { /* brillo violeta arriba, como en la sección de contacto */
  content: ""; position: absolute; top: -260px; left: 50%; width: 760px; height: 460px; z-index: -1; pointer-events: none;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(116, 57, 239, .32), transparent);
}
.cmodal.is-closing .cmodal__panel { animation: cmClose .3s cubic-bezier(.5, 0, .75, 0) forwards; }

@keyframes cmFade { from { opacity: 0; } }
@keyframes cmOpen {
  0%   { clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%); transform: scale(.92) rotate(-1.5deg); }
  100% { clip-path: polygon(50% -60%, 160% 50%, 50% 160%, -60% 50%); transform: none; }
}
@keyframes cmClose {
  0%   { clip-path: polygon(50% -60%, 160% 50%, 50% 160%, -60% 50%); }
  100% { clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%); transform: scale(.94); opacity: .6; }
}

/* La x del logo en la esquina: los cuatro trazos se dibujan hacia el vértice */
.cmodal__x { position: absolute; top: -58px; right: 70px; width: 170px; height: 170px; z-index: -1; pointer-events: none; opacity: .5; }
.cmodal__x line { stroke: var(--violet); stroke-width: 1; stroke-dasharray: 74; stroke-dashoffset: 74; animation: cmDraw .9s var(--ease) .25s forwards; }
.cmodal__x line:nth-child(2) { animation-delay: .32s; }
.cmodal__x line:nth-child(3) { animation-delay: .39s; }
.cmodal__x line:nth-child(4) { animation-delay: .46s; }
.cmodal__x polygon { fill: var(--violet); stroke: var(--violet); stroke-width: 3; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; opacity: 0; animation: cmPop .5s var(--ease) .85s forwards; }
@keyframes cmDraw { to { stroke-dashoffset: 0; } }
@keyframes cmPop { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }

.cmodal__close {
  position: absolute; top: 16px; right: 16px; z-index: 1;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  background: rgba(0, 0, 0, .5); border: 1px solid var(--border-strong); font-size: 1.5rem; line-height: 1;
  transition: border-color .2s, transform .3s var(--ease);
}
.cmodal__close:hover { border-color: var(--violet); transform: rotate(90deg); }

.cmodal__title { font-size: clamp(1.7rem, 4vw, 2.2rem); letter-spacing: -.03em; }
.cmodal__lead { color: var(--muted); margin-top: 10px; max-width: 46ch; }
.cmodal .kicker { margin-bottom: 12px; }

/* Entrada escalonada del contenido, después del diamante */
.cm-in { animation: cmUp .55s var(--ease) backwards; }
.cmodal__view > .kicker { animation-delay: .16s; }
.cmodal__view > .cmodal__title { animation-delay: .21s; }
.cmodal__view > .cmodal__lead { animation-delay: .26s; }
.cform > .cm-in:nth-child(1) { animation-delay: .31s; }
.cform > .cm-in:nth-child(2) { animation-delay: .37s; }
.cform > .cm-in:nth-child(3) { animation-delay: .43s; }
.cform > .cm-in:nth-child(6) { animation-delay: .49s; }
@keyframes cmUp { from { opacity: 0; transform: translateY(12px); } }

/* Campos */
.cform { display: grid; gap: 18px; margin-top: 28px; }
.cform__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.cfield { display: grid; align-content: start; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.cfield label, .cfield legend { font-size: .85rem; font-weight: 500; padding: 0; }
.cfield legend { margin-bottom: 9px; }
.cfield__opt { color: var(--muted); font-weight: 400; }
.cfield input, .cfield textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text);
  background: rgba(154, 164, 184, .06); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.cfield textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.cfield input::placeholder, .cfield textarea::placeholder { color: var(--muted); opacity: .7; }
.cfield input:hover, .cfield textarea:hover { border-color: rgba(155, 107, 255, .5); }
.cfield input:focus, .cfield textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(155, 107, 255, .22); background: rgba(155, 107, 255, .05); }
.cfield .is-invalid, .cfield input.is-invalid, .cfield textarea.is-invalid { border-color: #F87171; }
.cfield .is-invalid:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, .2); }
.cfield__error { font-size: .8rem; color: #FCA5A5; }
.cfield__error:empty { display: none; }
.cfield__foot { display: flex; justify-content: space-between; gap: 12px; }
.cfield__count { margin-left: auto; font-family: var(--mono); font-size: .72rem; color: var(--muted); }

/* Opciones como chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 8px 14px; border-radius: 999px; font-size: .85rem;
  border: 1px solid var(--border-strong); color: var(--muted);
  transition: color .2s, border-color .2s, background .2s, transform .2s var(--ease);
}
.chip:hover span { color: var(--text); border-color: rgba(155, 107, 255, .5); }
.chip input:checked + span { background: var(--violet-dark); border-color: var(--violet-dark); color: var(--white); transform: translateY(-1px); }
.chip input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.cfield--chips.is-invalid .chip span { border-color: rgba(248, 113, 113, .6); }

/* Trampa para bots, fuera de la vista */
.cform__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cform__alert {
  font-size: .9rem; padding: 12px 14px; border-radius: 10px;
  background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .35); color: #FECACA;
}
.cform__alert a { color: inherit; text-decoration: underline; }

.cform__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.cform__privacy { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); }
.cform__submit { min-width: 172px; }
.cform__submit:disabled { cursor: progress; opacity: .85; transform: none; }
.cform__spinner { display: none; width: 11px; height: 11px; border-radius: 2px; background: currentColor; animation: cmSpin 1s var(--ease) infinite; }
.cform.is-sending .cform__spinner { display: inline-block; }
@keyframes cmSpin { from { transform: rotate(45deg) scale(.8); } 50% { transform: rotate(225deg) scale(1.1); } to { transform: rotate(405deg) scale(.8); } }

/* Mensaje enviado: el diamante aparece, se dibuja el check y salen cuatro rayos */
.cmodal__done { text-align: center; padding: 18px 0 6px; display: grid; justify-items: center; gap: 4px; animation: cmUp .5s var(--ease); }
.cmodal__done[hidden] { display: none; }
.cmodal__done .cmodal__lead { margin: 10px auto 26px; }
.cmodal__done .cmodal__title:focus { outline: none; }
.done__mark { width: 128px; height: 128px; margin-bottom: 18px; overflow: visible; }
.done__diamond { fill: var(--violet-dark); stroke: var(--violet); stroke-width: 2; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; animation: cmDiamond .6s var(--ease) backwards; }
.done__check { fill: none; stroke: var(--white); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: cmDraw .45s var(--ease) .45s forwards; }
.done__rays line { stroke: var(--violet); stroke-width: 3; stroke-linecap: round; opacity: 0; transform-box: view-box; transform-origin: center; animation: cmRays .7s var(--ease) .6s forwards; }
@keyframes cmDiamond { from { opacity: 0; scale: .3; rotate: -90deg; } }
@keyframes cmRays { 0% { opacity: 0; scale: .7; } 40% { opacity: 1; } 100% { opacity: 0; scale: 1.15; } }

/* Pantallas bajas (notebooks con zoom de Windows al 125-150 %): todo más compacto para que entre sin scroll */
@media (min-width: 641px) and (max-height: 860px) {
  .cmodal__panel { padding: 32px 36px 26px; }
  .cmodal__title { font-size: 1.65rem; }
  .cmodal__lead { margin-top: 6px; font-size: .95rem; }
  .cmodal .kicker { margin-bottom: 8px; }
  .cform { gap: 14px; margin-top: 20px; }
  .cfield { gap: 5px; }
  .cfield legend { margin-bottom: 7px; }
  .cfield input, .cfield textarea { padding: 9px 12px; }
  .cfield textarea { min-height: 84px; height: 96px; }
  .chip span { padding: 6px 12px; }
  .cform__foot { margin-top: 0; }
  .cmodal__x { width: 140px; height: 140px; top: -48px; right: 64px; }
}
@media (min-width: 641px) and (max-height: 700px) {
  .cmodal__panel { padding-top: 26px; padding-bottom: 22px; }
  .cmodal__lead { display: none; }
  .cform { margin-top: 16px; gap: 12px; }
  .cfield textarea { min-height: 64px; height: 72px; }
  .done__mark { width: 96px; height: 96px; margin-bottom: 10px; }
}

@media (max-width: 640px) {
  .cmodal { padding: 0; }
  .cmodal__panel {
    width: 100%; margin: auto 0 0; max-height: 94vh; max-height: 94dvh; overflow-y: auto;
    padding: 34px 20px 24px; border-radius: 22px 22px 0 0; border-bottom: 0;
    animation-name: cmSheet; animation-duration: .5s;
  }
  .cmodal.is-closing .cmodal__panel { animation: cmSheet .3s ease-in reverse forwards; }
  .cform__row { grid-template-columns: 1fr; }
  .cform__submit { width: 100%; }
  .cmodal__x { width: 130px; height: 130px; top: -46px; right: 66px; }
}
@keyframes cmSheet { from { transform: translateY(100%); } }

/* Modo claro */
:root[data-theme="light"] .cmodal::backdrop { background: rgba(14, 21, 37, .5); }
:root[data-theme="light"] .cmodal__panel { box-shadow: 0 40px 120px -20px rgba(14, 21, 37, .45); }
:root[data-theme="light"] .cmodal__panel::before { background: radial-gradient(closest-side, rgba(116, 57, 239, .14), transparent); }
:root[data-theme="light"] .cmodal__close { background: rgba(255, 255, 255, .92); color: var(--ink); }
:root[data-theme="light"] .cmodal__x line { stroke: var(--violet-dark); }
:root[data-theme="light"] .cfield input, :root[data-theme="light"] .cfield textarea { background: var(--paper); }
:root[data-theme="light"] .cfield input:focus, :root[data-theme="light"] .cfield textarea:focus { background: var(--white); box-shadow: 0 0 0 3px rgba(116, 57, 239, .18); border-color: var(--violet-dark); }
:root[data-theme="light"] .chip:hover span { color: var(--ink); }
:root[data-theme="light"] .cfield .is-invalid, :root[data-theme="light"] .cfield input.is-invalid, :root[data-theme="light"] .cfield textarea.is-invalid { border-color: #D92D20; }
:root[data-theme="light"] .cfield__error { color: #B42318; }
:root[data-theme="light"] .cform__alert { background: #FEF3F2; border-color: #FECDCA; color: #912018; }
