/* Camina con Teresita. Valores tomados del diseño de partida (artifact). */
@import url('https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@0,400;0,500;1,400&family=IM+Fell+English&family=Pinyon+Script&family=Young+Serif&display=swap');

:root {
  --bg: #F2ECDF;
  --ink: #28261A;
  --ink-soft: #4A4633;
  --ink-mute: #5C5740;
  --card: #FBF8F1;
  --card-2: #F6F1E6;
  --card-3: #EFE8D8;
  --line: #C9BBA0;
  --line-soft: #DCD0B6;
  --line-strong: #B3A281;
  --green: #4B5230;
  --green-dark: #2F3420;
  --green-tint: #E8E0CE;
  --rose: #9E4A57;
  --rose-ink: #6E3440;
  --petal: #C47A83;
  --body: "Alegreya", "Palatino Linotype", Georgia, serif;
  /* Tipografía de display. Opciones del diseño:
     Carta de Teresita: "Pinyon Script", "Snell Roundhand", cursive  (escala 1.12, interlínea 1.02)
     Imprenta antigua:  "IM Fell English", Georgia, serif             (escala 1,    interlínea 0.9)
     Clásica moderna:   "Young Serif", Georgia, serif                 (escala 0.84, interlínea 0.95) */
  --disp: "Pinyon Script", "Snell Roundhand", cursive;
  --ds: 1.12;
  --dlh: 1.02;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.5; overflow-x: hidden; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
.disp { font-family: var(--disp); font-weight: 400; font-style: normal; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: inherit; background: var(--green); color: var(--card-2); border: 0; font-size: 18px; padding: 14px 24px; border-radius: 999px; min-height: 48px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-dark); color: var(--card-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.ghost { display: inline-flex; align-items: center; font-family: inherit; font-size: 18px; color: var(--ink); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 14px 24px; min-height: 48px; cursor: pointer; text-decoration: none; }
.ghost:hover { background: var(--green-tint); color: var(--ink); }
.ghost:disabled { opacity: .45; cursor: not-allowed; }
.ghost:disabled:hover { background: transparent; }

/* Hero */
.site-header { max-width: 1120px; margin: 0 auto; padding: 40px 24px 24px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; padding-top: 8px; }
.brand { font-size: 16px; letter-spacing: .16em; text-decoration: none; color: var(--ink); padding-bottom: 14px; border-bottom: 1px solid var(--line); align-self: flex-start; }
.hero h1 { margin: 0; font-size: calc(var(--ds) * clamp(62px, 11.5vw, 124px)); line-height: var(--dlh); }
.hero-lead { margin: 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.25; color: var(--ink-soft); max-width: 460px; font-style: italic; }
.hero-copy label { font-size: 17px; color: var(--ink-mute); margin-top: 6px; }
.select { font-family: inherit; font-size: 18px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; max-width: 420px; min-height: 52px; }
.hero figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.photo-img { display: block; width: 100%; height: auto; filter: sepia(.15); border-radius: 4px; }
.hero figcaption { font-size: 14px; color: var(--ink-mute); text-align: right; font-style: italic; }

/* Jardín */
.garden { position: relative; height: 300px; margin-top: 24px; overflow: hidden; background: #C9CFA8; }
.garden-svg, .garden-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.garden-svg { z-index: 0; }
.garden-img { z-index: 1; object-fit: cover; object-position: center bottom; }
.garden-fade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(var(--bg) 0%, rgba(242,236,223,0) 30%, rgba(242,236,223,0) 62%, var(--bg) 100%); }
.garden-caption { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
/* Halo pergamino detrás del texto: la ilustración es muy cargada justo en el centro (ramas y campanario). */
.garden-caption::before { content: ""; position: absolute; z-index: -1; left: 50%; bottom: -12px; width: min(560px, 100%); height: 150px; transform: translateX(-50%); background: radial-gradient(ellipse closest-side, rgba(242,236,223,.92) 0%, rgba(242,236,223,.8) 55%, rgba(242,236,223,0) 100%); pointer-events: none; }
.garden-caption .disp { margin: 0; font-size: calc(var(--ds) * 40px); line-height: 1.1; color: var(--ink); text-shadow: 0 0 10px var(--bg), 0 0 3px var(--bg); }
.garden-caption p { margin: 0; font-size: 17px; color: var(--ink); font-style: italic; text-shadow: 0 0 8px var(--bg), 0 0 2px var(--bg); }

/* Caminito */
.camino { position: relative; width: 100%; max-width: 1120px; margin: 0 auto; overflow: hidden; }
.tiles { position: absolute; top: 0; display: flex; flex-direction: column; }
.tile { display: block; width: 100%; height: auto; }
.path-svg { position: absolute; top: 0; display: block; }
.walker-svg { position: absolute; left: 0; top: 0; pointer-events: none; }
.walker { transition: transform .15s linear; }
.stop { position: absolute; width: 0; height: 0; transition: opacity .8s ease, transform .8s ease; }
.stop-mark { position: absolute; left: -21px; top: -21px; width: 42px; height: 42px; border-radius: 50%; background: var(--card); border: 2px solid var(--green); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(40,38,26,.3); }
.stop-card { position: absolute; top: -30px; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; background: rgba(251,248,241,.95); border: 1px solid var(--line-soft); border-radius: 10px; box-shadow: 0 8px 22px rgba(50,44,24,.22); cursor: pointer; font-family: inherit; text-align: left; }
.stop-card .stop-title { font-size: 18px; line-height: 1.25; color: var(--ink); flex-grow: 1; }
.stop-card .plus { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; }
.stop-card:hover .plus { background: var(--green-dark); }

/* Pie */
.site-footer { max-width: 720px; margin: 0 auto; padding: 64px 24px 96px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.site-footer .disp { margin: 0; font-size: calc(var(--ds) * clamp(32px, 5vw, 48px)); line-height: 1.1; }
.site-footer p { margin: 0; font-size: 19px; line-height: 1.55; color: var(--ink-soft); max-width: 520px; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.site-footer .colophon { margin-top: 12px; font-size: 15px; color: var(--ink-mute); }

/* Ficha de la estación */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.sheet-wrap[hidden] { display: none; }
.scrim { position: absolute; inset: 0; border: 0; background: rgba(40,38,26,.55); cursor: pointer; }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; background: var(--card); border-radius: 16px; padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 16px; margin-bottom: 4vh; box-shadow: 0 20px 50px rgba(40,38,26,.35); animation: rise .45s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.petal { position: absolute; top: -20px; width: 12px; height: 16px; background: var(--petal); border-radius: 12px 1px 12px 1px; opacity: 0; animation: fall 3.4s ease-in forwards; }
@keyframes fall { 0% { opacity: 0; transform: translate(0,0) rotate(0); } 12% { opacity: .85; } 100% { opacity: 0; transform: translate(40px,300px) rotate(220deg); } }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet h2 { margin: 6px 0 0; font-size: calc(var(--ds) * clamp(28px, 5vw, 38px)); line-height: 1.15; }
.close { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sheet .story { margin: 0; font-size: 19px; line-height: 1.6; color: var(--ink); }
.sheet blockquote { margin: 4px 0; padding: 0 0 0 18px; border-left: 2px solid var(--rose); font-style: italic; font-size: 21px; line-height: 1.45; color: var(--rose-ink); }
.lesson { background: var(--card-3); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.lesson span { font-size: 16px; color: var(--green); font-style: italic; }
.lesson p { margin: 0; font-size: 18px; line-height: 1.55; }
.listen { display: flex; flex-direction: column; gap: 10px; }
.listen-where { margin: 0; font-size: 16px; color: var(--ink-mute); font-style: italic; }
.player { min-height: 170px; border-radius: 12px; overflow: hidden; background: var(--card-3); }
.player iframe { display: block; width: 100%; height: 170px; border: 0; }
.listen-alt { margin: 0; font-size: 15px; color: var(--ink-mute); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sheet-nav { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.sheet-nav .ghost { font-size: 17px; padding: 10px 18px; min-height: 44px; }

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .sheet { padding: 20px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stop, .sheet, .walker { transition: none; animation: none; }
  .petal { display: none; }
}
