/* ==========================================================================
   Mellizo — shared styles
   ========================================================================== */

:root {
  --bg: #f4f2ee;
  --bg-2: #ebe8e2;
  --surface: #ffffff;
  --ink: #0f0e0c;
  --ink-2: #2a2824;
  --muted: #6a655c;
  --faint: #a9a399;
  --line: #dcd8cf;
  --line-strong: #c9c4b9;
  --accent: #e0521f;
  --ok: #1f8a5b;
  --pilot: #b7791f;

  /* Brand band — identical in light and dark */
  --brand: #d4471d;
  --brand-deep: #9e2f0d;
  --brand-glow: #ff9157;
  --on-brand: #fff6f0;
  --on-brand-muted: rgba(255, 246, 240, 0.76);

  --tile-ink: #171512;
  --tile-sand: #d9cfc0;

  --max: 1240px;
  --radius: 20px;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0c0b;
    --bg-2: #161513;
    --surface: #181715;
    --ink: #f3f0ea;
    --ink-2: #d6d1c8;
    --muted: #a19b90;
    --faint: #6a655c;
    --line: #2a2825;
    --line-strong: #3a3733;
    --accent: #ff6a3d;
    --ok: #4cc38a;
    --pilot: #e0a64a;
    --tile-sand: #3a332b;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0c0b;
  --bg-2: #161513;
  --surface: #181715;
  --ink: #f3f0ea;
  --ink-2: #d6d1c8;
  --muted: #a19b90;
  --faint: #6a655c;
  --line: #2a2825;
  --line-strong: #3a3733;
  --accent: #ff6a3d;
  --ok: #4cc38a;
  --pilot: #e0a64a;
  --tile-sand: #3a332b;
}

/* Language switching: show only the active language. */
html[data-lang="en"] [data-l="es"],
html[data-lang="es"] [data-l="en"] { display: none !important; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg { display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 32px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Type primitives ---------- */
.mono {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.label { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); margin: 0 0 22px; }
.label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.display {
  font-weight: 400; letter-spacing: -0.045em; line-height: 0.98;
  font-size: clamp(46px, 7.4vw, 104px); margin: 0;
}
h2.title {
  font-weight: 400; letter-spacing: -0.035em; line-height: 1.02;
  font-size: clamp(34px, 4.6vw, 62px); margin: 0;
}
.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); line-height: 1.5; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--bg);
  padding: 6px 6px 6px 18px; border-radius: 4px;
  transition: background .15s ease, transform .15s ease;
}
.btn .ic {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 3px;
  border: 1px solid color-mix(in srgb, var(--bg) 35%, transparent);
}
.btn:hover { transform: translateY(-1px); }
.btn-light { background: #fff; color: #0f0e0c; }
.btn-light .ic { border-color: rgba(15, 14, 12, .2); }
.btn-ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line-strong);
  padding: 11px 18px;
}
.btn-ghost:hover { border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- Announcement + header ---------- */
.announce { background: var(--tile-ink); color: #e9e4db; text-align: center; padding: 9px 16px; font-size: 11px; }
.announce .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: 1px; }

header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 17px; letter-spacing: 0.24em; text-transform: uppercase; }
.logo svg { color: var(--accent); flex-shrink: 0; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { text-decoration: none; color: var(--ink-2); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.lang { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.lang button {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em;
  border: 0; background: transparent; color: var(--muted); padding: 8px 10px; cursor: pointer;
}
.lang button + button { border-left: 1px solid var(--line-strong); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Hairline grid background ---------- */
.gridbg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 20%, transparent 75%);
  opacity: .8;
}

/* ---------- Brand stage (ember panel with contours) ---------- */
.stage {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius);
  color: var(--on-brand);
  background:
    radial-gradient(55% 70% at 50% 108%, var(--brand-glow) 0%, transparent 70%),
    linear-gradient(180deg, var(--brand-deep) 0%, var(--brand) 60%, #e05a29 100%);
}
.contours { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.contours ellipse { fill: none; stroke: var(--on-brand); }
.focal { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .5; transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .focal { animation: none; } }

/* ---------- Product window mock ---------- */
.window {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 40px 80px -30px rgba(40, 12, 0, .45), 0 2px 0 rgba(0,0,0,.03);
  overflow: hidden; text-align: left;
}
.win-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.win-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); display: block; }
.win-bar .mono { margin-left: 10px; color: var(--muted); font-size: 11px; }
.win-body { display: grid; grid-template-columns: 160px 1fr; min-height: 330px; }
.win-side { border-right: 1px solid var(--line); padding: 14px 10px; font-size: 13px; color: var(--muted); }
.win-side div { padding: 7px 10px; border-radius: 6px; }
.win-side .on { background: var(--bg-2); color: var(--ink); font-weight: 500; }
.win-main { padding: 18px 20px; }
.win-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.win-title b { font-weight: 500; font-size: 15px; }
.win-title .mono { color: var(--faint); font-size: 10.5px; }
.proc { border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; margin-bottom: 9px; }
.proc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; color: var(--muted); }
.flow > span { border: 1px solid var(--line); border-radius: 5px; padding: 2px 8px; background: var(--bg); }
.flow em { font-style: normal; color: var(--faint); }
.badge { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.b-auto { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.b-pilot { color: var(--pilot); background: color-mix(in srgb, var(--pilot) 14%, transparent); }
.b-map { color: var(--muted); background: var(--bg-2); }

/* ---------- Sections ---------- */
.section { padding-block: 120px; }
.section-head { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: end; margin-bottom: 64px; }
.section-head .lead { max-width: 30em; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Hairline cell grid (HappyRobot-style) */
.cells { display: grid; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cells > * { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px 30px 36px; }
.cells-3 { grid-template-columns: repeat(3, 1fr); }
.cells-4 { grid-template-columns: repeat(4, 1fr); }
.cell h3 { font-weight: 400; font-size: 24px; letter-spacing: -0.02em; margin: 38px 0 10px; }
.cell p { color: var(--muted); margin: 0; font-size: 16px; }
.cell .label { margin: 0; }
.cell .foot { margin-top: 26px; color: var(--ink); }

.stat { padding: 28px 30px 30px !important; }
.stat b { display: block; font-weight: 400; font-size: clamp(36px, 4vw, 54px); letter-spacing: -0.04em; line-height: 1; margin-bottom: 16px; }
.stat .mono { color: var(--muted); }

/* ---------- Industry tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { text-decoration: none; display: block; }
.tile-art {
  position: relative; aspect-ratio: 4 / 3.4; border-radius: 12px; overflow: hidden;
  color: var(--on-brand); padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.tile-art svg.art { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile-art > * { position: relative; }
.tile-art .num { opacity: .8; }
.tile-art .name { font-size: clamp(26px, 2.4vw, 34px); letter-spacing: -0.03em; font-weight: 400; display: flex; justify-content: space-between; align-items: end; }
.tile-art .name .ic { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 3px; transition: background .15s ease; }
.tile:hover .tile-art .name .ic { background: rgba(255,255,255,.16); }
.tile .uses { margin-top: 14px; color: var(--muted); }
.t-ember { background: linear-gradient(160deg, var(--brand-deep), var(--brand)); }
.t-ink { background: var(--tile-ink); }
.t-sand { background: #b9532a; background: linear-gradient(160deg, #5b4636, #2b211a); }

/* ---------- Closing CTA band ---------- */
.closing { padding: 0 16px 16px; }
.closing .stage { text-align: center; }
.closing-inner { padding-block: 130px; }
.closing h2 { max-width: 15em; margin: 0 auto 40px; }
.closing .label { color: var(--on-brand-muted); }
.closing .label::before { background: var(--on-brand); }

/* ---------- Footer ---------- */
footer.site { padding-block: 56px 40px; color: var(--muted); font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.foot-grid p { margin: 14px 0 0; max-width: 26em; }
.foot-grid h4 { margin: 0 0 14px; color: var(--ink); }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-grid a { text-decoration: none; }
.foot-grid a:hover { color: var(--ink); }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .section { padding-block: 88px; }
  .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 44px; }
  .cells-3, .tiles { grid-template-columns: 1fr; }
  .cells-4 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
  .nav-links { gap: 20px; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav .btn { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .cells > * { padding: 26px 20px 28px; }
  .cells-4 { grid-template-columns: 1fr 1fr; }
  .cells-4.uses-grid { grid-template-columns: 1fr; }
  .cells > * { min-width: 0; }
  .stat { padding: 22px 18px !important; }
  .win-body { grid-template-columns: 1fr; }
  .win-side { display: none; }
  .closing { padding: 0 8px 8px; }
  .closing-inner { padding-block: 96px; }
  .tile-art { aspect-ratio: 4 / 3; }
}

/* ---------- Booking dialog (embedded Google Calendar) ---------- */
dialog.book {
  width: min(1120px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px));
  max-width: none; max-height: none; margin: auto; padding: 0;
  border: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 50px 140px -30px rgba(40, 12, 0, .6);
  grid-template-columns: 340px 1fr;
}
dialog.book[open] { display: grid; animation: book-in .28s cubic-bezier(.2, .8, .2, 1); }
dialog.book::backdrop { background: rgba(15, 14, 12, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes book-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { dialog.book[open] { animation: none; } }

/* Branded side panel */
.book-panel {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 32px; padding: 30px 30px 26px;
  color: var(--on-brand);
  background:
    radial-gradient(90% 55% at 50% 108%, var(--brand-glow) 0%, transparent 70%),
    linear-gradient(180deg, var(--brand-deep) 0%, var(--brand) 62%, #e05a29 100%);
}
.book-panel .logo { color: var(--on-brand); }
.book-panel .logo svg { color: var(--on-brand); }
.book-intro { flex: 1; }
.book-panel .label { color: rgba(255, 255, 255, .78); margin: 0 0 16px; }
.book-panel .label::before { background: #fff; }
.book-title { margin: 0; font-size: 34px; font-weight: 400; letter-spacing: -0.035em; line-height: 1.05; }
.book-sub { margin: 14px 0 0; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .82); }
.book-points { list-style: none; margin: 30px 0 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, .22); }
.book-points li { display: flex; gap: 14px; align-items: baseline; padding: 13px 0; font-size: 15px; border-bottom: 1px solid rgba(255, 255, 255, .22); }
.book-points .mono { font-size: 11px; color: rgba(255, 255, 255, .6); }
.book-foot { margin: 0; font-size: 11px; color: rgba(255, 255, 255, .7); }

/* Calendar side */
.book-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.book-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--line); }
.book-bar .label { margin: 0; }
.book-close {
  flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.book-close:hover { border-color: var(--ink); background: var(--bg-2); }
.book-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.book-body { position: relative; flex: 1; min-height: 0; background: #fff; }
.book-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.book-loading { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: #8b857b; }
dialog.book.is-loaded .book-loading { display: none; }
.book-cal { display: none; }
dialog.book.is-cal .book-body { background: var(--surface); overflow-y: auto; -webkit-overflow-scrolling: touch; }
dialog.book.is-cal .book-body iframe { display: none; }
dialog.book.is-cal .book-cal { display: block; position: relative; min-height: 100%; padding: 8px 4px; }
dialog.book.is-cal .book-cal iframe { display: block; position: static; height: auto; }
body.book-open { overflow: hidden; }

@media (max-width: 860px) {
  dialog.book { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .book-panel { gap: 0; padding: 18px 20px 20px; }
  .book-panel .logo, .book-sub, .book-points, .book-foot { display: none; }
  .book-panel .label { margin-bottom: 8px; }
  .book-title { font-size: 24px; padding-right: 48px; }
  .book-bar { position: absolute; top: 12px; right: 12px; padding: 0; border: 0; }
  .book-bar .label { display: none; }
  .book-close { border-color: rgba(255, 255, 255, .45); color: #fff; }
  .book-close:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
}
@media (max-width: 640px) {
  dialog.book { width: 100vw; height: 100dvh; border-radius: 0; }
}
