/* ==========================================================
   Lớp "kỷ niệm 10 năm": gradient, giấy, cuộn phim, cỏ & ánh sáng
   ========================================================== */
:root {
  /* hạt giấy (noise) + thớ giấy (sợi dài) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .27 0 0 0 0 .16 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004 .09' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .32 0 0 0 .1 -.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --film: #0D1F14;
}

/* Nền toàn trang: gradient xanh – trắng nhẹ */
body {
  background:
    radial-gradient(1100px 700px at 8% 4%, rgba(201, 236, 176, .55), transparent 62%),
    radial-gradient(900px 640px at 96% 38%, rgba(214, 240, 226, .7), transparent 60%),
    linear-gradient(180deg, #FBFDF8 0%, #F1F8EA 45%, #EAF4E1 100%);
  background-attachment: fixed;
}
/* Hạt giấy phủ toàn trang, rất nhẹ */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 95; pointer-events: none;
  background-image: var(--grain); opacity: .16; mix-blend-mode: multiply;
}

/* Giấy cho từng phần */
.paper { background-image: var(--fibers), linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0) 45%); background-size: 600px 600px, 100% 100%; background-blend-mode: multiply, normal; }
.statement.paper { background-color: #FBFCF6; }
.reels.paper { background-color: #F3F8EC; }

/* ---------- Loader: [ 2016 ] ——— [ 2026 ] ---------- */
.js .loader {
  background:
    radial-gradient(900px 600px at 50% 40%, #E9F6DE, transparent 70%),
    var(--grain), var(--paper);
  display: grid; place-content: center; justify-items: center; gap: 36px;
}
.loader-row { display: flex; align-items: center; gap: clamp(12px, 3vw, 32px); width: min(980px, 88vw); }
.loader-bracket { flex: none; font: 800 clamp(28px, 5.4vw, 72px)/1 var(--sans); letter-spacing: -.04em; color: var(--green-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.loader-line { flex: 1; height: 2px; background: linear-gradient(90deg, var(--green), var(--green-deep)); transform-origin: left center; }
.loader-logo { width: clamp(110px, 12vw, 170px); height: auto; filter: drop-shadow(0 12px 24px rgba(12, 46, 27, .18)); }

/* ---------- Lời mở đầu: đoạn chữ + chồng ảnh polaroid + quạt thẻ ---------- */
.statement { overflow: hidden; }
.statement-text { position: relative; z-index: 2; max-width: 22ch; }

/* Chồng ảnh polaroid bên phải đoạn chữ (PC); điện thoại/tablet: ẩn, giữ một cột */
.statement-collage { display: none; }
@media (min-width: 900px) {
  .statement-lead {
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center; gap: clamp(32px, 5vw, 96px);
  }
  .statement-collage {
    display: block; position: relative; z-index: 1;
    width: 100%; max-width: 560px; justify-self: end;
    aspect-ratio: 1.25 / 1; pointer-events: none;
  }
  .polaroid {
    position: absolute; margin: 0;
    padding: 9px 9px 0; background: #FFFEFA; border-radius: 3px;
    box-shadow: 0 1px 0 rgba(12,46,27,.08), 0 22px 44px -22px rgba(12,46,27,.5);
    rotate: var(--r, 0deg);
  }
  .polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 2px; background: #EEF6E3; filter: saturate(1.04); }
  .polaroid figcaption { padding: 9px 2px 11px; font: 700 clamp(17px, 1.35vw, 22px)/1 var(--script); color: var(--green-deep); text-align: center; white-space: nowrap; }
  /* hàng trên – hàng dưới so le, chừa dòng chú thích của ảnh phía sau */
  .polaroid--1 { --r: -6deg; left: 0; top: 0; width: 47%; z-index: 1; }
  .polaroid--2 { --r: 5deg; right: 2%; top: 0; width: 45%; z-index: 2; }
  .polaroid--3 { --r: 3deg; left: 10%; bottom: 0; width: 45%; z-index: 3; }
  .polaroid--4 { --r: -4deg; right: 0; bottom: 2%; width: 46%; z-index: 4; }
}

.fan { position: relative; z-index: 2; display: flex; justify-content: center; margin-top: clamp(24px, 3vh, 40px); padding: 24px 0 16px; }
.fan-card {
  --w: clamp(84px, 8.4vw, 140px);
  position: relative; flex: none; width: var(--w); margin-left: calc(var(--w) * -.1);
  aspect-ratio: 3 / 4.3; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  padding: 8px 8px 0; border-radius: 6px;
  background: var(--white); color: var(--green-deep); text-decoration: none;
  box-shadow: 0 1px 0 rgba(12,46,27,.08), 0 22px 40px -22px rgba(12,46,27,.55);
  rotate: var(--r); transform-origin: 50% 120%;
  transition: translate .5s var(--ease), box-shadow .5s;
}
.fan-card:first-child { margin-left: 0; }
.fan-card img { width: 100%; height: 100%; min-height: 0; object-fit: contain; border-radius: 3px; background: var(--tint); }
.fan-card span { display: flex; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.1; white-space: nowrap; padding: 6px 2px 8px; font-size: 12px; font-weight: 600; }
.fan-card b { font-size: 18px; font-weight: 900; letter-spacing: -.03em; }
.fan-card:hover, .fan-card:focus-visible { translate: 0 -22px; z-index: 3; box-shadow: 0 30px 50px -20px rgba(12,46,27,.6); }

/* ---------- Cuộn phim ---------- */
.film {
  --hole: 9px;
  position: relative; background: var(--film); padding: 26px 0;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
}
/* lỗ răng cưa hai bên mép phim */
.film::before, .film::after {
  content: ""; position: absolute; left: 0; right: 0; height: var(--hole); z-index: 2;
  background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(250,252,247,.88) 10px 22px, transparent 22px 30px);
  -webkit-mask: linear-gradient(#000, #000); border-radius: 2px;
}
.film::before { top: 8px; }
.film::after { bottom: 8px; }
.film-track { display: flex; gap: 10px; width: max-content; padding: 0 10px; will-change: transform; }
.frame { position: relative; margin: 0; flex: none; }
.frame img { height: clamp(150px, 17vw, 250px); width: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; filter: saturate(1.05) contrast(1.02); }
.frame figcaption { position: absolute; left: 6px; bottom: -20px; font: 600 10px/1 var(--sans); letter-spacing: .08em; color: #E8B54A; white-space: pre; opacity: .85; }

/* Cuộn phim dọc */
.film--vertical { width: clamp(150px, 15vw, 220px); padding: 0 24px; }
.film--vertical::before, .film--vertical::after {
  top: 0; bottom: 0; left: 6px; right: auto; width: var(--hole); height: auto;
  background: repeating-linear-gradient(180deg, transparent 0 10px, rgba(250,252,247,.88) 10px 22px, transparent 22px 30px);
}
.film--vertical::after { left: auto; right: 6px; }
.film--vertical .film-track { flex-direction: column; width: 100%; padding: 10px 0; gap: 26px; }
.film--vertical .frame img { width: 100%; height: auto; aspect-ratio: 4 / 5; }
.film--vertical .frame figcaption { left: 0; bottom: -17px; }

.reels { position: relative; z-index: 1; padding: clamp(96px, 14vh, 150px) 0; display: grid; gap: 0; overflow: hidden; }
.reels .film--a { rotate: -3.5deg; margin: 0 -6vw; z-index: 2; }
.reels .film--b { rotate: 2.5deg; margin: -26px -6vw 0; }

/* ---------- Hành trình: chồng ảnh có thể lật ---------- */
.season-photos { cursor: default; }
.season-stack { padding: 0; border: 0; cursor: pointer; }
.season-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.season-count { position: absolute; right: 12px; top: 12px; z-index: 2; padding: 4px 10px; border-radius: 99px; background: rgba(12,46,27,.66); color: var(--white); font: 600 12px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.season-more { border: 0; cursor: pointer; font-family: var(--sans); transition: background .3s, color .3s; }
.season-more:hover { background: var(--green); color: var(--white); }
.season-photo--a { box-shadow: 0 30px 60px -30px rgba(12,46,27,.6); }

/* ---------- Cỏ & ánh sáng (dùng chung) ---------- */
.memories-bg, .scene-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.memories-grass, .scene-grass { position: absolute; inset: -6% -2%; background: url('/resources/book/grass.jpg') center / cover no-repeat; }
.light { position: absolute; width: max(120%, 1200px); max-width: none; left: -10%; top: -30%; mix-blend-mode: screen; opacity: .9; pointer-events: none; }
.light--a { animation: light-drift 14s ease-in-out infinite alternate; }
.light--b { top: -10%; left: 20%; opacity: .55; rotate: 12deg; animation: light-drift 19s ease-in-out -6s infinite alternate-reverse; }
@keyframes light-drift {
  from { transform: translate3d(-3%, -2%, 0) rotate(-3deg); opacity: .55; }
  to { transform: translate3d(4%, 3%, 0) rotate(3deg); opacity: .95; }
}
/* đốm sáng lấp lánh */
.sparkles { position: absolute; inset: 0; background-image:
  radial-gradient(2px 2px at 12% 22%, #fff, transparent), radial-gradient(2px 2px at 34% 64%, #fff, transparent),
  radial-gradient(3px 3px at 58% 30%, #FFF6B0, transparent), radial-gradient(2px 2px at 76% 72%, #fff, transparent),
  radial-gradient(2px 2px at 88% 18%, #fff, transparent), radial-gradient(3px 3px at 22% 86%, #FFF6B0, transparent),
  radial-gradient(2px 2px at 66% 90%, #fff, transparent), radial-gradient(2px 2px at 46% 12%, #fff, transparent);
  animation: twinkle 4s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }

/* Sách trên nền cỏ */
.memories::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 55%, transparent 40%, rgba(8, 40, 18, .35)); pointer-events: none; }
.memories-head h2 { color: var(--white); text-shadow: 0 4px 30px rgba(0, 40, 10, .35); }
.memories-head p { color: #EAF8DC; }
.book-wrap::after { background: radial-gradient(closest-side, rgba(0, 30, 8, .45), transparent); bottom: -10px; height: 60px; }
.page-inner img { object-fit: contain; }
.book-arrow { background: rgba(255,255,255,.92); border-color: transparent; color: var(--green-deep); box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.book-indicator { color: var(--white); }
.sound-toggle { color: var(--white); border-color: rgba(255,255,255,.4); background: rgba(12,46,27,.25); backdrop-filter: blur(6px); }
.sponsors img { box-shadow: 0 20px 50px -20px rgba(0,0,0,.4); }

/* Hẹn gặp trên nền cỏ tối */
.meet::before { display: none; }
.meet .scene-grass { filter: saturate(.9) brightness(.55); }
.meet .scene-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 50, 26, .72), rgba(10, 50, 26, .45) 50%, rgba(10, 50, 26, .78)); }
.meet .light { opacity: .5; z-index: 1; }

/* Tâm tình: ánh sáng nhẹ trên giấy */
.light--soft { top: -40%; left: -20%; opacity: .5; mix-blend-mode: soft-light; filter: hue-rotate(40deg); animation: light-drift 22s ease-in-out infinite alternate; }
.letters > *:not(.light) { position: relative; z-index: 1; }

/* Footer: dải cỏ phía trên */
.site-footer .scene-bg { bottom: auto; height: 420px; -webkit-mask: linear-gradient(180deg, #000 45%, transparent); mask: linear-gradient(180deg, #000 45%, transparent); }
.site-footer .scene-grass { filter: brightness(.7); }
.site-footer .light { opacity: .45; }

/* ---------- Viên "mùa đang xem" ---------- */
.season-pill {
  position: fixed; left: var(--gutter); bottom: 20px; z-index: 110;
  display: flex; align-items: center; gap: 12px; padding: 6px 16px 6px 6px;
  border: 0; border-radius: 99px; cursor: pointer;
  background: var(--tint, #EEF6E3); color: var(--ink);
  box-shadow: 0 1px 0 rgba(12,46,27,.12), 0 16px 40px -14px rgba(12,46,27,.5);
  translate: 0 140%; transition: translate .6s var(--ease), background-color .8s ease;
}
.season-pill.is-visible { translate: 0 0; }
.season-pill img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--white); }
.season-pill span { display: grid; text-align: left; line-height: 1.15; }
.season-pill small { font-size: 11px; color: var(--muted); }
.season-pill b { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.season-pill i { width: 18px; height: 12px; margin-left: 4px; background: linear-gradient(currentColor 0 0) top / 100% 2px no-repeat, linear-gradient(currentColor 0 0) center / 100% 2px no-repeat, linear-gradient(currentColor 0 0) bottom / 100% 2px no-repeat; }

/* Mục lục 10 mùa: mở ra từ viên */
.season-index {
  position: fixed; inset: 0; z-index: 170; overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(24px, 4vw, 56px) var(--gutter) 64px;
  background: var(--grain), linear-gradient(180deg, #F6FBF1, #E5F2DA);
  clip-path: circle(0 at var(--ox, 40px) var(--oy, 90%));
  transition: clip-path .7s cubic-bezier(.7, 0, .2, 1);
}
.season-index.is-open { clip-path: circle(150% at var(--ox, 40px) var(--oy, 90%)); }
.season-index-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.season-index-head h2 { font: 900 clamp(36px, 5vw, 72px)/.95 var(--sans); letter-spacing: -.045em; color: var(--green-deep); }
.season-index-close { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--green-deep); color: var(--white); font-size: 30px; cursor: pointer; }
.season-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.index-card {
  position: relative; display: grid; grid-template-rows: auto 1fr; gap: 10px; text-align: left;
  padding: 10px 10px 14px; border: 0; border-radius: 8px; cursor: pointer; overflow: hidden;
  background: var(--tint); color: var(--ink);
  transition: translate .5s var(--ease), box-shadow .5s;
}
.index-card:hover, .index-card:focus-visible { translate: 0 -6px; box-shadow: 0 24px 40px -24px rgba(12,46,27,.6); }
.index-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.index-card-roman { position: absolute; z-index: 1; left: 18px; top: 14px; font: 900 56px/.8 var(--sans); letter-spacing: -.05em; color: var(--white); text-shadow: 0 4px 20px rgba(0,0,0,.45); }
.index-card-text { display: grid; gap: 4px; padding: 0 4px; }
.index-card small { font-size: 12px; color: var(--muted); }
.index-card b { font-size: 17px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Mobile ---------- */
@media (max-width: 899px) {
  .fan { justify-content: flex-start; overflow-x: auto; padding: 40px 16px 20px; scrollbar-width: none; }
  .fan-card { --w: 104px; }
  .reels .film--a, .reels .film--b { margin-left: -20vw; margin-right: -20vw; }
  .season-pill { left: 12px; bottom: 12px; }
  .season-pill small { display: none; }
  body::after { opacity: .1; }
}
@media (prefers-reduced-motion: reduce) {
  .light, .sparkles { animation: none; }
  .season-index { transition: none; }
}

/* Chữ MỘC ở footer: trắng nổi trên nền cỏ */
.footer-big { color: #FBFDF8; text-shadow: 0 20px 60px rgba(0, 40, 12, .35); }

/* ---------- PC: quạt thẻ thành hàng ngang giống mobile, kéo trái/phải bằng chuột ---------- */
@media (min-width: 900px) {
  .fan {
    justify-content: flex-start; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    padding: 24px var(--gutter) 16px; scroll-padding-inline: var(--gutter);
    overscroll-behavior-x: contain; cursor: grab; user-select: none; -webkit-user-select: none;
  }
  .fan::-webkit-scrollbar { display: none; }
  .fan::after { content: ""; flex: none; width: 1px; }
  .fan.is-dragging { cursor: grabbing; }
  .fan.is-dragging .fan-card { pointer-events: none; }
  .fan-card { --w: clamp(150px, 11.5vw, 200px); rotate: 0deg; margin-left: 0; margin-right: 14px; cursor: inherit; }
  .fan-card span { font-size: 15px; }
  .fan-card b { font-size: 24px; }
  .fan-card img { -webkit-user-drag: none; }
}

@media (min-width: 1440px) {
  .statement { padding-top: 56px; padding-bottom: 56px; }
  .statement > * { max-width: 100%; }
  .statement-collage { max-width: 680px; }
  .fan { margin-top: 24px; }
  .fan-card { --w: 150px; }
}
