/* =========================================================
   Milán y Turín · Para Fio
   Mobile first: los estilos base son para móvil y
   @media (min-width: 560px) añade aire en pantallas grandes.
   Una sola columna de sobres lacrados, uno por día,
   bajo un skyline dibujado a mano de Milán a Turín.
   ========================================================= */

/* ---------- Fuentes (alojadas en /fonts, licencia OFL) ---------- */
@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("../fonts/bodoni-moda-latin-standard-normal.woff2") format("woff2-variations"),
       url("../fonts/bodoni-moda-latin-standard-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-display: swap;
  font-weight: 400 900;
  src: url("../fonts/bodoni-moda-latin-standard-italic.woff2") format("woff2-variations"),
       url("../fonts/bodoni-moda-latin-standard-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/figtree-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../fonts/caveat-latin-500-normal.woff2") format("woff2");
}

:root {
  --bg: #F9ECEA;
  --bg-2: #F4DEDC;
  --paper: #FFFAF8;
  --flap: #F5E0DE;
  --flap-in: #EBCDCB;
  --ink: #3B1720;
  --muted: #765860;
  --line: #E6C6C7;
  --barolo: #7B2436;
  --campari: #C9303F;
  --gold: #C99A33;
  --seal-ink: #FFF5F2;
  --hl: #FBE4E4;
  --shadow: 0 1px 0 rgba(123, 36, 54, .05), 0 14px 28px -18px rgba(123, 36, 54, .45);
  --font-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B0C11; --bg-2: #241018; --paper: #2A141B; --flap: #33181F; --flap-in: #3E1D27;
    --ink: #F7E6E4; --muted: #C3A2A8; --line: #4E2833; --barolo: #F3AAB5; --campari: #FF7686;
    --gold: #EBC163; --seal-ink: #2A0E15; --hl: #381923;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 28px -16px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
* { box-sizing: border-box; }
body {
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 50% 0%, var(--bg-2) 0%, var(--bg) 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(2rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; }
.hand { font-family: var(--font-hand); }
:focus-visible { outline: 2px solid var(--campari); outline-offset: 3px; border-radius: 6px; }

/* ---------- Hero ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .9rem; }
.hero .for { font-family: var(--font-hand); font-size: 1.9rem; color: var(--campari); line-height: 1; transform: rotate(-3deg); }
.hero h1 {
  font-size: clamp(3.1rem, 15vw, 4.6rem);
  line-height: .95;
  letter-spacing: -.01em;
  color: var(--barolo);
  font-variation-settings: "opsz" 96;
}
.hero h1 em { font-style: italic; font-weight: 400; color: var(--campari); padding: 0 .08em; }
.hero .dates {
  font-size: .8125rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.hero .sub { font-family: var(--font-display); font-style: italic; font-size: 1.25rem; color: var(--ink); max-width: 24rem; text-wrap: balance; }
.skyline { width: 100%; max-width: 26rem; height: auto; margin-top: .25rem; overflow: visible; }
.skyline .stroke { fill: var(--paper); stroke: var(--barolo); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.skyline .thin { fill: none; stroke: var(--barolo); stroke-width: 1.2; stroke-linecap: round; }
.skyline .ground { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-linecap: round; }
.skyline .route { fill: none; stroke: var(--campari); stroke-width: 1.6; stroke-dasharray: 2 6; stroke-linecap: round; }
.skyline .heart { fill: var(--campari); }
.skyline .star { fill: var(--gold); }
.skyline .light { fill: var(--gold); }
.skyline .label { font-family: var(--font-hand); font-size: 17px; fill: var(--muted); }
.skyline .km { font-family: var(--font-hand); font-size: 15px; fill: var(--campari); }
@media (prefers-reduced-motion: no-preference) {
  .skyline .light { animation: twinkle 3.2s ease-in-out infinite; }
  .skyline .light:nth-of-type(2n) { animation-delay: .8s; }
  .skyline .light:nth-of-type(3n) { animation-delay: 1.6s; }
  .skyline .light:nth-of-type(5n) { animation-delay: 2.4s; }
}
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.countdown {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .95rem .45rem .75rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper);
  font-size: .9375rem; font-weight: 600; color: var(--barolo);
  font-variant-numeric: tabular-nums;
}
.countdown svg { width: 15px; height: 15px; fill: var(--campari); flex: none; }

/* ---------- Carta ---------- */
.letter-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.75rem 1.5rem 1.6rem;
  box-shadow: var(--shadow);
  transform: rotate(-.6deg);
  display: flex; flex-direction: column; gap: .9rem;
}
.letter-card .hello { font-family: var(--font-hand); font-size: 1.85rem; color: var(--campari); line-height: 1; }
.letter-card p { font-family: var(--font-display); font-size: 1.125rem; line-height: 1.6; }

/* ---------- Encabezados de sección ---------- */
.section-head { display: flex; flex-direction: column; gap: .35rem; text-align: center; align-items: center; }
.section-head h2 { font-size: 2rem; color: var(--barolo); }
.section-head p { color: var(--muted); font-size: .96rem; max-width: 24rem; }

/* ---------- Sobres ---------- */
.envelopes { display: flex; flex-direction: column; gap: 3rem; padding-top: 1.5rem; }
.env { position: relative; display: flex; flex-direction: column; gap: 1rem; }
.env-front {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  perspective: 900px;
}
.env-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.env-lines path { fill: none; stroke: var(--line); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.env-flap {
  position: absolute; left: -1px; right: -1px; top: -1px;
  height: 7.25rem;
  background: var(--flap);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform .7s cubic-bezier(.6, .05, .25, 1), background-color .7s;
  z-index: 2;
}
.env-flap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--line));
  opacity: .5;
}
.seal {
  position: absolute; top: 5.15rem; left: 50%;
  width: 4.2rem; height: 4.2rem; margin-left: -2.1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--campari), var(--barolo) 120%);
  color: var(--seal-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
  z-index: 3;
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--line);
  transition: transform .45s ease, opacity .45s ease;
}
.seal b { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; }
.seal small { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; margin-top: .1rem; }
.env-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: .15rem; padding: 10rem 1.25rem 2rem; transition: padding-top .6s ease; }
.env-day { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.env-title { font-family: var(--font-display); font-size: 1.55rem; line-height: 1.15; color: var(--barolo); }
.env-title em { font-style: italic; }
.env-hint { font-family: var(--font-hand); font-size: 1.3rem; color: var(--campari); line-height: 1.1; margin-top: .2rem; }
.env-hint .when-open { display: none; }
.env-post {
  position: absolute; z-index: 1; right: .9rem; bottom: .7rem;
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600;
  font-variant-numeric: tabular-nums; opacity: .8;
}

.env.open .env-flap { transform: rotateX(180deg) scaleY(.38); background: var(--flap-in); }
.env.open .seal { transform: scale(.4) translateY(-2rem); opacity: 0; }
.env.open .env-hint .when-closed { display: none; }
.env.open .env-hint .when-open { display: inline; }
.env.open .env-text { padding-top: 1.75rem; }
.env.open .env-post { display: none; }

@media (prefers-reduced-motion: reduce) {
  .env-flap, .seal, .env-text { transition: none; }
}

/* ---------- Contenido de cada día ---------- */
.day {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem .7rem 1.4rem;
  display: flex; flex-direction: column; gap: 1.25rem;
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .day.reveal { animation: slideOut .65s cubic-bezier(.2, .7, .2, 1) both; }
}
@keyframes slideOut { from { transform: translateY(-1.25rem); opacity: 0; } to { transform: none; opacity: 1; } }
.day-intro { font-family: var(--font-display); font-style: italic; font-size: 1.2rem; line-height: 1.45; color: var(--barolo); text-align: center; padding: 0 .25rem; }

.plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.stop {
  display: grid; grid-template-columns: 3rem 1fr; gap: .1rem .7rem;
  padding: .7rem .6rem;
  border-radius: 8px;
  position: relative;
}
.stop time {
  font-weight: 700; font-size: .9375rem; color: var(--barolo);
  font-variant-numeric: tabular-nums; padding-top: .18rem;
}
.stop-body { min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.stop h3 { font-size: 1.16rem; line-height: 1.25; color: var(--ink); display: flex; align-items: baseline; gap: .4rem; }
.stop h3 svg { width: 13px; height: 13px; fill: var(--campari); flex: none; transform: translateY(1px); }
.stop p { font-size: .97rem; color: var(--ink); }
.stop .where {
  font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: .1rem;
}
.stop.special { background: var(--hl); }
.stop.star {
  background: var(--hl);
  border: 1px dashed var(--campari);
  padding: 1rem .8rem;
}
.stop.star h3 { font-size: 1.45rem; color: var(--barolo); }
.stop.star .notes { display: block; width: 46px; height: 22px; margin-bottom: .1rem; }
.stop.star .notes path { fill: none; stroke: var(--campari); stroke-width: 1.6; stroke-linecap: round; }
.stop.star .notes circle { fill: var(--campari); }
.day-note {
  font-family: var(--font-hand); font-size: 1.35rem; color: var(--campari); text-align: center; line-height: 1.2;
}

.open-all {
  align-self: center;
  background: none; border: 0; padding: .4rem .6rem;
  font: inherit; font-family: var(--font-hand); font-size: 1.35rem; color: var(--muted);
  cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px;
}
.open-all:hover { color: var(--campari); }

/* Secciones apiladas */
.stack { display: flex; flex-direction: column; gap: 1.25rem; }

/* Sin JavaScript: todos los días se ven abiertos */
.no-js .day[hidden] { display: flex !important; }
.no-js .env-hint, .no-js .open-all { display: none !important; }
.no-js .env-flap { transform: rotateX(180deg) scaleY(.38); background: var(--flap-in); }
.no-js .seal { opacity: 0; }
.no-js .env-text { padding-top: 1.75rem; }
.no-js .env-post { display: none; }

/* ---------- Para probar juntos ---------- */
.taste { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.taste label {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem .75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  min-width: 0;
  transition: background-color .25s, border-color .25s;
}
.taste input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.taste .box {
  width: 1.35rem; height: 1.35rem; flex: none;
  border: 1.5px solid var(--line); border-radius: 50%;
  display: grid; place-items: center;
  transition: background-color .25s, border-color .25s;
}
.taste .box svg { width: 12px; height: 12px; fill: var(--seal-ink); opacity: 0; transition: opacity .2s; }
.taste .txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.taste .txt b { font-weight: 600; font-size: .95rem; }
.taste .txt small { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: .15rem; }
.taste input:checked + .box { background: var(--campari); border-color: var(--campari); }
.taste input:checked + .box svg { opacity: 1; }
.taste label:has(input:checked) { background: var(--hl); border-color: var(--campari); }
.taste input:focus-visible + .box { outline: 2px solid var(--campari); outline-offset: 2px; }
.taste-count { text-align: center; font-family: var(--font-hand); font-size: 1.3rem; color: var(--campari); }

/* ---------- Maleta ---------- */
.suitcase { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.suitcase li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .6rem; align-items: start; }
.suitcase li svg { width: 14px; height: 14px; fill: var(--campari); margin-top: .35rem; }
.suitcase b { font-weight: 600; }

/* ---------- Firma ---------- */
.sign { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding-top: 1rem; }
.sign .with { font-family: var(--font-display); font-style: italic; font-size: 1.25rem; color: var(--ink); }
.sign .name { font-family: var(--font-hand); font-size: 3.2rem; color: var(--campari); line-height: 1; transform: rotate(-4deg); margin-top: .25rem; }
.sign svg { width: 22px; height: 22px; fill: var(--campari); margin-top: .6rem; }
.sign .foot { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 1.2rem; font-weight: 600; }

@media (min-width: 560px) {
  .wrap {
    padding-top: calc(3.5rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    gap: 4.5rem;
  }
  .day { padding: 1.9rem 1.6rem 1.7rem; }
  .stop { grid-template-columns: 3.8rem 1fr; gap: .1rem .9rem; }
}
