/* Página de curso: Fundamentos de Data Science. Identidad propia: un recorrido de estaciones
   (el "data journey") y numerales con punto medio. Acento teal sobre los tokens del sitio. */
.c-fundamentos-data-science { --fd: var(--teal); --fd-soft: color-mix(in srgb, var(--teal) 14%, var(--surface)); --fd-warm: #d9822b; }
:root[data-theme="dark"] .c-fundamentos-data-science { --fd-warm: #f0a65a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c-fundamentos-data-science { --fd-warm: #f0a65a; } }

.c-fundamentos-data-science .c-hero h1 { font-size: clamp(2.3rem, 1.4rem + 3.2vw, 4rem); max-width: 16ch; }
.c-fundamentos-data-science .c-hero h1 em,
.c-fundamentos-data-science h2 em { color: var(--fd); }
.c-fundamentos-data-science .cs-step-n { font-family: var(--f-data); font-size: 1rem; color: var(--fd); letter-spacing: .02em; }
.c-fundamentos-data-science .gain-list span { -webkit-text-stroke-color: var(--fd); }

/* ---------- Portada: la línea de estaciones de los 7 módulos ---------- */
.fd-frame {
  position: relative; padding: clamp(22px, 3vw, 34px); background: var(--deep); color: var(--on-deep); border: 1px solid color-mix(in srgb, var(--on-deep) 12%, transparent);
  background-image: radial-gradient(color-mix(in srgb, var(--on-deep) 10%, transparent) 1px, transparent 1px); background-size: 20px 20px;
}
.fd-frame-t { margin: 0 0 14px; font-family: var(--f-data); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-deep-accent); }
.fd-route { position: relative; list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 12px; }
.fd-route::before { content: ""; position: absolute; left: 21px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: color-mix(in srgb, var(--on-deep) 18%, transparent); }
.fd-route::after { content: ""; position: absolute; left: 21px; top: 14px; width: 3px; height: calc(100% - 28px); border-radius: 3px; background: var(--teal); transform-origin: top; animation: fd-fill 7s ease-in-out infinite; }
.fd-route li { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; font-size: .95rem; animation: fd-stop 7s ease-in-out infinite; animation-delay: calc(var(--i) * .7s); }
.fd-route b { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-data); font-size: .76rem; background: var(--deep); border: 2px solid color-mix(in srgb, var(--on-deep) 30%, transparent); color: var(--on-deep); }
.fd-route li:last-child b { background: var(--teal); border-color: var(--teal); color: var(--deep); }
@keyframes fd-fill { 0% { transform: scaleY(0); } 70%, 100% { transform: scaleY(1); } }
@keyframes fd-stop { 0%, 8% { opacity: .55; } 14%, 100% { opacity: 1; } }
.fd-float { right: -14px; bottom: 12%; animation: c-in .7s .6s cubic-bezier(.2, .8, .2, 1) both, c-bob 5s 1.4s ease-in-out infinite; }
.fd-float strong { color: var(--fd); }
.fd-hero-art .c-hero-frame { transform: rotate(-1.2deg); }

/* ---------- Historia ---------- */
.c-fundamentos-data-science .s1.scene { background: radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--fd-warm) 12%, transparent), transparent 55%); }
.c-fundamentos-data-science .s2, .c-fundamentos-data-science .s4 { display: block; }
.c-fundamentos-data-science .s5 { padding: 7%; }
.fd-stage { font-size: .9rem; }

/* Escena 1 */
.fd-q { position: absolute; left: 7%; right: 7%; top: 8%; display: grid; gap: 4px; padding: 14px 18px; border-radius: 16px; background: var(--deep); color: var(--on-deep); font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; line-height: 1.3; }
.fd-q small { font-family: var(--f-data); font-weight: 400; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--on-deep-accent); }
.fd-op { position: absolute; margin: 0; max-width: 54%; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 24px -16px rgba(16, 42, 67, .5); font-size: .88rem; line-height: 1.35; }
.fd-op.o1 { left: 7%; top: 38%; --d: .15s; }
.fd-op.o2 { right: 7%; top: 52%; border-radius: 16px 16px 4px 16px; --d: .3s; }
.fd-op.o3 { left: 12%; top: 69%; --d: .45s; }
.fd-gut { position: absolute; right: 7%; bottom: 7%; padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: .8rem; color: #fff; background: var(--fd-warm); --d: .6s; }
.cs-stage:not([data-step="1"]) .s1 .fd-op { opacity: 0; transform: translateY(14px) scale(.96); }
.cs-stage:not([data-step="1"]) .s1 .fd-gut { opacity: 0; }

/* Escena 2 */
.fd-kind { position: absolute; width: 44%; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 24px -16px rgba(16, 42, 67, .45); font-size: .78rem; }
.fd-kind header { padding: 7px 12px; font-weight: 600; font-size: .78rem; color: #fff; background: var(--fd); }
.fd-kind.k1 { left: 6%; top: 7%; }
.fd-kind.k2 { right: 6%; top: 22%; --d: .15s; } .fd-kind.k2 header { background: var(--accent); }
.fd-kind.k3 { left: 12%; top: 51%; --d: .3s; } .fd-kind.k3 header { background: var(--muted); }
.fd-mini { display: grid; grid-template-columns: repeat(3, 1fr); font-family: var(--f-data); font-size: .7rem; }
.fd-mini span { padding: 4px 10px; border-top: 1px solid var(--line); }
.fd-mini span:nth-child(-n+3) { border-top: 0; color: var(--muted); }
.fd-kind pre { margin: 0; padding: 8px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .7rem; line-height: 1.5; color: var(--ink); white-space: pre; }
.fd-kind p { margin: 0; padding: 8px 12px; font-style: italic; line-height: 1.4; }
.fd-tech { position: absolute; left: 6%; right: 6%; bottom: 6%; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; --d: .45s; }
.fd-tech li { padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--fd-soft); color: var(--ink); border: 1px solid var(--line); }
.cs-stage:not([data-step="2"]) .s2 .fd-kind { opacity: 0; transform: translateY(18px) rotate(-2deg); }
.cs-stage:not([data-step="2"]) .s2 .fd-tech { opacity: 0; }

/* Escena 3: data journey */
.c-fundamentos-data-science .s3.scene { background: var(--deep); color: var(--on-deep); }
.fd-lbl { margin: 0; font-family: var(--f-data); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-deep-accent); }
.fd-line { position: absolute; left: 7%; right: 7%; top: 38%; width: 86%; height: 20px; overflow: visible; }
.fd-line path { fill: none; stroke: color-mix(in srgb, var(--on-deep) 35%, transparent); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-dasharray: 6 6; animation: c-flow 1.4s linear infinite; }
.fd-stops { position: absolute; left: 7%; right: 7%; top: calc(38% - 4px); list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.fd-stops li { display: grid; justify-items: center; gap: 8px; text-align: center; }
.fd-stops i { width: 28px; height: 28px; border-radius: 50%; background: var(--deep); border: 3px solid var(--teal); }
.fd-stops li:last-child i { background: var(--teal); }
.fd-stops b { font-size: .82rem; }
.fd-stops em { font-style: normal; margin-top: 10px; padding: 5px 9px; border-radius: 10px; font-size: .7rem; font-weight: 600; line-height: 1.2; color: var(--deep); background: var(--on-deep-accent); transition: opacity .5s, transform .5s; }
.fd-stops .r-ana { background: var(--teal); transition-delay: .5s; }
.fd-stops .r-sci { background: #f0c46a; transition-delay: .7s; }
.fd-stops .r-eng { transition-delay: .3s; }
.cs-stage:not([data-step="3"]) .fd-stops em { opacity: 0; transform: translateY(10px); }
.fd-dot { position: absolute; top: calc(38% + 3px); left: 7%; width: 14px; height: 14px; margin-left: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--teal) 40%, transparent); animation: fd-travel 4s ease-in-out infinite; }
@keyframes fd-travel { 0% { left: 7%; } 90%, 100% { left: calc(93% - 28px); } }
.fd-foot { position: absolute; left: 7%; right: 7%; bottom: 8%; margin: 0; font-size: .86rem; color: color-mix(in srgb, var(--on-deep) 75%, transparent); --d: .8s; }
.cs-stage:not([data-step="3"]) .s3 .fd-foot { opacity: 0; }

/* Escena 4: escalera */
.fd-stairs { position: absolute; left: 7%; right: 7%; bottom: 16%; top: 8%; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; }
.fd-stairs li { display: grid; align-content: start; gap: 4px; padding: 12px 10px; border-radius: 12px 12px 4px 4px; color: #fff; transform-origin: bottom; transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .5s; }
.fd-stairs li:nth-child(1) { height: 34%; background: color-mix(in srgb, var(--teal) 55%, var(--accent)); }
.fd-stairs li:nth-child(2) { height: 54%; background: var(--accent); transition-delay: .12s; }
.fd-stairs li:nth-child(3) { height: 76%; background: color-mix(in srgb, var(--accent) 60%, var(--deep)); transition-delay: .24s; }
.fd-stairs li:nth-child(4) { height: 100%; background: var(--deep); border: 2px solid var(--teal); transition-delay: .36s; }
.fd-stairs small { font-family: var(--f-data); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.fd-stairs b { font-family: var(--f-display); font-size: .98rem; line-height: 1.2; }
.cs-stage:not([data-step="4"]) .fd-stairs li { transform: scaleY(.2); opacity: 0; }
.fd-stairs-note { position: absolute; left: 7%; bottom: 6%; margin: 0; font-size: .8rem; color: var(--muted); --d: .6s; }
.fd-stairs-note::before { content: "↗ "; color: var(--fd); font-weight: 700; }
.cs-stage:not([data-step="4"]) .fd-stairs-note { opacity: 0; }

/* Escena 5 */
.fd-q--ok { position: relative; left: auto; right: auto; top: auto; }
.fd-evid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.fd-evid li { display: grid; gap: 2px; padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--fd); font-size: .86rem; transition: opacity .5s, transform .5s; }
.fd-evid li:nth-child(2) { transition-delay: .15s; } .fd-evid li:nth-child(3) { transition-delay: .3s; }
.fd-evid p { margin: 0; }
.fd-evid span { font-family: var(--f-data); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cs-stage:not([data-step="5"]) .fd-evid li { opacity: 0; transform: translateX(20px); }
.fd-dec { position: absolute; right: 7%; bottom: 7%; padding: 9px 14px; border-radius: 12px; background: #1a9e5c; color: #fff; font-weight: 600; font-size: .85rem; --d: .5s; }
.cs-stage:not([data-step="5"]) .fd-dec { opacity: 0; transform: scale(.9); }

/* ---------- Programa ---------- */
.c-fundamentos-data-science .unit-n { font-family: var(--f-data); text-transform: none; letter-spacing: .02em; color: var(--fd); }
.c-fundamentos-data-science .unit li::before { background: var(--fd); }
.fd-dots { grid-template-columns: repeat(7, 1fr); max-width: 220px; gap: 8px; }
.c-fundamentos-data-science .road-classes.on .fd-dots i { background: var(--teal); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .fd-float { right: -6px; }
}
@media (max-width: 560px) {
  .fd-stage { font-size: .76rem; }
  .fd-frame { padding: 18px; }
  .fd-route { gap: 7px; } .fd-route li { font-size: .82rem; gap: 10px; } .fd-route b { width: 30px; height: 30px; font-size: .68rem; }
  .fd-route::before, .fd-route::after { left: 18px; }
  .fd-q { padding: 9px 12px; font-size: .86rem; top: 6%; } .fd-q small { font-size: .6rem; }
  .fd-op { font-size: .7rem; padding: 6px 9px; max-width: 62%; }
  .fd-op.o1 { top: 40%; } .fd-op.o2 { top: 56%; } .fd-op.o3 { top: 72%; left: 7%; }
  .fd-gut { font-size: .66rem; padding: 5px 9px; bottom: 5%; }
  .fd-kind { width: 47%; font-size: .64rem; } .fd-kind header { font-size: .64rem; padding: 4px 8px; }
  .fd-kind.k1 { left: 4%; top: 5%; } .fd-kind.k2 { right: 4%; top: 16%; } .fd-kind.k3 { left: 8%; top: 52%; }
  .fd-mini { font-size: .58rem; } .fd-mini span { padding: 2px 6px; }
  .fd-kind pre { font-size: .58rem; padding: 5px 8px; } .fd-kind p { padding: 5px 8px; }
  .fd-tech { gap: 4px; bottom: 4%; } .fd-tech li { font-size: .6rem; padding: 2px 7px; }
  .fd-stops b { font-size: .62rem; } .fd-stops i { width: 20px; height: 20px; border-width: 2px; }
  .fd-stops em { font-size: .56rem; padding: 3px 5px; margin-top: 4px; }
  .fd-dot { width: 10px; height: 10px; margin-left: 5px; top: calc(38% + 1px); }
  @keyframes fd-travel { 0% { left: 7%; } 90%, 100% { left: calc(93% - 20px); } }
  .fd-foot { font-size: .68rem; bottom: 6%; }
  .fd-stairs { gap: 5px; bottom: 15%; } .fd-stairs li { padding: 7px 5px; } .fd-stairs small { font-size: .5rem; } .fd-stairs b { font-size: .7rem; }
  .fd-stairs-note { font-size: .66rem; }
  .fd-evid { margin-top: 8px; gap: 5px; } .fd-evid li { padding: 5px 9px; font-size: .68rem; } .fd-evid span { font-size: .54rem; }
  .fd-dec { font-size: .68rem; padding: 6px 10px; bottom: 5%; }
}
@media (prefers-reduced-motion: reduce) {
  .fd-route::after, .fd-route li, .fd-dot, .fd-line path, .fd-float { animation: none !important; }
  .fd-route::after { transform: none; }
  .fd-dot { left: calc(93% - 28px); }
  .fd-stairs li, .fd-evid li, .fd-stops em { transition: none !important; }
}
