/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  /* Dark (default) — studio / presente */
  --bg:        #0b0b0a;
  --bg-2:      #131311;
  --bg-3:      #1c1c19;
  --ink:       #f2f1ec;
  --ink-soft:  #cfcdc4;
  --ink-mute:  #8d8b83;
  --line:      rgba(242,241,236,.14);
  --line-soft: rgba(242,241,236,.07);
  --accent:    #f2f1ec;      /* the accent IS off-white, inverted on hover */
  --accent-ink: #0b0b0a;
  --warm:      #e2793e;      /* single color accent — tungsten/amber */
  --warm-soft: rgba(226,121,62,.32);
  --glass-bg:     rgba(242,241,236,.055);
  --glass-border: rgba(242,241,236,.14);

  --serif: "Fraunces", "Georgia", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:  "JetBrains Mono", "IBM Plex Mono", monospace;
  --display: "Anton", "Archivo Black", var(--sans);
  --bubble: "Luckiest Guy", var(--display);

  --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);
  --spring:    cubic-bezier(0.34, 1.56, 0.64, 1);   /* ~ spring(stiffness:400, damping:30) */

  /* Cinematic curves (CLAUDE.md) — --ease-out above already IS the smooth-entrance curve */
  --ease-inertia: cubic-bezier(0.25, 1, 0.5, 1);     /* heavy scroll / ambient drift */
  --ease-camera:  cubic-bezier(0.87, 0, 0.13, 1);    /* camera-like, symmetric, sharp */

  --dur-hover:  130ms;
  --dur-press:  110ms;
  --dur-layout: 260ms;

  --nav-h: 84px;
  --container: 1240px;
}

/* Light theme — Historias / archivo */
[data-theme="light"] {
  --bg:        #e9dfc4;   /* aged paper beige */
  --bg-2:      #ddcfa8;   /* darker sepia sand */
  --bg-3:      #f2e9d2;   /* lighter paper for cards */
  --ink:       #332a1a;   /* warm sepia-black, never pure black */
  --ink-soft:  #5a4c34;
  --ink-mute:  #6e6248;   /* darkened from #7d6f52 — that failed WCAG AA (3.71:1) against this bg */
  --line:      rgba(51,42,26,.18);
  --line-soft: rgba(51,42,26,.09);
  --accent:    #332a1a;
  --accent-ink: #e9dfc4;
  --warm:      #a8531f;   /* faded rust ink */
  --warm-soft: rgba(168,83,31,.24);
  --glass-bg:     rgba(51,42,26,.045);
  --glass-border: rgba(51,42,26,.16);
}
[data-theme="light"] body {
  background-color: var(--bg);
}
[data-theme="light"] body::before {
  background-image:
    radial-gradient(28% 22% at 12% 8%, rgba(51,42,26,.10), transparent 70%),
    radial-gradient(22% 18% at 92% 88%, rgba(51,42,26,.09), transparent 70%),
    radial-gradient(60% 50% at 85% 6%, var(--warm-soft), transparent 68%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(51,42,26,.16) 100%);
  background-size: auto; background-position: 0 0;
  background-repeat: no-repeat;
}
[data-theme="light"] .grain-overlay {
  opacity: .12;
  mix-blend-mode: multiply;
}
[data-theme="light"] h1, [data-theme="light"] h2 {
  font-family: var(--serif); text-transform: none; font-weight: 500; letter-spacing: -0.01em; line-height: 1.05;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  transition: background .4s var(--ease-out), color .4s var(--ease-out);
}
/* Decorative background gradients as a fixed compositor layer instead of
   background-attachment:fixed — identical look, but scrolling no longer
   forces the browser to repaint a scroll-attached background every frame
   (the #1 cause of scroll jank on mobile Safari/low-end Android). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.07), transparent 60%),
    radial-gradient(circle, var(--warm-soft), transparent 62%),
    radial-gradient(circle, rgba(255,255,255,.035), transparent 65%);
  background-repeat: no-repeat;
  background-size: 95% 95%, 85% 85%, 110% 110%;
  background-position: 8% -8%, 96% 14%, 46% 112%;
}

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.05; letter-spacing: -0.01em; font-family: var(--serif); font-weight: 500; }
h1, h2 { font-family: var(--display); text-transform: uppercase; font-weight: 400; letter-spacing: -.01em; line-height: .96; }
h1 em, h2 em, h3 em, h4 em { font-family: var(--serif); font-style: italic; text-transform: none; color: var(--warm); letter-spacing: -.01em; }
ul { list-style: none; padding: 0; }
::selection { background: var(--ink); color: var(--bg); }

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

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .7rem 1.2rem; background: var(--ink); color: var(--bg);
  font-weight: 600; border-radius: 2px;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 720px) { .container { padding-inline: 2.5rem; } }
@media (min-width: 1280px) { .container { padding-inline: 3rem; } }

.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;
}

.kicker {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-mute);
  display: flex; align-items: center; gap: .6em;
}
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 8px 1px var(--warm-soft); }

.section { padding-block: clamp(4rem, 9vw, 8rem); position: relative; }
.section-frost { position: relative; z-index: 0; }
.section-frost::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: color-mix(in srgb, var(--bg-2) 55%, transparent);
  backdrop-filter: blur(28px) saturate(130%);
  -webkit-backdrop-filter: blur(28px) saturate(130%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 14%, black 86%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, black 14%, black 86%, transparent 100%);
}
.z-above { position: relative; z-index: 1; }
.section-halo {
  position: absolute; inset: -50% -10% -40% -10%; pointer-events: none; z-index: 0;
  background: radial-gradient(42% 38% at 50% 28%, var(--warm-soft), transparent 72%);
  filter: blur(100px);
}
.section-head { max-width: 46ch; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); margin-top: .8rem; }

.eyebrow-num {
  font-family: var(--mono); font-size: .8rem; color: var(--ink-mute);
  letter-spacing: .08em;
}

/* Streetwear / artistic accents */
.display-h {
  font-family: var(--display); font-style: normal; text-transform: uppercase;
  letter-spacing: -.01em; line-height: .92; font-weight: 400;
}
.tag-badge {
  display: inline-flex; align-items: center; gap: .5em; position: relative;
  font-family: var(--display); font-size: .85rem; letter-spacing: .03em; text-transform: uppercase;
  background: var(--warm); color: #100b06; padding: .45em .9em; border-radius: 3px;
  transform: rotate(-3deg); box-shadow: 0 6px 18px -6px var(--warm-soft);
}

.barcode {
  display: inline-block; width: 70px; height: 24px; vertical-align: middle;
  background-image: repeating-linear-gradient(90deg,
    currentColor 0 2px, transparent 2px 3px,
    currentColor 3px 4px, transparent 4px 7px,
    currentColor 7px 10px, transparent 10px 11px,
    currentColor 11px 12px, transparent 12px 16px);
  opacity: .55;
}

.grain-overlay {
  position: fixed; inset: 0; z-index: 2; opacity: .07; pointer-events: none; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

.halftone-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: soft-light;
  opacity: .12;
  background-image: radial-gradient(circle, var(--warm) 1px, transparent 1.4px);
  background-size: 5px 5px;
}
[data-theme="light"] .halftone-overlay { opacity: .1; mix-blend-mode: multiply; }



/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .95rem 1.7rem; font-family: var(--mono); font-size: .84rem;
  letter-spacing: .04em; text-transform: uppercase; font-weight: 500;
  border: 1px solid var(--line); border-radius: 2px;
  transition: background var(--dur-hover) var(--spring), color var(--dur-hover) var(--spring),
              border-color var(--dur-hover) var(--spring), transform var(--dur-press) var(--spring);
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn:active { transform: scale(.96); }
.btn-arrow { transition: transform var(--dur-hover) var(--spring); }
.btn:hover .btn-arrow { transform: translateX(4px); }
/* JS owns the press transform when GSAP is available, keeping it separate
   from the CSS fallback and making every CTA feel immediately responsive. */
.btn.js-press-anim:active { transform: none; }

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h); display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--line-soft);
  transition: background .4s var(--ease-out), border-color .4s var(--ease-out);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-logo { font-family: var(--sans); font-weight: 600; font-size: 1.15rem; letter-spacing: -.01em; white-space: nowrap; }
@media (max-width: 480px) { .nav-logo { font-size: .92rem; } }
.nav-links { display: none; align-items: center; gap: 2.2rem; }
.nav-links a {
  font-family: var(--mono); font-size: .82rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-soft); position: relative; padding-bottom: 3px;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px;
  background: var(--warm); transition: width var(--dur-hover) var(--spring);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }
@media (min-width: 960px) { .nav-links { display: flex; } }

/* Language switcher — round flag buttons only. Always visible in the header,
   on every breakpoint, so anyone can switch language at a glance. */
.lang-switch { display: flex; align-items: center; gap: .4rem; }
.lang-btn {
  padding: 0; border-radius: 50%; line-height: 0;
  opacity: .45; filter: grayscale(65%); transition: opacity var(--dur-hover) var(--ease-out), filter var(--dur-hover) var(--ease-out);
}
.lang-btn:hover { opacity: .8; filter: grayscale(20%); }
.lang-btn.is-active { opacity: 1; filter: grayscale(0%); }
.lang-btn.js-press-anim:active { transform: none; }
.flag { display: inline-block; width: 1.15rem; height: 1.15rem; border-radius: 50%; background-size: 160%; background-position: center; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.flag-ar { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect width='24' height='16' fill='%23fff'/%3E%3Crect width='24' height='5.33' fill='%2375AADB'/%3E%3Crect y='10.67' width='24' height='5.33' fill='%2375AADB'/%3E%3C/svg%3E"); }
.flag-br { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect width='24' height='16' fill='%23009c3b'/%3E%3Cpolygon points='12,2 22,8 12,14 2,8' fill='%23ffdf00'/%3E%3Ccircle cx='12' cy='8' r='3.2' fill='%23002776'/%3E%3C/svg%3E"); }
.flag-us { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect width='24' height='16' fill='%23B22234'/%3E%3Crect y='1.23' width='24' height='1.23' fill='%23fff'/%3E%3Crect y='3.69' width='24' height='1.23' fill='%23fff'/%3E%3Crect y='6.15' width='24' height='1.23' fill='%23fff'/%3E%3Crect y='8.61' width='24' height='1.23' fill='%23fff'/%3E%3Crect y='11.08' width='24' height='1.23' fill='%23fff'/%3E%3Crect y='13.54' width='24' height='1.23' fill='%23fff'/%3E%3Crect width='10' height='8.61' fill='%233C3B6E'/%3E%3C/svg%3E"); }

/* Floating capsule dock — mobile-only interaction focal point.
   One-off exception to the CLAUDE.md visual guardrail (approved): new
   pill shape, border, blur and label are a deliberate mobile-nav redesign. */
.nav-toggle {
  position: relative; display: flex; align-items: center; gap: .65rem; z-index: 110;
  padding: .6rem .95rem .6rem .8rem; border-radius: 999px;
  background: rgba(20,18,16,.85); border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
}
/* Glow pulse as an opacity-only overlay (GPU compositor) instead of animating
   box-shadow/border-color directly, which forces a paint on every frame. */
.nav-toggle::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid var(--warm); box-shadow: 0 4px 18px -6px rgba(0,0,0,.5), 0 0 12px 2px var(--warm-soft);
  opacity: 0; animation: nav-toggle-glow 2.8s ease-in-out infinite alternate;
}
@media (min-width: 960px) { .nav-toggle { display: none; } }
@media (prefers-reduced-motion: reduce) { .nav-toggle::after { animation: none; opacity: 0; } }
.nav-toggle-lines { position: relative; width: 20px; height: 14.5px; flex-shrink: 0; }
.nav-toggle-lines span {
  position: absolute; left: 0; width: 20px; height: 1.5px; background: #fff;
  transition: transform .3s var(--ease-camera), opacity .3s var(--ease-out);
}
.nav-toggle-lines span:nth-child(1) { top: 0; }
.nav-toggle-lines span:nth-child(2) { top: 6.5px; }
.nav-toggle-lines span:nth-child(3) { top: 13px; }
.nav-toggle-label {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.75); transition: opacity .3s var(--ease-out);
}
/* Fallback (no-JS / no-GSAP) only — when GSAP drives the icon (.js-nav-anim),
   these CSS rules are skipped so the two systems never fight over the same transform. */
.nav-toggle[aria-expanded="true"]:not(.js-nav-anim) span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"]:not(.js-nav-anim) span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"]:not(.js-nav-anim) span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav-toggle[aria-expanded="true"]:not(.js-nav-anim) .nav-toggle-label { opacity: 0; }
@keyframes nav-toggle-glow {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mobile-menu {
  position: fixed; inset: 0; z-index: 99; background: var(--bg);
  display: flex; flex-direction: column; justify-content: center; padding: 2rem;
  transform: translateY(-100%); transition: transform 320ms var(--ease-camera);
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu a {
  font-family: var(--sans); font-weight: 500; text-transform: uppercase; letter-spacing: .03em;
  font-size: 1.15rem; padding-block: .85rem; display: block;
  border-bottom: 1px solid var(--line-soft);
}
.mobile-menu a:last-of-type { border-bottom: none; }
.mobile-menu-foot { margin-top: 3rem; font-family: var(--mono); font-size: .8rem; color: var(--ink-mute); }

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(var(--nav-h) + 2rem); padding-bottom: 3rem; position: relative;
}
.hero-grain {
  position: absolute; inset: 0; opacity: .045; pointer-events: none; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow { margin-bottom: 1.6rem; }
.hero-title {
  font-family: var(--display); text-transform: uppercase; font-weight: 400;
  font-size: clamp(2.6rem, 7.5vw, 6rem); max-width: 17ch; margin-inline: 0; line-height: .96;
  letter-spacing: -.01em;
}
.hero-title em { font-family: var(--serif); font-style: italic; text-transform: none; color: var(--warm); letter-spacing: -.01em; }
.hero-sub {
  margin-top: 1.2rem; max-width: 48ch; font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--ink-soft); font-weight: 300;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1.8rem; margin-top: 1.8rem;
  font-family: var(--mono); font-size: .82rem; color: var(--ink-mute);
}
.hero-meta strong { color: var(--ink); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }
.hero-scroll {
  align-self: center; margin-top: 3.5rem;
  font-family: var(--mono); font-size: .74rem; color: var(--ink-mute);
  display: flex; flex-direction: column; align-items: center; gap: .7rem;
  letter-spacing: .1em; text-transform: uppercase;
}
.hero-scroll-line { width: 1px; height: 40px; background: var(--line); position: relative; overflow: hidden; }
.hero-scroll-line::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--ink); animation: scrollLine 2.4s var(--ease-inertia) infinite;
}
@keyframes scrollLine {
  from { transform: translateY(-100%); }
  to   { transform: translateY(100%); }
}

/* Hero 3D ornaments — Higgsfield-generated chrome sparks */
.hero-spark { position: absolute; z-index: 1; pointer-events: auto; perspective: 500px; }
.hero-spark-inner { transform-style: preserve-3d; }
.hero-spark img { display: block; width: 100%; height: auto; filter: drop-shadow(0 20px 28px rgba(0,0,0,.5)); }
.hero-spark--cross { top: 10%; left: 4%; width: min(130px, 15vw); animation: spark-float-a 9s var(--ease-inertia) infinite; }
.hero-spark--tilt   { top: 60%; right: 5%; width: min(160px, 18vw); animation: spark-float-b 12s var(--ease-inertia) infinite; }
@keyframes spark-float-a {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-14px) rotate(4deg); }
}
@keyframes spark-float-b {
  0%, 100% { transform: translateY(0) rotate(7deg); }
  50%      { transform: translateY(12px) rotate(-5deg); }
}
@media (max-width: 640px) { .hero-spark { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero-spark { animation: none !important; }
  .hero-spark-inner { transform: none !important; }
}

/* =============================================================
   7. Grids & cards
   ============================================================= */
.grid { display: grid; gap: 1px; background: var(--line); }
.services-grid { grid-template-columns: 1fr; }
@media (min-width: 720px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }

.service-card {
  background: var(--glass-bg); padding: 2.4rem 2rem; position: relative; overflow: hidden;
  transition: background var(--dur-hover) var(--spring), border-color var(--dur-hover) var(--spring),
              transform var(--dur-hover) var(--spring);
  border: 1px solid transparent; border-left: 2px solid transparent;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .service-card { backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); }
}
.service-card:hover { background: var(--glass-bg); border-color: var(--glass-border); border-left-color: var(--warm); }
.service-num { font-family: var(--mono); font-size: .82rem; color: var(--ink-mute); }
.service-card h3 { font-size: 1.4rem; margin-top: 1.4rem; }
.service-card p { margin-top: .9rem; color: var(--ink-soft); font-size: .95rem; max-width: 34ch; }
.service-card-link {
  margin-top: 1.6rem; display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-mute); transition: color var(--dur-hover) var(--spring), transform var(--dur-hover) var(--spring);
}
.service-card:hover .service-card-link { color: var(--ink); transform: translateX(4px); }

/* Compact variant — used on the homepage services grid to keep the section short */
.services-grid--compact { grid-template-columns: 1fr; }
@media (min-width: 560px)  { .services-grid--compact { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .services-grid--compact { grid-template-columns: repeat(3, 1fr); } }
.service-card--compact { padding: 1.4rem 1.3rem; }
.service-card--compact .service-num { font-size: .72rem; }
.service-card--compact h3 { font-size: 1.05rem; margin-top: .6rem; }
.service-card--compact p { margin-top: .4rem; font-size: .84rem; max-width: none; }

/* =============================================================
   8. Historias cards (light theme)
   ============================================================= */
.historias-grid { grid-template-columns: 1fr; gap: 1px; }
@media (min-width: 720px) { .historias-grid { grid-template-columns: repeat(2, 1fr); } }
.historia-card {
  background: var(--glass-bg); display: flex; flex-direction: column; overflow: hidden;
  transition: transform var(--dur-hover) var(--spring), border-color var(--dur-hover) var(--spring);
  border: 1px solid var(--glass-border); border-radius: 18px;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .historia-card { backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); }
}
.historia-card:hover { transform: translateY(-4px); border-color: var(--warm); }

/* Historias reveal in two beats: first the frame, then its editorial copy.
   The initial state is gated behind .is-ready, so content remains fully
   readable if JavaScript fails or is still loading. */
.is-ready .historia-card[data-reveal] .historia-card-img {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 520ms var(--ease-out);
}
.is-ready .historia-card[data-reveal].is-visible .historia-card-img { clip-path: inset(0 0 0 0); }
.is-ready .historia-card[data-reveal] .historia-card-body > * {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
}
.is-ready .historia-card[data-reveal].is-visible .historia-card-body > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.is-ready .historia-card[data-reveal].is-visible .historia-card-body > :nth-child(1) { transition-delay: 90ms; }
.is-ready .historia-card[data-reveal].is-visible .historia-card-body > :nth-child(2) { transition-delay: 135ms; }
.is-ready .historia-card[data-reveal].is-visible .historia-card-body > :nth-child(3) { transition-delay: 180ms; }
.is-ready .historia-card[data-reveal].is-visible .historia-card-body > :nth-child(4) { transition-delay: 225ms; }

/* Horizontal-scrolling row of cards, with prev/next arrows once it overflows */
.product-row-wrap { position: relative; padding-inline: 46px; }
.product-row {
  display: flex; gap: 1.1rem; overflow-x: auto; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-block: .3rem;
}
.product-row::-webkit-scrollbar { display: none; }
.product-row > .historia-card { flex: 0 0 300px; scroll-snap-align: start; }
.row-arrow {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 3;
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(10px) saturate(160%); -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid var(--glass-border); color: var(--ink); font-size: 1.2rem; line-height: 1;
  cursor: pointer; transition: background var(--dur-hover) var(--spring), opacity .2s, visibility .2s;
}
.row-arrow:hover { background: var(--warm); border-color: var(--warm); color: #fff; }
.row-arrow--prev { left: 0; }
.row-arrow--next { right: 0; }
.row-arrow[data-hidden] { opacity: 0; visibility: hidden; pointer-events: none; }
@media (max-width: 640px) {
  .row-arrow { display: none; }
  .product-row-wrap { padding-inline: 0; }
  /* Narrower cards leave the next one visibly peeking in, so it's clear
     the row keeps going — a fixed 300px card left almost no hint of that. */
  .product-row > .historia-card { flex-basis: 78vw; }
  .product-row {
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 85%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 85%, transparent 100%);
  }
}
.historia-card-img { aspect-ratio: 4/3; overflow: hidden; position: relative; }
/* Zoom en la foto: deliberadamente más lento que el resto de los hovers —
   es un efecto de imagen a pantalla completa, no una micro-interacción de UI. */
.historia-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--spring), filter .6s var(--ease-out); filter: contrast(1.05) saturate(1); }
.historia-card-img::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(160deg, var(--warm-soft) 0%, transparent 48%, rgba(0,0,0,.28) 100%);
  mix-blend-mode: overlay;
}
.historia-card:hover .historia-card-img img { transform: scale(1.05); filter: contrast(1.1) saturate(1.2); }

[data-theme="light"] .historia-card-img img { filter: sepia(.45) contrast(1.05) saturate(.85) brightness(.98); }
[data-theme="light"] .historia-card:hover .historia-card-img img { filter: sepia(.3) contrast(1.08) saturate(.95); }
[data-theme="light"] .historia-card-img::after {
  background: linear-gradient(160deg, rgba(51,42,26,.12) 0%, transparent 48%, rgba(51,42,26,.3) 100%);
  mix-blend-mode: multiply;
}
.historia-card-body { padding: 1.8rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.historia-card-meta { font-family: var(--mono); font-size: .74rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .05em; }
.historia-card h3 { font-size: 1.5rem; }
.historia-card p { color: var(--ink-soft); font-size: .95rem; }
.historia-card-cta { margin-top: auto; font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; display: inline-flex; align-items: center; gap: .5em; }

/* =============================================================
   9. Portfolio / reel strip
   ============================================================= */
.reel-strip { display: flex; gap: 1px; overflow-x: auto; overflow-y: visible; padding-block: .5rem 1.5rem; background: var(--line); scroll-snap-type: x proximity; }
.reel-strip::-webkit-scrollbar { height: 4px; }
.reel-strip::-webkit-scrollbar-thumb { background: var(--line); }
.reel-card {
  flex: 0 0 auto; width: min(260px, 70vw); aspect-ratio: 9/16; background: var(--bg);
  position: relative; overflow: hidden; scroll-snap-align: start; border-radius: 16px;
}
.reel-card img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.08) saturate(1.15); transition: transform .6s var(--spring), filter .6s var(--ease-out); }
.reel-card:hover img { transform: scale(1.06); filter: contrast(1.12) saturate(1.25); }
.reel-card-label {
  position: absolute; left: 1rem; bottom: 1rem; right: 1rem; font-family: var(--mono);
  font-size: .74rem; color: var(--ink); text-shadow: 0 2px 12px rgba(0,0,0,.7);
}

/* =============================================================
   10. Bio / timeline
   ============================================================= */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid; grid-template-columns: 1fr; gap: .6rem; padding-block: 2.2rem;
  border-top: 1px solid var(--line);
}
@media (min-width: 720px) { .timeline-item { grid-template-columns: 140px 1fr; gap: 2rem; } }
.timeline-item:last-child { border-bottom: 1px solid var(--line); }
.timeline-date { font-family: var(--mono); font-size: .85rem; color: var(--ink-mute); }
.timeline-item h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.timeline-item p { color: var(--ink-soft); max-width: 62ch; }

/* =============================================================
   11. Split / two-column
   ============================================================= */
.split {
  display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center;
}
@media (min-width: 960px) { .split { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.split-media { aspect-ratio: 4/5; overflow: hidden; position: relative; border-radius: 18px; }
.split-media img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.06) saturate(1.02); }
.split-media::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: linear-gradient(0deg, rgba(0,0,0,.32) 0%, transparent 45%);
  mix-blend-mode: overlay;
}
.split.reverse .split-media { order: 2; }
@media (max-width: 959px) { .split.reverse .split-media { order: 0; } }
.split-text p { color: var(--ink-soft); margin-top: 1.2rem; max-width: 52ch; }
.split-text h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }

/* =============================================================
   12. Video embed wrapper (reels)
   ============================================================= */
.reel-embed {
  aspect-ratio: 9/16; max-width: 380px; margin-inline: auto; background: var(--bg-2);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.reel-embed iframe, .reel-embed video { width: 100%; height: 100%; border: 0; object-fit: cover; }
.reel-embed-placeholder { text-align: center; padding: 2rem; font-family: var(--mono); font-size: .8rem; color: var(--ink-mute); }

/* =============================================================
   13. Pull quote / drop cap (historia article)
   ============================================================= */
.article-lede { font-size: clamp(1.15rem, 2vw, 1.5rem); max-width: 68ch; color: var(--ink-soft); font-weight: 300; }
.article-body { max-width: 68ch; }
.article-body p { margin-top: 1.4rem; color: var(--ink-soft); font-size: 1.05rem; }
.dropcap::first-letter {
  font-family: var(--serif); font-style: italic; font-size: 4.4rem; float: left;
  line-height: .8; padding-right: .12em; padding-top: .06em; color: var(--ink);
}
.pull-quote {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 2rem);
  max-width: 46ch; margin-block: 2.5rem; padding-left: 1.6rem; border-left: 2px solid var(--ink);
  color: var(--ink);
}

/* =============================================================
   13b. Documentary story template (historia-*.html) — A24-style
   ============================================================= */

/* Hero: giant title overlaid on a film-frame, floating quote/laurel card beside it */
.doc-hero-grid { display: grid; grid-template-columns: 1fr; gap: 1.6rem; }
@media (min-width: 900px) {
  .doc-hero-grid { grid-template-columns: 1fr 300px; align-items: end; gap: 2rem; }
}
.doc-frame {
  position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16/9;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.55), 0 10px 24px -10px rgba(0,0,0,.4);
}
[data-theme="light"] .doc-frame { box-shadow: 0 30px 60px -24px rgba(51,42,26,.35), 0 10px 24px -12px rgba(51,42,26,.25); }
.doc-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-frame::after {
  /* Darkens both the bottom (title) and top (corner label) so light-sky photos
     never leave white text sitting on a bright patch — independent of image content. */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(10,8,5,.88) 0%, rgba(10,8,5,.4) 40%, transparent 58%, rgba(10,8,5,.4) 80%, rgba(10,8,5,.7) 100%);
}
.doc-frame-title { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 1.6rem 1.8rem 1.8rem; }
.doc-frame-title h1 {
  font-family: var(--display); text-transform: uppercase; color: #fff; font-style: normal;
  font-size: clamp(2.2rem, 6.6vw, 5rem); line-height: .94; letter-spacing: -.01em;
  margin-top: .5rem; max-width: 16ch; text-shadow: 0 2px 20px rgba(0,0,0,.75), 0 1px 3px rgba(0,0,0,.9);
}

.doc-side { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 900px) { .doc-side { transform: translateY(-1.2rem); } }
.doc-quote-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px;
  padding: 1.3rem 1.4rem; backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 20px 40px -24px rgba(0,0,0,.35);
}
.doc-quote-card p { font-family: var(--serif); font-style: italic; font-size: 1.02rem; line-height: 1.4; color: var(--ink); }
.doc-quote-card cite {
  display: block; margin-top: .8rem; font-family: var(--mono); font-style: normal;
  font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute);
}
.doc-laurels { display: flex; flex-direction: column; gap: .5rem; }
.doc-laurel {
  display: inline-flex; align-items: center; gap: .6em; width: fit-content;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-mute); border: 1px solid var(--glass-border); border-radius: 999px;
  padding: .5em .9em; background: var(--glass-bg);
}
.doc-laurel::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--warm); flex-shrink: 0; }

/* Asymmetric narrative: dramatic statement (sticky) + chapters */
.doc-narrative { display: grid; grid-template-columns: 1fr; gap: 2.4rem; }
@media (min-width: 860px) { .doc-narrative { grid-template-columns: .85fr 1.15fr; gap: 3.5rem; } }
.doc-statement {
  font-family: var(--display); text-transform: uppercase; font-style: normal;
  font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.1; color: var(--ink);
}
@media (min-width: 860px) { .doc-statement { position: sticky; top: calc(var(--nav-h) + 2.5rem); align-self: start; } }
.doc-statement em { color: var(--warm); font-style: normal; }
.doc-chapters { display: flex; flex-direction: column; gap: 2.6rem; }
.doc-chapter-tag {
  display: block; margin-bottom: .6rem; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--warm);
}
.doc-chapter h3 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; color: var(--ink); margin-bottom: .6rem; }
.doc-chapter p { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.7; }

/* Feed of frames — cinematic-ratio cards with metadata micro-labels */
.doc-feed { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
@media (min-width: 720px) { .doc-feed { grid-template-columns: repeat(2, 1fr); } }
.doc-feed-card { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16/9; }
.doc-feed-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--spring); }
.doc-feed-card:hover img { transform: scale(1.03); }
.doc-feed-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background: linear-gradient(0deg, rgba(0,0,0,.68) 0%, transparent 42%);
  transition: opacity var(--dur-hover) var(--ease-out);
}
.doc-feed-card:hover::after { opacity: .8; }
.doc-feed-tag {
  position: absolute; top: .9rem; left: 1rem; z-index: 2;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.9); background: rgba(0,0,0,.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: .3em .75em; border-radius: 999px; border: 1px solid rgba(255,255,255,.15);
}
.doc-feed-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: .9rem 1.1rem;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; color: rgba(255,255,255,.85);
}
@media (prefers-reduced-motion: reduce) {
  .doc-feed-card img, .doc-feed-card::after { transition: none; }
}

/* =============================================================
   13d. "Documental histórico" palette — shared by historias.html AND
   the three historia-*.html story pages (.page-historia-doc), so the
   whole section reads as one consistent piece.
   (explicit one-off exception to the CLAUDE.md color/font guardrail,
   approved for this section; not a change to the site's global tokens)
   ============================================================= */
.page-historia-doc {
  --bg:        #0C0B0A;
  --bg-2:      #141210;
  --bg-3:      #1c1815;
  --ink:       #E6E1D5;
  --ink-soft:  #b6ad9c;
  --ink-mute:  #8a8271;
  --line:      rgba(230,225,213,.14);
  --line-soft: rgba(230,225,213,.07);
  --warm:      #C5A059;
  --warm-soft: rgba(197,160,89,.26);
  --blood:      #8B261D;
  --blood-text: #ae6d63;
  --glass-bg:     rgba(230,225,213,.045);
  --glass-border: rgba(197,160,89,.22);
  background-color: var(--bg);
  color: var(--ink);
}
.page-historia-doc .grain-overlay { opacity: .22; }
.page-historia-doc .doc-frame img,
.page-historia-doc .doc-feed-card img,
.page-historia-doc .frame-photo img { filter: sepia(.5) contrast(1.1) brightness(.85) saturate(.65); }

/* High-contrast display serif for the big titles, technical tracking for labels */
.page-historia-doc h1, .page-historia-doc h2, .page-historia-doc h3,
.page-historia-doc .doc-statement {
  font-family: 'Cormorant Garamond', var(--serif); font-weight: 600; letter-spacing: -.005em;
}
.page-historia-doc .doc-statement em,
.page-historia-doc .doc-frame-title h1 em { font-style: italic; color: var(--warm); }
.page-historia-doc .doc-chapter-tag,
.page-historia-doc .doc-feed-tag,
.page-historia-doc .doc-feed-meta,
.page-historia-doc .kicker,
.page-historia-doc .doc-laurel,
.page-historia-doc .doc-frame-corner { font-family: 'Space Mono', var(--mono); letter-spacing: .2em; }
.page-historia-doc .doc-quote-card p { font-family: 'Cormorant Garamond', var(--serif); font-weight: 600; }

/* Vignette across the viewport + a graded color overlay on the hero frame */
.doc-vignette {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45) 100%);
}
.page-historia-doc .doc-frame::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(135deg, var(--warm-soft) 0%, transparent 42%, rgba(12,11,10,.6) 100%);
}

/* Corner micro-credits over the hero frame, poster-style.
   Own dark chip behind the text: guarantees contrast even when the photo's
   corner is a bright sky, independent of how light the underlying image is. */
.doc-frame-corner {
  position: absolute; z-index: 2; font-family: var(--mono); font-size: .62rem;
  text-transform: uppercase; color: rgba(255,255,255,.85);
  background: rgba(10,8,5,.5); padding: .3em .6em; border-radius: 3px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.doc-frame-corner--tr { top: 1.1rem; right: 1.2rem; text-align: right; }

/* Smaller breadcrumb kicker above the hero frame on historia detail pages */
.doc-hero-kicker { font-size: .68rem; letter-spacing: .1em; gap: .5em; }

/* Archive footnote — was duplicated as an inline <style> block on every historia-*.html */
.archive-note {
  margin-top: 3rem; padding: 1.4rem 1.6rem; border: 1px dashed var(--line);
  font-family: var(--mono); font-size: .8rem; color: var(--ink-mute); border-radius: 2px;
}

/* =============================================================
   14. Contact
   ============================================================= */
.contact-links { display: flex; flex-direction: column; gap: 0; margin-top: 2.5rem; }
.contact-link {
  display: flex; align-items: center; justify-content: space-between; padding-block: 1.6rem;
  border-top: 1px solid var(--line); font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2.2rem);
  transition: padding-left var(--dur-hover) var(--spring), color var(--dur-hover) var(--spring);
}
.contact-links > *:last-child { border-bottom: 1px solid var(--line); }
.contact-link:hover { padding-left: 1rem; color: var(--ink-soft); }
.contact-link span { font-family: var(--mono); font-size: .8rem; color: var(--ink-mute); }

.form-simple { display: flex; flex-direction: column; gap: 1.2rem; margin-top: 2.5rem; max-width: 520px; }
.form-simple label { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-mute); transition: color var(--dur-hover) var(--spring); }
.form-simple .form-field:focus-within label { color: var(--warm); }
.form-simple input, .form-simple textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: var(--ink); font-family: var(--sans); font-size: 1rem; padding-block: .7rem;
  transition: border-color var(--dur-hover) var(--spring), box-shadow var(--dur-hover) var(--spring);
}
.form-simple input:focus, .form-simple textarea:focus { border-color: var(--warm); outline: none; box-shadow: 0 1px 0 0 var(--warm); }
.form-simple input:user-invalid, .form-simple textarea:user-invalid { border-color: #c0392b; }
.form-field { display: flex; flex-direction: column; gap: .4rem; }

/* =============================================================
   15. Footer
   ============================================================= */
.footer { border-top: 1px solid var(--line); padding-block: 3rem; }
.footer-inner { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 720px) { .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-end; } }
.footer-brand { font-family: var(--sans); font-weight: 600; font-size: 1.15rem; letter-spacing: -.01em; }
.footer-links { display: flex; gap: 1.6rem; font-family: var(--mono); font-size: .78rem; color: var(--ink-mute); flex-wrap: wrap; }
.footer-links a { transition: color var(--dur-hover) var(--spring); }
.footer-links a:hover { color: var(--ink); }
.footer-meta { font-family: var(--mono); font-size: .74rem; color: var(--ink-mute); }

/* =============================================================
   16. Reveal / effects
   ============================================================= */
/* .reveal's shorthand wins the cascade on any element that also has a component
   class (service-card, historia-card, ...) since both are single-class selectors —
   so it must carry those components' hover transitions too, or they silently stop
   transitioning (snap instantly) once this class is present. */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity var(--dur-layout) var(--ease-out), transform var(--dur-layout) var(--ease-out),
              background-color var(--dur-hover) var(--spring), border-color var(--dur-hover) var(--spring),
              color var(--dur-hover) var(--spring);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* A language swap is a content state change, not a page transition: one
   restrained compositor-only settle makes it feel deliberate without delay. */
body.is-language-changing main,
body.is-language-changing footer { animation: language-settle 260ms var(--ease-out); }
@keyframes language-settle {
  from { opacity: .72; transform: translate3d(0, 4px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Cascading stagger for grid cards — pure CSS, no JS dependency */
.grid > *:nth-child(1) { transition-delay: 0s; }
.grid > *:nth-child(2) { transition-delay: .06s; }
.grid > *:nth-child(3) { transition-delay: .12s; }
.grid > *:nth-child(4) { transition-delay: .18s; }
.grid > *:nth-child(5) { transition-delay: .24s; }
.grid > *:nth-child(6) { transition-delay: .3s; }
.grid > *:nth-child(7) { transition-delay: .36s; }
.grid > *:nth-child(8) { transition-delay: .42s; }
.grid > *:nth-child(9) { transition-delay: .48s; }

.tilt-card { position: relative; }

.cursor { position: fixed; top: 0; left: 0; z-index: 9998; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease-out); }
.cursor.is-ready { opacity: 1; }
.cursor-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; transform: translate(-50%,-50%); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

.bg-photo {
  position: fixed; top: -12vh; left: 0; right: 0; height: 124vh; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(11,11,10,.55) 0%, rgba(11,11,10,.78) 55%, rgba(11,11,10,.94) 100%),
    url('assets/img/site/textura-crudo.jpg');
  background-size: cover, cover;
  background-position: center, center 25%;
  background-repeat: no-repeat, no-repeat;
  will-change: transform;
}
.bg-video-wrap {
  position: fixed; top: -12vh; left: 0; right: 0; height: 124vh; z-index: -2; pointer-events: none;
  overflow: hidden; will-change: transform;
}
.bg-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-crudo-produce .halftone-overlay { display: none; }
.page-crudo-produce .grain-overlay { opacity: .28; }
.page-crudo-produce .bg-photo {
  background-image:
    linear-gradient(180deg, rgba(8,8,8,.4) 0%, rgba(8,8,8,.65) 55%, rgba(8,8,8,.92) 100%),
    url('assets/img/crudo-produce/fondo.jpg');
  background-size: cover, cover;
  background-position: center, center 20%;
  filter: blur(8px);
}
.page-crudo-produce {
  --warm: #e5231a;
  --warm-soft: rgba(229,35,26,.32);
  --bg:   #06070a;
  --bg-2: #0d1013;
  --bg-3: #15181c;
}
.page-crudo-produce .section-halo { display: none; }
.bg-video-wrap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,11,10,.55) 0%, rgba(11,11,10,.78) 55%, rgba(11,11,10,.94) 100%);
}

.page-cursos .bg-photo {
  background-image:
    linear-gradient(180deg, rgba(11,11,10,.45) 0%, rgba(11,11,10,.7) 55%, rgba(11,11,10,.92) 100%),
    url('assets/img/cursos/fondo.jpg');
  background-size: cover, cover;
  background-position: center, center 30%;
}
.page-cursos {
  --warm: #4a7ba6;
  --warm-soft: rgba(74,123,166,.34);
}

.page-productos .bg-photo {
  background-image:
    linear-gradient(180deg, rgba(6,10,16,.4) 0%, rgba(6,10,16,.65) 55%, rgba(6,10,16,.92) 100%),
    url('assets/img/productos/fondo.jpg');
  background-size: cover, cover;
  background-position: center, center;
}
.page-productos {
  --warm: #0ea5e9;
  --warm-soft: rgba(14,165,233,.32);
}

/* "Documental histórico cinemático" — historias.html archive index + its cards */
.page-historias .bg-photo,
.page-historia-doc .bg-photo {
  background-image:
    linear-gradient(180deg, rgba(12,11,10,.5) 0%, rgba(12,11,10,.82) 55%, rgba(12,11,10,.96) 100%),
    url('assets/img/historias/archivo-textura-fondo.jpg');
  background-size: cover, cover;
  background-position: center, center;
}
.page-historias {
  --bg:        #0C0B0A;
  --bg-2:      #141210;
  --bg-3:      #1c1815;
  --ink:       #E6E1D5;
  --ink-soft:  #b6ad9c;
  --ink-mute:  #8a8271;
  --line:      rgba(230,225,213,.14);
  --line-soft: rgba(230,225,213,.07);
  --warm:      #C5A059;
  --warm-soft: rgba(197,160,89,.26);
  --blood:      #8B261D;
  --blood-text: #ae6d63;   /* lightened for text — raw --blood is only 2.13:1 on --bg-2, fails WCAG AA */
  --glass-bg:     rgba(230,225,213,.045);
  --glass-border: rgba(197,160,89,.22);
  background-color: var(--bg);
  color: var(--ink);
}
.page-historias .halftone-overlay { display: none; }
.page-historias .grain-overlay { opacity: .22; }

.page-historias h1, .page-historias h2,
.page-historias .historia-card h3 { font-family: 'Cormorant Garamond', var(--serif); font-weight: 600; }
.page-historias .kicker,
.page-historias .historia-card-cta { font-family: 'Space Mono', var(--mono); letter-spacing: .2em; }

/* Cards as "fichas de archivo" — thin bronze border, sepia duotone, corner stamp */
.page-historias .historia-card {
  border: 1px solid var(--glass-border); background: var(--bg-2);
}
.page-historias .historia-card-img img {
  filter: sepia(.5) contrast(1.12) brightness(.82) saturate(.65);
}
.page-historias .historia-card-img::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.6) 100%);
}
.page-historias .historia-card:hover .historia-card-img img { filter: none; }
.page-historias .historia-card-meta {
  font-family: 'Space Mono', var(--mono); letter-spacing: .16em; color: var(--blood-text);
}

/* Floating dust motes — cinematic atmosphere, GPU-only (transform + opacity).
   Color reads from --warm, so each page's own accent shows through (site-wide component). */
.dust-particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.dust-particles span {
  position: absolute; bottom: -4%; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, var(--warm), transparent 72%);
  filter: blur(1.8px);
  animation: dust-drift linear infinite;
  will-change: transform;
}
@keyframes dust-drift {
  0%   { transform: translate3d(0, 0, 0) scale(.8); opacity: 0; }
  8%   { opacity: .85; }
  92%  { opacity: .45; }
  100% { transform: translate3d(var(--dx, 24px), -108vh, 0) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .dust-particles { display: none; } }
/* Half the particle count on phones — fewer blurred+will-change compositor
   layers for weaker mobile GPUs, same atmosphere, still visible. */
@media (max-width: 640px) { .dust-particles span:nth-child(n+8) { display: none; } }

/* Tech / glass treatment for "Lo que uso" — rounded pill buttons, frosted fills */
.page-productos .btn { border-radius: 999px; }
.page-productos .btn-primary {
  background: color-mix(in srgb, var(--warm) 25%, var(--glass-bg));
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--warm-soft);
  color: var(--ink);
}
.page-productos .btn-primary:hover {
  background: color-mix(in srgb, var(--warm) 42%, var(--glass-bg));
  color: var(--ink);
}
.page-productos .btn-ghost {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
}
.page-productos .btn-ghost:hover {
  background: color-mix(in srgb, var(--ink) 14%, var(--glass-bg));
  color: var(--ink);
}
.page-productos .tag-badge {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--warm-soft);
  color: var(--warm);
  border-radius: 999px;
  transform: none;
  box-shadow: none;
}

.seccion-tech-lab {
  background-color: color-mix(in srgb, var(--warm) 6%, #1a1d20);
  border-top: 2px solid rgba(14, 165, 233, 0.4);
  border-radius: 12px;
  padding: 30px;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

/* Tarjeta de producto (contenedor glass) */
.mathy-product-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 24px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.mathy-product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 10px 30px -10px rgba(0, 255, 255, 0.2);
}

/* Botón redondo (CTA) */
.mathy-cta-button {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid #0ea5e9;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: 50px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-decoration: none;
  transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), transform var(--dur-press) var(--spring);
  display: inline-block;
  margin-top: 16px;
}
.mathy-cta-button:active { transform: scale(.96); }
.mathy-cta-button:hover {
  background: rgba(14, 165, 233, 0.4);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.6);
  color: #ffffff;
}


/* =============================================================
   17. Responsive tweaks
   ============================================================= */
@media (max-width: 719px) {
  .service-card { padding: 2rem 1.4rem; }
}

/* =============================================================
   18. Reduced motion — only intrusive
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-line::after { animation: none; }
  .reveal { transition-duration: .01s; }
  body.is-language-changing main,
  body.is-language-changing footer { animation: none; }
}

/* =============================================================
   19. View transitions
   ============================================================= */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fadeOutUp .5s var(--ease-out); }
::view-transition-new(root) { animation: fadeInUp .5s var(--ease-out); }
@keyframes fadeOutUp { to { opacity: 0; transform: translateY(-10px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } }

/* =============================================================
   20. Glass buttons + background depth (additive — nothing above is altered)
   Only transform/opacity are animated. Tokens fall back to dark-theme values.
   ============================================================= */
:root {
  --glass-hi:   rgba(255,255,255,.24);   /* specular top edge */
  --glass-lo:   rgba(0,0,0,.28);         /* bottom inner shade */
  --glass-drop: rgba(0,0,0,.65);         /* ambient shadow */
  --glass-fill-a: rgba(255,255,255,.10);
  --glass-fill-b: rgba(255,255,255,.02);
}
[data-theme="light"] {
  --glass-hi:   rgba(255,255,255,.6);
  --glass-lo:   rgba(51,42,26,.14);
  --glass-drop: rgba(51,42,26,.32);
  --glass-fill-a: rgba(255,255,255,.4);
  --glass-fill-b: rgba(255,255,255,.08);
}

/* --- Buttons ------------------------------------------------- */
.btn { position: relative; overflow: hidden; isolation: isolate; }

/* Ghost = frosted glass: blur, tinted gradient fill, lit top edge, soft drop shadow. */
.btn-ghost {
  background: linear-gradient(180deg, var(--glass-fill-a) 0%, var(--glass-fill-b) 100%);
  border-color: rgba(255,255,255,.16);
  backdrop-filter: blur(14px) saturate(170%); -webkit-backdrop-filter: blur(14px) saturate(170%);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 0 var(--glass-lo),
    0 12px 26px -14px var(--glass-drop);
}
[data-theme="light"] .btn-ghost { border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

/* Primary keeps its fill; it gets a lit edge and a floating shadow. */
.btn-primary {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -1px 0 rgba(0,0,0,.14), 0 16px 30px -14px var(--glass-drop);
}
.btn-primary:hover {
  backdrop-filter: blur(14px) saturate(170%); -webkit-backdrop-filter: blur(14px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 var(--glass-lo), 0 12px 26px -14px var(--glass-drop);
}

/* Glass glint: a soft diagonal highlight sweeps across on hover. */
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255,255,255,.30) 50%, transparent 68%);
  transform: translate3d(-130%, 0, 0);
  transition: transform .9s var(--ease-out);
}
.btn:hover::after { transform: translate3d(130%, 0, 0); }

/* --- Background depth ---------------------------------------- */
/* Near layer: anamorphic vignette, transparent centre, soft dark edges (dark theme only).
   Sits behind the content (z -1) so it deepens the background without dimming buttons or photos. */
html:not([data-theme="light"]) body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 95% at 50% 42%, transparent 48%, rgba(0,0,0,.5) 100%),
    linear-gradient(180deg, transparent 78%, rgba(0,0,0,.32) 100%);
}
/* Mid layer: static light pools between the photo (far) and the content (near).
   Lives inside .bg-photo so it inherits that layer's scroll parallax. */
.bg-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(46% 40% at 80% 22%, var(--warm-soft), transparent 72%),
    radial-gradient(38% 34% at 12% 80%, rgba(255,255,255,.07), transparent 72%),
    radial-gradient(30% 28% at 50% 55%, rgba(255,255,255,.035), transparent 72%);
}
@media (prefers-reduced-motion: reduce) {
  .btn::after { transition: none; }
}
