/* ============================================================
   arnaudev.com — estilos
   ============================================================ */

@font-face {
  font-family: 'Martian Mono';
  src: url('../fonts/martian-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --bg: #0a0a0d;
  --bg-raise: #0e0e12;
  --surface: rgba(255, 255, 255, .025);
  --surface-strong: #121217;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --text: #ececf1;
  --muted: #a3a3ae;
  --dim: #74747f;
  --green: #3deb6e;
  --green-ink: #04150a;
  --green-soft: rgba(61, 235, 110, .1);
  --green-line: rgba(61, 235, 110, .35);
  --green-glow: rgba(61, 235, 110, .4);

  --mono: 'Martian Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Instrument Sans', ui-sans-serif, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 16px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Rejilla de fondo + grano */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 75%);
  opacity: .55;
}

body::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  opacity: .045;
}

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

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

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--green); color: var(--green-ink); }

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: .6rem 1rem;
  border-radius: 8px;
  background: var(--green);
  color: var(--green-ink);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-fill { fill: currentColor; stroke: none; }

kbd {
  font-family: var(--mono);
  font-size: .95em;
  padding: .1em .45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--text);
  background: var(--surface);
}

/* ---------- Botones ---------- */

.btn {
  --btn-bg: var(--green);
  --btn-fg: var(--green-ink);
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .95rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  font-stretch: 95%;
  letter-spacing: .01em;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, border-color .25s, color .25s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -14px var(--green-glow);
}
.btn:active { transform: translateY(0); }
.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--green-line);
  color: var(--green);
  box-shadow: none;
}

.btn-sm { padding: .7rem 1rem; font-size: .72rem; }

/* ---------- Cabecera ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(10, 10, 13, .78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  flex: none;
}
.brand-mark {
  width: 30px;
  height: auto;
  fill: var(--green);
  filter: drop-shadow(0 0 10px rgba(61, 235, 110, .35));
}
.brand-word {
  font-family: var(--sans);
  font-weight: 500;
  font-size: .82rem;
  letter-spacing: .42em;
  margin-right: -.42em;
}

.nav { margin-left: auto; }
.nav ul { display: flex; gap: .25rem; }
.nav a {
  position: relative;
  display: block;
  padding: .5rem .8rem;
  font-family: var(--mono);
  font-size: .72rem;
  font-stretch: 92%;
  color: var(--muted);
  transition: color .2s;
}
.nav a::before {
  content: '>';
  position: absolute;
  left: -.05rem;
  color: var(--green);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s var(--ease);
}
.nav a:hover,
.nav a.is-active { color: var(--text); }
.nav a:hover::before,
.nav a.is-active::before { opacity: 1; transform: none; }
.nav-contact { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}
.lang button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  padding: .38rem .55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green);
}

.menu-toggle {
  display: none;
  appearance: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: none;
  cursor: pointer;
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.menu-toggle span:first-child { top: 16px; }
.menu-toggle span:last-child { top: 23px; right: 17px; }
.menu-toggle[aria-expanded="true"] span:first-child { top: 19.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { top: 19.5px; right: 11px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(3rem, 9vh, 6.5rem)) 0 clamp(4rem, 9vh, 6.5rem);
  min-height: min(100svh, 980px);
  display: flex;
  align-items: center;
  overflow-x: clip; /* el brillo de fondo no debe ensanchar la página en móvil */
}
.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: min(760px, 90vw);
  aspect-ratio: 1;
  right: -12%;
  top: 8%;
  background: radial-gradient(closest-side, rgba(61, 235, 110, .16), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 5rem);
}

.eyebrow {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.prompt { color: var(--green); font-weight: 700; margin-right: .3em; }

.hero-title {
  font-family: var(--mono);
  font-weight: 760;
  font-stretch: 112.5%;
  font-size: clamp(2.9rem, 11vw, 6.6rem);
  line-height: .98;
  letter-spacing: -.035em;
  text-transform: uppercase;
}
.hero-title .line { display: block; }

.caret {
  color: var(--green);
  margin-left: .04em;
  text-shadow: 0 0 24px var(--green-glow);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lead {
  margin-top: 1.8rem;
  max-width: 34rem;
  font-size: clamp(1.12rem, 1.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--muted);
}
.hero-lead strong { color: var(--text); font-weight: 600; }

.status {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin-top: 1.6rem;
  padding: .5rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .68rem;
  font-stretch: 92%;
  color: var(--muted);
  background: var(--surface);
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}
.status-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--green);
  animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: .9; }
  80%, 100% { transform: scale(2.8); opacity: 0; }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2.2rem;
}

/* ---------- Terminal ---------- */

.terminal {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #111116, #0b0b0f);
  box-shadow:
    0 50px 100px -40px rgba(0, 0, 0, .9),
    0 0 0 1px rgba(61, 235, 110, .04),
    0 0 80px -30px rgba(61, 235, 110, .25);
  overflow: hidden;
  transition: border-color .3s;
}
.terminal:focus-within { border-color: var(--green-line); }

.terminal-bar,
.browser-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
}
.terminal-dots { display: inline-flex; gap: 6px; flex: none; }
.terminal-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #26262e;
}
.terminal-dots i:first-child { background: var(--green); opacity: .8; }

.terminal-title {
  flex: 1;
  text-align: center;
  margin-right: 46px;
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--dim);
}

.terminal-body {
  height: 360px;
  overflow-y: auto;
  padding: 1.1rem 1.25rem 1.3rem;
  font-family: var(--mono);
  font-size: .76rem;
  font-stretch: 90%;
  line-height: 1.85;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: #2a2a33 transparent;
}

.t-line { min-height: 1.85em; white-space: pre-wrap; word-break: break-word; }
.t-line + .t-cmd { margin-top: .7rem; }
.t-prompt { color: var(--green); font-weight: 700; margin-right: .5em; }
.t-cmd { color: var(--text); }
.t-muted { color: var(--muted); }
.t-dim { color: var(--dim); }
.t-accent { color: var(--green); }
.t-error { color: #ff7b72; }
.t-key {
  display: inline-block;
  min-width: 18ch;
  margin-right: 1ch;
  color: var(--text);
}
.t-line a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-color: var(--green-line);
  text-underline-offset: 3px;
}
.t-line a:hover { text-decoration-color: var(--green); }

.term-line {
  display: flex;
  align-items: center;
  margin-top: .7rem;
}
.term-line input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font: inherit;
  caret-color: var(--green);
}

.terminal-hint {
  margin-top: .9rem;
  text-align: center;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--dim);
}

/* ---------- Ticker ---------- */

.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 1.15rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 42s linear infinite;
}
.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 2.4rem;
  padding-right: 2.4rem;
  font-family: var(--mono);
  font-size: .8rem;
  font-stretch: 105%;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.ticker-track span::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  transform: rotate(45deg);
  opacity: .7;
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */

.section { padding-block: clamp(5rem, 11vw, 9rem); }

.section-head { margin-bottom: clamp(2.75rem, 5vw, 4.25rem); }

.section-tag {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--dim);
  margin-bottom: 1.1rem;
}
.section-num { color: var(--green); font-weight: 700; }

h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-stretch: 90%;
  font-size: clamp(2.2rem, 5vw, 3.9rem);
  line-height: 1.03;
  letter-spacing: -.03em;
}
h2 em {
  font-style: normal;
  color: var(--green);
}

.section-lead {
  margin-top: 1.2rem;
  max-width: 36rem;
  font-size: 1.12rem;
  color: var(--muted);
}

/* ---------- Sobre mí ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}
.about-text p {
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.7;
  color: var(--muted);
}
.about-text p + p { margin-top: 1.3rem; }
.about-text strong { color: var(--text); font-weight: 600; }

.file-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raise);
  overflow: hidden;
}
.file-card-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--dim);
  background: rgba(255, 255, 255, .02);
}
.file-icon {
  width: 10px;
  height: 12px;
  border: 1.5px solid var(--green);
  border-radius: 2px;
}
.file-card-body { padding: .5rem 1.25rem; }
.file-card-body > div {
  display: grid;
  grid-template-columns: 9.5ch 1fr;
  gap: 1rem;
  padding: .95rem 0;
  border-bottom: 1px dashed var(--line);
  align-items: baseline;
}
.file-card-body > div:last-child { border-bottom: 0; }
.file-card-body dt {
  font-family: var(--mono);
  font-size: .7rem;
  font-stretch: 90%;
  color: var(--dim);
}
.file-card-body dt::after { content: ':'; }
.file-card-body dd { font-size: 1rem; }
.file-card-body .is-ok {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--green);
  font-family: var(--mono);
  font-size: .8rem;
}

/* ---------- Servicios ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .35s, transform .35s var(--ease), background-color .35s;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0;
  transition: opacity .35s;
}
.card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .035);
  transform: translateY(-3px);
}
.card:hover::before { opacity: .8; }

.card-num {
  position: absolute;
  top: 1.2rem;
  right: 1.6rem;
  font-family: var(--mono);
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  pointer-events: none;
}

.card-path {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--green);
  margin-bottom: 2.5rem;
}

.card h3 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 600;
  font-stretch: 92%;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.card-desc {
  margin-top: .9rem;
  color: var(--muted);
  max-width: 34rem;
}

.checklist {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: .7rem;
}
.checklist li {
  position: relative;
  padding-left: 1.8rem;
  font-size: .98rem;
}
.checklist li::before {
  content: '+';
  position: absolute;
  left: 0;
  top: .05em;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--green);
}

.process { margin-top: clamp(3.5rem, 7vw, 5.5rem); }
.process-title {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  color: var(--dim);
  margin-bottom: 1.6rem;
}
.process-title::before { content: '$ '; color: var(--green); }

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}
.process-steps li {
  position: relative;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-strong);
}
.process-steps li::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 36px;
  height: 1px;
  background: var(--green);
  box-shadow: 0 0 12px var(--green-glow);
}
.step-num {
  display: block;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--green);
  margin-bottom: .8rem;
}
.process-steps strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: .4rem;
}
.process-steps p {
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- Proyectos ---------- */

.projects { display: grid; gap: clamp(4rem, 8vw, 6.5rem); }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.project:nth-child(even) .project-media { order: 2; }

.project-media {
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raise);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
  transition: border-color .35s, transform .45s var(--ease), box-shadow .45s var(--ease);
}
.project-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
  transition: transform .8s var(--ease);
}
.project-media:hover {
  border-color: var(--green-line);
  transform: translateY(-4px);
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .95), 0 0 60px -30px var(--green-glow);
}
.project-media:hover img { transform: scale(1.025); }

.browser-bar { padding: .65rem .9rem; }
.browser-url {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  max-width: 300px;
  margin-inline: auto;
  padding: .35rem .8rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, .04);
  font-family: var(--mono);
  font-size: .64rem;
  color: var(--muted);
}
.browser-url .icon { width: .9em; height: .9em; color: var(--green); }

.project-index {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--dim);
}
.project-kind {
  margin-top: 1.4rem;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--green);
}
.project h3 {
  margin-top: .5rem;
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  font-weight: 600;
  font-stretch: 90%;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.project-desc {
  margin-top: 1rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.4rem;
}
.tags li,
.chips li {
  padding: .4rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: .66rem;
  font-stretch: 92%;
  color: var(--muted);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.8rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--green-line);
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 600;
  color: var(--green);
  transition: border-color .2s, gap .25s var(--ease);
}
.link-arrow:hover { border-color: var(--green); gap: .75rem; }

.next-project {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 60% 80% at 50% 120%, rgba(61, 235, 110, .1), transparent 70%);
}
.next-tag {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--dim);
}
.next-project h3 {
  margin-top: 1rem;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 600;
  font-stretch: 90%;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.next-project p:not(.next-tag) {
  margin-top: .8rem;
  color: var(--muted);
}
.next-project .btn { margin-top: 1.8rem; }

/* ---------- Stack ---------- */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.stack-group {
  padding: 1.6rem 1.6rem 1.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.stack-group h3 {
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.3rem;
}
.t-comment { color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li {
  font-size: .74rem;
  padding: .55rem .85rem;
  color: var(--text);
  background: rgba(255, 255, 255, .02);
  transition: border-color .2s, color .2s;
}
.chips li:hover { border-color: var(--green-line); color: var(--green); }

/* ---------- Contacto ---------- */

.section-contact { padding-top: clamp(2rem, 5vw, 4rem); }

.contact-panel {
  position: relative;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 6vw, 5rem);
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(ellipse 70% 90% at 85% 120%, rgba(61, 235, 110, .16), transparent 65%),
    var(--bg-raise);
  overflow: hidden;
}
.contact-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 100% 100%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 80% at 100% 100%, #000, transparent 70%);
  pointer-events: none;
}
.contact-panel > * { position: relative; }

.contact-title {
  font-family: var(--mono);
  font-weight: 760;
  font-stretch: 112.5%;
  font-size: clamp(2.4rem, 8vw, 5.6rem);
  line-height: 1;
  letter-spacing: -.04em;
}
.contact-lead {
  margin-top: 1.4rem;
  max-width: 32rem;
  font-size: clamp(1.08rem, 1.5vw, 1.22rem);
  color: var(--muted);
}

.contact-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem 1.2rem;
  margin-top: 2.6rem;
}
.email-link {
  font-family: var(--mono);
  font-size: clamp(.92rem, 2.4vw, 1.45rem);
  font-weight: 500;
  font-stretch: 95%;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: .25rem;
  word-break: break-all;
  transition: color .2s, border-color .2s;
}
.email-link:hover { color: var(--green); border-color: var(--green); }

.copy-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .66rem;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.copy-btn:hover { color: var(--text); border-color: var(--green-line); }
.copy-btn.is-copied { color: var(--green); border-color: var(--green-line); }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  margin-top: clamp(3rem, 7vw, 6rem);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}
.brand-sm .brand-mark { width: 22px; }
.brand-sm .brand-word { font-size: .7rem; }
.footer-meta {
  font-size: .85rem;
  color: var(--dim);
}
.footer-top {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
  transition: color .2s;
}
.footer-top:hover { color: var(--green); }

/* ---------- Animaciones de entrada ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity .8s var(--ease) calc(var(--d, 0) * 90ms),
    transform .8s var(--ease) calc(var(--d, 0) * 90ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
  .ticker-track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
  .terminal-wrap { max-width: 640px; }
  .process-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.2rem; }
}

@media (max-width: 900px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    margin: 0;
    padding: 1rem var(--gutter) 1.6rem;
    background: rgba(10, 10, 13, .96);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s, transform .3s var(--ease), visibility 0s .3s;
  }
  .site-header.is-open .nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .25s, transform .3s var(--ease), visibility 0s;
  }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a {
    padding: 1rem 0 1rem 1.4rem;
    font-size: .9rem;
    border-bottom: 1px solid var(--line);
  }
  .nav li:last-child a { border-bottom: 0; }
  .nav a::before { left: 0; top: 1rem; opacity: .5; transform: none; }
  .nav-contact { display: block; }
  .menu-toggle { display: block; }
  .header-actions { margin-left: auto; }

  .about-grid,
  .services-grid,
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-media { order: 0; }
  .stack-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  :root { --header-h: 64px; }
  body { font-size: 1rem; }
  .header-cta { display: none; }
  .brand-word { font-size: .72rem; letter-spacing: .34em; margin-right: -.34em; }
  .brand-mark { width: 26px; }
  .header-actions { gap: .6rem; }
  .terminal-body { height: 300px; font-size: .72rem; }
  .term-line input { font-size: 16px; }
  .terminal-title { margin-right: 0; text-align: right; }
  .process-steps { grid-template-columns: 1fr; }
  .card-num { font-size: 3.4rem; }
  .card-path { margin-bottom: 1.8rem; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .contact-actions .btn { flex: 1 1 auto; justify-content: center; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
  .brand-word { display: none; }
}
