/* ==========================================================================
   brayan.studio — portafolio
   Oscuro, técnico, con el producto propio al frente.
   ========================================================================== */

/* --------------------------------------------------------------- tokens -- */

:root {
  --bg: #08080a;
  --bg-soft: #0e0e12;
  --surface: #131318;
  --surface-hi: #1b1b22;
  --line: #24242e;
  --line-soft: #1a1a22;

  --text: #ededf2;
  --text-dim: #9a9aa8;
  /* 4.88:1 sobre la superficie: el mínimo 4.5:1 se cumple también en los
     textos chicos (etiquetas, chips, numeración), que es donde se usa. */
  --text-faint: #82828f;

  --accent: #d4ff4f;
  --accent-dim: #a8cc3f;
  --accent-glow: rgba(212, 255, 79, 0.15);
  /* En oscuro el acento sirve igual como texto y como fondo. En claro no,
     por eso son dos tokens: uno para pintar, otro para leer. */
  --accent-text: #d4ff4f;
  --on-accent: #08080a;

  --cyan: #4fd7ff;
  --violet: #a78bfa;
  --pink: #f472b6;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --maxw: 1280px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --nav-h: 68px;
}

:root[data-theme="light"] {
  --bg: #fafafa;
  --bg-soft: #f2f2f4;
  --surface: #ffffff;
  --surface-hi: #f6f6f8;
  --line: #e2e2e8;
  --line-soft: #ebebf0;
  --text: #121216;
  --text-dim: #55555f;
  --text-faint: #70707c;
  /* 5.10:1 como texto sobre blanco y, a la vez, 5.10:1 con blanco encima
     cuando hace de fondo de botón. */
  --accent: #4f7a00;
  --accent-dim: #3f6200;
  --accent-glow: rgba(79, 122, 0, 0.12);
  --accent-text: #4f7a00;
  --on-accent: #ffffff;
}

/* ---------------------------------------------------------------- reset -- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

body.is-locked {
  overflow: hidden;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* ----------------------------------------------------------- tipografia -- */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
}

h2 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
}

h3 {
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1.1em;
}

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.lede {
  max-width: 56ch;
  color: var(--text-dim);
  font-size: clamp(1rem, 1.25vw, 1.1rem);
}

.accent {
  color: var(--accent);
}

/* ---------------------------------------------------------------- layout -- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(4.5rem, 9vw, 8rem);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* Rejilla técnica de fondo, sutil. */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  opacity: 0.55;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

main,
.site-nav,
.site-footer {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------- botones -- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  overflow: hidden;
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px var(--accent-glow);
}

.btn:active {
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.btn span {
  transition: transform 0.35s var(--ease);
}

.btn:hover span:last-child {
  transform: translateX(3px);
}

/* ------------------------------------------------------------------- nav -- */

.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--nav-h);
  padding-inline: var(--gutter);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-nav.is-stuck {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line-soft);
}

.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.nav-brand i {
  color: var(--accent);
  font-style: normal;
}

.nav-brand small {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-dim);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem);
}

.nav-links a {
  position: relative;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: color 0.3s var(--ease);
}

.nav-links a::before {
  content: "0" counter(navitem) " ";
  counter-increment: navitem;
  color: var(--text-faint);
  font-size: 0.73rem;
}

.nav-links {
  counter-reset: navitem;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--accent);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* disparador del command palette */
.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.7rem 0.42rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.cmdk-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cmdk-trigger kbd {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.12rem 0.34rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-dim);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.7rem;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-burger {
  display: none;
  width: 34px;
  height: 34px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav-burger i {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}

.nav-burger i:nth-child(1) {
  top: 12px;
}

.nav-burger i:nth-child(2) {
  top: 19px;
}

.nav-burger[aria-expanded="true"] i:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-burger[aria-expanded="true"] i:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* barra de progreso de lectura */
.scroll-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 0.1s linear;
}

/* ------------------------------------------------------------------ hero -- */

.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  min-height: 100svh;
  padding-block: calc(var(--nav-h) + 4rem) 4rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.6rem;
  padding: 0.4rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 255, 79, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(212, 255, 79, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 255, 79, 0);
  }
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero h1 .line {
  display: block;
  overflow: hidden;
}

.hero h1 .line > span {
  display: block;
  animation: riseIn 0.9s var(--ease) backwards;
}

.hero h1 .line:nth-child(2) > span {
  animation-delay: 0.1s;
}

.hero h1 .line:nth-child(3) > span {
  animation-delay: 0.2s;
}

@keyframes riseIn {
  from {
    transform: translateY(102%);
  }
  to {
    transform: translateY(0);
  }
}

.hero-text {
  max-width: 46ch;
  margin-bottom: 2.2rem;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.6rem;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-top: 1.8rem;
  border-top: 1px solid var(--line-soft);
}

.metric b {
  display: block;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ------------------------------------------------------------- terminal -- */

.terminal {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.terminal-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line);
}

.terminal-bar i:nth-child(1) {
  background: #ff5f57;
}

.terminal-bar i:nth-child(2) {
  background: #febc2e;
}

.terminal-bar i:nth-child(3) {
  background: #28c840;
}

.terminal-bar b {
  margin-left: 0.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-faint);
}

.terminal-body {
  height: 340px;
  padding: 1rem 1.1rem;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.75;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.t-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.t-prompt {
  color: var(--accent);
}

.t-out {
  color: var(--text-dim);
}

.t-key {
  color: var(--cyan);
}

.t-warn {
  color: #febc2e;
}

.t-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.t-input-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  background: none;
  border: 0;
  outline: none;
  caret-color: var(--accent);
}

/* --------------------------------------------------------------- stack -- */

.marquee {
  overflow: hidden;
  padding-block: 1.6rem;
  border-block: 1px solid var(--line-soft);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: slide 32s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

.marquee-track span {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}

.marquee-track span:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------ proyectos -- */

.work-list {
  border-top: 1px solid var(--line-soft);
}

.work-row {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.4rem, 2.6vw, 2.1rem) 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: padding-inline 0.45s var(--ease);
}

.work-row:hover {
  padding-inline: 1.2rem;
}

.work-row::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  border-radius: 10px;
}

.work-row:hover::after {
  opacity: 1;
}

.work-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.work-main h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
  transition: color 0.3s var(--ease);
}

.work-row:hover .work-main h3 {
  color: var(--accent);
}

.work-main p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.tag {
  padding: 0.16rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-faint);
  white-space: nowrap;
}

.tag--live {
  border-color: var(--accent);
  color: var(--accent);
}

.tag--wip {
  border-color: #febc2e;
  color: #febc2e;
}

.work-arrow {
  font-family: var(--mono);
  color: var(--text-faint);
  transition: transform 0.4s var(--ease), color 0.3s var(--ease);
}

.work-row:hover .work-arrow {
  transform: translate(4px, -4px);
  color: var(--accent);
}

.work-host {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  transition: color 0.3s var(--ease);
}

.work-row:hover .work-host {
  color: var(--accent-text);
}

/* --------------------------------------------------- vista previa del sitio -- */
/*
 * Sigue al cursor dentro de un marco de navegador con el dominio real.
 * El perspective vive en el contenedor y la inclinación en el marco, así
 * el seguimiento del cursor y el giro no se pisan entre sí.
 */

.work-peek {
  position: fixed;
  z-index: 40;
  width: 380px;
  perspective: 1000px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.35s var(--ease);
  will-change: transform;
}

.work-peek.is-on {
  opacity: 1;
}

.peek-frame {
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(0.94);
  transform-style: preserve-3d;
  transition: transform 0.45s var(--spring), box-shadow 0.45s var(--ease);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.work-peek.is-on .peek-frame {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.6), 0 0 44px -12px var(--accent-glow),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.peek-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.peek-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
}

.peek-bar i:nth-child(1) { background: #ff5f57; }
.peek-bar i:nth-child(2) { background: #febc2e; }
.peek-bar i:nth-child(3) { background: #28c840; }

.peek-url {
  flex: 1;
  margin-left: 0.5rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peek-shot {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-soft);
}

.peek-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ------------------------------------------------------------- productos -- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.1rem;
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2.4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}

.product:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

/* brillo que sigue al cursor */
.product::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  background: radial-gradient(
    380px circle at var(--mx, 50%) var(--my, 50%),
    var(--accent-glow),
    transparent 62%
  );
}

.product:hover::before {
  opacity: 1;
}

.product > * {
  position: relative;
}

.product-ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
}

.product h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.product p {
  flex: 1;
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.2rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  color: var(--text-faint);
}

/* --------------------------------------------------------------- proceso -- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}

.step {
  position: relative;
  padding-top: 2.6rem;
  border-top: 1px solid var(--line);
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: 1rem;
  left: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
}

.step h3 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.step p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* -------------------------------------------------------------- servicios -- */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

.svc {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2.4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.4s var(--ease);
}

.svc:hover {
  border-color: var(--accent);
}

.svc h3 {
  margin-bottom: 0.6rem;
}

.svc p {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* Sin precio, la tarjeta cierra con la acción: el objetivo es la
   conversación, no el número. */
.svc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-text);
  transition: gap 0.3s var(--ease);
}

.svc:hover .svc-link {
  gap: 0.8rem;
}

/* ------------------------------------------------------------------ CTA -- */

.cta {
  position: relative;
  padding-block: clamp(4.5rem, 9vw, 7.5rem);
  text-align: center;
  border-top: 1px solid var(--line-soft);
}

.cta h2 {
  max-width: 16ch;
  margin-inline: auto;
  margin-bottom: 1.2rem;
}

.cta .lede {
  margin-inline: auto;
  margin-bottom: 2.2rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

/* -------------------------------------------------- command palette (⌘K) -- */

.cmdk {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: start center;
  padding-top: clamp(4rem, 14vh, 9rem);
  padding-inline: 1rem;
  background: rgba(4, 4, 6, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}

.cmdk.is-open {
  opacity: 1;
  visibility: visible;
}

.cmdk-panel {
  width: min(100%, 560px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.28s var(--spring);
}

.cmdk.is-open .cmdk-panel {
  transform: none;
}

.cmdk-input {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.cmdk-input span {
  font-family: var(--mono);
  color: var(--accent);
}

.cmdk-input input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
  background: none;
  border: 0;
  outline: none;
}

.cmdk-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 0.5rem;
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  font-size: 0.88rem;
  text-align: left;
  color: var(--text-dim);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.cmdk-item:hover,
.cmdk-item.is-sel {
  background: var(--surface-hi);
  color: var(--text);
}

.cmdk-item i {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-style: normal;
  color: var(--accent);
  width: 1.4rem;
}

.cmdk-item small {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.cmdk-empty {
  padding: 1.6rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.cmdk-foot {
  display: flex;
  gap: 1.2rem;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* ---------------------------------------------------------------- footer -- */

.site-footer {
  padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
  border-top: 1px solid var(--line-soft);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 2.5rem;
}

.footer-brand p {
  max-width: 34ch;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.footer-col b {
  display: block;
  margin-bottom: 1rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.footer-col a {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  transition: color 0.3s var(--ease);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------- reveal -- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------- toast/egg -- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  z-index: 95;
  transform: translate(-50%, 140%);
  padding: 0.8rem 1.3rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  transition: transform 0.45s var(--spring);
}

.toast.is-on {
  transform: translate(-50%, 0);
}

body.konami {
  animation: hueShift 2.4s linear infinite;
}

@keyframes hueShift {
  to {
    filter: hue-rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  #bg-canvas {
    display: none;
  }
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: calc(var(--nav-h) + 3rem) 3rem;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  /* En táctil los controles del header suben a 44×44: con el dedo, 34px
     obliga a apuntar y se falla. */
  .icon-btn,
  .nav-burger {
    width: 44px;
    height: 44px;
  }

  .nav-burger i {
    left: 14px;
  }

  .nav-burger i:nth-child(1) {
    top: 18px;
  }

  .nav-burger i:nth-child(2) {
    top: 25px;
  }

  .cmdk-trigger {
    min-height: 44px;
  }

  /* El logo también es un enlace (vuelve al inicio): necesita su área. */
  .nav-brand {
    min-height: 44px;
    align-items: center;
  }

  .nav-tools {
    gap: 0.4rem;
  }

  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem var(--gutter) 1.6rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease),
      transform 0.3s var(--ease);
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-links a {
    width: 100%;
    padding-block: 0.85rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-burger {
    display: block;
  }

  .cmdk-trigger span {
    display: none;
  }

  .cmdk-trigger {
    padding: 0.42rem 0.6rem;
  }

  .work-row {
    grid-template-columns: 2rem 1fr auto;
    gap: 0.9rem;
  }

  .work-peek {
    display: none;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .terminal-body {
    height: 280px;
  }
}
