/* ============================================
   Adrián Chacón Portfolio — v4 DEV
   Programmer-minimalist. Dark first. Mono only.
   - Single narrow column, lots of negative space
   - JetBrains Mono everywhere, sized for hierarchy
   - // comments for section labels
   - Brand yellow used SOLELY as accent (hover, prompt, status)
   - NouvelleVague reserved for the hero name (brand wordmark)
   ============================================ */

@font-face {
  font-family: "NouvelleVague";
  src: url("assets/fonts/NouvelleVague.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:        #0A0A0A;
  --bg-alt:    #101010;
  --bg-row:    #131313;
  --bg-row-h:  #181715;
  --fg:        #F2F2F2;
  --fg-muted:  #A8A8A8;
  --fg-dim:    #6E6E6E;
  --accent:    #FFCC05;
  /* --accent-text: usado para small accent text (navbar items, stat units, etc).
     En dark hereda accent yellow (suficiente contraste sobre #0A0A0A).
     En light se override a casi-negro porque el yellow sobre blanco se pierde
     en text size pequeño. Brand sigue siendo el yellow para elementos grandes. */
  --accent-text: var(--accent);
  --line:      #1C1C1C;
  --line-2:    #262626;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max-w: 760px;
  --pad-x:  clamp(20px, 4vw, 32px);
  --gap:    clamp(56px, 8vw, 96px);
  --ease:   cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme="light"] {
  --bg:        #FAFAFA;
  --bg-alt:    #F3F3F1;
  --bg-row:    #F3F3F1;
  --bg-row-h:  #EFEDE4;
  --fg:        #282828;
  --fg-muted:  #6A6A6A;
  --fg-dim:    #8A8A8A;  /* antes #B0B0B0 — demasiado claro sobre blanco */
  --accent-text: #1A1A1A; /* dark brand black para legibilidad en text pequeño */
  --line:      #E4E4E4;
  --line-2:    #D8D8D8;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-feature-settings: "ss01", "ss02", "calt", "liga", "zero";
}
body { background: var(--bg); color: var(--fg); overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
img { display: block; max-width: 100%; }

::selection { background: var(--accent); color: #0A0A0A; }

/* =========================================================
   TOP PROMPT — terminal-style breadcrumb
   ========================================================= */
.prompt {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
:root[data-theme="light"] .prompt { background: rgba(250,250,250,0.88); }
.prompt__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  color: var(--fg-muted);
}
.prompt__path {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}
.prompt__lion {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 2px;
}
.prompt__user { color: var(--accent-text); font-weight: 600; }
.prompt__sep  { color: var(--fg-dim); }
/* Separadores del path (@ y :~/) van en accent — más vida en el navbar */
.prompt__path .prompt__sep { color: var(--accent); }
.prompt__branch { color: var(--accent); }
.prompt__branch::before { content: "("; color: var(--accent); }
.prompt__branch::after  { content: ")"; color: var(--accent); }
.prompt__dollar { color: var(--accent); margin-right: 4px; }

.prompt__tools { display: inline-flex; align-items: center; gap: 14px; }
.prompt__btn {
  font: inherit;
  font-size: 11.5px;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s var(--ease);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.prompt__btn:hover { color: var(--fg); }
.prompt__btn .on   { color: var(--accent-text); font-weight: 600; }
.prompt__btn .off  { color: var(--fg-dim); }
.prompt__btn .sep  { color: var(--accent); }

/* Burger: 3 líneas terminal-style. Hidden en desktop, shown en mobile. */
.prompt__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s var(--ease);
}
.prompt__burger:hover,
.prompt__burger.is-open { border-color: var(--accent); }
.prompt__burger span {
  display: block;
  width: 14px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--fg-muted);
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease), background 0.15s var(--ease);
}
.prompt__burger:hover span,
.prompt__burger.is-open span { background: var(--accent); }
/* Animación abierto → X */
.prompt__burger.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.prompt__burger.is-open span:nth-child(2) { opacity: 0; }
.prompt__burger.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Dropdown menu — absolutely posicionado debajo del prompt */
.prompt__menu {
  position: absolute;
  top: 100%;
  right: var(--pad-x, 16px);
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(10, 10, 10, 0.96);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 60;
  min-width: 180px;
  animation: prompt-menu-in 0.18s var(--ease) both;
}
:root[data-theme="light"] .prompt__menu {
  background: rgba(250, 250, 250, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.prompt__menu .prompt__btn { font-size: 12.5px; }
@keyframes prompt-menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .prompt__inner { padding: 12px 16px; font-size: 11.5px; }
  .prompt__tools--desktop { display: none; }
  .prompt__burger { display: inline-flex; }
}

/* =========================================================
   PAGE container
   ========================================================= */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 80px) var(--pad-x) 16px;
}

/* =========================================================
   HERO — minimal text intro + brand mark + avatar
   ========================================================= */
.hero {
  margin-bottom: var(--gap);
}
.hero__mark {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.hero__mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero__cols {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 0;
  align-items: start;
}
.hero__col-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.hero__col-right { flex-shrink: 0; }
.hero__head-text { display: grid; gap: 6px; min-width: 0; }
.hero__avatar {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
@media (max-width: 600px) {
  .hero__cols { grid-template-columns: 1fr; gap: 16px; }
  .hero__col-right { width: 140px; order: -1; }
  .hero__col-left { order: 0; }
}
.hero__line {
  font-size: clamp(12.5px, 1.4vw, 15px);
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.hero__line::before { content: "# "; color: var(--accent); }

.hero__name {
  font-family: "NouvelleVague", "Newsreader", Georgia, serif;
  font-size: clamp(34px, 8vw, 54px);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 10px 0 6px;
  line-height: 1.05;
  text-wrap: balance;
}
.hero__name-first { color: var(--fg); white-space: nowrap; }
.hero__name-last { color: var(--accent); white-space: nowrap; }
.hero__name-suffix {
  color: var(--fg-muted);
  font-size: 0.55em;
  vertical-align: baseline;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hero__role {
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--fg-muted);
  margin: 4px 0 0;
  line-height: 1.4;
}

.hero__body {
  margin: 32px 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fg);
  max-width: 60ch;
}
.hero__body p { margin: 0 0 14px; }
.hero__body p:last-child { margin-bottom: 0; }
.hero__body mark {
  background: transparent;
  color: var(--accent);
  padding: 0;
}
.hero__body code {
  background: var(--bg-row);
  border: 1px solid var(--line-2);
  color: var(--fg);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.92em;
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-row);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg);
  margin-bottom: 24px;
}
.hero__status .dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: relative;
}
.hero__status .dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.4;
  animation: pulse-ring 2.2s ease-in-out infinite;
}
@keyframes pulse-ring {
  0%, 100% { transform: scale(0.8); opacity: 0.4; }
  50%      { transform: scale(1.4); opacity: 0; }
}
.hero__status .at { color: var(--fg-muted); }

.hero__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  background: var(--bg-row);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { background: var(--bg-row-h); border-color: var(--accent); color: var(--accent); }
.btn .arr { color: var(--fg-dim); transition: color 0.15s var(--ease), transform 0.15s var(--ease); }
.btn:hover .arr { color: var(--accent); transform: translateX(2px); }
.btn--ghost { background: transparent; }
.btn--accent { background: var(--accent); color: #0A0A0A; border-color: var(--accent); }
.btn--accent:hover { background: var(--accent); color: #0A0A0A; transform: translateY(-1px); }
.btn--accent .arr,
.btn--accent:hover .arr { color: #0A0A0A; }
/* Light: invertir hover de los secondary/ghost — dark fill + light text.
   El hover con border yellow + text yellow sobre bg claro se ve washed out;
   con fill negro contrasta y se siente más decidido. */
:root[data-theme="light"] .btn:not(.btn--accent):hover {
  background: #0A0A0A;
  border-color: #0A0A0A;
  color: #FAFAFA;
}
:root[data-theme="light"] .btn:not(.btn--accent):hover .arr {
  color: #FAFAFA;
}

/* =========================================================
   SECTION
   ========================================================= */
.section { margin-bottom: var(--gap); }
#contact { margin-bottom: 0; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.section__h {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  margin: 0;
  letter-spacing: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.section__h::before {
  content: "// ";
  color: var(--accent);
  font-weight: 500;
}
.section__count {
  font-size: 11.5px;
  color: var(--fg-dim);
}
.section__meta {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 60ch;
  min-width: 0;
  flex-shrink: 1;
}

/* =========================================================
   PROJECTS — flat list
   ========================================================= */
.projects { display: flex; flex-direction: column; }
.proj {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 12px;
  margin: 0 -12px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: var(--fg);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
  position: relative;
}
.proj + .proj,
.proj-preview + .proj {
  border-top-color: var(--line);
}
.proj:hover { background: var(--bg-row); border-color: var(--line-2); border-top-color: transparent; }
.proj__year {
  font-size: 12px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.proj__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.proj__title {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fg);
  transition: color 0.15s var(--ease);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj:hover .proj__title { color: var(--accent); }
.proj__tags {
  font-size: 11.5px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.proj__tags .sep { color: var(--fg-dim); }
.proj__arrow {
  font-size: 13px;
  color: var(--fg-dim);
  font-family: var(--mono);
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}
.proj:hover .proj__arrow { color: var(--accent); transform: translate(2px, -2px); }

/* 07 "see all" CTA row */
.proj--cta {
  margin-top: 4px;
  background: var(--bg-row);
  border: 1px solid var(--line-2);
}
.proj--cta::before { display: none; }
.proj--cta .proj__year { color: var(--accent); font-weight: 600; }
.proj--cta .proj__title { color: var(--accent); }
.proj--cta:hover { background: var(--bg-row-h); border-color: var(--accent); }
.proj--cta:hover .proj__title { color: var(--accent); }

@media (max-width: 480px) {
  .proj { grid-template-columns: 48px 1fr auto; gap: 10px; }
  .proj__title { font-size: 13.5px; }
}

/* Expandable rows */
.proj--expandable {
  grid-template-columns: 56px 1fr auto auto;
  cursor: pointer;
}
.proj--expandable.is-open {
  background: var(--bg-row);
  border-color: var(--line-2);
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
}
.proj__ext-link {
  font-size: 13px;
  color: var(--fg-dim);
  font-family: var(--mono);
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
  padding: 4px;
  margin: -4px;
  position: relative;
  z-index: 1;
  line-height: 1;
}
.proj--expandable:hover .proj__ext-link { color: var(--accent); }
.proj__toggle {
  font-size: 12px;
  color: var(--fg-dim);
  font-family: var(--mono);
  transition: color 0.15s var(--ease);
  user-select: none;
  line-height: 1;
  align-self: center;
}
.proj--expandable:hover .proj__toggle,
.proj--expandable.is-open .proj__toggle { color: var(--accent); }

@media (max-width: 480px) {
  .proj--expandable { grid-template-columns: 48px 1fr auto auto; gap: 10px; }
}

/* Preview panel — custom image card */
/* Wrapper animable: contiene .proj-preview y le da el open/close
   smooth via max-height transition. La preview adentro queda a su
   tamaño natural; el wrapper la clipea desde 0 al expandirse y al
   colapsarse. max-height grande (800px) cubre la altura natural
   del preview en cualquier viewport (desktop ~430px, mobile ~232px). */
.proj-preview-wrap {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}
.proj-preview-wrap.is-open {
  max-height: 800px;
}

.proj-preview {
  border: 1px solid var(--line-2);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--bg-alt);
  overflow: hidden;
  animation: projPreviewIn 0.32s var(--ease);
}
@keyframes projPreviewIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Terminal bar */
.proj-preview__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-row);
  font-size: 11px;
  color: var(--fg-dim);
}
.proj-preview__bar .dots { display: inline-flex; gap: 5px; flex-shrink: 0; }
.proj-preview__bar .dots i {
  width: 8px; height: 8px; border-radius: 50%; display: block;
}
.proj-preview__bar .dots i:nth-child(1) { background: #FF5F57; }
.proj-preview__bar .dots i:nth-child(2) { background: #FEBC2E; }
.proj-preview__bar .dots i:nth-child(3) { background: #28C840; }
.proj-preview__bar .file {
  flex: 1;
  margin-left: 6px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-preview__ext {
  font-size: 10.5px;
  color: var(--fg-dim);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s var(--ease);
}
.proj-preview__ext:hover { color: var(--accent); }

/* Image card */
.proj-preview__card {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-row);
  cursor: pointer;
}
.proj-preview__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s var(--ease), filter 0.4s var(--ease);
}
.proj-preview__card:hover .proj-preview__img {
  transform: scale(1.03);
  filter: brightness(0.55);
}

/* Gradient overlay */
.proj-preview__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 18px 18px;
  background: linear-gradient(
    to top,
    rgba(10,10,10,0.82) 0%,
    rgba(10,10,10,0.18) 55%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.proj-preview__card:hover .proj-preview__overlay { opacity: 1; }

.proj-preview__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.proj-preview__tag {
  font-size: 10.5px;
  color: var(--accent);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.proj-preview__role {
  font-size: 12px;
  color: rgba(242,242,242,0.75);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-preview__cta {
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-end;
  padding: 6px 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  backdrop-filter: blur(4px);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.proj-preview__card:hover .proj-preview__cta {
  background: var(--accent);
  border-color: var(--accent);
  color: #0A0A0A;
}

/* =========================================================
   ABOUT — narrow column prose
   ========================================================= */
.about__body { font-size: 13.5px; line-height: 1.75; color: var(--fg); max-width: 64ch; }
.about__body p { margin: 0 0 14px; }
.about__body p:last-child { margin-bottom: 0; }
.about__body strong { color: var(--fg); font-weight: 500; }
.about__body code {
  background: var(--bg-row);
  border: 1px solid var(--line-2);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.92em;
}
.about__body mark {
  background: transparent;
  color: var(--accent);
  padding: 0;
}
/* Light: highlighter style — yellow puro de marca + dark text.
   El yellow accent sobre blanco se pierde en text body size; con bg
   sólido del brand queda visible y muy presente. */
:root[data-theme="light"] .hero__body mark,
:root[data-theme="light"] .about__body mark {
  background: var(--accent);
  color: #0A0A0A;
  padding: 0 4px;
  border-radius: 2px;
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 28px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.about__stat { padding: 4px 16px; border-right: 1px solid var(--line); }
.about__stat:first-child { padding-left: 0; }
.about__stat:last-child { border-right: none; padding-right: 0; }
.about__stat .n {
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1;
}
.about__stat .n sup {
  font-size: 0.5em;
  color: var(--accent-text);
  margin-left: 2px;
  vertical-align: super;
  font-weight: 600;
}
.about__stat .l {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 6px;
  line-height: 1.3;
}
@media (max-width: 600px) {
  .about__stats { grid-template-columns: repeat(2, 1fr); }
  .about__stat:nth-child(2) { border-right: none; }
  .about__stat:nth-child(1), .about__stat:nth-child(2) { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .about__stat:nth-child(3), .about__stat:nth-child(4) { padding-top: 12px; }
  /* columna izquierda → sin padding-left, columna derecha → sin padding-right ni border */
  .about__stat:nth-child(3) { padding-left: 0; }
  .about__stat:nth-child(4) { border-right: none; padding-right: 0; }
}

/* =========================================================
   SERVICES — numbered list
   ========================================================= */
.svc { display: flex; flex-direction: column; gap: 4px; }
.svc-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
  position: relative;
}
.svc-item:hover { background: var(--bg-row); border-color: var(--line-2); }
.svc-item__n {
  font-size: 12px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.svc-item__h {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fg);
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.svc-item__em {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--fg-muted);
}
.svc-item__d {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--fg-muted);
  margin: 0;
  max-width: 60ch;
}
.svc-item__d strong { color: var(--fg); font-weight: 500; }

/* =========================================================
   TIERS / ENGAGE — pricing cards (3 cols desktop, stack mobile)
   Each tier is a small terminal window with dots + filename.
   The middle card (.tier--featured) is highlighted with accent.
   ========================================================= */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 760px) {
  .tiers {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.tier {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg-alt);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.tier:hover {
  border-color: var(--fg-dim);
  transform: translateY(-1px);
}
.tier--featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.tier--featured:hover {
  border-color: var(--accent);
}

.tier__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-row);
  font-size: 11px;
}
.tier__bar .dots {
  display: inline-flex;
  gap: 4px;
}
.tier__bar .dots i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.tier__bar .dots i:nth-child(1) { background: #FF5F57; }
.tier__bar .dots i:nth-child(2) { background: #FEBC2E; }
.tier__bar .dots i:nth-child(3) { background: #28C840; }
.tier__file {
  color: var(--fg-muted);
  margin-left: 4px;
}

.tier__body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tier__n {
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.3px;
}

.tier__h {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
  line-height: 1.2;
}

.tier__price-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px dashed var(--line-2);
  border-bottom: 1px dashed var(--line-2);
  margin: 2px 0 4px;
}
.tier__price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}
.tier__em {
  font-size: 11px;
  color: var(--fg-muted);
}

.tier__d {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0;
}

/* =========================================================
   STACK — categorized blocks
   ========================================================= */
.stack {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stack__cat {
  font-size: 12px;
  color: var(--fg-muted);
  padding-top: 4px;
}
.stack__cat::before { content: "$ "; color: var(--accent); }
.stack__items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}
.stack__item {
  font-size: 13px;
  color: var(--fg);
  position: relative;
}
.stack__item + .stack__item::before {
  content: "·";
  color: var(--fg-dim);
  margin-right: 14px;
  margin-left: -14px;
}
.stack__row {
  display: contents;
}
.stack__row > .stack__cat,
.stack__row > .stack__items {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.stack__row:last-child > .stack__cat,
.stack__row:last-child > .stack__items {
  border-bottom: none;
  padding-bottom: 4px;
  margin-bottom: 0;
}

@media (max-width: 520px) {
  .stack { grid-template-columns: 1fr; gap: 4px; }
  .stack__row > .stack__cat { padding-top: 8px; padding-bottom: 4px; margin-bottom: 0; border-bottom: none; }
  .stack__row > .stack__items { padding-bottom: 8px; margin-bottom: 0; }
}

/* =========================================================
   EXPERIENCE — terminal history
   ========================================================= */
.exp { display: flex; flex-direction: column; gap: 0; }
.exp-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 12px 12px;
  margin: 0 -12px;
  border-radius: 5px;
  transition: background 0.15s var(--ease);
  position: relative;
}
.exp-row + .exp-row::before {
  content: "";
  position: absolute;
  left: 12px; right: 12px; top: 0;
  height: 1px;
  background: var(--line);
}
.exp-row:hover { background: var(--bg-row); }
.exp-row__year {
  font-size: 11.5px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.exp-row__main {
  min-width: 0;
}
.exp-row__role {
  font-size: 14px;
  color: var(--fg);
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.exp-row__role em {
  font-style: normal;
  color: var(--fg-muted);
  font-weight: 400;
  font-size: 12px;
}
.exp-row__co {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 2px;
  display: block;
}
.exp-row__loc {
  font-size: 11px;
  color: var(--fg-dim);
  white-space: nowrap;
}
.exp-row__now {
  display: inline-block;
  background: var(--accent);
  color: #0A0A0A;
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: scale(0.5);
}
.exp-row__now.is-revealed {
  animation: nowPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s forwards;
}
@keyframes nowPop {
  0%   { opacity: 0; transform: scale(0.5); box-shadow: 0 0 0 rgba(255, 204, 5, 0); }
  60%  { opacity: 1; transform: scale(1.15); box-shadow: 0 0 16px rgba(255, 204, 5, 0.8); }
  100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 rgba(255, 204, 5, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .exp-row__now { opacity: 1; transform: none; }
  .exp-row__now.is-revealed { animation: none; }
}
@media (max-width: 600px) {
  .exp-row { grid-template-columns: 1fr; gap: 2px; }
  .exp-row__loc { font-size: 10.5px; }
}

/* =========================================================
   PROCESS — 4-step block
   ========================================================= */
.proc { display: flex; flex-direction: column; gap: 4px; }
.proc-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: 6px;
  position: relative;
}
.proc-step::before {
  content: "";
  position: absolute;
  left: 30px; top: 38px; bottom: -4px;
  width: 1px;
  background: var(--line);
}
.proc-step:last-child::before { display: none; }
.proc-step__n {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg-row);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  height: 20px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
/* En light, mantenemos el "label oscuro con number amarillo" igual que dark.
   Sobre fondo claro, yellow#FFCC05 sobre un grey claro casi no se distingue. */
:root[data-theme="light"] .proc-step__n {
  background: #1A1A1A;
  border-color: #2A2A2A;
  color: var(--accent);
}
.proc-step__h {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  margin: 0 0 4px;
}
.proc-step__d {
  font-size: 13px;
  line-height: 1.65;
  color: var(--fg-muted);
  margin: 0 0 6px;
  max-width: 60ch;
}
.proc-step__tools {
  font-size: 11px;
  color: var(--fg-dim);
}
.proc-step__tools::before { content: "$ "; color: var(--accent); }

/* =========================================================
   CONTACT — code-block style
   ========================================================= */
.contact-block {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg-alt);
  overflow: hidden;
}
.contact-block__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-row);
  font-size: 11.5px;
  color: var(--fg-dim);
}
.contact-block__bar .dots { display: inline-flex; gap: 5px; }
.contact-block__bar .dots i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--fg-dim); display: block;
}
.contact-block__bar .dots i:nth-child(1) { background: #FF5F57; }
.contact-block__bar .dots i:nth-child(2) { background: #FEBC2E; }
.contact-block__bar .dots i:nth-child(3) { background: #28C840; }
.contact-block__bar .file { margin-left: 8px; color: var(--fg-muted); }

.contact-block__body {
  padding: 18px 18px 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-muted);
}
.contact-block__body .ln {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 0;
}
.contact-block__body .ln-no {
  color: var(--fg-dim);
  text-align: right;
  padding-right: 12px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.contact-block__body .ln-code { color: var(--fg); white-space: pre; overflow-x: auto; }
.contact-block__body .k    { color: #C792EA; }   /* keyword-ish purple */
.contact-block__body .prop { color: #FFCC05; }   /* yellow accent */
.contact-block__body .str  { color: #ABE9A8; }   /* soft green */
.contact-block__body .num  { color: #82AAFF; }   /* soft blue */
.contact-block__body .punc { color: var(--fg-dim); }
.contact-block__body a { color: inherit; border-bottom: 1px dashed var(--fg-dim); transition: border-color 0.15s var(--ease), color 0.15s var(--ease); }
.contact-block__body a:hover { border-color: var(--accent); color: var(--accent); }

:root[data-theme="light"] .contact-block__body .k { color: #6C42E2; }
:root[data-theme="light"] .contact-block__body .str { color: #2E7D32; }
:root[data-theme="light"] .contact-block__body .num { color: #1565C0; }
:root[data-theme="light"] .contact-block__body .prop { color: #BA8B00; }

.contact-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* =========================================================
   FOOTER — full brand lockup + prompt return
   ========================================================= */
.foot {
  padding: 28px var(--pad-x) 40px;
  border-top: 1px solid var(--line);
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.foot__brand {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.foot__logo {
  width: clamp(180px, 32vw, 240px);
  height: auto;
  display: block;
  filter: invert(1);
}
:root[data-theme="light"] .foot__logo { filter: none; }
.foot__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--fg-dim);
}
.foot__left { display: inline-flex; align-items: center; gap: 8px; }
.foot__left::before { content: "$"; color: var(--accent); }
.foot__left .caret {
  width: 6px; height: 11px;
  background: var(--accent);
  display: inline-block;
  animation: blink 1.1s steps(1, end) infinite;
  vertical-align: -1px;
  margin-left: 2px;
}
.foot__status { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-muted); }
.foot__status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* =========================================================
   CUSTOM SELECT — matches form input style, opens below
   ========================================================= */
.cselect {
  position: relative;
}
.cselect__btn {
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.cselect__btn:hover {
  background-color: var(--bg-row);
}
.cselect.is-open .cselect__btn {
  border-color: var(--accent);
  background-color: var(--bg-row);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.cselect__btn:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-row);
}
.cselect__val.is-placeholder { color: var(--fg-dim); }
.cselect__caret {
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
  transition: transform 0.2s var(--ease);
}
.cselect.is-open .cselect__caret { transform: rotate(180deg); }

.cselect__menu {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg-alt);
  border: 1px solid var(--accent);
  border-top-color: var(--line-2);
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
:root[data-theme="light"] .cselect__menu { box-shadow: 0 8px 24px rgba(0,0,0,0.10); }
.cselect__opt {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0;
  align-items: center;
  padding: 9px 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.12s var(--ease), color 0.12s var(--ease);
}
.cselect__opt:hover {
  background-color: var(--bg-row-h);
  color: var(--accent);
}
.cselect__opt.is-selected { color: var(--accent); }
.cselect__opt.is-placeholder { color: var(--fg-dim); }
.cselect__opt-mark {
  color: var(--accent);
  font-weight: 700;
}

/* =========================================================
   FORM — terminal-styled new-message panel
   ========================================================= */
.form-block {
  margin-top: 16px;
}
/* Wrapper interno animable que contiene el form o el fterm. Misma
   técnica que .proj-preview-wrap: overflow hidden + max-height transition.
   max-height en pixels transitiona confiable, a diferencia de
   grid-template-rows con fr units que el browser puede skipear cuando
   hay content swap (como pasa entre form view ↔ terminal view).

   Max-height por phase via modifier class:
   - .form-block__body--form: 720px desktop / 1100px mobile (radios stack
     vertical + más altura por single column layout).
   - .form-block__body--terminal: 320px (cubre fterm de 300px + buffer).

   Two-direction transition: collapse 520ms snappy, expand 880ms smooth.
   El timing se lee del end state — base es expand, .is-collapsed es collapse. */
.form-block__body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.88s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-block:not(.is-collapsed) .form-block__body--form     { max-height: 720px; }
.form-block:not(.is-collapsed) .form-block__body--terminal { max-height: 320px; }
.form-block.is-collapsed .form-block__body {
  max-height: 0;
  transition: max-height 0.52s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 600px) {
  /* En mobile el form__grid-2 colapsa a single column y el radio-group
     stacka vertical → el form natural llega a ~900px. 720px era el cap
     desktop y clipeaba todo lo de abajo (message + submit + sim). */
  .form-block:not(.is-collapsed) .form-block__body--form { max-height: 1100px; }
}
/* Terminal view: ALTURA FIJA del fterm para que no crezca mientras
   el typewriter va escribiendo. 300px cubre el caso más alto (failed
   con hint de 3 líneas + retry btn). */
.form-block .fterm {
  height: 300px;
}
.form {
  padding: 18px;
  display: grid;
  gap: 16px;
}
.form__grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .form__grid-2 { grid-template-columns: 1fr; }
}
.form__row {
  display: grid;
  gap: 6px;
}
.form__label {
  font-size: 11px;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.form__label::before { content: "// "; color: var(--accent); }
.form__label .req { color: var(--accent); margin-left: 2px; font-weight: 600; }
.form__input,
.form__select,
.form__textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.form__input::placeholder,
.form__textarea::placeholder { color: var(--fg-dim); }
.form__input:hover,
.form__select:hover,
.form__textarea:hover { border-color: var(--line-2); background-color: var(--bg-row); }
.form__input:focus,
.form__select:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-row);
}
.form__textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}
.form__input--err,
.form__input--err:hover,
.form__input--err:focus {
  border-color: #ff6b6b !important;
  background-color: rgba(255,107,107,0.04) !important;
}

.fterm__error-hint {
  font-size: 12.5px;
  color: var(--fg-muted);
  line-height: 1.6;
  margin: 2px 0;
  animation: fterm-hint-in 0.36s var(--ease) both;
}
@keyframes fterm-hint-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fterm__mailto {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity .15s;
}
.fterm__mailto:hover { opacity: .75; }
.form__select {
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
                    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: right 14px top 50%, right 8px top 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.form__select option { background: var(--bg); color: var(--fg); }

.form__submit-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 6px;
}
.form__hint {
  font-size: 11px;
  color: var(--fg-dim);
  flex: 1;
  min-width: 140px;
}
.form__hint::before { content: "↳ "; color: var(--accent); }

/* ── DEV SIMULATOR ─────────────────────────────────── */
.form__submit-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.form__hint {
  font-size: 11.5px;
  color: var(--fg-dim);
  letter-spacing: .02em;
  flex: 1;
}
.dev-sim {
  position: relative;
}
.dev-sim__btn {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--fg-dim);
  background: var(--bg-row);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  letter-spacing: .03em;
  transition: color .15s, border-color .15s;
}
.dev-sim__btn:hover { color: var(--accent); border-color: var(--accent); }
.dev-sim__menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--bg-alt);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  overflow: hidden;
  min-width: 160px;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.dev-sim__item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 11.5px;
  font-family: var(--mono);
  color: var(--fg-muted);
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .1s, color .1s;
}
.dev-sim__item:last-child { border-bottom: none; }
.dev-sim__item:hover { background: var(--bg-row-h); color: var(--fg); }
/* ─────────────────────────────────────────────────── */

.form__feedback {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  font-family: var(--mono);
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 4px;
  border-left: 2px solid;
  line-height: 1.5;
}
.form__feedback--ok {
  color: #4ade80;
  background: rgba(74,222,128,0.06);
  border-color: #4ade80;
}
.form__feedback--err {
  color: #ff6b6b;
  background: rgba(255,107,107,0.06);
  border-color: #ff6b6b;
}
.form__feedback-prefix {
  font-weight: 700;
  flex-shrink: 0;
  opacity: 0.7;
}

/* =========================================================
   FORM TERMINAL TRANSITION
   ========================================================= */

/* Form fades out on submit. Duración alineada con el collapse (0.52s). */
.form--fading {
  animation: form-exit .48s var(--ease) forwards;
  pointer-events: none;
}
@keyframes form-exit {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* Terminal container */
.fterm {
  padding: 24px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: fterm-in .3s var(--ease) both;
}
@keyframes fterm-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Log lines */
.fterm__log {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  font-family: var(--mono);
  margin-bottom: 28px;
}
.fterm__line {
  display: flex;
  align-items: center;
  min-height: 20px;
}
.fterm__cmd  { color: var(--fg-muted); letter-spacing: .02em; }
.fterm__res  { letter-spacing: .02em; }
.fterm--ok   { color: #4ade80; }
.fterm--err  { color: #ff6b6b; }
:root[data-theme="light"] .fterm--ok { color: #15803d; }
:root[data-theme="light"] .fterm--err { color: #b91c1c; }
.fterm__dim  { color: var(--fg-dim); }

/* Blinking cursor */
.fterm__cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: middle;
  animation: blink .9s step-end infinite;
}
.fterm__cursor--res {
  background: currentColor;
}

/* Thank you message */
.fterm__thanks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fterm__thanks-head {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
  letter-spacing: -.01em;
}
.fterm__thanks-sub {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.65;
  max-width: 46ch;
}
.fterm__reload {
  font-size: 11.5px;
  color: var(--fg-dim);
  letter-spacing: .03em;
  margin-top: 6px;
}

/* Dev sim inside terminal */
.dev-sim--term {
  margin-top: 20px;
  align-self: flex-start;
}

/* =========================================================
   PAGE LOGOTYPE — bottom brand mark
   ========================================================= */
.page-logotype {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px var(--pad-x) 32px;
  display: flex;
  justify-content: center;
}
.page-logotype__img {
  width: clamp(200px, 35vw, 320px);
  height: auto;
  display: block;
}

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

/* =========================================================
   EFFECTS LAYER — Scramble color, Terminal boot, Glitch, Typewriter caret
   ========================================================= */

/* Per-char states inside Scramble. Each char transitions independently:
   - cycling: accent color (yellow)
   - locked: smoothly fades to inherit (default text color)
   - hidden: visibility:hidden to reserve layout before reveal
   - kept: punctuation/space, no styling

   font-variant-ligatures: none → previene que dos chars random adyacentes
   formen una ligatura (e.g. '=>' → '⇒') durante el cycle, lo que cambia el
   ancho del cell. tabular-nums fuerza ancho fijo para dígitos. */
.s-cycling, .s-locked, .s-kept, .s-hidden {
  transition: color 0.28s ease, text-shadow 0.28s ease, opacity 0.2s ease;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0, "dlig" 0, "tnum" 1;
}
.s-cycling { color: var(--accent); opacity: 1; }
.s-locked, .s-kept { opacity: 1; }
.s-hidden { opacity: 0; }
/* .s-locked and .s-kept inherit color naturally */

/* Matrix mode override: cycling chars en amarillo brand con glow (ambos themes).
   Lo distintivo del matrix vs standard scramble es el pool katakana + el glow,
   no el color (el verde no encajaba con la paleta del site).
   Ancho 1ch forzado: katakana cae a system font (JetBrains Mono no tiene CJK)
   y podría renderear a anchos distintos → display: inline-block + width: 1ch
   garantiza alineación durante el cycle. */
.scramble--matrix .s-cycling {
  color: var(--accent);
  text-shadow:
    0 0 calc(6px  * var(--fx-scramble-glow, 1)) rgba(255, 204, 5, calc(0.9  * var(--fx-scramble-glow, 1))),
    0 0 calc(14px * var(--fx-scramble-glow, 1)) rgba(255, 204, 5, calc(0.55 * var(--fx-scramble-glow, 1))),
    0 0 calc(26px * var(--fx-scramble-glow, 1)) rgba(255, 204, 5, calc(0.3  * var(--fx-scramble-glow, 1)));
  display: inline-block;
  width: 1ch;
  text-align: center;
  vertical-align: baseline;
}
:root[data-theme="light"] .scramble--matrix .s-cycling {
  color: var(--accent);
  text-shadow:
    0 0 calc(6px  * var(--fx-scramble-glow, 1)) rgba(255, 170, 0, calc(0.95 * var(--fx-scramble-glow, 1))),
    0 0 calc(14px * var(--fx-scramble-glow, 1)) rgba(255, 170, 0, calc(0.6  * var(--fx-scramble-glow, 1))),
    0 0 calc(26px * var(--fx-scramble-glow, 1)) rgba(255, 170, 0, calc(0.35 * var(--fx-scramble-glow, 1)));
}

/* Glitch variant: text-shadow doesn't inherit by default — force per-char spans to pick it up */
.has-glitch span[class^="s-"] { text-shadow: inherit; }

/* Override: en combo matrix+glitch, los s-cycling mantienen el glow del matrix */
.has-glitch .scramble--matrix .s-cycling {
  text-shadow:
    0 0 calc(6px  * var(--fx-scramble-glow, 1)) rgba(255, 204, 5, calc(0.9  * var(--fx-scramble-glow, 1))),
    0 0 calc(14px * var(--fx-scramble-glow, 1)) rgba(255, 204, 5, calc(0.55 * var(--fx-scramble-glow, 1))),
    0 0 calc(26px * var(--fx-scramble-glow, 1)) rgba(255, 204, 5, calc(0.3  * var(--fx-scramble-glow, 1)));
}
:root[data-theme="light"] .has-glitch .scramble--matrix .s-cycling {
  text-shadow:
    0 0 calc(6px  * var(--fx-scramble-glow, 1)) rgba(255, 170, 0, calc(0.95 * var(--fx-scramble-glow, 1))),
    0 0 calc(14px * var(--fx-scramble-glow, 1)) rgba(255, 170, 0, calc(0.6  * var(--fx-scramble-glow, 1))),
    0 0 calc(26px * var(--fx-scramble-glow, 1)) rgba(255, 170, 0, calc(0.35 * var(--fx-scramble-glow, 1)));
}

/* Scroll lock mientras el boot está activo. El contenido está montado
   por detrás del overlay pero no queremos que el user pueda scrollear
   ni hacer scroll por inercia / touch / wheel. */
:root.has-boot:not(.is-after-boot),
:root.has-boot:not(.is-after-boot) body {
  overflow: hidden;
  height: 100vh;
  touch-action: none;
  overscroll-behavior: none;
}

/* Terminal boot overlay — centered both axes. Opaco desde el frame 0
   para que no haya flash de contenido detrás. */
.terminal-boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #050505;
  color: #e8e8e8;
  font-family: var(--mono);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.terminal-boot__inner {
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.terminal-boot__line {
  opacity: 0;
  animation: bootLineIn 0.18s ease-out forwards;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}
.terminal-boot__cmd { flex-shrink: 0; }
.terminal-boot__dots {
  flex: 1 1 auto;
  min-width: 12px;
  align-self: flex-end;
  height: 1em;
  background-image: radial-gradient(circle, currentColor 0.7px, transparent 1.4px);
  background-size: 6px 100%;
  background-repeat: repeat-x;
  background-position: 0 75%;
  opacity: 0.4;
}
.terminal-boot__ok {
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 600;
}
@media (max-width: 600px) {
  .terminal-boot { padding: 16px; font-size: 11.5px; }
  .terminal-boot__inner { gap: 6px; }
  .terminal-boot__line { gap: 6px; }
}
.terminal-boot__line:nth-child(1) { animation-delay: 0ms; }
.terminal-boot__line:nth-child(2) { animation-delay: 60ms; }
.terminal-boot__line:nth-child(3) { animation-delay: 120ms; }
.terminal-boot__line:nth-child(4) { animation-delay: 180ms; }
.terminal-boot__line:nth-child(5) { animation-delay: 240ms; }
.terminal-boot__line:nth-child(6) { animation-delay: 300ms; }
.terminal-boot__cursor {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  animation: bootCursor 0.9s steps(1) infinite;
}
@keyframes bootLineIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@keyframes bootCursor { 50% { opacity: 0; } }

/* No pre-boot hide ni post-boot animation. El boot overlay (z-index 9999)
   ya cubre todo. Cuando termina, el contenido es visible inmediatamente.
   El "efecto de entrada" lo da el Scramble en el texto, que ya tiene gate
   para esperar a is-after-boot antes de disparar. */

/* Typewriter caret (only while typing) */
.is-typing::after {
  content: "▍";
  display: inline-block;
  margin-left: 1px;
  color: var(--accent);
  font-weight: 400;
  animation: typeCaret 0.65s steps(1) infinite;
}
@keyframes typeCaret { 50% { opacity: 0; } }

/* Glitch effect — variant e. CONSTANT text-shadow visible at rest + frequent flicker spikes.
   Em units so el shadow escala con el font-size de cada elemento — kicker 13px y h1 50px
   tienen el mismo porcentaje de RGB offset, no se ve más distorsionado uno que otro. */
.has-glitch .section__h,
.has-glitch .proj__title,
.has-glitch .hero__name,
.has-glitch .svc-item__h,
.has-glitch .exp-row__role,
.has-glitch .proc-step__h,
.has-glitch .stack__cat,
.has-glitch .hero__line {
  text-shadow:
    calc(0.06em * var(--fx-glitch-distort, 1)) 0 0 rgba(255, 60, 60, calc(0.5 * var(--fx-glitch-distort, 1))),
    calc(-0.06em * var(--fx-glitch-distort, 1)) 0 0 rgba(60, 200, 255, calc(0.5 * var(--fx-glitch-distort, 1)));
  animation: glitchFlicker var(--fx-glitch-freq, 2.4s) linear infinite;
  will-change: transform, text-shadow;
}
.has-glitch .hero__name   { animation-delay: 0.0s; }
.has-glitch .section__h   { animation-delay: 0.3s; }
.has-glitch .proj__title  { animation-delay: 0.8s; }
.has-glitch .svc-item__h  { animation-delay: 1.2s; }
.has-glitch .exp-row__role{ animation-delay: 1.6s; }
.has-glitch .proc-step__h { animation-delay: 2.0s; }

/* Glitch sutil en los botones --accent (los amarillos principales).
   Yellow glow constante + RGB chromatic aberration en los spikes (cyberpunk). */
.has-glitch .btn--accent {
  box-shadow:
    0 0 calc(8px  * var(--fx-btn-glow, 1)) rgba(255, 204, 5, calc(0.25 * var(--fx-btn-glow, 1))),
    0 0 calc(26px * var(--fx-btn-glow, 1)) rgba(255, 204, 5, calc(0.10 * var(--fx-btn-glow, 1))),
    0 0 calc(44px * var(--fx-btn-glow, 1)) rgba(255, 204, 5, calc(0.15 * var(--fx-btn-glow, 1)));
  animation: btnGlitch 3.6s linear infinite;
  animation-delay: 1s;
  will-change: transform, box-shadow;
}
@keyframes btnGlitch {
  /* Base glow — usa vars del FxPanel para live tweak */
  0%, 78%, 86%, 95%, 100% {
    transform: translateX(0);
    box-shadow:
      0 0 calc(8px  * var(--fx-btn-glow, 1)) rgba(255, 204, 5, calc(0.25 * var(--fx-btn-glow, 1))),
      0 0 calc(26px * var(--fx-btn-glow, 1)) rgba(255, 204, 5, calc(0.10 * var(--fx-btn-glow, 1))),
      0 0 calc(44px * var(--fx-btn-glow, 1)) rgba(255, 204, 5, calc(0.15 * var(--fx-btn-glow, 1)));
  }
  /* Spike: halo colapsa para que la RGB chromatic se vea.
     Usa --fx-btn-spike para escalar la chromatic aberration */
  80% {
    transform: translateX(calc(-4px * var(--fx-btn-spike, 1)));
    box-shadow:
      calc(6px * var(--fx-btn-spike, 1)) 0 0 -1px rgba(255, 60, 60, var(--fx-btn-spike, 1)),
      calc(-6px * var(--fx-btn-spike, 1)) 0 0 -1px rgba(60, 200, 255, var(--fx-btn-spike, 1)),
      0 0 8px rgba(255, 204, 5, calc(0.3 * var(--fx-btn-glow, 1)));
  }
  82% {
    transform: translateX(calc(5px * var(--fx-btn-spike, 1))) translateY(-1px);
    box-shadow:
      calc(-8px * var(--fx-btn-spike, 1)) 0 0 -1px rgba(255, 60, 60, var(--fx-btn-spike, 1)),
      calc(8px * var(--fx-btn-spike, 1)) 0 0 -1px rgba(60, 200, 255, var(--fx-btn-spike, 1)),
      0 0 6px rgba(255, 204, 5, calc(0.2 * var(--fx-btn-glow, 1)));
  }
  84% {
    transform: translateX(calc(-3px * var(--fx-btn-spike, 1))) translateY(1px);
    box-shadow:
      calc(7px * var(--fx-btn-spike, 1)) 0 0 -1px rgba(255, 60, 60, var(--fx-btn-spike, 1)),
      calc(-7px * var(--fx-btn-spike, 1)) 0 0 -1px rgba(60, 200, 255, var(--fx-btn-spike, 1)),
      0 0 8px rgba(255, 204, 5, calc(0.3 * var(--fx-btn-glow, 1)));
  }
  /* Pulso de glow intermedio sin RGB — escala glow x1.4 */
  92% {
    box-shadow:
      0 0 calc(12px * var(--fx-btn-glow, 1) * 1.5) rgba(255, 204, 5, calc(0.4 * var(--fx-btn-glow, 1))),
      0 0 calc(36px * var(--fx-btn-glow, 1) * 1.4) rgba(255, 204, 5, calc(0.20 * var(--fx-btn-glow, 1))),
      0 0 calc(60px * var(--fx-btn-glow, 1) * 1.3) rgba(255, 204, 5, calc(0.25 * var(--fx-btn-glow, 1)));
  }
}

/* Glitch en la foto del hero — translate + filter shifts periódicos */
.has-glitch .hero__avatar {
  animation: avatarGlitch 3.2s linear infinite;
  animation-delay: 1.4s;
  will-change: transform, filter;
}
@keyframes avatarGlitch {
  0%, 78%, 100% { transform: translate(0); filter: none; }
  80% { transform: translate(-2px, 0); filter: hue-rotate(20deg) contrast(1.06) saturate(1.15); }
  82% { transform: translate(3px, 1px); filter: hue-rotate(-30deg) saturate(1.4) brightness(1.05); }
  83% { transform: translate(-1px, -2px); filter: hue-rotate(15deg) contrast(1.1); }
  85% { transform: translate(2px, 0); filter: hue-rotate(-12deg) saturate(1.2); }
  86% { transform: translate(0); filter: none; }
  93% { transform: translate(1px, 0); filter: hue-rotate(10deg) saturate(1.15); }
  94% { transform: translate(0); filter: none; }
}

/* ============================================
   ENTRY FX — elementos no-texto se incorporan con efecto cyberpunk
   - Buttons: hard snap + brightness flash (sin transition suave)
   - Images / cards: scan-line reveal (clip-path top→bottom + opacity)
   La clase .fx-entered la agrega un IntersectionObserver en App.jsx
   cuando el elemento entra al viewport (espera al boot si está activo).
   ============================================ */

/* Estado inicial: invisible. Solo en variants con glitch */
.has-glitch .btn,
.has-glitch .hero__avatar,
.has-glitch .proj-preview__card,
.has-glitch .contact-block,
.has-glitch .hero__status,
.has-glitch .proj--cta,
.has-glitch .about__stats,
.has-glitch .tier {
  opacity: 0;
}

/* Buttons: CRT TV power-on. Arranca como línea horizontal delgada
   (scaleY casi 0), se expande verticalmente a tamaño completo con
   flash de brightness. Como prender una TV vieja.
   El transform no choca con btnGlitch (delay 1s) porque btnEntry
   termina antes. */
.has-glitch .btn {
  transform-origin: center center;
}
.has-glitch .btn.fx-entered {
  animation: btnEntry 1.1s cubic-bezier(0.18, 0.6, 0.2, 1) both;
  animation-delay: var(--fx-delay, 0ms);
}
/* Override: en btn--accent debe correr btnEntry Y btnGlitch.
   El selector .btn--accent.fx-entered tiene specificity 30, igual que
   .has-glitch .btn.fx-entered. Pero como agregamos .has-glitch acá,
   sube a 30 + 1 elemento = más específico. Compone ambas animations:
   - btnEntry corre 1.1s una sola vez (entrada TV power-on)
   - btnGlitch arranca con animation-delay y corre infinite */
.has-glitch .btn--accent.fx-entered {
  animation:
    btnEntry 1.1s cubic-bezier(0.18, 0.6, 0.2, 1) both,
    btnGlitch var(--fx-btn-cycle, 3.6s) linear infinite;
  animation-delay: var(--fx-delay, 0ms), calc(var(--fx-delay, 0ms) + 1.3s);
}
/* TV power-on más dramático: punto inicial → línea blanca brillante →
   parpadeo de línea → expansión rápida con overshoot → settle.
   1.1s total para que se aprecie cada fase. */
@keyframes btnEntry {
  /* Off → punto encendido */
  0%   { opacity: 0; transform: scaleY(0) scaleX(0.6); filter: brightness(0); }
  /* Snap-on: el haz vertical aparece muy brillante (overshoot horizontal) */
  4%   { opacity: 1; transform: scaleY(0.025) scaleX(1.08); filter: brightness(6) saturate(2.2); }
  /* La línea se mantiene encendida, brillante */
  10%  { opacity: 1; transform: scaleY(0.025) scaleX(1); filter: brightness(4.5) saturate(2); }
  /* Parpadeo: la línea tiembla brevemente (vieja TV) */
  14%  { opacity: 0.85; transform: scaleY(0.02) scaleX(0.98); filter: brightness(3.2); }
  18%  { opacity: 1; transform: scaleY(0.03) scaleX(1.02); filter: brightness(5) saturate(2); }
  22%  { opacity: 1; transform: scaleY(0.025) scaleX(1); filter: brightness(4); }
  /* Hold: línea estable un instante antes de expandir */
  35%  { opacity: 1; transform: scaleY(0.04) scaleX(1); filter: brightness(3); }
  /* Expansión vertical: la línea crece a tamaño full */
  60%  { opacity: 1; transform: scaleY(1.08) scaleX(1); filter: brightness(2) saturate(1.5); }
  /* Overshoot bounce */
  75%  { opacity: 1; transform: scaleY(0.96) scaleX(1); filter: brightness(1.4) saturate(1.2); }
  85%  { opacity: 1; transform: scaleY(1.02) scaleX(1); filter: brightness(1.15); }
  /* Settle final */
  100% { opacity: 1; transform: scaleY(1) scaleX(1); filter: none; }
}

/* Images & cards: scan-line reveal — clip-path top→bottom + opacity rise.
   Durations diferenciadas por tamaño del elemento (más grande = más lenta). */
.has-glitch .hero__avatar.fx-entered,
.has-glitch .proj-preview__card.fx-entered,
.has-glitch .contact-block.fx-entered,
.has-glitch .hero__status.fx-entered,
.has-glitch .proj--cta.fx-entered,
.has-glitch .about__stats.fx-entered,
.has-glitch .tier.fx-entered {
  animation: scanReveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--fx-delay, 0ms);
}
/* Cards/bloques grandes — duration más larga para que se aprecie */
.has-glitch .proj-preview__card.fx-entered,
.has-glitch .contact-block.fx-entered,
.has-glitch .tier.fx-entered {
  animation-duration: 1.15s;
}
.has-glitch .hero__avatar.fx-entered {
  animation-duration: 1s;
}
.has-glitch .hero__status.fx-entered {
  animation-duration: 0.65s;
}
@keyframes scanReveal {
  0%   { opacity: 0; clip-path: inset(0 0 100% 0); }
  60%  { opacity: 1; }
  100% { opacity: 1; clip-path: inset(0 0 0 0); }
}

/* Scan-line visible — barra amarilla brillante que recorre el elemento
   durante el reveal. Usa wrapper via ::after en cards/divs (no en imgs). */
.has-glitch .proj-preview__card,
.has-glitch .contact-block,
.has-glitch .hero__status,
.has-glitch .proj--cta,
.has-glitch .about__stats,
.has-glitch .tier {
  position: relative;
  overflow: hidden;
}
.has-glitch .proj-preview__card.fx-entered::after,
.has-glitch .contact-block.fx-entered::after,
.has-glitch .hero__status.fx-entered::after,
.has-glitch .proj--cta.fx-entered::after,
.has-glitch .about__stats.fx-entered::after,
.has-glitch .tier.fx-entered::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 204, 5, 0.9), 0 0 22px rgba(255, 204, 5, 0.5);
  pointer-events: none;
  z-index: 5;
  animation: scanLineSweep 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--fx-delay, 0ms);
}
.has-glitch .proj-preview__card.fx-entered::after,
.has-glitch .contact-block.fx-entered::after,
.has-glitch .tier.fx-entered::after {
  animation-duration: 1.15s;
}
.has-glitch .hero__status.fx-entered::after {
  animation-duration: 0.65s;
}
@keyframes scanLineSweep {
  0%   { opacity: 0; top: 0; }
  10%  { opacity: 1; top: 0; }
  90%  { opacity: 1; top: calc(100% - 2px); }
  100% { opacity: 0; top: calc(100% - 2px); }
}

/* Hover trigger — heavier shake */
.has-glitch .section__h:hover,
.has-glitch .proj--expandable:hover .proj__title,
.has-glitch .proj:hover .proj__title,
.has-glitch .hero__name:hover {
  animation: glitchShake 0.36s steps(8, end) 2;
}
@keyframes glitchShake {
  0%   { transform: translate(0, 0);      text-shadow: 0.09em 0 rgba(255,60,60,0.85), -0.09em 0 rgba(60,200,255,0.85); }
  20%  { transform: translate(-3px, 1px); text-shadow: -0.12em 0 rgba(255,60,60,0.95), 0.12em 0 rgba(60,200,255,0.95); }
  40%  { transform: translate(3px, -1px); text-shadow: 0.12em 0 rgba(255,60,60,0.9), -0.12em 0 rgba(60,200,255,0.9); }
  60%  { transform: translate(-2px, 2px); text-shadow: -0.09em 0.04em rgba(255,60,60,0.95), 0.09em -0.04em rgba(60,200,255,0.95); }
  80%  { transform: translate(2px, -2px); text-shadow: 0.09em 0 rgba(255,60,60,0.8), -0.09em 0 rgba(60,200,255,0.8); }
  100% { transform: translate(0, 0);      text-shadow: 0.09em 0 rgba(255,60,60,0.85), -0.09em 0 rgba(60,200,255,0.85); }
}

/* Flicker keyframes — constant base shadow + spike every cycle.
   Usa --fx-glitch-distort para escalar todo el efecto (em + opacity). */
@keyframes glitchFlicker {
  /* Base calm */
  0%, 82%, 88%, 94%, 100% {
    transform: translate(0, 0);
    text-shadow:
      calc(0.06em * var(--fx-glitch-distort, 1)) 0 0 rgba(255, 60, 60, calc(0.5 * var(--fx-glitch-distort, 1))),
      calc(-0.06em * var(--fx-glitch-distort, 1)) 0 0 rgba(60, 200, 255, calc(0.5 * var(--fx-glitch-distort, 1)));
  }
  /* Spike: offsets escalados x1.7-2x respecto al em base + opacity x1.7-1.8 */
  84% {
    transform: translate(-2px, 0);
    text-shadow:
      calc(0.06em * var(--fx-glitch-distort, 1) * 1.7) 0 0 rgba(255, 60, 60, calc(0.5 * var(--fx-glitch-distort, 1) * 1.7)),
      calc(-0.06em * var(--fx-glitch-distort, 1) * 1.7) 0 0 rgba(60, 200, 255, calc(0.5 * var(--fx-glitch-distort, 1) * 1.7));
  }
  85% {
    transform: translate(2px, -1px);
    text-shadow:
      calc(-0.06em * var(--fx-glitch-distort, 1) * 2) 0 0 rgba(255, 60, 60, calc(0.5 * var(--fx-glitch-distort, 1) * 1.8)),
      calc(0.06em * var(--fx-glitch-distort, 1) * 2) 0 0 rgba(60, 200, 255, calc(0.5 * var(--fx-glitch-distort, 1) * 1.8));
  }
  86% {
    transform: translate(-1px, 1px);
    text-shadow:
      calc(0.06em * var(--fx-glitch-distort, 1) * 1.5) 0 0 rgba(255, 60, 60, calc(0.5 * var(--fx-glitch-distort, 1) * 1.5)),
      calc(-0.06em * var(--fx-glitch-distort, 1) * 1.5) 0 0 rgba(60, 200, 255, calc(0.5 * var(--fx-glitch-distort, 1) * 1.5));
  }
  /* Pulso intermedio sin shake — escalado x1.2 */
  92% {
    transform: translate(1px, 0);
    text-shadow:
      calc(-0.06em * var(--fx-glitch-distort, 1) * 1.2) 0 0 rgba(255, 60, 60, calc(0.5 * var(--fx-glitch-distort, 1) * 1.3)),
      calc(0.06em * var(--fx-glitch-distort, 1) * 1.2) 0 0 rgba(60, 200, 255, calc(0.5 * var(--fx-glitch-distort, 1) * 1.3));
  }
}

/* Scanline overlay across the page.
   Usa --fx-scanlines para escalar opacity (multiplier 0-2) */
.has-glitch body::after,
:root.has-glitch::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.04) 0px,
      rgba(255,255,255,0.04) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: overlay;
  opacity: var(--fx-scanlines, 1);
}

/* Periodic horizontal slice glitch over hero */
.has-glitch .hero::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 30%;
  height: 8px;
  background: rgba(60, 200, 255, 0.35);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 5;
  animation: glitchSlice 6s steps(60, end) infinite;
  opacity: 0;
}
@keyframes glitchSlice {
  0%, 100% { opacity: 0; transform: translateY(0); }
  4%       { opacity: 0.6; transform: translateY(40px); }
  6%       { opacity: 0;   transform: translateY(120px); }
  53%      { opacity: 0;   transform: translateY(-20px); }
  55%      { opacity: 0.8; transform: translateY(180px); }
  57%      { opacity: 0;   transform: translateY(220px); }
}
/* position: relative para anclar el slice glitch ::before. NO usamos
   overflow: hidden porque clipeaba el box-shadow del btn--accent (el
   yellow glow se cortaba en el borde inferior del hero). El slice
   viaja máximo ~220px desde top 30% — se queda dentro de los límites
   del hero en cualquier viewport razonable. */
.has-glitch .hero { position: relative; }

/* ============================================
   FX PANEL — live tweak panel (variant matrix/glitch only)
   ============================================ */
.fx-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9500;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg);
}
.fx-panel__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: rgba(15, 15, 15, 0.92);
  color: var(--fg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
:root[data-theme="light"] .fx-panel__toggle {
  background: rgba(255, 255, 255, 0.94);
  color: var(--fg);
}
.fx-panel__toggle:hover { border-color: var(--accent); color: var(--accent); }
.fx-panel__toggle-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 204, 5, 0.6);
  animation: pulse-ring 2.2s ease-in-out infinite;
}
.fx-panel.is-open .fx-panel__toggle { border-color: var(--accent); color: var(--accent); }

.fx-panel__body {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 320px;
  max-height: min(70vh, 600px);
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 15, 0.96);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
:root[data-theme="light"] .fx-panel__body {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}
.fx-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.fx-panel__close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.fx-panel__close:hover { color: var(--fg); background: var(--bg-row); }

.fx-panel__sliders {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fx-panel__sliders::-webkit-scrollbar { width: 6px; }
.fx-panel__sliders::-webkit-scrollbar-track { background: transparent; }
.fx-panel__sliders::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 3px;
}

.fx-row { display: flex; flex-direction: column; gap: 5px; }
.fx-row__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--fg-muted);
}
.fx-row__val {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
}
.fx-row input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.fx-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
  transition: transform 0.12s var(--ease);
}
.fx-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.fx-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
}

.fx-panel__actions {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}
:root[data-theme="light"] .fx-panel__actions { background: rgba(0, 0, 0, 0.03); }
.fx-panel__btn {
  flex: 1;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.fx-panel__btn--reset {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--line-2);
}
.fx-panel__btn--reset:hover { color: var(--fg); border-color: var(--line-2); }
.fx-panel__btn--copy {
  background: var(--accent);
  color: #0A0A0A;
  border: 1px solid var(--accent);
}
.fx-panel__btn--copy:hover { transform: translateY(-1px); }
.fx-panel__btn--reboot {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.fx-panel__btn--reboot:hover {
  background: var(--accent);
  color: #0A0A0A;
}

/* Pool selector — chip-style buttons en fila */
.fx-pool {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.fx-pool__btn {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.fx-pool__btn:hover {
  color: var(--fg);
  border-color: var(--line-2);
}
.fx-pool__btn.is-selected {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 204, 5, 0.06);
}

/* Color swatches — round chips para cambiar --accent */
.fx-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fx-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.fx-swatch:hover {
  transform: scale(1.12);
  border-color: var(--fg-muted);
}
.fx-swatch.is-selected {
  border-color: var(--fg);
  transform: scale(1.08);
}
.fx-swatch.is-selected::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--fg);
  opacity: 0.4;
}
/* Botón rainbow al lado de los presets que abre el custom picker */
.fx-swatch--custom {
  background: conic-gradient(
    from 180deg,
    #ff3030, #ffce30, #4eff30, #30ffe0, #305cff, #ce30ff, #ff3030
  );
}

/* Custom color picker — SV square + hue slider tipo Photoshop.
   Aparece debajo de la fila de swatches cuando se togglea. */
.fx-picker {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  height: 140px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.fx-picker__sv {
  flex: 1;
  position: relative;
  cursor: crosshair;
  border-radius: 5px;
  /* Sobre el hue actual: gradient horizontal blanco→hue, vertical transparente→negro */
  background:
    linear-gradient(to bottom, transparent, #000),
    linear-gradient(to right, #fff, var(--picker-hue, #f00));
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.fx-picker__sv-cursor {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 4px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.fx-picker__hue {
  width: 16px;
  position: relative;
  cursor: ns-resize;
  border-radius: 5px;
  /* Full hue spectrum, top→bottom: red → yellow → green → cyan → blue → magenta → red */
  background: linear-gradient(to bottom,
    #ff0000 0%, #ffff00 16.66%, #00ff00 33.33%, #00ffff 50%,
    #0000ff 66.66%, #ff00ff 83.33%, #ff0000 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.fx-picker__hue-cursor {
  position: absolute;
  left: -3px;
  right: -3px;
  height: 4px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: 2px;
  transform: translateY(-50%);
  pointer-events: none;
}

@media (max-width: 600px) {
  .fx-panel { right: 12px; bottom: 12px; }
  .fx-panel__body { width: min(92vw, 320px); }
}

/* ============================================
   MASTER FX OFF — neutraliza todos los efectos visualmente
   El toggle en el navbar pone .fx-off en <html>. El usuario que
   quiera leer sin animaciones lo puede usar como master switch.
   ============================================ */

/* Scramble: cualquier estado de char se ve como locked normal */
.fx-off .s-cycling,
.fx-off .s-hidden,
.fx-off .s-locked,
.fx-off .s-kept {
  color: inherit !important;
  text-shadow: none !important;
  opacity: 1 !important;
  transition: none !important;
  display: inline !important;
  width: auto !important;
}

/* Glitch flicker animations — off */
.fx-off .section__h,
.fx-off .proj__title,
.fx-off .hero__name,
.fx-off .svc-item__h,
.fx-off .exp-row__role,
.fx-off .proc-step__h,
.fx-off .stack__cat,
.fx-off .hero__line {
  animation: none !important;
  text-shadow: none !important;
  transform: none !important;
}

/* Btn glitch — off */
.fx-off .btn--accent {
  animation: none !important;
  box-shadow: none !important;
}

/* Avatar glitch — off */
.fx-off .hero__avatar {
  animation: none !important;
  filter: none !important;
}

/* Entry FX — reveal inmediato sin animaciones */
.fx-off .btn,
.fx-off .hero__avatar,
.fx-off .proj-preview__card,
.fx-off .contact-block,
.fx-off .hero__status,
.fx-off .proj--cta,
.fx-off .about__stats,
.fx-off .tier {
  opacity: 1 !important;
  animation: none !important;
  clip-path: none !important;
  transform: none !important;
}
.fx-off .btn,
.fx-off .hero__avatar,
.fx-off .proj-preview__card,
.fx-off .contact-block,
.fx-off .hero__status,
.fx-off .proj--cta,
.fx-off .about__stats,
.fx-off .tier {
  /* duplicado para sobreescribir el initial state */
  opacity: 1 !important;
}

/* NOW badge — visible inmediato */
.fx-off .exp-row__now {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* Scan-line sweep ::after — off */
.fx-off .proj-preview__card::after,
.fx-off .contact-block::after,
.fx-off .hero__status::after,
.fx-off .proj--cta::after,
.fx-off .about__stats::after,
.fx-off .tier::after,
.fx-off body::after,
.fx-off::after,
.fx-off .hero::before {
  display: none !important;
}

/* Hero status pulse-ring — off */
.fx-off .hero__status .dot::after {
  animation: none !important;
}

/* FxPanel widget — oculto en master fx off */
.fx-off .fx-panel {
  display: none !important;
}

/* ============================================
   TIER CTA — button at the bottom of each tier card
   ============================================ */
.tier__cta {
  width: 100%;
  justify-content: center;
  margin-top: 18px;
  font-size: 12px;
}
.tier__body { display: flex; flex-direction: column; }
.tier__body > p { flex: 1; }

/* ============================================
   FORM RADIO GROUP (tier preselect)
   ============================================ */
.form__row--tier { margin-top: 4px; }
.form__radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 600px) {
  .form__radio-group { grid-template-columns: 1fr; }
}
.form__radio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--fg-muted);
  background: var(--bg);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.form__radio:hover { border-color: var(--accent); color: var(--fg); }
.form__radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}
.form__radio input[type="radio"]:checked {
  border-color: var(--accent);
}
.form__radio input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--accent);
}
.form__radio.is-selected {
  border-color: var(--accent);
  color: var(--fg);
  background: rgba(255, 204, 5, 0.06);
}
