/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f7f5f1;
  --bg-2:      #ebe9e3;
  --ink:       #0b0b0c;
  --ink-soft:  #3a3b3e;
  --ink-mute:  #74757a;
  --glass:     rgba(255, 255, 255, 0.6);
  --glass-2:   rgba(255, 255, 255, 0.34);
  --glass-brd: rgba(11, 11, 12, 0.10);
  --accent:    #0b0b0c;
  --accent-2:  #3a3b3e;
  --line:      rgba(11, 11, 12, 0.14);

  --display: "Bodoni Moda", "Playfair Display", Georgia, serif;
  --sans:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", "IBM Plex Mono", monospace;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --nav-h: 76px;
  --radius: 6px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  overflow-y: visible;
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overflow-y: visible;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.02; letter-spacing: -0.005em; font-family: var(--display); font-weight: 700; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.container-narrow { max-width: 780px; }

.eyebrow {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
  display: block;
}
.kicker {
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .05em;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .95rem 1.7rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .01em;
  border: 1.5px solid var(--line);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .35s var(--ease-out), color .35s var(--ease-out), border-color .35s var(--ease-out);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(11, 11, 12, .55);
}
.btn-primary:hover { transform: translateY(-2px); background: transparent; color: var(--accent); box-shadow: 0 18px 36px -16px rgba(11, 11, 12, .4); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }
.btn-sm { padding: .6rem 1.2rem; font-size: .85rem; }

/* =============================================================
   5. Glass component
   ============================================================= */
.glass-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(11, 11, 12, .04);
}

/* =============================================================
   6. Nav
   ============================================================= */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(247, 245, 241, 0.75);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
@supports (backdrop-filter: blur(16px)) {
  .nav { backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); }
}
.nav.is-scrolled { border-color: var(--line); box-shadow: 0 8px 24px -18px rgba(11,11,12,.35); }

.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.nav-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; }
.nav-logo { height: 44px; width: auto; }
.nav-links { display: none; gap: 1.8rem; font-weight: 500; font-size: .95rem; }
.nav-links a { position: relative; padding-block: .3rem; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--accent);
  transition: right .3s var(--ease-out);
}
.nav-links a:hover::after { right: 0; }

/* Mobile dropdown: JS toggles .is-open on .nav-links via the burger button */
.nav-links.is-open {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: .25rem 1.25rem 1.25rem;
  box-shadow: 0 24px 40px -24px rgba(11,11,12,.3);
}
.nav-links.is-open a {
  padding: .95rem 0;
  border-bottom: 1px solid var(--line);
}
.nav-links.is-open a:last-child { border-bottom: 0; }
.nav-links.is-open a::after { display: none; }

.nav-burger { display: grid; gap: 4px; padding: .4rem; position: relative; z-index: 1; }
.nav-burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); }
.nav-burger.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.is-active span:nth-child(2) { opacity: 0; }
.nav-burger.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav .btn-sm { display: none; }

@media (min-width: 960px) {
  .nav-links { display: flex; position: static; padding: 0; background: none; border: 0; box-shadow: none; flex-direction: row; }
  .nav-links a { border-bottom: 0; padding-block: .3rem; }
  .nav-burger { display: none; }
  .nav .btn-sm { display: inline-flex; }
}

/* =============================================================
   7. Hero
   ============================================================= */
.hero {
  position: relative;
  padding-block: 4rem 5rem;
  overflow: clip;
}
.hero-mesh {
  position: absolute; inset: -10% -10% -10% -10%; z-index: -1;
  background-image:
    radial-gradient(rgba(11,11,12,.14) 1.4px, transparent 1.4px),
    radial-gradient(ellipse at 30% 20%, rgba(11,11,12,.06) 0%, transparent 60%);
  background-size: 22px 22px, 100% 100%;
  background-position: 0 0, 0 0;
  animation: meshDrift 34s linear infinite;
}
.hero-mesh--cta { inset: -20% -10% 0 -10%; }
@keyframes meshDrift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 220px 110px, 0 0; }
}

.hero-inner {
  display: grid;
  gap: 3rem;
  align-items: center;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  max-width: 14ch;
  margin-bottom: 1.2rem;
}
.hero-title em { font-style: italic; font-weight: 600; color: var(--accent); }
.hero-sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 1.8rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.6rem; }
.hero-trust {
  display: flex; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.hero-trust span:not(:last-child)::after {
  content: "·";
  margin: 0 .8rem;
  color: var(--line);
}

/* Hero visual: CSS print mockups (no photography needed) */
.hero-visual { position: relative; min-height: 340px; }
.print-stack { position: relative; width: 100%; max-width: 380px; margin-inline: auto; height: 340px; }
.print-card {
  position: absolute;
  border-radius: 4px;
  box-shadow: 0 30px 60px -25px rgba(11,11,12,.4);
  transition: transform .5s var(--ease-out);
}
.print-card--flyer {
  top: 0; left: 10%;
  width: 62%; aspect-ratio: 3/4;
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.2rem;
  transform: rotate(-8deg);
}
.print-card-label { font-family: var(--mono); font-size: .65rem; color: var(--ink-mute); letter-spacing: .05em; }
.print-card-lines { display: grid; gap: .5rem; margin-top: 1rem; }
.print-card-lines span { display: block; height: 8px; border-radius: 1px; background: var(--line); }
.print-card-lines span:nth-child(1) { width: 90%; }
.print-card-lines span:nth-child(2) { width: 70%; }
.print-card-lines span:nth-child(3) { width: 80%; }

.print-card--business {
  bottom: 10%; right: 4%;
  width: 68%; aspect-ratio: 16/9.5;
  background: var(--accent);
  color: #fff;
  padding: 1.2rem;
  display: flex; flex-direction: column; justify-content: space-between;
  transform: rotate(6deg);
}
.print-card-mark { width: 30px; height: 30px; }
.print-card-name { font-weight: 700; font-size: .95rem; font-family: var(--display); }
.print-card-role { font-size: .75rem; color: rgba(255,255,255,.65); }

.print-card--poster {
  top: 30%; left: 0;
  width: 42%; aspect-ratio: 5/7;
  background: #e4e1d9;
  border: 1px solid var(--line);
  display: grid; place-items: end start;
  padding: 1rem;
  transform: rotate(-2deg);
  z-index: -1;
}

@media (hover: hover) and (pointer: fine) {
  .print-stack:hover .print-card--flyer { transform: rotate(-11deg) translateY(-6px); }
  .print-stack:hover .print-card--business { transform: rotate(9deg) translateY(-6px); }
}

@media (min-width: 960px) {
  .hero-inner { grid-template-columns: 1.1fr .9fr; }
}

/* =============================================================
   8. Sections (shared)
   ============================================================= */
.section { padding-block: 5.5rem; position: relative; }
.section-alt { background: var(--bg-2); }
.section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  max-width: 20ch;
  margin-bottom: 1rem;
}
.section-title em { font-style: italic; font-weight: 600; color: var(--accent); }
.section-sub {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 58ch;
  margin-bottom: 3rem;
}

/* Services grid */
.services-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.service-card { padding: 1.8rem; transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out); }
.service-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 20px 40px -28px rgba(11,11,12,.3); }
.service-icon { display: block; width: 34px; height: 34px; margin-bottom: 1.1rem; color: var(--ink); }
.service-icon svg { width: 100%; height: 100%; display: block; }
.service-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.service-card p { color: var(--ink-soft); font-size: .92rem; }

/* Steps */
.steps { display: grid; gap: 1.5rem; }
.step {
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #ffffff;
}
.step-n {
  font-family: var(--mono);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--accent);
  display: block;
  margin-bottom: .8rem;
}
.step h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.step p { color: var(--ink-soft); }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* AI section */
.section-ai { position: relative; }
.ai-inner { display: grid; gap: 3rem; align-items: center; }
.ai-points { display: grid; gap: .6rem; margin: 1.4rem 0 1.8rem; }
.ai-points li {
  padding: .7rem 1rem;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: .92rem;
  color: var(--ink-soft);
}
.ai-visual { display: flex; justify-content: center; }
.ai-glass-card { padding: 1.6rem; max-width: 340px; display: grid; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(11,11,12,.04); }
.ai-bubble { padding: .8rem 1rem; border-radius: 10px; font-size: .88rem; max-width: 85%; }
.ai-bubble--in { background: var(--bg-2); border: 1px solid var(--line); justify-self: start; }
.ai-bubble--out { background: var(--accent); color: #fff; justify-self: end; }
@media (min-width: 960px) { .ai-inner { grid-template-columns: 1.1fr .9fr; } }

/* Benefits */
.benefits-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.benefit { display: flex; gap: 1rem; align-items: flex-start; padding: 1.4rem; border-radius: var(--radius); background: #ffffff; border: 1px solid var(--line); }
.benefit-icon { display: block; width: 26px; height: 26px; flex-shrink: 0; color: var(--ink); margin-top: .1rem; }
.benefit-icon svg { width: 100%; height: 100%; display: block; }
.benefit h3 { font-size: 1rem; margin-bottom: .3rem; }
.benefit p { color: var(--ink-soft); font-size: .88rem; }

/* FAQ */
.faq-list { display: grid; gap: .8rem; }
.faq-item {
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #ffffff;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); transition: transform .3s var(--ease-out); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: .8rem; color: var(--ink-soft); }

/* Contact */
.section-cta { overflow: clip; }
.contact-form { padding: 2rem; display: grid; gap: 1.2rem; margin-top: 1rem; }
.form-row { display: grid; gap: 1rem; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
label { display: grid; gap: .4rem; font-size: .9rem; font-weight: 500; }
input[type="text"], input[type="email"], textarea {
  padding: .8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #ffffff;
  font: inherit;
  color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,11,12,.12); }
input.is-invalid, textarea.is-invalid { border-color: #b3261e; }
input.is-invalid:focus, textarea.is-invalid:focus { box-shadow: 0 0 0 3px rgba(179,38,30,.14); }
.field-error {
  display: block; min-height: 1.1em;
  font-size: .78rem; color: #b3261e;
}
.form-check.is-invalid span { color: #b3261e; }
.form-check { display: flex; flex-direction: row; align-items: flex-start; gap: .6rem; font-size: .82rem; color: var(--ink-soft); font-weight: 400; }
.form-check a { text-decoration: underline; text-underline-offset: 2px; color: var(--ink); }
.form-check input { margin-top: .2rem; }
.form-msg { font-size: .88rem; min-height: 1.2em; }
.form-msg.is-ok { color: #1a7a4a; }
.form-msg.is-err { color: #b3261e; }
.contact-alt { margin-top: 1.6rem; text-align: center; color: var(--ink-soft); }
.contact-alt a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* =============================================================
   9. Footer
   ============================================================= */
.footer { background: var(--ink); color: var(--bg); padding-block: 3.5rem 1.5rem; }
.footer-inner { display: grid; gap: 1.5rem; padding-block: 1rem 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: .9rem; color: rgba(247,245,241,.7); }
.footer-links a:hover { color: var(--bg); }
.footer-note { font-size: .85rem; color: rgba(247,245,241,.5); }
.footer-credits {
  font-size: .8rem;
  color: rgba(247,245,241,.4);
  border-top: 1px solid rgba(247,245,241,.14);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
@media (min-width: 640px) {
  .footer-credits { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
}
.footer-legal { display: flex; flex-wrap: wrap; }
.footer-legal a:not(:last-child)::after { content: "·"; margin: 0 .7rem; color: rgba(247,245,241,.3); }
.footer-legal a:hover { color: rgba(247,245,241,.8); }

/* Legal pages (aviso-legal / privacidad / cookies) */
.legal-page { padding-block: 3.5rem 5rem; }
.legal-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .6rem; }
.legal-page .updated { font-family: var(--mono); font-size: .78rem; color: var(--ink-mute); margin-bottom: 2.5rem; display: block; }
.legal-page h2 { font-size: 1.25rem; margin-top: 2.4rem; margin-bottom: .8rem; }
.legal-page p, .legal-page li { color: var(--ink-soft); margin-bottom: .9rem; }
.legal-page ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.legal-page li { list-style: disc; margin-bottom: .5rem; }
.legal-page a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.legal-page strong { color: var(--ink); }

/* Status pages: 404 / gracias */
.status-page { position: relative; padding-block: 6rem 7rem; overflow: clip; text-align: center; }
.status-inner { display: flex; flex-direction: column; align-items: center; }
.status-title {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  max-width: 20ch;
  margin-bottom: 1.2rem;
}
.status-title em { font-style: italic; font-weight: 600; }
.status-page .section-sub { margin-inline: auto; }
.status-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; margin: 1.8rem 0 2.2rem; }
@media (min-width: 720px) { .footer-inner { grid-template-columns: auto 1fr auto; align-items: center; } }

/* =============================================================
   10. Chat widget
   ============================================================= */
.chat-widget { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 200; }
.chat-toggle {
  position: relative;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent);
  color: #fff; font-size: 1.5rem;
  display: grid; place-items: center;
  box-shadow: 0 18px 36px -14px rgba(11,11,12,.55);
  transition: transform .3s var(--ease-out);
}
.chat-toggle:hover { transform: scale(1.06); }
.chat-toggle-icon { width: 24px; height: 24px; display: block; }
.chat-toggle-dot {
  position: absolute; top: 4px; right: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #2bd576; border: 2px solid #fff;
}
.chat-panel {
  position: absolute; bottom: 76px; right: 0;
  width: min(360px, calc(100vw - 2.4rem));
  height: min(500px, 70vh);
  background: #fff;
  border-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -25px rgba(11,11,12,.45);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem;
  background: var(--accent);
  color: #fff;
}
.chat-header strong { font-family: var(--display); font-size: 1.1rem; }
.chat-header strong { display: block; font-size: .95rem; }
.chat-status { font-size: .72rem; color: rgba(255,255,255,.65); }
.chat-close { color: #fff; font-size: 1rem; padding: .3rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: grid; gap: .7rem; align-content: start; }
.chat-msg { padding: .7rem .9rem; border-radius: 14px; font-size: .88rem; max-width: 85%; line-height: 1.45; }
.chat-msg--bot { background: var(--bg-2); justify-self: start; }
.chat-msg--user { background: var(--accent); color: #fff; justify-self: end; }
.chat-msg--typing { opacity: .6; font-style: italic; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1rem .8rem; }
.chat-chip {
  font-size: .78rem; padding: .4rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-soft);
}
.chat-chip:hover { background: var(--accent); color: #fff; border-color: transparent; }
.chat-form { display: flex; gap: .6rem; padding: .9rem; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; padding: .7rem .9rem; border-radius: 999px; border: 1px solid var(--line); font: inherit; }
.chat-form button {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
}

/* =============================================================
   11. Effects / reveal
   ============================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

.split-word { display: inline-block; opacity: 0; transform: translateY(0.4em); }
.is-ready .split-word { animation: wordIn .7s var(--ease-out) forwards; }

@keyframes wordIn {
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================================
   12. Responsive
   ============================================================= */
@media (min-width: 540px)  { .hero-title { font-size: clamp(2.6rem, 6.5vw, 4.4rem); } }
@media (min-width: 720px)  { .section { padding-block: 6.5rem; } }
@media (min-width: 960px)  { .hero { padding-block: 6rem 7rem; } }
@media (min-width: 1280px) { .container { padding-inline: 2rem; } }

/* =============================================================
   13. Reduced motion (only intrusive)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-mesh { animation: none; }
  .chat-toggle-dot { animation: none; }
}
