/* ============================================================
   SIA — Soto Inteligencia Artificial
   styles.css — Pure CSS, no frameworks
   ============================================================ */

@font-face {
  font-family: 'Anton';
  src: url('../fonts/anton.ttf') format('truetype');
  font-display: swap;
}

/* ── VARIABLES ──────────────────────────────────────────── */
:root {
  --ink:    #171717;
  --paper:  #f1f0e9;
  --signal: #ff4f1f;

  /* Tema de cada sección: .dark los invierte */
  --bg:   var(--paper);
  --fg:   var(--ink);
  --mut:  #5c5b55;
  --line: rgba(23,23,23,.18);

  --ff-display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --ff-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --ff-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --pad: clamp(20px, 3.2vw, 56px);
  --nav-h: 72px;
  --section-gap: clamp(96px, 12vw, 180px);
}

.dark {
  --bg:   var(--ink);
  --fg:   var(--paper);
  --mut:  #a9a8a0;
  --line: rgba(241,240,233,.2);
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
::selection { background: var(--signal); color: var(--ink); }

code {
  font-family: var(--ff-mono);
  font-size: .9em;
  padding: .1em .35em;
  border: 1px solid var(--line);
}

/* ── LAYOUT ─────────────────────────────────────────────── */
.container { padding-inline: var(--pad); max-width: 1680px; margin-inline: auto; }
section, .case { padding-block: var(--section-gap); background: var(--bg); color: var(--fg); }

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 400; }

.display {
  font-family: var(--ff-display);
  font-size: clamp(3rem, 8.4vw, 9.5rem);
  line-height: 1.12;
  letter-spacing: -.012em;
  text-transform: uppercase;
}

.section-label, .block-title, .case-meta, .stack, .tag, .step-num, .nums dt, figcaption, .form-label {
  font-family: var(--ff-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mut);
}
.section-label { margin-bottom: 28px; }

.lead { font-size: clamp(1.25rem, 1.9vw, 1.625rem); line-height: 1.4; letter-spacing: -.012em; font-weight: 500; color: var(--fg); }

/* ── SCROLL REVEAL ──────────────────────────────────────── */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.js .reveal.visible { opacity: 1; transform: none; }

/* ── SCROLL PROGRESS ────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 100%;
  background: var(--signal);
  z-index: 1001;
  transform: scaleX(0);
  transform-origin: left;
}

/* ── NAVBAR ─────────────────────────────────────────────── */
/* difference: el texto se invierte solo sobre fondos claros y oscuros */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 900;
  color: #fff;
  mix-blend-mode: difference;
  transition: transform .25s var(--ease-out);
}
#navbar.nav-away:not(:focus-within) { transform: translateY(-100%); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; max-width: none; }
.nav-logo { font-family: var(--ff-display); font-size: 2rem; letter-spacing: .01em; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 40px); }
.nav-links a { font-size: .875rem; font-weight: 500; position: relative; padding-block: 4px; }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease-out);
}
.nav-links a.active::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover::after { transform: scaleX(1); }
}

.nav-right { display: flex; align-items: center; gap: 20px; }
.lang-toggle { display: flex; align-items: center; gap: 4px; }
.lang-btn {
  min-width: 32px; min-height: 32px;
  font-family: var(--ff-mono);
  font-size: .75rem;
  opacity: .55;
}
.lang-btn.active { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.lang-sep { opacity: .4; font-size: .75rem; }

.hamburger { display: none; flex-direction: column; justify-content: center; gap: 6px; width: 44px; height: 44px; padding: 10px; margin-right: -10px; }
.hamburger span { display: block; height: 2px; background: currentColor; transition: transform .25s var(--ease-out), opacity .2s; }
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 850;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding-inline: var(--pad);
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease, visibility .2s;
}
.mobile-nav.open { visibility: visible; opacity: 1; }
.mobile-nav a { font-family: var(--ff-display); font-size: clamp(2.5rem, 12vw, 4rem); text-transform: uppercase; line-height: 1.2; }
.mobile-lang { display: flex; gap: 12px; margin-top: 24px; }

/* ── HERO — Elastic manifesto ───────────────────────────── */
#hero {
  --hero-max: calc((100svh - 200px) / 2.88); /* en pantallas bajas manda el alto */
  --hero-fs: min(16.5cqw, var(--hero-max));
  position: relative;
  container-type: inline-size;
  min-height: 100svh;
  padding: 0;
  background: var(--ink);
  color: var(--ink);
  overflow: hidden;
}
.hero-paper { position: absolute; inset: 0; background: var(--paper); }
.js .hero-paper { clip-path: ellipse(20% 0% at 100% 100%); }

.hero-inner {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: var(--nav-h) var(--pad) clamp(20px, 3vw, 36px);
}
.hero-kicker { position: absolute; top: var(--nav-h); right: var(--pad); font-weight: 500; font-size: clamp(.9375rem, 1.3cqw, 1.125rem); }

.hero-title {
  font-family: var(--ff-display);
  font-size: var(--hero-fs);
  line-height: .96;
  letter-spacing: -.035em;
}
.hero-line { display: block; white-space: nowrap; }
.hero-line-2 { margin-left: 33%; }
.hero-line-3 { margin-left: 6%; }
.hero-mask {
  display: inline-block;
  overflow: hidden;
  /* .02em de la spec + holgura medida para el rebote (0.042em izq, 0.018em arriba).
     Los márgenes negativos la cancelan: el texto queda exactamente en el mismo lugar. */
  padding: .03em .02em .08em .07em;
  margin: -.03em 0 -.08em -.05em;
  vertical-align: top;
}
.hero-word { display: inline-block; transform-origin: top left; }
.js .hero-word { opacity: 0; }

.hero-foot { display: flex; align-items: flex-end; gap: 24px; padding-right: calc(clamp(64px, 10cqw, 170px) + 16px); }
.hero-sub { font-size: clamp(1.0625rem, 1.9cqw, 1.625rem); font-weight: 500; letter-spacing: -.012em; line-height: 1.25; max-width: 24ch; }
.hero-replay {
  margin-left: auto;
  min-height: 44px;
  padding-inline: 8px;
  font-family: var(--ff-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.hero-arrow { position: absolute; right: var(--pad); bottom: clamp(20px, 3vw, 36px); width: clamp(64px, 10cqw, 170px); transition: transform .25s var(--ease-out); }
.hero-arrow:active { transform: translateY(6px); }
@media (hover: hover) and (pointer: fine) {
  .hero-arrow:hover { transform: translateY(6px); }
}

html[lang="en"] #hero { --hero-fs: min(14.2cqw, var(--hero-max)); }

/* ── ENFOQUE ────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
  margin-top: clamp(56px, 7vw, 104px);
}
.about-copy p + p { margin-top: 1.1em; }
.about-copy p { color: var(--mut); max-width: 48ch; }
.about-copy p.lead { color: var(--fg); }
#figura-compuerta { min-width: 0; min-height: 320px; }

/* ── ÍNDICE DE TRABAJOS ─────────────────────────────────── */
#projects { padding-bottom: 0; }
.work-index { margin-top: clamp(56px, 7vw, 104px); border-top: 1px solid var(--line); }
.work-index li { border-bottom: 1px solid var(--line); }
.work-index a {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding-block: clamp(16px, 2vw, 28px);
}
.wi-num { font-family: var(--ff-mono); font-size: .75rem; color: var(--mut); }
.wi-name { font-family: var(--ff-display); font-size: clamp(2.25rem, 6vw, 5.5rem); line-height: 1.08; text-transform: uppercase; transition: transform .25s var(--ease-out); }
.wi-what { color: var(--mut); text-align: right; }
.work-index a:active .wi-name { transform: translateX(10px); }
@media (hover: hover) and (pointer: fine) {
  .work-index a:hover .wi-name { transform: translateX(10px); }
}

/* ── CASOS ──────────────────────────────────────────────── */
#caso-geotecno { margin-top: var(--section-gap); }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.status { color: var(--fg); }
.status::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--signal);
}
.case-name {
  font-family: var(--ff-display);
  font-size: clamp(3.5rem, 13.6vw, 15.5rem);
  line-height: 1.06;
  letter-spacing: -.012em;
  text-transform: uppercase;
  margin-top: 16px;
}
.case-pitch { font-size: clamp(1.25rem, 2.4vw, 2.125rem); font-weight: 500; letter-spacing: -.016em; line-height: 1.22; max-width: 32ch; margin-top: 16px; }

.case-body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 112px);
  align-items: start;
  margin-top: clamp(56px, 7vw, 104px);
}
.case-copy { max-width: 720px; }

.media { position: sticky; top: calc(var(--nav-h) + 16px); }
.media video, .media img { width: 100%; height: auto; background: #0d0d0d; }
.media figcaption { margin-top: 10px; }
.media-tall { max-width: min(100%, 420px); margin-inline: auto; width: 100%; }
.media-shot a { display: block; }

.block-title { color: var(--fg); margin: 48px 0 12px; }
.block-title:first-child { margin-top: 0; }
.deliver li { padding-block: 12px; border-top: 1px solid var(--line); }
.deliver li:last-child { border-bottom: 1px solid var(--line); }

/* Acordeón nativo: <details name> ya es exclusivo */
.hard details { border-top: 1px solid var(--line); }
.hard details:last-child { border-bottom: 1px solid var(--line); }
.hard summary {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 16px;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  font-weight: 600;
  letter-spacing: -.012em;
  line-height: 1.25;
  cursor: pointer;
  list-style: none;
}
.hard summary::-webkit-details-marker { display: none; }
.hard summary::after { content: '+'; font-family: var(--ff-mono); font-weight: 400; flex: none; }
.hard details[open] summary::after { content: '–'; }
.hard details p { padding-bottom: 20px; color: var(--mut); }

.nums {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px clamp(20px, 3vw, 48px);
  margin-top: clamp(64px, 8vw, 120px);
  padding-top: 24px;
  border-top: 1px solid var(--fg);
}
.nums div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.nums dd { font-family: var(--ff-display); font-size: clamp(2.25rem, 4.6vw, 5rem); line-height: 1.15; }
.nums dt { max-width: 26ch; margin-top: 4px; }

.stack { margin-top: 32px; text-transform: none; letter-spacing: .01em; }

/* El Herrero */
.narrow { max-width: 780px; margin-top: clamp(56px, 7vw, 104px); }
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 5vw, 80px) clamp(24px, 4vw, 64px);
  margin-top: clamp(56px, 7vw, 104px);
}
.tile { padding: 0; }
.tile .media { position: static; }
.tile p:not(.tag) { color: var(--mut); max-width: 56ch; }
.tile-title { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 600; letter-spacing: -.016em; line-height: 1.2; margin: 20px 0 8px; }
.tag { display: inline-block; letter-spacing: .04em; color: var(--fg); padding: 2px 8px; border: 1px solid var(--line); vertical-align: middle; }
.pipe {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.4vw, 32px);
  aspect-ratio: 1;
  padding: clamp(20px, 3vw, 40px);
  border: 1px solid var(--line);
}
.pipe-logo { width: clamp(64px, 7vw, 96px); height: auto; }
.pipe-steps {
  --p: 1;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-left: 32px;
  font-size: clamp(1.25rem, 2.5vw, 2.25rem);
  line-height: 1.15;
}
.pipe-steps::before, .pipe-steps::after {
  content: '';
  position: absolute;
  left: 5px; top: .575em; bottom: .575em;
  width: 2px;
  background: var(--line);
}
.pipe-steps::after {
  background: var(--signal);
  transform: scaleY(var(--p));
  transform-origin: top;
  transition: transform .5s var(--ease-out);
}
.pipe-steps li {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  transition: opacity .3s ease;
}
.pipe-steps li::before {
  content: '';
  position: absolute;
  z-index: 1;
  left: -32px; top: calc(.575em - 6px);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--signal);
  transition: background .3s ease, box-shadow .3s ease;
}
.pipe-steps b { font-family: var(--ff-display); font-weight: 400; text-transform: uppercase; transition: color .3s ease; }
.pipe-note { font-family: var(--ff-mono); font-size: .75rem; color: var(--mut); text-align: right; }
.pipe-live li:not(.on) { opacity: .3; }
.pipe-live li:not(.on)::before { background: var(--mut); }
.pipe-live li.now b { color: var(--signal); }
.pipe-live li.now::before { box-shadow: 0 0 0 5px rgba(255,79,31,.25); }

/* ── LABORATORIO ────────────────────────────────────────── */
.lab-note { max-width: 56ch; margin-top: 28px; color: var(--mut); font-size: 1.125rem; line-height: 1.5; }
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: clamp(56px, 7vw, 104px);
}
.lab-item { padding: clamp(20px, 2.4vw, 36px); background: var(--bg); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.lab-item p[data-lang] { color: var(--mut); }
.lab-item:last-child { grid-column: span 2; }
.lab-title { font-family: var(--ff-display); font-size: clamp(1.75rem, 2.8vw, 2.75rem); line-height: 1.15; text-transform: uppercase; }
.lab-item .stack { margin-top: auto; padding-top: 12px; }

/* ── PROCESO ────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  margin-top: clamp(56px, 7vw, 104px);
}
.step { border-top: 1px solid var(--fg); padding-top: 16px; }
.step-title { font-size: clamp(1.25rem, 1.8vw, 1.625rem); font-weight: 600; letter-spacing: -.016em; line-height: 1.2; margin: 32px 0 10px; }
.step p { color: var(--mut); }

/* ── SERVICIOS ──────────────────────────────────────────── */
.services { margin-top: clamp(56px, 7vw, 104px); border-top: 1px solid var(--line); }
.services li {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 8px clamp(40px, 6vw, 112px);
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.services h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 600; letter-spacing: -.016em; line-height: 1.2; }
.services p { color: var(--mut); }

/* ── BOTONES ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding-inline: 32px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  transition: transform .16s ease-out, background .2s ease;
}
.btn:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--signal); color: var(--ink); }
}

/* ── CONTACTO ───────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(48px, 6vw, 112px);
  align-items: start;
}
.contact-details { margin-top: 40px; }
.contact-details li { padding-block: 12px; border-top: 1px solid var(--line); color: var(--mut); }

.contact-form { display: flex; flex-direction: column; gap: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-input, .form-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  color: var(--fg);
  font-family: var(--ff-sans);
  font-size: 1rem;
  border-radius: 0;
  resize: vertical;
  transition: border-color .2s ease;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--mut); opacity: .7; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--fg); box-shadow: 0 1px 0 var(--fg); }
.form-textarea { min-height: 120px; }
.form-success { display: none; font-family: var(--ff-display); font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.15; text-transform: uppercase; }
.form-success.show { display: block; }

/* ── FOOTER ─────────────────────────────────────────────── */
footer { padding-block: 40px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
img.footer-logo { width: 72px; height: 72px; mix-blend-mode: multiply; }
div.footer-logo { font-family: var(--ff-display); font-size: 1.5rem; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { font-size: .875rem; }
.footer-social { display: flex; gap: 12px; }
.social-link { display: grid; place-items: center; width: 44px; height: 44px; }
.social-link svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.footer-copy { margin-top: 24px; font-size: .8125rem; color: var(--mut); }

/* ── LEGAL PAGES ────────────────────────────────────────── */
.legal-hero { padding-top: calc(var(--nav-h) + 72px); padding-bottom: 56px; border-bottom: 1px solid var(--line); }
.legal-hero h1 { font-family: var(--ff-display); font-size: clamp(2.75rem, 7vw, 6rem); line-height: 1.08; text-transform: uppercase; }
.legal-content { padding-block: 72px; max-width: 760px; }
.legal-content h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -.012em; line-height: 1.25; margin: 48px 0 12px; }
.legal-content p { color: var(--mut); margin-bottom: 16px; }
.legal-content ul { list-style: disc; padding-left: 24px; color: var(--mut); margin-bottom: 16px; }
.legal-content ul li { margin-bottom: 6px; }
.legal-date { font-size: .875rem; color: var(--mut); margin-top: -8px; margin-bottom: 48px; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .about-grid, .case-body, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .media { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  #hero { --hero-fs: 16.2cqw; }
  html[lang="en"] #hero { --hero-fs: 13.8cqw; }
  .hero-inner { justify-content: space-between; }
  .hero-title { line-height: 1.16; margin-block: auto; }
  .hero-line-2 { margin-left: 26%; }
  .hero-line-3 { margin-left: 4%; }
  .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles, .form-row, .services li { grid-template-columns: minmax(0, 1fr); }
  .lab-grid, .steps { grid-template-columns: minmax(0, 1fr); }
  .lab-item:last-child { grid-column: auto; }
  .work-index a { grid-template-columns: 32px minmax(0, 1fr); }
  .wi-what { grid-column: 2; text-align: left; }
  .pipe { aspect-ratio: auto; min-height: 460px; }
  .hard summary { min-height: 48px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}

/* ── MOVIMIENTO REDUCIDO ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #navbar { transition: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .hero-paper { clip-path: none; }
  .js .hero-word { opacity: 1; }
  .hero-replay { display: none; }
}

/* ── UTILITIES ──────────────────────────────────────────── */
[data-lang] { display: none; }
[data-lang].lang-active { display: block; }
span[data-lang].lang-active { display: inline; }
