/* Allezy — landing « Un petit livre »
 * Trang triết lý dạng quyển sách Pháp: giấy kem, mực xanh-đen, khung kẻ đôi
 * kiểu Gallimard, lettrine, guillemets. Cùng tinh thần paper-and-ink với
 * hoctudat.com nhưng chất liệu Pháp.
 */
:root {
  --papier: #f9f4e7;          /* crème vergé */
  --papier-deep: #efe6d0;
  --encre: #1f2547;           /* mực xanh-đen (bleu-noir) — từ navy logo */
  --encre-soft: #333a63;
  --encre-mute: #4d5478;      /* meta text, ~6.5:1 trên papier */
  --encre-faint: #7d82a0;     /* decorative only */
  --rouge: #c2372d;           /* đỏ an toàn cho text (AA trên papier) */
  --rouge-bright: #e8483d;    /* đỏ logo — fill/decor */
  --or: #f0a51f;              /* vàng logo — decor nhỏ */
  --sarcelle: #17839c;        /* teal logo — hiếm khi dùng */
  --blanc: #fffdf6;
  --display: "Playfair Display", "Didot", Georgia, serif;
  --serif: "EB Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

body {
  font-family: var(--serif);
  color: var(--encre);
  background: var(--papier);
  line-height: 1.75;
  font-size: 18px;
  min-height: 100dvh;
  overflow-x: hidden;
}

::selection { background: rgba(232, 72, 61, 0.18); }

:focus-visible {
  outline: 2px solid var(--rouge);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Intro veil ---------- */
.intro-veil {
  position: fixed; inset: 0; z-index: 100;
  background: var(--encre);
  pointer-events: none;
  animation: veil-lift 1.1s cubic-bezier(.7, 0, .2, 1) .15s forwards;
}
@keyframes veil-lift {
  0%   { opacity: 1; }
  55%  { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Layout ---------- */
.container { width: min(1140px, 92%); margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: transparent;
  transition: background .4s ease, box-shadow .4s ease, backdrop-filter .4s ease;
}
.site-header.is-scrolled {
  background: rgba(249, 244, 231, 0.88);
  backdrop-filter: blur(10px) saturate(110%);
  box-shadow: 0 1px 0 rgba(31, 37, 71, 0.1);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  /* padding-top lớn khi ở đầu trang: nav nằm gọn BÊN TRONG khung kẻ đôi của bìa
     (khung inset 20px + line trong 26px) thay vì bị line cắt ngang chữ */
  padding: 40px 0 14px;
  transition: padding .35s ease;
}
.site-header.is-scrolled .nav { padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 86px; height: auto; }
.brand-name {
  font-family: var(--sans);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--encre-mute);
  border-left: 1px solid rgba(31, 37, 71, .25);
  padding-left: 12px;
  line-height: 1.5;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--encre-soft);
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--rouge); }
.hub-pill {
  font-style: normal !important;
  font-family: var(--sans) !important;
  font-size: 13px !important; font-weight: 500;
  letter-spacing: .02em;
  color: var(--papier) !important;
  background: var(--encre);
  padding: 9px 18px;
  border-radius: 999px;
  transition: background .25s ease, transform .25s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.hub-pill:hover { background: var(--rouge); transform: translateY(-1px); }
.hub-pill .arr { font-size: 12px; }

.menu-toggle { display: none; }

/* ---------- Cover (hero = bìa sách) ---------- */
.cover {
  position: relative;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 110px 0 90px;
}
/* Khung kẻ đôi Gallimard: rouge ngoài, encre trong */
.cover-frame {
  position: absolute; inset: 20px;
  border: 1.5px solid var(--rouge-bright);
  pointer-events: none;
}
.cover-frame::after {
  content: "";
  position: absolute; inset: 5px;
  border: 1px solid var(--encre);
}
.cover-inner { position: relative; max-width: 760px; }

.cover-eyebrow {
  font-family: var(--sans);
  font-size: 12px; font-weight: 500;
  letter-spacing: .34em; text-transform: uppercase;
  color: var(--encre-mute);
  animation: fade-in-up .8s ease .9s both;
}
.tricolore {
  display: flex; justify-content: center; gap: 9px;
  margin: 22px 0 8px;
  animation: fade-in-up .8s ease 1.05s both;
}
.tricolore i {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block;
}
.d-bleu  { background: #2d3273; }
.d-blanc { background: transparent; border: 1.5px solid var(--encre-faint); }
.d-rouge { background: var(--rouge-bright); }

.cover-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(68px, 13vw, 158px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--encre);
  animation: fade-in-up 1s cubic-bezier(.2, .7, .2, 1) 1.15s both;
}
.bang { color: var(--rouge-bright); }

.cover-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.6vw, 23px);
  color: var(--encre-mute);
  margin-top: 6px;
  animation: fade-in-up .9s ease 1.35s both;
}
.cover-lead {
  max-width: 560px;
  margin: 26px auto 0;
  font-size: clamp(17px, 2.2vw, 19px);
  color: var(--encre-soft);
  animation: fade-in-up .9s ease 1.5s both;
}
.cover-lead em { color: var(--encre); }

.cover-actions {
  display: flex; justify-content: center; align-items: center; gap: 26px;
  margin-top: 36px;
  flex-wrap: wrap;
  animation: fade-in-up .9s ease 1.65s both;
}
.btn-encre {
  font-family: var(--sans);
  font-size: 14px; font-weight: 500;
  color: var(--papier);
  background: var(--encre);
  padding: 14px 28px;
  border-radius: 999px;
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.btn-encre:hover {
  background: var(--rouge);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(31, 37, 71, .18);
}
.btn-lien {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--encre-soft);
  border-bottom: 1px solid rgba(31, 37, 71, .35);
  padding-bottom: 2px;
  transition: color .2s ease, border-color .2s ease;
}
.btn-lien:hover { color: var(--rouge); border-color: var(--rouge); }

.cover-imprint {
  position: absolute;
  bottom: 44px; left: 0; right: 0;
  font-family: var(--sans);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--encre-faint);
  text-align: center;
  animation: fade-in-up .9s ease 1.9s both;
}

.scroll-hint {
  position: absolute;
  bottom: 44px; right: 46px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--encre-faint);
  font-family: var(--sans);
  font-size: 10px; letter-spacing: .28em; text-transform: uppercase;
  writing-mode: vertical-rl;
  animation: fade-in-up 1s ease 2.1s both;
}
.scroll-hint .line {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, var(--encre-faint), transparent);
  animation: hint-drop 2.2s ease-in-out infinite;
}
@keyframes hint-drop {
  0%   { transform: scaleY(0); transform-origin: top; }
  45%  { transform: scaleY(1); transform-origin: top; }
  55%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Chapitres ---------- */
.chapitre { padding: 130px 0 110px; scroll-margin-top: 40px; }
.chapitre-alt {
  background:
    linear-gradient(to bottom, rgba(31, 37, 71, .035), rgba(31, 37, 71, 0) 140px),
    var(--papier-deep);
}
.prose { max-width: 680px; }

.running-head {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  font-family: var(--sans);
  font-size: 12px; font-weight: 500;
  letter-spacing: .34em; text-transform: uppercase;
  color: var(--rouge);
}
.running-head .rule {
  width: 56px; height: 1px;
  background: currentColor;
  opacity: .5;
}
.chapitre-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(34px, 5.4vw, 48px);
  line-height: 1.15;
  text-align: center;
  margin: 18px 0 54px;
}
.chapitre-intro {
  text-align: center;
  font-style: italic;
  color: var(--encre-mute);
  max-width: 520px;
  margin: -34px auto 60px;
}

.prose p + p { margin-top: 1.4em; }

/* Lettrine — chữ hoa đầu chương */
.lettrine::first-letter {
  font-family: var(--display);
  font-weight: 700;
  font-size: 4.6em;
  line-height: .82;
  float: left;
  color: var(--rouge);
  padding: 6px 14px 0 0;
}

/* Dramatis personae — ba cô gái */
.cast {
  list-style: none;
  margin: 44px 0;
  display: grid; gap: 30px;
}
.cast li {
  border-left: 2px solid rgba(194, 55, 45, .35);
  padding-left: 24px;
}
.cast-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.cast li p { color: var(--encre-soft); }

/* Ảnh dán như trong album */
.photographie {
  margin: 64px auto 0;
  max-width: 560px;
  background: var(--blanc);
  padding: 14px 14px 16px;
  box-shadow: 0 14px 38px rgba(31, 37, 71, .16);
  transform: rotate(-1.3deg);
  position: relative;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.photographie:hover { transform: rotate(0deg) scale(1.01); }
.photographie::before {
  /* băng dính giấy */
  content: "";
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 108px; height: 26px;
  background: rgba(239, 230, 208, .85);
  box-shadow: 0 1px 3px rgba(31, 37, 71, .12);
}
.photographie figcaption {
  font-style: italic;
  font-size: 15.5px;
  color: var(--encre-mute);
  text-align: center;
  padding-top: 12px;
}

/* ---------- Ba niềm tin ---------- */
.beliefs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1080px;
  margin: 0 auto;
}
.belief {
  padding: 12px 40px 20px;
  text-align: center;
  position: relative;
}
.belief + .belief { border-left: 1px solid rgba(31, 37, 71, .16); }
.belief-numeral {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 52px;
  color: var(--rouge-bright);
  display: block;
  line-height: 1;
}
.belief-fr {
  font-style: italic;
  font-size: 17px;
  color: var(--encre-mute);
  margin-top: 18px;
}
.belief h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.35;
  margin: 10px 0 14px;
}
.belief-note {
  font-size: 16.5px;
  color: var(--encre-soft);
  max-width: 300px;
  margin: 0 auto;
}

/* ---------- Pull quote + CTA ---------- */
.pullquote {
  position: relative;
  text-align: center;
  margin: 10px 0 50px;
  padding-top: 34px;
}
.pullquote::before {
  content: "«";
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: 120px;
  line-height: 1;
  color: rgba(232, 72, 61, .18);
  pointer-events: none;
}
.pullquote p {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.5;
}
.pullquote cite {
  display: block;
  margin-top: 18px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--encre-mute);
}

.cta-final {
  text-align: center;
  margin-top: 76px;
  padding-top: 56px;
  border-top: 1px solid rgba(31, 37, 71, .16);
}
.cta-signoff {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(40px, 6vw, 58px);
  margin-bottom: 28px;
}
.cta-actions {
  display: flex; justify-content: center; align-items: center; gap: 26px;
  flex-wrap: wrap;
}

/* ---------- Footer (bìa sau — mực đặc) ---------- */
.site-footer {
  background: var(--encre);
  color: rgba(249, 244, 231, .82);
  padding: 76px 0 36px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 48px;
}
.brand-block .brand img {
  width: 104px;
  filter: brightness(0) invert(1) opacity(.92);
}
.brand-block p {
  font-style: italic;
  margin-top: 18px;
  max-width: 300px;
  color: rgba(249, 244, 231, .66);
}
.socials { display: flex; gap: 14px; margin-top: 22px; }
.socials a {
  width: 36px; height: 36px;
  border: 1px solid rgba(249, 244, 231, .3);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.socials a:hover { border-color: var(--rouge-bright); color: var(--rouge-bright); transform: translateY(-2px); }
.socials svg { width: 17px; height: 17px; }

.site-footer h4 {
  font-family: var(--sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: .26em; text-transform: uppercase;
  color: rgba(249, 244, 231, .5);
  margin-bottom: 18px;
}
.site-footer ul { list-style: none; display: grid; gap: 10px; }
.site-footer ul a { transition: color .2s ease; }
.site-footer ul a:hover { color: var(--or); }

.copyright {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid rgba(249, 244, 231, .16);
  font-family: var(--sans);
  font-size: 13px;
  color: rgba(249, 244, 231, .55);
}
.coeur { color: var(--rouge-bright); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body { font-size: 17px; }

  .menu-toggle {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer;
    padding: 8px; z-index: 60;
  }
  .menu-toggle span {
    width: 24px; height: 2px;
    background: var(--encre);
    transition: transform .3s ease, opacity .3s ease;
  }
  .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-links {
    position: fixed; inset: 0;
    background: var(--papier);
    flex-direction: column; justify-content: center;
    gap: 34px;
    font-size: 24px;
    opacity: 0; pointer-events: none;
    transition: opacity .35s ease;
    z-index: 55;
  }
  .nav-links.open { opacity: 1; pointer-events: auto; }
  .nav-links a { font-size: 24px; }
  .hub-pill { font-size: 16px !important; padding: 14px 28px; }
  body.menu-open { overflow: hidden; }

  .brand-name { display: none; }

  .nav { padding: 30px 0 12px; }
  .site-header.is-scrolled .nav { padding: 10px 0; }

  .cover { padding: 96px 0 120px; }
  .cover-frame { inset: 12px; }
  .cover-imprint { bottom: 30px; letter-spacing: .2em; padding: 0 24px; }
  .scroll-hint { display: none; }

  .chapitre { padding: 90px 0 76px; }

  .beliefs { grid-template-columns: 1fr; max-width: 560px; gap: 44px; }
  .belief { padding: 0 8px; }
  .belief + .belief { border-left: none; border-top: 1px solid rgba(31, 37, 71, .16); padding-top: 44px; }

  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .copyright { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro-veil { animation: none; opacity: 0; visibility: hidden; }
  .cover-eyebrow, .tricolore, .cover-title, .cover-sub, .cover-lead,
  .cover-actions, .cover-imprint, .scroll-hint { animation: none; }
  .scroll-hint .line { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .photographie { transition: none; }
}
