/* Mario Acevedo · web final (base visual: versión 4 de web\)
   Dirección: taller industrial, ordenado. Un solo acento (ámbar de seguridad). */

:root {
  --bg: oklch(0.165 0.008 60);
  --surface: oklch(0.205 0.01 60);
  --surface-2: oklch(0.245 0.012 60);
  --fg: oklch(0.95 0.008 80);
  --muted: oklch(0.74 0.012 70);
  --faint: oklch(0.6 0.012 70);
  --border: oklch(0.32 0.012 60);
  --accent: oklch(0.76 0.165 58);
  --accent-dim: oklch(0.76 0.165 58 / 0.12);
  --accent-fg: oklch(0.18 0.02 55);
  --error: oklch(0.68 0.19 28);
  --success: oklch(0.78 0.14 150);

  --f-display: "Archivo", "Arial Narrow", sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --t-sm: 0.875rem;
  --t-base: 1rem;
  --t-md: 1.125rem;
  --t-lg: 1.25rem;
  --t-h3: 1.4rem;
  --t-h2: clamp(2.1rem, 8.4vw, 4.6rem);
  --t-hero: clamp(2.5rem, 12.6vw, 8.6rem);

  --s1: 0.5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem; --s5: 4rem; --s6: 7rem;
  --gutter: 1rem;
  --r-sm: 4px;
  --r-md: 10px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
main { overflow-x: clip; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
strong { font-weight: 600; color: var(--fg); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }

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

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-fg); padding: var(--s1) var(--s2); border-radius: var(--r-sm);
}
.skip:focus { top: var(--s1); }

section { padding: var(--s5) var(--gutter); position: relative; scroll-margin-top: 108px; }
main > section + section { border-top: 1px solid var(--border); }

.kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--s2);
}
.h2 {
  font-family: var(--f-display);
  font-stretch: 78%;
  font-weight: 800;
  font-size: var(--t-h2);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
  max-width: 18ch;
}
.lead { color: var(--muted); font-size: var(--t-md); max-width: 46ch; margin-top: var(--s2); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  background: var(--accent); color: var(--accent-fg);
  font-family: var(--f-body); font-weight: 600; text-decoration: none;
  border-radius: var(--r-sm);
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: oklch(0.81 0.16 62); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--small { font-size: var(--t-sm); padding: 0.55rem 0.95rem; min-height: 44px; }
.btn--big { font-size: var(--t-md); padding: 1rem 1.5rem; min-height: 56px; width: 100%; }
.btn--ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--surface); border-color: var(--fg); }
.wa-ico { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Encabezado ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.6rem var(--s2);
  padding: 0.7rem var(--gutter);
  padding-top: max(0.7rem, env(safe-area-inset-top));
  background: oklch(0.165 0.008 60 / 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-family: var(--f-display); font-weight: 800; font-stretch: 80%; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand__tag { font-size: 0.72rem; color: var(--muted); }
.nav {
  order: 3; flex-basis: 100%;
  display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 2px;
  scroll-padding-inline: var(--gutter);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 0.9rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--fg);
  font-size: var(--t-sm); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.nav a:hover { border-color: var(--fg); }
.nav a.is-here { border-color: var(--accent); color: var(--accent); }

/* ---------- 1. Portada ---------- */
.hero { padding-top: var(--s4); padding-bottom: var(--s5); display: grid; align-content: start; }
.hero__title {
  font-family: var(--f-display);
  font-weight: 900;
  font-stretch: 75%;
  font-size: var(--t-hero);
  line-height: 0.88;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  max-width: 13ch;
  overflow-wrap: break-word;
}
.hero__title .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.05em; }
.hero__title .w > span { display: inline-block; }
/* Mientras carga la animación, no mostrar las piezas en su lugar final (evita el parpadeo) */
.js-motion .hero__title .w > span, .js-motion .crate { visibility: hidden; }
.w--accent { color: var(--accent); }
.belt {
  position: relative;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 0.4rem;
  margin: var(--s4) 0 var(--s3); padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}
.crate {
  position: relative;
  padding: 0.55rem 0.6rem 0.5rem;
  min-width: 5.4rem; text-align: center;
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg);
  background: var(--surface-2);
  border: 1.5px solid var(--muted);
  border-radius: 2px;
  will-change: transform;
}
.crate::after {
  content: "✓"; position: absolute; top: -0.85rem; right: -0.45rem;
  width: 1.3rem; height: 1.3rem; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg);
  font-size: 0.7rem; border-radius: 50%;
  opacity: var(--done, 1); transform: scale(var(--done, 1));
}
.crate--wide { display: none; }
.hero__sub { font-size: var(--t-lg); color: var(--muted); max-width: 34ch; }
.hero__cta { display: grid; gap: var(--s2); margin-top: var(--s4); }
.hero__note { font-size: var(--t-sm); color: var(--faint); }
.hero__me { display: flex; align-items: center; gap: 0.75rem; font-size: var(--t-sm); color: var(--muted); max-width: 46ch; }
.hero__me img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); flex: none; }

/* ---------- 2. Casos ---------- */
.cases__head { margin-bottom: var(--s4); }
.case { display: grid; gap: var(--s3); }
.case + .case { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px dashed var(--border); }
.case__shot {
  display: block;
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  background: var(--surface); box-shadow: 0 24px 60px -30px oklch(0 0 0 / 0.7);
  align-self: start;
}
.case__shot img { width: 100%; height: auto; }
.case__shot--stack { overflow: visible; border: 0; background: none; box-shadow: none; }
.case__shot--stack > a { display: block; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 24px 60px -30px oklch(0 0 0 / 0.7); }
.case__shot--stack > a.case__shot2 {
  width: 80%; margin: -10% 0 0 auto; position: relative;
  box-shadow: 0 30px 60px -20px oklch(0 0 0 / 0.85);
}
.case__who {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--accent); font-size: var(--t-sm); margin-bottom: var(--s3);
}
.case__who img { height: 28px; width: auto; background: oklch(0.97 0.01 80); border-radius: 4px; padding: 2px 4px; }
.case__dot { width: 10px; height: 10px; background: var(--accent); border-radius: 2px; flex: none; }
.case__label { color: var(--faint); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; margin: var(--s3) 0 var(--s1); }
.case__label:first-of-type { margin-top: 0; }
.case__pains { display: grid; gap: 0.4rem; }
.case__pains li { color: var(--muted); padding-left: 1.4rem; position: relative; }
.case__pains li::before { content: "×"; position: absolute; left: 0; color: var(--error); font-weight: 700; }
.case__done { font-size: var(--t-md); max-width: 52ch; margin-bottom: var(--s2); }
.case__wa {
  display: inline-flex; align-items: center; gap: 0.4em; min-height: 44px;
  color: var(--accent); font-weight: 600; text-decoration: none;
}
.case__wa:hover { text-decoration: underline; }

/* ---------- 3. Sobre mí ---------- */
.me { display: grid; gap: var(--s4); }
.me__photo {
  aspect-ratio: 1 / 1; max-width: 240px; width: 100%;
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  background: var(--surface);
  box-shadow: 10px 10px 0 var(--accent-dim);
}
.me__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.me__body p:not(.kicker):not(.lead) { color: var(--muted); margin-top: var(--s2); max-width: 52ch; }
.me__in { margin-top: var(--s3); }

/* ---------- 4. ¿Es para ti? ---------- */
.fit__grid { display: grid; gap: var(--s2); margin-top: var(--s4); }
.fit__card { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3); background: var(--surface); }
.fit__card h3 { font-family: var(--f-display); font-stretch: 85%; font-weight: 800; font-size: var(--t-h3); line-height: 1.1; margin-bottom: var(--s2); }
.fit__card ul { display: grid; gap: 0.75rem; }
.fit__card li { position: relative; padding-left: 1.9rem; }
.fit__card li::before {
  position: absolute; left: 0; top: 0.1em;
  width: 1.3rem; height: 1.3rem; display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 700; border-radius: 50%;
}
.fit__card--yes { border-color: var(--accent); background: var(--accent-dim); }
.fit__card--yes h3 { color: var(--accent); }
.fit__card--yes li::before { content: "✓"; background: var(--accent); color: var(--accent-fg); }
.fit__card--no li { color: var(--muted); }
.fit__card--no li::before { content: "×"; border: 1.5px solid var(--faint); color: var(--faint); font-size: 0.85rem; }

/* ---------- 5. Lo que también se puede armar ---------- */
.ideas__grid { display: grid; gap: var(--s2); margin-top: var(--s4); }
.idea {
  border: 1px dashed var(--muted); border-radius: var(--r-md);
  padding: var(--s3); display: grid; gap: var(--s1); align-content: start;
}
.idea__ico { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: var(--s1); }
.idea h3 { font-family: var(--f-display); font-stretch: 85%; font-weight: 800; font-size: var(--t-h3); line-height: 1.1; }
.idea p { color: var(--muted); }

/* ---------- 6. Preguntas ---------- */
.faq__list { margin-top: var(--s4); border-top: 1px solid var(--border); max-width: 820px; }
details { border-bottom: 1px solid var(--border); }
summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2);
  padding: var(--s3) 0; min-height: 56px;
  font-family: var(--f-display); font-stretch: 88%; font-weight: 700; font-size: var(--t-lg); line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--f-mono); color: var(--accent); font-size: 1.4rem; flex: none; transition: transform 200ms var(--ease-out); }
details[open] summary::after { transform: rotate(45deg); }
summary:hover { color: var(--accent); }
details p { color: var(--muted); padding-bottom: var(--s3); max-width: 60ch; }

/* ---------- Cierre ---------- */
.close { padding-top: var(--s6); padding-bottom: var(--s6); display: grid; gap: var(--s3); justify-items: start; }
.close__title {
  font-family: var(--f-display); font-weight: 900; font-stretch: 75%;
  font-size: clamp(2.8rem, 12vw, 8rem); line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase;
  max-width: 12ch; text-wrap: balance;
}
.close__sub { font-size: var(--t-lg); color: var(--muted); max-width: 36ch; }
.close .btn { margin-top: var(--s2); }

.foot {
  padding: var(--s4) var(--gutter) calc(var(--s4) + 84px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: var(--t-sm); color: var(--muted);
  display: grid; gap: 4px;
}

/* ---------- Botón fijo (celular) ---------- */
.dock {
  position: fixed; left: var(--gutter); right: var(--gutter);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 56px; border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-fg);
  font-weight: 600; font-size: var(--t-md); text-decoration: none;
  box-shadow: 0 10px 30px oklch(0 0 0 / 0.45);
  transition: transform 260ms var(--ease-out), opacity 260ms var(--ease-out);
}
.dock.is-hidden { transform: translateY(140%); opacity: 0; pointer-events: none; }

/* ---------- Celulares chicos ---------- */
@media (max-width: 360px) {
  .brand__tag { display: none; }
  .crate { min-width: 0; flex: 1; padding-inline: 0.3rem; font-size: 0.62rem; }
}

/* ---------- Tablet y compu ---------- */
@media (min-width: 640px) {
  :root { --gutter: 2rem; }
  .btn--big { width: auto; }
  .hero__cta { justify-items: start; }
  .crate--wide { display: block; }
  .crate { font-size: 0.78rem; min-width: 7rem; padding: 0.7rem 1rem 0.6rem; }
  .fit__grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .ideas__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  :root { --gutter: clamp(2.5rem, 5vw, 5rem); }
  section { padding-top: var(--s6); padding-bottom: var(--s6); }
  .top { flex-wrap: nowrap; }
  .nav { order: 0; flex-basis: auto; margin: 0 0 0 auto; padding: 0; overflow: visible; }
  .dock { display: none; }
  .foot { padding-bottom: var(--s4); grid-template-columns: 1fr auto; }

  .hero { min-height: calc(100svh - 64px); align-content: end; padding-top: var(--s5); padding-bottom: var(--s5); }
  .hero__title { font-size: clamp(4rem, 7vw, 7rem); max-width: 17ch; }
  .hero__cta { grid-template-columns: auto 1fr; align-items: center; gap: var(--s3); }
  .hero__sub { font-size: 1.5rem; }

  .case { grid-template-columns: 1.25fr 1fr; align-items: center; gap: var(--s5); }
  .case--flip .case__shot { order: 2; }
  .cases > * , .fit > *, .ideas > * { max-width: 1320px; margin-inline: auto; }

  .me { grid-template-columns: 360px 1fr; align-items: center; gap: var(--s5); }
  .me__photo { aspect-ratio: 4 / 5; max-width: 360px; }
  .faq { display: grid; grid-template-columns: 0.6fr 1.4fr; gap: var(--s5); }
  .faq__list { margin-top: 0; }

  .close { justify-items: center; text-align: center; }
  .close__title { max-width: none; }
  .close__sub { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
