/* ═══════════════════════════════════════════════════════════════════════
   FlowHarmony — Public homepage (encapsulated)

   Scope rules:
   - Every selector is prefixed `fh-hp-` and lives ONLY in this file.
   - This stylesheet is never loaded by the Studio; the Studio's
     static/css/styles.css is never loaded here. No shared cascade.
   - Colours echo the Studio tokens (#00f0cc / #b89dfa / near-black) so the
     landing and the app read as the same product, but they are declared
     locally: nothing here depends on the Studio's :root.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --hp-bg:        #07080d;
  --hp-bg-2:      #0b0d15;
  --hp-ink:       #f2f3f8;
  --hp-ink-soft:  #a9b0c6;
  /* Measured against --hp-bg: this is the darkest tertiary ink that still
     clears WCAG AA (4.5:1) for the small mono labels that use it. */
  --hp-ink-faint: #7d859b;
  --hp-line:      rgba(255, 255, 255, 0.09);
  --hp-line-2:    rgba(255, 255, 255, 0.16);
  --hp-panel:     rgba(255, 255, 255, 0.035);

  /* Semantic layer colours — each one means a musical dimension. */
  --hp-teal:   #00f0cc;   /* acordes  */
  --hp-mint:   #7ce8b0;   /* tonalidad */
  --hp-purple: #b89dfa;   /* ritmo    */
  --hp-gold:   #fcd34d;   /* estructura */
  --hp-pink:   #f9a8d4;   /* letra    */
  --hp-blue:   #93c5fd;   /* melodía  */

  --hp-accent: var(--hp-teal);

  --hp-r-sm: 8px;
  --hp-r-md: 12px;
  --hp-r-lg: 18px;
  --hp-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --hp-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hp-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body.fh-hp {
  margin: 0;
  background: var(--hp-bg);
  color: var(--hp-ink);
  font-family: var(--hp-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.fh-hp img, .fh-hp svg { max-width: 100%; }

/* Link reset. Anything that needs its own colour must out-specify this rule —
   hence the `.fh-hp` prefix on the button and skip-link rules below. */
.fh-hp a { color: inherit; text-decoration: none; }

.fh-hp :focus-visible {
  outline: 2px solid var(--hp-teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.fh-hp-shell {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.fh-hp .fh-hp-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--hp-r-sm);
  background: var(--hp-teal);
  color: #04120f;
  font-weight: 600;
  transition: top 0.2s var(--hp-ease);
}
.fh-hp .fh-hp-skip:focus { top: 16px; }

/* ── Typography ──────────────────────────────────────────────────────── */

.fh-hp-eyebrow {
  margin: 0 0 14px;
  font-family: var(--hp-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hp-teal);
}

.fh-hp-h1 {
  margin: 0 0 20px;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.fh-hp-h2 {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.fh-hp-lead {
  margin: 0 0 30px;
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.5vw, 1.14rem);
  color: var(--hp-ink-soft);
}
.fh-hp-lead strong { color: var(--hp-ink); font-weight: 600; }

.fh-hp-section-lead {
  margin: 0;
  max-width: 56ch;
  color: var(--hp-ink-soft);
}

.fh-hp-note {
  margin: 22px 0 0;
  font-size: 0.86rem;
  color: var(--hp-ink-faint);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.fh-hp .fh-hp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--hp-r-sm);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s var(--hp-ease),
              border-color 0.18s var(--hp-ease),
              transform 0.18s var(--hp-ease),
              box-shadow 0.18s var(--hp-ease);
}

.fh-hp .fh-hp-btn-lg { padding: 14px 24px; font-size: 1rem; }

.fh-hp .fh-hp-btn-primary {
  background: var(--hp-teal);
  color: #04120f;
  box-shadow: 0 8px 26px rgba(0, 240, 204, 0.16);
}
.fh-hp .fh-hp-btn-primary:hover {
  background: #4bf6da;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 240, 204, 0.26);
}
.fh-hp .fh-hp-btn-primary:active { transform: translateY(0); }

.fh-hp .fh-hp-btn-ghost {
  border-color: var(--hp-line-2);
  color: var(--hp-ink);
  background: transparent;
}
.fh-hp .fh-hp-btn-ghost:hover {
  border-color: var(--hp-teal);
  background: rgba(0, 240, 204, 0.07);
}

/* ── Top bar ─────────────────────────────────────────────────────────── */

.fh-hp-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 8, 13, 0.82);
  border-bottom: 1px solid var(--hp-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Cabezal de lectura: el mismo gesto que el playhead del hero, aplicado a la
   página entera. 1 px, sin desplazar layout, sin coste de repintado real. */
.fh-hp-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 100%;
  transform: scaleX(var(--hp-progress, 0));
  transform-origin: left;
  background: linear-gradient(90deg, rgba(0, 240, 204, 0.35), var(--hp-teal));
}

/* Disclosure de navegación móvil: oculto por defecto, el CSS de ≤760px lo
   muestra. Sin librerías, sin overlay a pantalla completa. */
.fh-hp-navtoggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--hp-line-2);
  border-radius: var(--hp-r-sm);
  background: transparent;
  color: var(--hp-ink);
  cursor: pointer;
  transition: border-color 0.2s var(--hp-ease), background-color 0.2s var(--hp-ease);
}
.fh-hp-navtoggle:hover { border-color: var(--hp-teal); }

/* Las tres barras repiten las capas del logo, con los mismos anchos desiguales. */
.fh-hp-navtoggle-mark { display: grid; gap: 3.5px; width: 17px; }
.fh-hp-navtoggle-mark i {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: width 0.26s var(--hp-ease), transform 0.26s var(--hp-ease);
}
.fh-hp-navtoggle-mark i:nth-child(1) { width: 11px; }
.fh-hp-navtoggle-mark i:nth-child(2) { width: 17px; }
.fh-hp-navtoggle-mark i:nth-child(3) { width: 8px; }
.fh-hp-navtoggle[aria-expanded="true"] { border-color: var(--hp-teal); color: var(--hp-teal); }
.fh-hp-navtoggle[aria-expanded="true"] .fh-hp-navtoggle-mark i { width: 17px; }

.fh-hp-mobilenav {
  border-top: 1px solid var(--hp-line);
  background: rgba(7, 8, 13, 0.97);
}
.fh-hp-mobilenav[hidden] { display: none; }
.fh-hp-mobilenav ul {
  margin: 0;
  padding: 6px 0 12px;
  list-style: none;
}
.fh-hp-mobilenav a {
  display: block;
  padding: 12px 2px;
  border-bottom: 1px solid var(--hp-line);
  font-size: 0.98rem;
  color: var(--hp-ink-soft);
}
.fh-hp-mobilenav li:last-child a { border-bottom: none; }
.fh-hp-mobilenav a:hover { color: var(--hp-teal); }

.fh-hp-topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.fh-hp-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* Sin contenedor: la marca se sostiene sola. El disco YA es la forma cerrada,
   meterlo en un cuadrado le restaba carácter y sumaba ruido. */
.fh-hp-brand-mark {
  display: grid;
  place-items: center;
  /* flex:none es imprescindible: sin él la barra estrecha encoge el símbolo
     hasta hacerlo desaparecer, y la marca se queda sin logo justo en móvil. */
  flex: none;
  color: var(--hp-teal);
  transition: color 0.24s var(--hp-ease), transform 0.24s var(--hp-ease);
}
.fh-hp-brand:hover .fh-hp-brand-mark { transform: rotate(-8deg) scale(1.04); }

.fh-hp-brand-text { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fh-hp-brand-text strong {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.022em;
  /* Red de seguridad: si algún ancho imprevisto aprieta la barra, el wordmark
     se recorta con puntos suspensivos en vez de solaparse con el CTA. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Etiqueta larga y corta del CTA de la barra. La corta solo aparece cuando el
   ancho obliga a compactar; el nombre accesible no cambia. */
.fh-hp-cta-short { display: none; }

/* "3.0" es indicador de versión, no parte del logo: vive separado por un
   hairline y con peso tipográfico claramente menor. */
.fh-hp-version {
  position: relative;
  padding-left: 9px;
  font-family: var(--hp-mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--hp-ink-faint);
}
.fh-hp-version::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.1em;
  bottom: 0.1em;
  width: 1px;
  background: var(--hp-line-2);
}

.fh-hp-nav { margin-left: auto; }
.fh-hp-nav ul {
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fh-hp-nav a {
  position: relative;
  font-size: 0.9rem;
  color: var(--hp-ink-soft);
  transition: color 0.18s var(--hp-ease);
}
.fh-hp-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -6px;
  height: 1px;
  background: var(--hp-teal);
  transition: right 0.24s var(--hp-ease);
}
.fh-hp-nav a:hover { color: var(--hp-ink); }
.fh-hp-nav a:hover::after { right: 0; }

/* ── Hero ────────────────────────────────────────────────────────────── */

.fh-hp-hero {
  position: relative;
  padding: clamp(56px, 9vw, 104px) 0 clamp(48px, 7vw, 88px);
  overflow: hidden;
}

/* Five faint horizontal rules — a stave, not a gradient blob. */
.fh-hp-staff {
  position: absolute;
  inset: 12% -10% auto -10%;
  display: flex;
  flex-direction: column;
  gap: clamp(26px, 5vw, 52px);
  pointer-events: none;
}
.fh-hp-staff i {
  display: block;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(0, 240, 204, 0.16) 22%,
    rgba(184, 157, 250, 0.13) 62%,
    transparent);
}

.fh-hp-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.fh-hp-cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fh-hp-cta-center { justify-content: center; }

/* ── Song surface (mock) ─────────────────────────────────────────────── */

.fh-hp-surface {
  position: relative;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--hp-line-2);
  border-radius: var(--hp-r-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    var(--hp-bg-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.fh-hp-surface-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hp-line);
}

.fh-hp-surface-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fh-hp-surface-sub { color: var(--hp-ink-faint); font-weight: 400; }

.fh-hp-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--hp-teal);
  box-shadow: 0 0 0 4px rgba(0, 240, 204, 0.14);
}

.fh-hp-mock-badge {
  margin-left: auto;
  flex: none;
  padding: 3px 9px;
  border: 1px solid rgba(252, 211, 77, 0.3);
  border-radius: 999px;
  background: rgba(252, 211, 77, 0.08);
  color: var(--hp-gold);
  font-family: var(--hp-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fh-hp-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0;
}
.fh-hp-readout > span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--hp-line);
  border-radius: var(--hp-r-sm);
  background: var(--hp-panel);
}
.fh-hp-readout b {
  font-family: var(--hp-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--hp-ink-faint);
}
.fh-hp-readout i {
  font-style: normal;
  font-size: 0.86rem;
  font-weight: 600;
}
.fh-hp-readout-inline { padding: 0 0 16px; }

/* En la superficie los cuatro datos rompían en 3+1, que se lee como un error de
   maquetación. Rejilla 2x2: siempre equilibrada, a cualquier ancho. */
.fh-hp-surface .fh-hp-readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fh-hp-surface .fh-hp-readout > span { min-width: 0; }
.fh-hp-surface .fh-hp-readout i {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fh-hp-track { padding: 9px 0; }

.fh-hp-track-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--hp-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hp-ink-faint);
}

/* estructura */
.fh-hp-sections { display: flex; gap: 3px; }
.fh-hp-sec {
  flex: var(--w) 1 0;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 5px;
  background: rgba(252, 211, 77, 0.09);
  border: 1px solid rgba(252, 211, 77, 0.16);
  color: rgba(252, 211, 77, 0.82);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fh-hp-sec-on {
  background: rgba(252, 211, 77, 0.2);
  border-color: rgba(252, 211, 77, 0.42);
  color: var(--hp-gold);
}

/* acordes — son <button> porque cambian la visualización: así el teclado
   obtiene la propagación entre capas sin JS extra de accesibilidad. */
.fh-hp-chords { display: flex; gap: 4px; }
.fh-hp-chord {
  flex: var(--w) 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 9px 10px;
  border-radius: var(--hp-r-sm);
  background: rgba(0, 240, 204, 0.08);
  border: 1px solid rgba(0, 240, 204, 0.2);
  overflow: hidden;
  font-family: var(--hp-body);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.24s var(--hp-ease),
              border-color 0.24s var(--hp-ease),
              opacity 0.24s var(--hp-ease),
              transform 0.24s var(--hp-ease);
}
.fh-hp-chord:hover,
.fh-hp-chord.is-active {
  background: rgba(0, 240, 204, 0.17);
  border-color: rgba(0, 240, 204, 0.48);
  transform: translateY(-1px);
}
/* Cuando una capa está enfocada, el resto cede el foco de atención. */
.fh-hp-surface.is-linked .fh-hp-chord:not(.is-active) { opacity: 0.45; }
.fh-hp-chord b {
  font-size: 0.86rem;
  color: var(--hp-teal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.fh-hp-chord i {
  font-family: var(--hp-mono);
  font-style: normal;
  font-size: 0.6rem;
  color: var(--hp-ink-faint);
}

/* ritmo */
.fh-hp-beats {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
}
.fh-hp-beats i {
  height: 22px;
  border-radius: 3px;
  background: rgba(184, 157, 250, 0.1);
  border: 1px solid rgba(184, 157, 250, 0.14);
}
.fh-hp-beats i.on {
  background: rgba(184, 157, 250, 0.55);
  border-color: rgba(184, 157, 250, 0.7);
}
.fh-hp-beats i.ghost { background: rgba(184, 157, 250, 0.26); }
.fh-hp-beats-lg i { height: 40px; border-radius: 4px; }

/* Propagación: los pulsos que sostiene el acorde enfocado. */
.fh-hp-beats i { transition: opacity 0.24s var(--hp-ease), box-shadow 0.24s var(--hp-ease); }
.fh-hp-surface.is-linked .fh-hp-beats i { opacity: 0.3; }
.fh-hp-surface.is-linked .fh-hp-beats i.is-lit {
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(184, 157, 250, 0.5);
}

/* melodía */
.fh-hp-contour {
  display: block;
  width: 100%;
  height: 44px;
  overflow: visible;
}
.fh-hp-contour polyline {
  fill: none;
  stroke: var(--hp-blue);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.fh-hp-contour-lg { height: 96px; margin: 4px 0 18px; }

/* Tramo de melodía que cae bajo el acorde enfocado. El recorte se hace con
   inset() en porcentajes sobre el bbox de la polilínea (x va de 0 a 320, o sea
   el ancho completo), así que --hl-l/--hl-r son directamente el % del tema. */
.fh-hp-contour-hl {
  clip-path: inset(-20% calc(100% - var(--hl-r, 0%)) -20% var(--hl-l, 0%));
  transition: clip-path 0.28s var(--hp-ease), opacity 0.2s var(--hp-ease);
  opacity: 0;
}
polyline.fh-hp-contour-hl { stroke: var(--hp-teal); stroke-width: 3; }
.fh-hp-surface.is-linked .fh-hp-contour-hl { opacity: 1; }
.fh-hp-surface.is-linked .fh-hp-contour polyline:not(.fh-hp-contour-hl) { opacity: 0.35; }

/* Pista de descubrimiento: se retira en cuanto el usuario interactúa. */
.fh-hp-surface-cue {
  margin: 6px 0 0;
  font-size: 0.74rem;
  color: var(--hp-ink-faint);
  transition: opacity 0.24s var(--hp-ease);
}
.fh-hp-surface.is-linked .fh-hp-surface-cue { opacity: 0; }

/* playhead */
.fh-hp-playhead {
  position: absolute;
  top: 96px;
  bottom: 58px;
  left: 18px;
  width: 2px;
  background: linear-gradient(180deg,
    rgba(0, 240, 204, 0), var(--hp-teal) 18%, var(--hp-teal) 82%, rgba(0, 240, 204, 0));
  box-shadow: 0 0 12px rgba(0, 240, 204, 0.6);
  animation: fh-hp-sweep 13s linear infinite;
}
/* `left` (not transform) so the sweep always spans exactly the surface width,
   at any viewport size. One 2px element — the paint cost is negligible. */
@keyframes fh-hp-sweep {
  0%   { left: 18px; opacity: 0; }
  6%   { opacity: 1; }
  94%  { opacity: 1; }
  100% { left: calc(100% - 18px); opacity: 0; }
}

.fh-hp.fh-hp-motion-off .fh-hp-playhead { animation-play-state: paused; opacity: 0.35; }

.fh-hp-surface-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  margin-top: 6px;
  border-top: 1px solid var(--hp-line);
}

.fh-hp-motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--hp-line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--hp-ink-soft);
  font-family: var(--hp-body);
  font-size: 0.74rem;
  cursor: pointer;
  transition: border-color 0.18s var(--hp-ease), color 0.18s var(--hp-ease);
}
.fh-hp-motion-toggle:hover { border-color: var(--hp-teal); color: var(--hp-ink); }
.fh-hp-motion-icon {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--hp-teal);
}
.fh-hp-motion-toggle[aria-pressed="true"] .fh-hp-motion-icon {
  border-radius: 50%;
  background: var(--hp-ink-faint);
}

.fh-hp-surface-hint {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--hp-ink-faint);
  text-align: right;
}

/* ── Sections ────────────────────────────────────────────────────────── */

.fh-hp-section { padding: clamp(64px, 9vw, 112px) 0; }

/* The top bar is sticky, so anchor jumps must stop below it or the section
   heading lands underneath the bar. 64px bar + breathing room. */
.fh-hp-hero[id],
.fh-hp-section[id] { scroll-margin-top: 84px; }

/* Separador de sección: no es una línea corrida sino una con un corte, el mismo
   gesto que abre el disco de la marca. Ata cada costura de la página al logo. */
.fh-hp-rule {
  position: relative;
}
.fh-hp-rule::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--hp-line-2) 9%,
    var(--hp-line-2) 45%,
    transparent 45%,
    transparent 55%,
    var(--hp-line-2) 55%,
    var(--hp-line-2) 91%,
    transparent);
}

.fh-hp-section-alt {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.022) 12%, transparent);
}

.fh-hp-section-head { margin-bottom: clamp(32px, 4vw, 52px); }

/* ── Flow ────────────────────────────────────────────────────────────── */

.fh-hp-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.fh-hp-step {
  position: relative;
  padding: 22px 20px 24px;
  border: 1px solid var(--hp-line);
  border-radius: var(--hp-r-md);
  background: var(--hp-panel);
  transition: border-color 0.22s var(--hp-ease), transform 0.22s var(--hp-ease);
}
.fh-hp-step:hover { border-color: var(--hp-line-2); transform: translateY(-2px); }

/* Connector between steps — the flow reads as one line, not four cards. */
.fh-hp-step::after {
  content: '';
  position: absolute;
  top: 46px;
  right: -21px;
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 240, 204, 0.5), rgba(0, 240, 204, 0.12));
}
.fh-hp-step:last-child::after { display: none; }

.fh-hp-step-num {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--hp-mono);
  font-size: 0.68rem;
  color: var(--hp-ink-faint);
}

.fh-hp-step-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 10px;
  color: var(--hp-teal);
  background: rgba(0, 240, 204, 0.08);
  border: 1px solid rgba(0, 240, 204, 0.2);
}

.fh-hp-step h3 {
  margin: 0 0 8px;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.fh-hp-step p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--hp-ink-soft);
}
.fh-hp-step em { color: var(--hp-ink); font-style: italic; }

/* ── Lens (tabs + panels) ────────────────────────────────────────────── */

.fh-hp-lens { display: grid; gap: 18px; }

/* min-width:0 es obligatorio: como hijo de grid, `min-width:auto` haría que el
   rail creciera hasta el ancho de los tabs y desbordara la página en móvil.
   El scroll debe ocurrir DENTRO del rail, no empujando el documento. */
.fh-hp-lens-rail { position: relative; min-width: 0; }

/* Indicador de "hay más": solo aparece cuando el rail realmente desborda, y se
   retira en cuanto el usuario desplaza. */
.fh-hp-lens-more {
  display: none;
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  z-index: 2;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--hp-bg);
  background: var(--hp-teal);
  pointer-events: none;
  transition: opacity 0.24s var(--hp-ease);
}
.fh-hp-lens-rail.is-overflowing .fh-hp-lens-more { display: grid; }
.fh-hp-lens-rail.is-overflowing::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 68px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--hp-bg) 78%);
  transition: opacity 0.24s var(--hp-ease);
}
.fh-hp-lens-rail.is-scrolled .fh-hp-lens-more,
.fh-hp-lens-rail.is-scrolled::after { opacity: 0; }

.fh-hp-lens-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fh-hp-lens-tabs button {
  padding: 9px 16px;
  border: 1px solid var(--hp-line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--hp-ink-soft);
  font-family: var(--hp-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s var(--hp-ease),
              color 0.2s var(--hp-ease),
              background-color 0.2s var(--hp-ease);
}
.fh-hp-lens-tabs button:hover { color: var(--hp-ink); border-color: var(--hp-ink-faint); }

.fh-hp-lens-tabs button[aria-selected="true"] {
  color: #05100e;
  font-weight: 600;
  background: var(--hp-tab, var(--hp-teal));
  border-color: var(--hp-tab, var(--hp-teal));
}
.fh-hp-lens-tabs button[data-accent="teal"]   { --hp-tab: var(--hp-teal); }
.fh-hp-lens-tabs button[data-accent="mint"]   { --hp-tab: var(--hp-mint); }
.fh-hp-lens-tabs button[data-accent="purple"] { --hp-tab: var(--hp-purple); }
.fh-hp-lens-tabs button[data-accent="gold"]   { --hp-tab: var(--hp-gold); }
.fh-hp-lens-tabs button[data-accent="pink"]   { --hp-tab: var(--hp-pink); }
.fh-hp-lens-tabs button[data-accent="blue"]   { --hp-tab: var(--hp-blue); }

.fh-hp-lens-stage {
  position: relative;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--hp-line-2);
  border-radius: var(--hp-r-lg);
  background: var(--hp-bg-2);
  min-height: 320px;
}

.fh-hp-mock-float { position: absolute; top: 16px; right: 16px; margin-left: 0; }

.fh-hp-panel { max-width: 760px; }
.fh-hp-panel[hidden] { display: none; }

.fh-hp-panel[data-accent="teal"]   { --hp-accent: var(--hp-teal); }
.fh-hp-panel[data-accent="mint"]   { --hp-accent: var(--hp-mint); }
.fh-hp-panel[data-accent="purple"] { --hp-accent: var(--hp-purple); }
.fh-hp-panel[data-accent="gold"]   { --hp-accent: var(--hp-gold); }
.fh-hp-panel[data-accent="pink"]   { --hp-accent: var(--hp-pink); }
.fh-hp-panel[data-accent="blue"]   { --hp-accent: var(--hp-blue); }

.fh-hp-panel-claim {
  margin: 0 0 20px;
  padding-right: 120px;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--hp-ink);
}

.fh-hp-panel-foot {
  margin: 18px 0 0;
  font-size: 0.88rem;
  color: var(--hp-ink-soft);
}
.fh-hp-panel-foot b { color: var(--hp-accent); font-weight: 600; }

.fh-hp-bullets {
  margin: 0;
  padding: 0 0 0 18px;
  list-style: none;
}
.fh-hp-bullets li {
  position: relative;
  margin-bottom: 9px;
  font-size: 0.92rem;
  color: var(--hp-ink-soft);
}
.fh-hp-bullets li::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hp-accent);
}
.fh-hp-bullets b { color: var(--hp-ink); font-weight: 600; }

.fh-hp-grid-chords {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.fh-hp-grid-chords > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid var(--hp-line);
  border-radius: var(--hp-r-sm);
  background: var(--hp-panel);
  transition: border-color 0.2s var(--hp-ease), background-color 0.2s var(--hp-ease);
}
.fh-hp-grid-chords > span:hover {
  border-color: color-mix(in srgb, var(--hp-accent) 45%, transparent);
  background: color-mix(in srgb, var(--hp-accent) 8%, transparent);
}
.fh-hp-grid-chords b { font-size: 1.02rem; font-weight: 600; }
.fh-hp-grid-chords i {
  font-family: var(--hp-mono);
  font-style: normal;
  font-size: 0.68rem;
  color: var(--hp-ink-faint);
}
.fh-hp-hi {
  border-color: color-mix(in srgb, var(--hp-accent) 55%, transparent) !important;
  background: color-mix(in srgb, var(--hp-accent) 12%, transparent) !important;
}
.fh-hp-hi b { color: var(--hp-accent); }

.fh-hp-keyline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.fh-hp-keyline > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 20px;
  border: 1px solid var(--hp-line);
  border-radius: var(--hp-r-sm);
  background: var(--hp-panel);
}
.fh-hp-keyline b { font-size: 1.15rem; font-weight: 600; }
.fh-hp-keyline i {
  font-family: var(--hp-mono);
  font-style: normal;
  font-size: 0.7rem;
  color: var(--hp-ink-faint);
}
.fh-hp-key-main {
  border-color: color-mix(in srgb, var(--hp-accent) 45%, transparent) !important;
}
.fh-hp-key-main b { color: var(--hp-accent); }

.fh-hp-timeline { margin: 0; padding: 0; list-style: none; }
.fh-hp-timeline li {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 14px;
  border-left: 2px solid var(--hp-line-2);
  transition: border-color 0.2s var(--hp-ease), background-color 0.2s var(--hp-ease);
}
.fh-hp-timeline li:hover { background: rgba(255, 255, 255, 0.03); }
.fh-hp-timeline li.fh-hp-hi {
  border-left-color: var(--hp-accent) !important;
  background: color-mix(in srgb, var(--hp-accent) 9%, transparent) !important;
}
.fh-hp-timeline b {
  font-family: var(--hp-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--hp-ink-faint);
}
.fh-hp-timeline span { font-size: 0.98rem; font-weight: 500; }
.fh-hp-timeline li.fh-hp-hi span { color: var(--hp-accent); }
.fh-hp-timeline i {
  font-family: var(--hp-mono);
  font-style: normal;
  font-size: 0.72rem;
  color: var(--hp-ink-faint);
}

.fh-hp-lyrics { display: grid; gap: 10px; }
.fh-hp-lyrics p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 2.1;
  color: var(--hp-ink);
}
.fh-hp-lyrics span {
  display: inline-block;
  transform: translateY(-0.75em);
  margin-right: 2px;
  font-family: var(--hp-mono);
  font-size: 0.66rem;
  color: var(--hp-pink);
}

/* ── Ecosystem ───────────────────────────────────────────────────────── */

.fh-hp-eco-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr);
  gap: clamp(32px, 5vw, 68px);
  align-items: center;
}

.fh-hp-eco-list {
  margin: 26px 0;
  padding: 0;
  list-style: none;
}
.fh-hp-eco-list li {
  padding: 13px 0;
  border-top: 1px solid var(--hp-line);
  font-size: 0.94rem;
  color: var(--hp-ink-soft);
}
.fh-hp-eco-list li:last-child { border-bottom: 1px solid var(--hp-line); }
.fh-hp-eco-list b { color: var(--hp-ink); font-weight: 600; }

.fh-hp-eco-map svg { display: block; width: 100%; height: auto; }

.fh-hp-eco-links line {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.fh-hp-eco-core {
  fill: rgba(0, 240, 204, 0.07);
  stroke: rgba(0, 240, 204, 0.45);
  stroke-width: 1.2;
}
.fh-hp-eco-core-t1, .fh-hp-eco-core-t2 {
  fill: var(--hp-teal);
  font-family: var(--hp-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-anchor: middle;
}
.fh-hp-eco-core-t1 { fill: var(--hp-ink-faint); font-size: 9px; }

.fh-hp-eco-node circle {
  fill: rgba(255, 255, 255, 0.04);
  stroke: var(--hp-line-2);
  stroke-width: 1;
  transition: fill 0.24s var(--hp-ease), stroke 0.24s var(--hp-ease);
}
.fh-hp-eco-node text {
  fill: var(--hp-ink-soft);
  font-family: var(--hp-body);
  font-size: 10.5px;
  text-anchor: middle;
  transition: fill 0.24s var(--hp-ease);
}
.fh-hp-eco-node[data-tone="teal"]   { --hp-tone: var(--hp-teal); }
.fh-hp-eco-node[data-tone="mint"]   { --hp-tone: var(--hp-mint); }
.fh-hp-eco-node[data-tone="purple"] { --hp-tone: var(--hp-purple); }
.fh-hp-eco-node[data-tone="gold"]   { --hp-tone: var(--hp-gold); }
.fh-hp-eco-node[data-tone="pink"]   { --hp-tone: var(--hp-pink); }
.fh-hp-eco-node[data-tone="blue"]   { --hp-tone: var(--hp-blue); }
.fh-hp-eco-node:hover circle {
  fill: color-mix(in srgb, var(--hp-tone) 14%, transparent);
  stroke: var(--hp-tone);
}
.fh-hp-eco-node:hover text { fill: var(--hp-tone); }

/* ── Close + footer ──────────────────────────────────────────────────── */

.fh-hp-close {
  padding: clamp(72px, 10vw, 128px) 0;
  text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, rgba(0, 240, 204, 0.06), transparent 62%);
}
.fh-hp-close .fh-hp-section-lead { margin: 0 auto 28px; }

.fh-hp-footer {
  padding: 30px 0;
  border-top: 1px solid var(--hp-line);
  background: var(--hp-bg-2);
}
.fh-hp-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}
.fh-hp-footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hp-ink);
}
.fh-hp-footer-mark { display: grid; place-items: center; color: var(--hp-teal); }
.fh-hp-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fh-hp-footer nav a {
  font-size: 0.86rem;
  color: var(--hp-ink-soft);
  transition: color 0.18s var(--hp-ease);
}
.fh-hp-footer nav a:hover { color: var(--hp-teal); }
.fh-hp-footer-note {
  margin-left: auto;
  font-size: 0.76rem;
  color: var(--hp-ink-faint);
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1000px) {
  .fh-hp-hero-grid,
  .fh-hp-eco-grid { grid-template-columns: minmax(0, 1fr); }
  .fh-hp-eco-map { max-width: 400px; margin: 0 auto; }
  .fh-hp-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fh-hp-step:nth-child(2)::after { display: none; }
}

@media (max-width: 760px) {
  .fh-hp-shell { padding: 0 18px; }
  .fh-hp-nav { display: none; }
  .fh-hp-navtoggle { display: flex; }
  .fh-hp-topbar-inner { gap: 10px; }
  .fh-hp-topbar-cta { margin-left: auto; }
  .fh-hp-lead { max-width: none; }
  .fh-hp-cta-row .fh-hp-btn { flex: 1 1 auto; justify-content: center; }
  .fh-hp-panel-claim { padding-right: 0; margin-top: 26px; }
  .fh-hp-mock-float { top: 14px; right: 14px; }
  .fh-hp-surface-hint { display: none; }
  .fh-hp-footer-note { margin-left: 0; flex-basis: 100%; }
}

@media (max-width: 620px) {
  /* A este ancho la barra no da para símbolo + wordmark + versión + CTA largo +
     disclosure. El wordmark NO se sacrifica: la marca es nueva y el símbolo
     todavía no se sostiene solo. Se cede en este orden:
       1) cae el indicador de versión,
       2) el CTA se compacta a "Studio",
       3) se aprietan los espacios internos (bloque de 400 px). */
  .fh-hp-topbar .fh-hp-version { display: none; }
  .fh-hp-cta-full { display: none; }
  .fh-hp-cta-short { display: inline; }
  .fh-hp-topbar-cta { padding-left: 13px; padding-right: 13px; }
  .fh-hp-flow { grid-template-columns: minmax(0, 1fr); }
  .fh-hp-step::after { display: none; }
  /* Los tabs se desbordan lateralmente en vez de romper el ancho de página.
     El margen negativo vive en el rail para que la máscara y el indicador
     queden pegados al borde real del viewport. */
  .fh-hp-lens-rail { margin: 0 -18px; }
  .fh-hp-lens-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
    padding-inline: 18px;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 18px;
  }
  .fh-hp-lens-tabs::-webkit-scrollbar { display: none; }
  .fh-hp-lens-tabs button { flex: none; scroll-snap-align: start; }
  .fh-hp-lens-more { right: 10px; }
  .fh-hp-surface { padding: 14px; }
  /* The badge squeezes the title into a hard cut; drop the subtitle instead. */
  .fh-hp-surface-sub { display: none; }
  /* A este ancho "TONALIDAD La menor" no cabe en línea y el valor se cortaba
     ("La me..."). Apilar etiqueta y valor lo resuelve sin encoger tipografía. */
  .fh-hp-surface .fh-hp-readout > span {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .fh-hp-chord { padding: 8px; }
  .fh-hp-chord b { font-size: 0.76rem; }
  .fh-hp-chord i { display: none; }
  .fh-hp-sec { font-size: 0.62rem; padding: 5px 6px; }
  .fh-hp-timeline li { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .fh-hp-timeline i { display: none; }
  .fh-hp-lyrics p { line-height: 2.3; }
}

/* Paso 3 de la reducción: apretar espacios internos de la barra. Solo entra
   cuando ya cayeron la versión y la etiqueta larga del CTA, y existe para que a
   320 px sigan cabiendo símbolo + wordmark + CTA compacto + disclosure. */
@media (max-width: 400px) {
  .fh-hp-topbar-inner { gap: 8px; }
  .fh-hp-brand { gap: 8px; }
  .fh-hp-brand-text strong { font-size: 0.95rem; }
  .fh-hp-topbar-cta { padding-left: 11px; padding-right: 11px; gap: 6px; }
  .fh-hp-navtoggle { width: 38px; height: 38px; }
}

/* A 320 px el wordmark todavía se recortaba con puntos suspensivos. Último
   apretón para que "FlowHarmony" quepa entero, que es el requisito. */
@media (max-width: 340px) {
  .fh-hp-brand { gap: 6px; }
  .fh-hp-brand-text strong { font-size: 0.88rem; }
  .fh-hp-topbar-cta { padding-left: 10px; padding-right: 10px; }
  .fh-hp-navtoggle { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fh-hp *,
  .fh-hp *::before,
  .fh-hp *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .fh-hp-playhead { display: none; }
}
