@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --paper: #f5f0e6;      /* papel cálido: fondo general */
  --paper-2: #ece4d4;    /* secciones alternas */
  --card: #fffdf8;
  --text: #1f2328;       /* grafito */
  --muted: #5a554c;
  --line: #d9cfbc;
  --brand: #1f2328;
  --brand-2: #3a4148;
  --accent: #8a4f0c;     /* ocre para texto: contraste AA sobre el papel */
  --ocre: #e39a3b;       /* ocre del logo: solo decoración o sobre grafito */
  --ok: #2f6b3f;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --max: 1180px;
  --gutter: 20px;
  /* rosetas del tigrillo como trama decorativa */
  --rosetas: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%238a4f0c' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M9 14a7 6 -20 0 1 9-5M21 12a7 6 -20 0 1-2 8M15 22a7 6 -20 0 1-8-4'/%3E%3Cpath d='M37 42a7 6 20 0 1 9-5M49 40a7 6 20 0 1-2 8M43 50a7 6 20 0 1-8-4'/%3E%3C/g%3E%3Cg fill='%238a4f0c'%3E%3Cellipse cx='14' cy='15' rx='2' ry='1.6'/%3E%3Cellipse cx='42' cy='43' rx='2' ry='1.6'/%3E%3Ccircle cx='44' cy='12' r='1.6'/%3E%3Ccircle cx='12' cy='44' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.1; }
h1, h2 { font-weight: 650; letter-spacing: -0.032em; }
h3 { font-weight: 650; letter-spacing: -0.015em; }
p { margin: 0; }
em { font-style: normal; }
a { color: var(--text); text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--accent); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: 16px; top: -60px; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 6px; z-index: 20; }
.skip:focus { top: 12px; color: #fff; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 900px) { :root { --gutter: 40px; } }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(245, 240, 230, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; min-height: 68px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.logo img { width: 32px; height: 32px; }
.logo span { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.logo b { color: var(--muted); font-weight: 500; }
.site-header nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; list-style: none; margin: 0; padding: 0; }
.site-header nav a { text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-header nav .btn { padding: 9px 18px; font-size: .9rem; color: #fff; }
@media (max-width: 720px) {
  .site-header { position: static; }
  .site-header nav ul { gap: 4px 18px; }
  .site-header nav .nav-opt { display: none; }
  .site-header nav .btn { padding: 7px 14px; }
}

/* Botones */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 999px; font-weight: 600; text-decoration: none; line-height: 1.3; border: 1px solid var(--brand); background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border-color: #b9ad97; }
.btn.ghost:hover { border-color: var(--text); color: var(--text); }
.btn svg { width: 18px; height: 18px; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 18px; height: 18px; background: var(--rosetas) -5px -5px / 56px 56px; }

/* Portada */
.hero { padding: clamp(56px, 9vw, 112px) 0 clamp(56px, 8vw, 96px); }
.hero .wrap { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; }
@media (max-width: 920px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2.3rem, 4.2vw, 3.5rem); line-height: 1.06; margin-bottom: 26px; }
.hero h1 em { color: var(--muted); }
.hero .sub { font-size: clamp(1.08rem, 1.7vw, 1.25rem); color: var(--muted); max-width: 52ch; margin-bottom: 36px; line-height: 1.6; }

/* Mini-escenas (ilustrativas) */
.demo { position: relative; margin: 0; }
.demo-label { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 1px 0 rgba(31, 35, 40, .04), 0 18px 40px -24px rgba(31, 35, 40, .35); }
.panel + .panel { margin-top: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); margin-bottom: 12px; }
.panel-head b { color: var(--text); font-size: .85rem; }
.chat { display: grid; gap: 8px; }
.bubble { max-width: 85%; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: #efe7d7; font-size: .92rem; line-height: 1.45; }
.bubble small { display: block; font-size: .7rem; color: var(--muted); margin-top: 2px; }
.arrow { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0; color: var(--accent); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.arrow svg { width: 20px; height: 20px; }
.rows-mini { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.rows-mini li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); }
.rows-mini li:first-child { border-top: 0; padding-top: 0; }
.rows-mini span { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--ok); background: #e3efe3; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chip.wait { color: var(--accent); background: #f6e6cf; }
.chip svg { width: 14px; height: 14px; }
.cal { display: grid; grid-template-columns: 56px 1fr; gap: 6px 10px; font-size: .9rem; }
.cal time { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal div { background: #efe7d7; border-radius: 8px; padding: 6px 10px; display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.sheet { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; }
.sheet th { background: #efe7d7; font-weight: 600; }
.sheet .bad { background: #f8dcd2; }

/* Secciones */
.block { padding: clamp(72px, 10vw, 120px) 0; }
.block.alt { background: var(--paper-2); }
.head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 64px); }
.head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 16px; }
.head h2 em { color: var(--muted); }
.head p { color: var(--muted); font-size: 1.08rem; max-width: 60ch; }

.band { height: 22px; background: var(--rosetas) 0 -17px / 56px 56px; opacity: .55; }

/* Escenas del día a día */
.scene { display: grid; gap: 40px 64px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; padding: 48px 0; border-top: 1px solid var(--line); }
.scene:first-of-type { border-top: 0; padding-top: 0; }
@media (max-width: 920px) { .scene { grid-template-columns: 1fr; } }
.scene .num { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; display: block; }
.scene h3 { font-weight: 650; font-size: clamp(1.45rem, 2.4vw, 1.9rem); letter-spacing: -0.025em; margin-bottom: 14px; }
.scene p { color: var(--muted); max-width: 52ch; }
.scene p + p { margin-top: 12px; }
.scene p strong { color: var(--text); font-weight: 600; }
.tags { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: .85rem; font-weight: 500; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; }

/* Servicios */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--text); }
@media (max-width: 860px) { .services { grid-template-columns: 1fr; } }
.service { padding: 28px 28px 8px 0; }
.service + .service { padding-left: 28px; border-left: 1px solid var(--line); }
@media (max-width: 860px) { .service, .service + .service { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); } }
.service h3 { font-weight: 650; font-size: 1.35rem; margin-bottom: 8px; }
.service p { color: var(--muted); }

/* Sectores */
.sectors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
@media (max-width: 900px) { .sectors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .sectors { grid-template-columns: 1fr; } }
.sectors li { padding: 22px 0; border-top: 1px solid var(--line); }
.sectors h3 { font-weight: 650; font-size: 1.12rem; margin-bottom: 6px; }
.sectors p { color: var(--muted); font-size: .97rem; }

/* Experiencia */
.caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 700px) { .caps { grid-template-columns: 1fr; } }
.cap { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.cap h3 { font-size: 1.12rem; margin-bottom: 8px; display: flex; gap: 12px; align-items: center; }
.cap h3 svg { flex: none; width: 22px; height: 22px; color: var(--accent); }
.cap p { color: var(--muted); font-size: .97rem; }

/* Proceso */
.steps { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: paso; }
.steps li::before { content: counter(paso); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); font-size: 1rem; font-weight: 650; margin-bottom: 16px; }
.steps h3 { font-size: 1.15rem; margin-bottom: 6px; }
.steps p { color: var(--muted); }

/* Preguntas frecuentes */
.faq { max-width: 820px; border-top: 2px solid var(--text); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative; font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-family: var(--sans); font-size: 1.6rem; font-weight: 300; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding: 0 44px 24px 0; max-width: 68ch; }
@media (max-width: 640px) { .faq details p { padding-right: 0; } }

/* Contacto */
.contact { background: var(--brand); color: #fff; padding: clamp(72px, 10vw, 128px) 0; position: relative; overflow: hidden; }
.contact::after { content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 45%; background: var(--rosetas) 0 0 / 56px 56px; opacity: .25; filter: brightness(1.9); pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000); }
.contact .wrap { position: relative; z-index: 1; }
.contact .eyebrow { color: var(--ocre); }
.contact h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); max-width: 15ch; margin-bottom: 22px; }
.contact h2 em { color: #a9b0b8; }
.contact p { color: #d5d8dc; font-size: 1.1rem; max-width: 54ch; margin-bottom: 36px; }
.contact .btn { background: var(--ocre); border-color: var(--ocre); color: #1f2328; }
.contact .btn:hover { background: #f0ad55; border-color: #f0ad55; color: #1f2328; }
.contact .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.contact .btn.ghost:hover { border-color: #fff; }
.contact :focus-visible { outline-color: #fff; }

.todo { background: #fff3c4; color: #5a4300; padding: 0 4px; border-radius: 3px; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Páginas de texto (privacidad) */
.prose { max-width: 72ch; padding: clamp(56px, 8vw, 96px) 0; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 12px; }
.prose h2 { font-size: 1.5rem; margin: 44px 0 10px; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose .meta { color: var(--muted); margin-bottom: 28px; }

/* Pie */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; align-items: center; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer .logo { color: var(--text); }

/* Escenas 3D (Three.js). Sin WebGL quedan los ejemplos en HTML (.demo-fallback). */
.stage, .cases-stage { display: none; }
.has-3d .stage { display: block; position: relative; }
.has-3d .demo-fallback { display: none; }
.stage canvas { display: block; width: 100%; height: 100%; }
.hero-stage { height: clamp(320px, 44vw, 580px); margin: 0 calc(-1 * var(--gutter)); }
@media (min-width: 921px) { .hero-stage { margin: 0 -40px 0 -20px; } }

.has-3d .cases { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0 56px; align-items: start; }
.has-3d .cases-stage { display: block; grid-column: 2; grid-row: 1; position: sticky; top: 84px; height: min(76vh, 620px); }
.has-3d .cases-stage .stage { height: 100%; }
.has-3d .cases-list { grid-column: 1; grid-row: 1; }
.has-3d .scene { grid-template-columns: 1fr; min-height: 66vh; align-content: center; border-top: 0; padding: 32px 0 32px 24px; border-left: 2px solid var(--line); transition: border-color .3s; }
.has-3d .scene.is-active { border-left-color: var(--accent); }
.stage-tabs { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 8px; }
.stage-tabs button { font: 600 .85rem/1 var(--sans); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.stage-tabs button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 920px) {
  .has-3d .cases { grid-template-columns: 1fr; }
  .has-3d .cases-stage { grid-column: 1; grid-row: 1; top: 0; z-index: 2; height: 340px; background: var(--paper-2); margin: 0 calc(-1 * var(--gutter)); border-bottom: 1px solid var(--line); }
  .has-3d .cases-list { grid-row: 2; }
  .has-3d .scene { min-height: auto; padding: 36px 0 36px 18px; }
}
@media (max-width: 600px) { .hero-stage { height: 270px; } .has-3d .cases-stage { height: 300px; } }
.summary { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; margin: 28px 0 8px; }
.summary h2 { margin-top: 0 !important; font-size: 1.15rem; }
.summary ul { margin: 0; padding-left: 20px; }
.summary li { margin-bottom: 4px; }
