/* ASTRA — portada "Cuaderno de observación"
   Fuente de verdad: referencia/portada-prototipo.dc.html */

:root { --marker: #FFC83D; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: #172457; }
a:hover { color: #3A14F0; }
:focus-visible { outline: 3px solid #3A14F0; outline-offset: 3px; }
.night :focus-visible { outline-color: #FFC83D; }

/* ---------- Base ---------- */
.paper { background-color: #F5F0E4; background-image: linear-gradient(rgba(23,36,87,.065) 1px, transparent 1px), linear-gradient(90deg, rgba(23,36,87,.065) 1px, transparent 1px); background-size: 28px 28px; font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; color: #172457; position: relative; overflow-x: hidden; min-height: 100vh; }
.night { position: relative; background: radial-gradient(120% 90% at 70% 10%, #16236A 0%, #0B1438 55%, #08102E 100%); color: #F5F0E4; overflow: hidden; }
.night a { color: #F5F0E4; }
.night a:hover { color: #FFC83D; }
.wrap { max-width: 1180px; margin: 0 auto 0 170px; padding: 0 48px; box-sizing: border-box; position: relative; }
.serif { font-family: 'Fraunces', Georgia, serif; font-variation-settings: "SOFT" 60, "WONK" 1; }
.brand { font-family: 'Oswald', 'Arial Narrow', sans-serif; font-weight: 600; letter-spacing: .05em; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #3A4268; }
.night .mono { color: #AEB6E3; }
.hand { font-family: 'Kalam', cursive; color: #3A14F0; }
.night .hand { color: #1EC0F5; }
.h2 { margin: 0; font-size: clamp(38px, 4.4vw, 62px); line-height: 1.02; font-weight: 500; letter-spacing: -.015em; }
.lede { margin: 26px 0 0; font-size: 19px; line-height: 1.55; color: #3A4268; max-width: 44ch; }
.eyebrow { margin: 0 0 16px; }
.section { padding-top: 100px; padding-bottom: 120px; z-index: 2; }

/* Marcador amarillo */
.hl { background-image: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 90%, transparent 90%); background-repeat: no-repeat; background-size: 0% 100%; transition: background-size 1.1s cubic-bezier(.6,.05,.2,1) .15s; padding: 0 .06em; }
.hl.on { background-size: 100% 100%; }
.hld { background-image: linear-gradient(var(--marker), var(--marker)); background-repeat: no-repeat; background-position: 0 88%; background-size: 0% 16%; transition: background-size 1.1s cubic-bezier(.6,.05,.2,1) .2s, color .5s ease .6s; padding: 0 .08em; border-radius: 2px; }
.hld.on { background-size: 100% 100%; color: #0B1438; }

/* Botones */
.btn-ink { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px; background: #172457; color: #F5F0E4; border-radius: 3px; text-decoration: none; font-weight: 700; font-size: 17px; box-shadow: 4px 4px 0 var(--marker); transition: transform .2s ease, box-shadow .2s ease; box-sizing: border-box; }
.btn-ink:hover, .btn-ink:focus-visible { color: #F5F0E4; transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--marker); }
.btn-sun { display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 28px; background: var(--marker); border-radius: 3px; text-decoration: none; font-weight: 700; font-size: 17px; box-shadow: 4px 4px 0 #1EC0F5; transition: transform .2s ease, box-shadow .2s ease; box-sizing: border-box; }
.night .btn-sun, .night .btn-sun:hover { color: #0B1438; }
.btn-sun:hover, .btn-sun:focus-visible { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #1EC0F5; }
.btn-line { display: inline-flex; align-items: center; min-height: 52px; font-weight: 700; font-size: 17px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn-lg { min-height: 60px; padding: 0 34px; font-size: 19px; margin-top: 36px; }
.link-min { min-height: 44px; display: inline-flex; align-items: center; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }

/* ---------- Índice lateral y progreso ---------- */
.margin-line { position: fixed; top: 0; bottom: 0; left: 146px; width: 2px; background: rgba(58,20,240,.22); z-index: 1; pointer-events: none; }
.rail { position: fixed; left: 18px; top: 50%; transform: translateY(-50%); width: 124px; height: 460px; z-index: 5; }
.rail-lines { position: absolute; left: 0; top: 0; }
.rail-star { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.rail-star svg { width: 16px; height: 16px; }
.rail-star .core { fill: #F5F0E4; stroke: #172457; stroke-width: 1.6; transition: fill .35s ease; }
.rail-star.done .core { fill: #172457; stroke: #F5F0E4; }
.rail-label { position: absolute; left: 38px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-family: 'Kalam', cursive; font-size: 16px; color: #172457; background: #F5F0E4; border: 1px solid rgba(23,36,87,.25); padding: 0 8px; border-radius: 12px; opacity: 0; transition: opacity .25s ease; }
.rail-star.now .rail-label, .rail-star:hover .rail-label, .rail-star:focus-visible .rail-label { opacity: 1; }
.rail-guide { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; pointer-events: none; transition: left .8s cubic-bezier(.5,0,.2,1), top .8s cubic-bezier(.5,0,.2,1); filter: drop-shadow(0 2px 0 rgba(11,20,56,.35)); }
.rail-guide img { width: 100%; height: 100%; object-fit: contain; animation: bob 3s ease-in-out infinite; }
.topbar { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: #1EC0F5; z-index: 6; display: none; transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- Noche: cabecera + hero ---------- */
.waves { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.waves path { animation: drift 14s ease-in-out infinite alternate; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 26px; z-index: 3; }
.logo-link { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-link img { width: 46px; height: 46px; object-fit: contain; }
.logo-link .brand { font-size: 28px; }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; }
.main-nav a:not(.btn-sun) { font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.hero { padding-top: 40px; padding-bottom: 150px; z-index: 2; }
.hero-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.hero-text { flex: 1 1 480px; min-width: 0; }
.hero-text .mono { margin: 0 0 28px; }
.hero h1 { margin: 0; font-size: clamp(50px, 6.2vw, 94px); line-height: 1; font-weight: 500; letter-spacing: -.02em; }
.hero-lede { margin: 32px 0 0; font-size: 20px; line-height: 1.55; max-width: 36ch; color: #C9CEEA; }
.hero .actions { margin-top: 40px; }
.hero .note { margin: 18px 0 0 4px; font-size: 20px; }
.hero-figure { flex: 1 1 420px; min-width: 0; margin: 0; position: relative; }
.constellation { width: 100%; max-width: 500px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.hero-figure figcaption { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 4px; }
.hero-figure figcaption img { width: 78px; height: 78px; object-fit: contain; }
.hero-figure figcaption .hand { font-size: 21px; line-height: 1.3; transform: rotate(-1.5deg); }
.torn { position: absolute; left: 0; bottom: -1px; width: 100%; height: 48px; display: block; }

.st { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop .6s ease forwards; }
.tw { animation: pop .6s ease forwards, twinkle 3.4s ease-in-out 2.6s infinite; }
.astro { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s cubic-bezier(.5,0,.2,1) .5s forwards; }
.astro-bar { animation-delay: 1.6s; }
.slot { transform-box: fill-box; transform-origin: center; animation: pulse 2.6s ease-in-out infinite; }
.slot.hot { stroke: var(--marker); stroke-width: 2.6; }
.slotfill { fill: transparent; transition: fill .3s ease; }
.slotfill.hot { fill: var(--marker); }
.bob { animation: bob 3.2s ease-in-out infinite; }

/* ---------- Tarjetas, cintas ---------- */
.icard { position: relative; flex: 1 1 300px; min-width: 0; background: #FFFDF7; border: 1.5px solid #172457; box-shadow: 6px 6px 0 rgba(23,36,87,.12); padding: 30px 30px 28px; box-sizing: border-box; }
.icard h3 { margin: 12px 0 0; font-size: 30px; line-height: 1.1; font-weight: 600; }
.icard .mono { margin: 0; }
.icard p:not(.mono) { margin: 12px 0 24px; font-size: 17px; line-height: 1.5; color: #3A4268; }
.tape { position: absolute; top: -15px; width: 130px; height: 30px; background: rgba(255,200,61,.6); border: 1px solid rgba(23,36,87,.08); }

/* ---------- Próxima actividad ---------- */
.ticket { position: relative; background: #FFFDF7; border: 1.5px solid #172457; box-shadow: 10px 10px 0 rgba(23,36,87,.12); padding: 44px 44px 40px; transform: rotate(-.6deg); }
.ticket .tape:nth-of-type(1) { left: 48px; transform: rotate(-4deg); }
.ticket .tape:nth-of-type(2) { right: 48px; transform: rotate(5deg); }
.ticket-grid { display: flex; flex-wrap: wrap; gap: 36px 56px; align-items: flex-start; }
.ticket-date { flex: 0 0 auto; text-align: center; border-right: 1.5px dashed rgba(23,36,87,.3); padding-right: 48px; }
.ticket-day { margin: 0; font-size: 96px; line-height: .9; font-weight: 600; }
.ticket-date .mono { margin: 10px 0 0; color: #172457; font-weight: 600; }
.ticket-body { flex: 1 1 380px; min-width: 0; }
.ticket-body h3 { margin: 0; font-size: 36px; line-height: 1.1; font-weight: 600; }
.ticket-desc { margin: 14px 0 0; font-size: 18px; line-height: 1.55; color: #3A4268; max-width: 52ch; }
.ticket-place { margin: 20px 0 0; }
.ticket .actions { margin-top: 30px; }
.countdown { position: absolute; right: 36px; bottom: -42px; margin: 0; font-size: 21px; transform: rotate(-3deg); }
.empty-card { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; background: #FFFDF7; border: 1.5px dashed #172457; padding: 32px 36px; transform: rotate(-.4deg); }
.empty-card .bob { width: 96px; height: 96px; object-fit: contain; }
.empty-card-body { flex: 1 1 320px; min-width: 0; }
.empty-card h3, .empty-card h2 { margin: 0; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.08; font-weight: 500; }
.empty-card p { margin: 10px 0 0; font-size: 18px; line-height: 1.5; color: #3A4268; }

/* ---------- Mentorías ---------- */
.mentor-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 32px; margin-top: 56px; }
.mentor-row .icard:first-child { transform: rotate(-1deg); }
.mentor-row .icard:last-child { transform: rotate(1.2deg); }
.mentor-row .icard:first-child .tape { left: 32px; transform: rotate(-4deg); }
.mentor-row .icard:last-child .tape { right: 32px; transform: rotate(5deg); }
.mline { flex: 0 1 200px; align-self: center; min-width: 120px; }
.mline path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s cubic-bezier(.5,0,.2,1) .3s; }
.mline .dot { opacity: 0; transition: opacity .4s ease 1.5s; }
.mentor.on .mline path { stroke-dashoffset: 0; }
.mentor.on .mline .dot { opacity: 1; }

/* ---------- Apuntes ---------- */
.split { display: flex; flex-wrap: wrap; align-items: center; gap: 48px 64px; }
.split-text { flex: 1 1 400px; min-width: 0; }
.split-text .lede { max-width: 40ch; }
.split-text .actions { margin-top: 34px; }
.split-art { flex: 1 1 420px; min-width: 0; }
.sheets { position: relative; height: 420px; }
.sheet { position: absolute; left: 50%; top: 20px; width: 270px; height: 350px; margin-left: -135px; background-color: #FFFDF7; background-image: linear-gradient(90deg, transparent 38px, rgba(58,20,240,.3) 38px, rgba(58,20,240,.3) 40px, transparent 40px), repeating-linear-gradient(transparent 0, transparent 27px, rgba(23,36,87,.13) 27px, rgba(23,36,87,.13) 28px); border: 1.5px solid #172457; box-shadow: 6px 6px 0 rgba(23,36,87,.12); padding: 34px 22px 22px 56px; box-sizing: border-box; transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.sheet .mono { margin: 0; font-size: 10px; }
.sheet .serif { margin: 10px 0 0; font-size: 24px; font-weight: 600; line-height: 1.1; }
.sheet .hand { margin: 14px 0 0; font-size: 17px; }
.sheet .hand.list { margin-top: 52px; font-size: 16px; color: #172457; opacity: .6; }
.s1 { transform: rotate(-3deg); }
.s2 { transform: rotate(1deg); }
.s3 { transform: rotate(3.5deg); }
.sheets.on .s1 { transform: translate(-170px, 18px) rotate(-10deg); }
.sheets.on .s2 { transform: translate(0, -6px) rotate(0deg); }
.sheets.on .s3 { transform: translate(170px, 22px) rotate(9deg); }
.stamp { position: absolute; left: 50%; top: 170px; z-index: 4; transform: translate(-50%, -50%) rotate(-12deg) scale(1.8); opacity: 0; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 20px; letter-spacing: .16em; text-transform: uppercase; color: #3A14F0; border: 3px solid #3A14F0; border-radius: 6px; padding: 10px 18px; background: rgba(245,240,228,.88); white-space: nowrap; transition: transform .45s cubic-bezier(.3,1.6,.5,1) 1s, opacity .2s ease 1s; }
.sheets.on .stamp { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); }

/* ---------- Bitácora ---------- */
.log-title { margin-bottom: 60px; }
.polaroids { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 48px 40px; }
.polaroid { margin: 0; background: #FFFDF7; padding: 14px 14px 18px; box-shadow: 0 1px 0 rgba(23,36,87,.15), 8px 10px 0 rgba(23,36,87,.08); border: 1px solid rgba(23,36,87,.15); position: relative; }
.polaroid .tape { left: 50%; margin-left: -65px; }
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: #E9E2D0; }
.polaroid figcaption { margin: 14px 0 0; font-size: 19px; color: #172457; }
.log-more { margin: 56px 0 0; font-size: 18px; }
.log-more a { font-weight: 700; text-underline-offset: 5px; }

/* ---------- Únete ---------- */
.join { padding-top: 90px; padding-bottom: 140px; z-index: 2; }
.join-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.join-mascot { width: 240px; height: auto; }
.join .mono { margin: 30px 0 16px; }
.join h2 { margin: 0; font-size: clamp(42px, 5.4vw, 80px); line-height: 1; font-weight: 500; letter-spacing: -.02em; max-width: 16ch; }
.join-lede { margin: 28px 0 0; font-size: 20px; line-height: 1.55; color: #3A4268; max-width: 44ch; }
.join .note { margin: 18px 0 0; font-size: 21px; }
.steps { list-style: none; margin: 40px 0 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; text-align: left; background: #FFFDF7; border: 1.5px solid #172457; box-shadow: 6px 6px 0 rgba(23,36,87,.12); transform: rotate(-.5deg); max-width: 520px; box-sizing: border-box; }
.steps li { display: flex; align-items: flex-start; gap: 16px; font-size: 18px; line-height: 1.45; }
.steps .box { flex: 0 0 26px; width: 26px; height: 26px; border: 2px solid #172457; border-radius: 4px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.steps .box svg { width: 30px; height: 30px; overflow: visible; }
.tick { fill: none; stroke: #3A14F0; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .5s ease; }
.steps.on li:nth-child(1) .tick { stroke-dashoffset: 0; transition-delay: .3s; }
.steps.on li:nth-child(2) .tick { stroke-dashoffset: 0; transition-delay: .9s; }
.steps.on li:nth-child(3) .tick { stroke-dashoffset: 0; transition-delay: 1.5s; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1.5px solid #172457; position: relative; z-index: 2; background: #F5F0E4; font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; color: #172457; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 40px; padding-top: 32px; padding-bottom: 40px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 40px; height: 40px; object-fit: contain; }
.footer-brand .brand { margin: 0; font-size: 22px; }
.footer-brand p:not(.brand) { margin: 4px 0 0; font-size: 15px; color: #3A4268; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: center; }

/* ---------- Keyframes ---------- */
@keyframes pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(18px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .wrap { margin: 0 auto; padding-left: 24px; padding-right: 24px; }
  .rail, .margin-line { display: none; }
  .topbar { display: block; }
}
@media (max-width: 760px) { .mline { display: none; } }
@media (max-width: 700px) {
  .sheets.on .s1 { transform: translate(-70px, 18px) rotate(-8deg); }
  .sheets.on .s3 { transform: translate(70px, 22px) rotate(7deg); }
  .sheet { width: 230px; height: 310px; margin-left: -115px; }
  .stamp { top: 150px; font-size: 17px; }
  .ticket { padding: 36px 22px 28px; }
  .ticket-date { border-right: 0; padding-right: 0; text-align: left; }
  .countdown { right: 12px; }
}

/* ---------- Movimiento reducido: todo visible desde el principio ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .st { opacity: 1; }
  .astro { stroke-dashoffset: 0; }
  .hl, .hld { background-size: 100% 100%; }
  .hld { color: #0B1438; }
  .tick, .mline path { stroke-dashoffset: 0; }
  .mline .dot { opacity: 1; }
  .sheets .s1 { transform: translate(-170px, 18px) rotate(-10deg); }
  .sheets .s2 { transform: translate(0, -6px) rotate(0deg); }
  .sheets .s3 { transform: translate(170px, 22px) rotate(9deg); }
  .stamp { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg); }
}
@media (prefers-reduced-motion: reduce) and (max-width: 700px) {
  .sheets .s1 { transform: translate(-70px, 18px) rotate(-8deg); }
  .sheets .s3 { transform: translate(70px, 22px) rotate(7deg); }
}
