/* Divr — estética "lakesera": el scroll es la profundidad del lago */

:root {
  --surface: #e6f7f9;
  --shallow: #b7e5ee;
  --ink: #062033;          /* texto en aguas claras */
  --ink-soft: #2c4f63;
  --foam: #eaf8fb;         /* texto en aguas profundas */
  --foam-soft: #bfd7e1;
  --accent: #7fe0e8;       /* cian bioluminiscente */
  --bronze: #c98a4f;
  --silver: #bcc8d0;
  --gold: #e6b85c;
  --card-light: rgba(255, 255, 255, .55);
  --card-deep: rgba(127, 224, 232, .06);
  --line-deep: rgba(127, 224, 232, .18);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html { background: #010a14; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--foam);
  background: transparent;
  overflow-x: hidden;
}

/* el lago: color calculado por main.js según la profundidad (en metros) */
.lake { position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--lake-top, #eaf9fa), var(--lake-bottom, #c3eaf1)); }

#bubbles { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
main, .nav, .footer, .depth { position: relative; z-index: 1; }

.mono { font-family: var(--mono); }
.small { font-size: .85rem; }
.muted { color: var(--foam-soft); }
a { color: inherit; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 720px; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.01em; }
h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5.6vw, 4.2rem); font-weight: 700; max-width: 15ch; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 700; max-width: 22ch; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; margin-bottom: .3em; }

.layer { padding: 96px 0; }
/* Sistema único de rótulos: kicker, eyebrows y títulos de grupo del stack */
.label, .eyebrow, .kicker, .stackgrid__group h3 { font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow { color: var(--accent); margin: 0 0 14px; }
.lead { font-size: 1.15rem; max-width: 60ch; color: var(--foam-soft); }
.lead--narrow { max-width: 52ch; margin-bottom: 40px; }
.subhead { margin-top: 64px; }

/* ---------- Superficie (aguas claras: texto oscuro) ---------- */
.hero, #problemas { color: var(--ink); }
.hero .lead, #problemas .lead { color: var(--ink-soft); }
.hero .eyebrow, #problemas .eyebrow, .hero .kicker { color: #0b6f86; }

.hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding-top: 120px; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; width: 100%; }
.hero h1 { max-width: 14ch; }
.kicker { margin: 0 0 18px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.waterline { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 90px; }
.waterline path { fill: rgba(61, 147, 179, .35); animation: swell 9s ease-in-out infinite alternate; transform-origin: center; }
@keyframes swell { from { transform: translateX(-2%) scaleY(1); } to { transform: translateX(2%) scaleY(1.25); } }

/* Iceberg low-poly: viewBox de 240 de ancho con la línea de agua en y=60. A 150 px de ancho, esa línea queda a 37,5 px del borde superior. */
.berg { position: absolute; left: 7%; bottom: -81px; width: 150px; height: auto; pointer-events: none; transform-origin: 50% 37.5px; animation: bob 8s ease-in-out infinite alternate; }
.berg__net { opacity: .45; }
@keyframes bob { from { transform: translateY(0) rotate(-1.2deg); } to { transform: translateY(3px) rotate(1.2deg); } }

#problemas .case { background: var(--card-light); border: 1px solid rgba(6, 32, 51, .08); backdrop-filter: blur(6px); }
#problemas .case__flow > div { border-top-color: rgba(6, 32, 51, .12); }
#problemas .case__flow dt { color: #0b6f86; }
#problemas .case__flow dd { color: var(--ink-soft); }

/* ---------- Tiburoncito (main.js): detrás del contenido, solo en aguas profundas ---------- */
.shark { position: absolute; left: 0; top: 0; z-index: 0; width: 60px; height: 33px; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
.shark.is-on { opacity: .9; }
.shark__body svg { display: block; width: 60px; height: 33px; shape-rendering: crispEdges; }
.shark__roll.is-spin { animation: roll .9s ease-in-out; }
@keyframes roll { to { transform: rotate(360deg); } }
.shark-bubble { position: absolute; z-index: 0; pointer-events: none; border: 1px solid rgba(127, 224, 232, .8); border-radius: 50%; animation: rise 1.6s ease-out forwards; opacity: 0; }
@keyframes rise { 0% { opacity: .9; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-70px) translateX(6px); } }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px 28px;
  transition: background .3s, color .3s;
  color: var(--ink);
}
.nav.is-deep { background: rgba(2, 16, 30, .72); backdrop-filter: blur(10px); color: var(--foam); }
.nav.is-shallow { background: rgba(234, 249, 250, .7); backdrop-filter: blur(10px); }
/* Logo: isotipo + wordmark "divr" (Outfit). 1 color navy sobre claro; 2 colores sobre oscuro. */
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #062033; }
.logo__iso { width: 30px; height: 30px; flex: none;
  --fin: currentColor; --wave: currentColor; --l0: currentColor; --l1: currentColor; --l2: currentColor; --l3: currentColor; }
.logo__iso .fin { fill: var(--fin); }
.logo__iso .wave { stroke: var(--wave); }
.logo__iso .l0 { fill: var(--l0); } .logo__iso .l1 { fill: var(--l1); }
.logo__iso .l2 { fill: var(--l2); } .logo__iso .l3 { fill: var(--l3); }
.logo__word { font-family: "Outfit", var(--sans); font-weight: 600; font-size: 1.5rem; letter-spacing: -.02em; line-height: 1; }
.nav.is-deep .logo { color: var(--foam); }
.nav.is-deep .logo__iso { --fin: #7fe0e8; --wave: #7fe0e8; --l0: #3fa3cf; --l1: #2f8cbf; --l2: #2475a6; --l3: #2a6f9c; } /* l3 aclarada para contrastar con la nav oscura */
.footer__word { font-family: "Outfit", var(--sans); font-weight: 600; font-size: 1.1rem; }
.nav__links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.nav__links a { text-decoration: none; opacity: .8; }
.nav__links a:hover, .nav__links a:focus-visible { opacity: 1; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block; font: 600 .98rem var(--sans); text-decoration: none; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  background: #062033; color: #eaf8fb; transition: transform .15s, background .2s;
}
.btn:hover { transform: translateY(-1px); background: #0b3550; }
.btn--small { padding: 9px 16px; font-size: .88rem; }
.btn--ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); }
.nav.is-deep .btn, .layer:not(.hero):not(#problemas) .btn:not(.btn--ghost) { background: var(--accent); color: #032031; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Grillas y tarjetas ---------- */
.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--tight { gap: 24px; margin-top: 8px; }
.card, .price, .case, .role {
  padding: 24px; border-radius: var(--radius);
  background: var(--card-deep); border: 1px solid var(--line-deep);
}
.card p, .price p, .case p, .role p { margin: 0; }

/* ---------- Estratos bronze / silver / gold ---------- */
.strata { display: grid; gap: 22px; }
.stratum {
  position: relative; padding: 30px 30px 30px 34px; border-radius: var(--radius);
  background: rgba(2, 16, 30, .28); border: 1px solid var(--line-deep);
}
.stratum::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 4px; background: var(--layer); }
.stratum--bronze { --layer: var(--bronze); }
.stratum--silver { --layer: var(--silver); }
.stratum--gold { --layer: var(--gold); }
.stratum__tag { margin: 0 0 6px; color: var(--layer); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.stratum p { color: var(--foam-soft); max-width: 70ch; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; font-size: .8rem; }
.stack li { padding: 4px 10px; border: 1px solid var(--line-deep); border-radius: 999px; color: var(--foam); }

/* ---------- Pasos ---------- */
.steps { list-style: none; padding: 0; margin: 40px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: none; }
.steps li { padding: 26px; border-top: 1px solid var(--line-deep); }
.steps p { color: var(--foam-soft); margin: 0; }
.steps__n { display: block; color: var(--accent); font-size: .85rem; margin-bottom: 10px; }
.formats { margin: 8px 0 0; color: var(--foam); font-size: 1.05rem; }
.formats .mono { color: var(--accent); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; margin-right: 12px; }
.principles { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.principles li { padding-left: 22px; position: relative; color: var(--foam-soft); }
.principles li::before { content: "○"; position: absolute; left: 0; color: var(--accent); font-size: .8rem; top: 3px; }
.principles strong { color: var(--foam); font-weight: 600; }

/* ---------- Formatos de trabajo ---------- */
.format { padding: 24px; border-radius: var(--radius); background: var(--card-deep); border: 1px solid var(--line-deep); display: flex; flex-direction: column; gap: 10px; }
.format h3 { margin: 0; }
.format p { margin: 0; color: var(--foam-soft); }
.format--lead { border-color: var(--accent); background: rgba(127, 224, 232, .1); }
.format__amount { font-size: 1.6rem; font-weight: 700; color: var(--foam) !important; }
.format__amount .mono { font-size: .8rem; font-weight: 400; color: var(--accent); margin-right: 4px; }

/* ---------- Casos ---------- */
.cases { display: grid; gap: 18px; }
.case__ctx { color: var(--accent); font-size: .78rem; margin-bottom: 8px !important; }
.case__flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 14px 0 0; }
.case__flow > div { border-top: 1px solid var(--line-deep); padding-top: 12px; }
.case__flow dt { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.case__flow dd { margin: 0; color: var(--foam-soft); }
.case__flow .metrics { margin-top: 0; }
.metrics { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; color: var(--foam-soft); }
.metric { display: block; font-family: var(--mono); font-size: 1.45rem; color: var(--gold); line-height: 1.1; }
.lab__intro { color: var(--foam-soft); margin: -6px 0 12px; }
.repos { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.repos li { padding: 14px 0; border-bottom: 1px solid var(--line-deep); color: var(--foam-soft); }
.repos a { text-decoration: none; }
.repos a:hover { color: var(--foam); }
.repos .mono { color: var(--accent); margin-right: 6px; }

/* ---------- Equipo ---------- */
.role p:last-child { color: var(--foam-soft); }

/* ---------- Formulario ---------- */
.form { display: grid; gap: 16px; margin-top: 28px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: .9rem; color: var(--foam-soft); }
.form input, .form textarea {
  font: inherit; color: var(--foam); padding: 12px 14px; border-radius: 10px;
  background: rgba(127, 224, 232, .05); border: 1px solid var(--line-deep);
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form .btn { justify-self: start; }
.form__status { min-height: 1.4em; margin: 0; font-size: .92rem; }
.form__status.is-ok { color: var(--accent); }
.form__status.is-err { color: #ffb4a8; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.footer { padding: 48px 0 64px; border-top: 1px solid var(--line-deep); }
.footer__inner p { margin: 4px 0; }
.footer a { text-decoration-color: var(--line-deep); text-underline-offset: 3px; }
.form__legal { margin: 0; }
/* privacidad.html */
.legal { padding: 64px 0 32px; }
.legal h2 { font-size: 1.3rem; margin-top: 1.6em; }
.legal p { color: var(--foam-soft); }
.legal a { color: var(--accent); }
.legal__home { color: var(--foam) !important; text-decoration: none; font-size: 1.5rem; }
.legal__date { margin-top: 2.4em; }

/* ---------- Medidor de profundidad ---------- */
.depth { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .72rem; }
.depth__track { width: 2px; height: 160px; background: rgba(127, 224, 232, .2); position: relative; border-radius: 2px; }
.depth__marker { position: absolute; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); top: 0; transition: top .15s linear; }
.depth__label { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--accent); opacity: .85; white-space: nowrap; }
.depth.is-shallow .depth__label { color: #0b6f86; }
.depth.is-shallow .depth__marker { background: #0b8aa3; box-shadow: none; }

/* ---------- Diagrama del hero ---------- */
.arch { margin: 0; justify-self: center; width: 100%; max-width: 380px; }
.arch svg { width: 100%; height: auto; display: block; overflow: visible; }
.arch text { font-family: var(--mono); font-size: 12px; fill: var(--ink); text-anchor: middle; }
.arch__layer text { text-anchor: start; font-size: 13px; }
.arch__layer .arch__tag { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.arch__chips rect { fill: rgba(255, 255, 255, .65); stroke: rgba(6, 32, 51, .18); }
.arch__chips--out rect { fill: #062033; stroke: none; }
.arch__chips--out text { fill: #eaf8fb; }
.arch__layer > rect:first-child { fill: rgba(255, 255, 255, .55); stroke: rgba(6, 32, 51, .12); }
.arch__layer--bronze { --edge: var(--bronze); }
.arch__layer--silver { --edge: #8a9aa4; }
.arch__layer--gold { --edge: #c9962f; }
.arch__edge { fill: var(--edge); }
.arch__layer .arch__tag { fill: var(--edge); }
.arch__wires use { fill: none; stroke: rgba(11, 111, 134, .35); stroke-width: 1.2; stroke-dasharray: 3 5; }
.arch__packets circle { fill: #0b8aa3; }

/* ---------- Trabajamos con (stack por categoría) ---------- */
.stackgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stackgrid__group { padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--line-deep); background: rgba(2, 16, 30, .22); }
.stackgrid__group h3 { display: flex; align-items: center; gap: 9px; color: var(--accent); margin: 0 0 12px; }
.cat-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stackgrid__group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stackgrid__group li { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-deep); font-weight: 500; font-size: .95rem; }

/* ---------- Sectores ---------- */
.sector { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line-deep); background: rgba(2, 16, 30, .22); }
.sector h3 { color: var(--gold); }
.sector p { margin: 0; color: var(--foam-soft); }

/* ---------- Copy de negocio: subtítulo, síntomas, segunda línea técnica ---------- */
.hero__sub { font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 600; color: #0b4f66; margin: -4px 0 18px; max-width: 30ch; }
.symptoms { list-style: none; padding: 0; margin: 8px 0 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.symptoms li { padding: 18px 20px 18px 44px; position: relative; border-radius: var(--radius); background: var(--card-light); border: 1px solid rgba(6, 32, 51, .08); backdrop-filter: blur(6px); color: var(--ink); font-weight: 500; }
.symptoms li::before { content: "✓"; position: absolute; left: 18px; top: 17px; color: #0b6f86; font-weight: 700; }
#problemas .subhead { margin-top: 0; }
.tech { display: block; margin-top: 8px; font-size: .74rem; letter-spacing: .02em; color: var(--accent); opacity: .85; }
#problemas .tech { color: #0b6f86; }
.role .tech { margin: 10px 0 0; }
.stratum h3 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stratum h3 .stratum__tag { margin: 0; font-size: .7rem; font-weight: 500; }

/* ---------- Por qué primero los datos ---------- */
.stats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stats li { padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--line-deep); background: rgba(2, 16, 30, .22); color: var(--foam-soft); }
.stats .metric { font-size: 2rem; margin-bottom: 8px; }
.source { color: var(--foam-soft); opacity: .8; margin: 16px 0 0; max-width: 80ch; }

/* ---------- Diagnóstico ---------- */
.diag { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.diag__note { color: var(--foam-soft); max-width: 56ch; }
.diag__note strong { color: var(--foam); }
.diag__box { padding: 28px; border-radius: var(--radius); border: 1px solid var(--accent); background: rgba(127, 224, 232, .08); }
.diag__box h3 { font-size: .78rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.principles--wide { margin: -12px 0 36px; max-width: 80ch; }
.format__dur { margin: 0; color: var(--accent) !important; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
#como .formats { margin-top: 22px; color: var(--foam-soft); }

/* ---------- Preguntas frecuentes ---------- */
.faq { display: grid; gap: 10px; margin-top: 12px; }
.faq details { border: 1px solid var(--line-deep); border-radius: var(--radius); background: rgba(2, 16, 30, .22); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 48px 18px 22px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); color: var(--accent); font-family: var(--mono); font-size: 1.2rem; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 22px 20px; color: var(--foam-soft); }
.form textarea::placeholder { color: var(--foam-soft); opacity: .55; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .arch { max-width: 340px; justify-self: start; }
  .case__flow { grid-template-columns: 1fr; gap: 14px; }
  .stackgrid { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3, .steps, .stats, .diag { grid-template-columns: 1fr; }
  .symptoms { grid-template-columns: repeat(2, 1fr); }
  .nav__links { display: none; }
  .berg { left: auto; right: 6%; width: 120px; bottom: -44px; transform-origin: 50% 30px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .layer { padding: 84px 0; }
  .grid--4, .form__row, .stackgrid, .symptoms { grid-template-columns: 1fr; }
  .nav { padding: 12px 16px; }
  .depth { top: auto; bottom: 14px; right: 12px; transform: none; }
  .depth__track { display: none; }
  .depth__label { writing-mode: horizontal-tb; transform: none; background: rgba(2, 16, 30, .7); padding: 4px 8px; border-radius: 999px; }
  .depth.is-shallow .depth__label { background: rgba(234, 249, 250, .8); }
  .stratum { padding: 24px 20px 24px 26px; }
  /* centrado sobre la línea del agua; margin-left (no translate) porque transform lo usa el balanceo. 96 px de ancho → línea de agua a 24 px del borde superior */
  .berg { left: 50%; right: auto; margin-left: -48px; width: 96px; bottom: -30px; transform-origin: 50% 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .waterline path { animation: none; }
  .berg { animation: none; }
  .arch__packets { display: none; }
  .btn:hover { transform: none; }
}
