/* Tecnocuache — landing
   Paleta tomada del logo: tinta, gris de pelaje, beige de la insignia y rosa de la nariz. */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #231f20;
  --muted: #6a6461;
  --line: #e6e0d8;
  --beige: #e2ddd6;
  --fur: #84807c;
  --pink: #e8a3a0;
  --pink-soft: #f8e4e1;
  --tail: #ecc9b8;

  --radius: 20px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --shadow: 0 1px 2px rgba(35, 31, 32, .06), 0 12px 32px -12px rgba(35, 31, 32, .18);

  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p  { margin: 0; text-wrap: pretty; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.code { font-family: var(--mono); font-weight: 500; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
}
.skip:focus { top: 16px; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; border-radius: 999px;
  background: var(--ink); color: #fff; border: 2px solid var(--ink);
  font-weight: 500; font-size: 1rem; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(35, 31, 32, .5); }
.btn--small { padding: 9px 18px; font-size: .95rem; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--light { background: #fff; color: var(--ink); border-color: #fff; }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn--outline-light:hover { border-color: #fff; }

/* ── Navegación ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__in { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 500; font-size: 1.15rem; letter-spacing: .08em;
}
.brand img { border-radius: 50%; }

.nav__menu { display: flex; align-items: center; gap: 28px; }
.nav__menu a:not(.btn) { text-decoration: none; font-weight: 400; font-size: .98rem; position: relative; padding: 6px 0; }
.nav__menu a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--pink); transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.nav__menu a:not(.btn):hover::after { transform: scaleX(1); }

.nav__toggle {
  display: none; width: 44px; height: 44px; border: 0; border-radius: 12px;
  background: transparent; cursor: pointer; align-items: center; justify-content: center;
}
.nav__bars, .nav__bars::before, .nav__bars::after {
  display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav__bars { position: relative; }
.nav__bars::before, .nav__bars::after { content: ""; position: absolute; left: 0; }
.nav__bars::before { top: -7px; }
.nav__bars::after { top: 7px; }
.nav__toggle[aria-expanded="true"] .nav__bars { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__bars::before { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px var(--gutter) 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a:not(.btn) { padding: 12px 0; font-size: 1.05rem; }
  .nav__menu .btn { margin-top: 8px; }
}

/* ── Hero ── */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 96px); overflow: hidden; }
.hero__in { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(24px, 5vw, 64px); }

.eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .85rem; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 18px;
}
.eyebrow .code {
  background: var(--ink); color: #fff; padding: 3px 9px; border-radius: 8px; letter-spacing: 0; font-size: .8rem;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--pink) 62%, var(--pink) 92%, transparent 92%);
}
.lead { margin-top: 22px; font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 34em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero__art { position: relative; display: grid; place-items: center; }
.hero__art img { position: relative; width: 100%; max-width: 560px; animation: flotar 6s ease-in-out infinite; }
.hero__blob {
  position: absolute; width: min(88%, 440px); aspect-ratio: 1; border-radius: 50%;
  background: var(--beige);
}
.hero__blob::before, .hero__blob::after { content: ""; position: absolute; border-radius: 50%; }
.hero__blob::before { width: 22%; aspect-ratio: 1; background: var(--pink-soft); right: -6%; top: 4%; }
.hero__blob::after { width: 12%; aspect-ratio: 1; background: var(--tail); left: -2%; bottom: 10%; }

@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

@media (max-width: 860px) {
  .hero__in { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .hero__art img { max-width: 420px; }
  .hero__blob { width: min(70%, 320px); }
}

/* ── Secciones ── */
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { margin-bottom: clamp(28px, 5vw, 52px); max-width: 40em; }
.section__sub { margin-top: 14px; color: var(--muted); }

.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
/* Cuatro tarjetas: 1, 2×2 o 4 por fila; nunca 3, para que ninguna quede sola */
.grid--4 { grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 560px)  { .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
.tags li {
  font-family: var(--mono); font-size: .76rem; padding: 4px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
}

/* ── Servicios ── */
.service {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px; transition: transform .2s ease, box-shadow .2s ease;
}
.service:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.service__icon {
  width: 56px; height: 56px; padding: 10px; margin-bottom: 20px;
  background: var(--pink-soft); border-radius: 16px;
  fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
}
.service__icon .fill { fill: var(--ink); stroke: none; }
.service p { margin-top: 10px; color: var(--muted); }

/* ── Proyectos ── */
.project {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.project__cover {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 24px 24px 44px; background: var(--cover); color: var(--on-cover);
}
.project__icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .45); }
.project__icon--pixel { image-rendering: pixelated; }
.pill {
  font-size: .78rem; font-weight: 500; letter-spacing: .04em;
  padding: 5px 12px; border-radius: 999px;
  background: var(--pill); color: var(--on-pill);
}

.project__body {
  display: flex; flex-direction: column; flex: 1;
  padding: 26px 24px 24px; margin-top: -20px;
  background: var(--bg); border-radius: var(--radius) var(--radius) 0 0;
}
.project__kind { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.project__body h3 { font-size: 1.55rem; margin-bottom: 10px; }
.project__body > p:not(.project__kind) { color: var(--muted); }

.checks { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 8px; font-size: .97rem; }
.checks li { position: relative; padding-left: 26px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--bg), 0 0 0 1.5px var(--accent);
}

.link { margin-top: auto; font-weight: 500; text-decoration: none; display: inline-flex; gap: 6px; align-self: flex-start; }
.link span { transition: transform .15s ease; }
a.link { border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
a.link:hover span { transform: translateX(4px); }
.link--muted { color: var(--muted); font-weight: 400; font-size: .95rem; }

.project--ixtli  { --cover: linear-gradient(135deg, #1c1f27, #12141a); --on-cover: #fff; --accent: #1f9d84; --pill: #5fe0c4; --on-pill: #0d2a24; }
.project--chamba { --cover: linear-gradient(135deg, #4a7fd4, #2f5eae); --on-cover: #fff; --accent: #3b6fc4; --pill: #ffd866; --on-pill: #3d2f00; }
.project--yume   { --cover: linear-gradient(135deg, #fbe3e8, #f6cdd6); --on-cover: #7a5446; --accent: #c98a94; --pill: #7a5446; --on-pill: #fffaf2; }
/* Tarjetas compactas: cuatro por fila en escritorio */
.grid--4 .project__cover { padding: 20px 20px 40px; }
.grid--4 .project__icon { width: 60px; height: 60px; border-radius: 15px; }
.grid--4 .project__body { padding: 24px 20px 20px; }
.grid--4 .project__body h3 { font-size: 1.35rem; }
.grid--4 .project__body > p:not(.project__kind), .grid--4 .checks, .grid--4 .project__more p { font-size: .95rem; }

/* Ficha plegable: cerrada solo dice qué es; «Ver más» muestra el resto */
.grid--4:has(.project__more[open]) { align-items: start; } /* la abierta crece sola */
.project__more { margin-top: auto; padding-top: 14px; }
.project__more > summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-weight: 500; font-size: .95rem; color: var(--ink);
  border-bottom: 2px solid var(--accent); padding-bottom: 2px;
}
.project__more > summary::-webkit-details-marker { display: none; }
.project__more > summary::after {
  content: ""; width: 7px; height: 7px; margin-top: -3px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s ease, margin .2s ease;
}
.project__more[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.project__more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.project__more .menos, .project__more[open] .mas { display: none; }
.project__more[open] .menos { display: inline; }
.project__more p { margin-top: 14px; color: var(--muted); }
.project__more .checks { margin-bottom: 16px; }
.project__shot {
  display: block; width: 100%; height: 180px; margin-top: 14px;
  object-fit: cover; object-position: top;
  border-radius: 12px; border: 1px solid var(--line);
}
.grid--4 .checks { margin: 16px 0 20px; }

.project--multi  { --cover: linear-gradient(135deg, #6f60e8, #4a3bc4); --on-cover: #fff; --accent: #5b4bdb; --pill: #d4ceff; --on-pill: #231a6b; }

/* ── Proceso ── */
.steps {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}
.steps li { position: relative; padding-top: 22px; border-top: 2px solid var(--ink); }
.steps__n {
  display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px;
  border-radius: 50%; background: var(--pink); font-family: var(--mono); font-weight: 500; font-size: .95rem;
}
.steps p { margin-top: 8px; color: var(--muted); font-size: 1rem; }

/* ── Contacto ── */
.section--cta { padding-top: 0; }
.cta {
  display: grid; justify-items: center; text-align: center; gap: 14px;
  padding: clamp(40px, 7vw, 72px) clamp(20px, 5vw, 64px);
  background: var(--ink); color: #fff; border-radius: calc(var(--radius) * 1.5);
}
.cta img { border-radius: 50%; margin-bottom: 6px; }
.cta p { color: #cfc9c4; max-width: 34em; }
.cta .hero__cta { justify-content: center; margin-top: 18px; }

/* ── Pie ── */
.footer { padding: 28px 0 40px; color: var(--muted); font-size: .92rem; }
.footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer .code { font-size: .82rem; }

/* ── Aparición al hacer scroll (solo si hay JS) ── */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .grid .reveal:nth-child(2), .js .steps .reveal:nth-child(2) { transition-delay: .08s; }
.js .grid .reveal:nth-child(3), .js .steps .reveal:nth-child(3) { transition-delay: .16s; }
.js .steps .reveal:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
