/* ============================================================
   LAM — Landing
   "Cho những điều ở lại."
   Warm paper · ô-ly notebook grid · indigo (chàm) night · gold
   ============================================================ */

:root {
  --paper-0: #F7F3EA;
  --paper-1: #FFFDF7;
  --paper-2: #EFE8D9;
  --line:    #E6DDCB;
  --line-soft:#F0E9DC;

  --ink:   #22242E;
  --ink-2: #585A66;
  --ink-3: #8C8A82;

  --lam-900:#181F38; --lam-800:#232C4C; --lam-700:#2E3A66;
  --lam-600:#3B4A84; --lam-500:#4E5EA0; --lam-400:#7986C2;
  --lam-200:#D2D6EC; --lam-100:#E8EAF4;

  --gold-700:#A8742E; --gold-600:#C28A3A; --gold-500:#D9A24E;
  --gold-300:#ECCB8C; --gold-100:#F6ECD6;

  --joy:#D9A24E; --calm:#6E84B8; --grateful:#8AA17C;
  --tender:#C98B8B; --tired:#B08968;

  --cream: #F6F1E4;

  --display: 'Cormorant', 'Lora', Georgia, serif;
  --serif: 'Lora', Georgia, serif;
  --sans: 'Be Vietnam Pro', -apple-system, system-ui, sans-serif;

  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-xl: 30px;

  --shadow-sm: 0 1px 2px rgba(24,31,56,.05), 0 2px 6px rgba(24,31,56,.04);
  --shadow-md: 0 2px 6px rgba(24,31,56,.06), 0 10px 28px rgba(24,31,56,.08);
  --shadow-lg: 0 12px 36px rgba(24,31,56,.12), 0 40px 80px rgba(24,31,56,.10);

  --wrap: 1160px;
  --oly: 26px;                      /* notebook cell */
  --oly-line: rgba(59,74,132,.055); /* faint indigo rule */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(20px, 4.5vw, 48px); }

::selection { background: var(--lam-200); color: var(--lam-900); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}
.skip {
  position: fixed; top: -100px; left: 16px; z-index: 100;
  background: var(--lam-700); color: var(--cream);
  padding: 10px 16px; border-radius: 0 0 12px 12px;
  transition: top .2s ease;
}
.skip:focus { top: 0; }

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

/* ---- paper grain ---- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px; opacity: .035; mix-blend-mode: multiply;
}

/* ============================================================
   Reveal on scroll
   ============================================================ */
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity .9s cubic-bezier(.22,.6,.2,1) var(--d, 0s),
              transform .9s cubic-bezier(.22,.6,.2,1) var(--d, 0s);
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  transition: background .35s ease, box-shadow .35s ease, border-color .35s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(247,243,234,.86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px; gap: 16px;
}

.wordmark { display: inline-flex; align-items: center; gap: 10px; }
.seal {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--lam-700); color: var(--cream);
  font-family: var(--display); font-weight: 600; font-size: 19px;
  display: grid; place-items: center; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(246,241,228,.18), var(--shadow-sm);
}
.wm-text { font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: -.01em; }
.wm-dot { font-style: normal; color: var(--gold-600); }

.nav-links { display: flex; gap: clamp(16px, 2.6vw, 30px); }
.nav-links a { font-size: 14.5px; color: var(--ink-2); padding: 6px 2px; transition: color .2s; }
.nav-links a:hover { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: .08em;
  color: var(--ink-2); background: none; border: 1px solid var(--line);
  border-radius: 9px; padding: 6px 10px; cursor: pointer; transition: all .2s;
}
.lang:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  border-radius: 14px; padding: 13px 22px; border: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; border-radius: 11px; }
.btn-lg { padding: 16px 28px; font-size: 16px; border-radius: 16px; }
.btn-ink { background: var(--lam-700); color: var(--cream); box-shadow: var(--shadow-sm); }
.btn-ink:hover { background: var(--lam-600); box-shadow: var(--shadow-md); }
.btn-gold { background: var(--gold-500); color: #3A2A0E; }
.btn-gold:hover { background: var(--gold-300); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-3); }

/* ============================================================
   Ô-LY NOTEBOOK GRID  (the soul of the page)
   ============================================================ */
.olygrid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--oly-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--oly-line) 1px, transparent 1px);
  background-size: var(--oly) var(--oly);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
}
.olygrid-soft {
  -webkit-mask-image: radial-gradient(90% 80% at 50% 45%, #000 20%, transparent 75%);
          mask-image: radial-gradient(90% 80% at 50% 45%, #000 20%, transparent 75%);
  opacity: .8;
}
.margin-line {
  position: absolute; top: 0; bottom: 0; left: clamp(28px, 6vw, 96px);
  width: 1px; background: rgba(201,139,139,.4); pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 65%, transparent);
          mask-image: linear-gradient(#000 65%, transparent);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(120px, 16vh, 170px) 0 clamp(40px, 7vh, 80px);
  min-height: 92svh;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: clamp(28px, 5vw, 72px); align-items: center;
}

.eyebrow {
  font-family: var(--serif); font-style: italic; font-size: 16px;
  color: var(--gold-700); margin: 0 0 8px;
}
.hero-h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(48px, 6.4vw, 86px);
  line-height: .98; letter-spacing: -.015em;
  margin: 10px 0 0; color: var(--lam-900);
}
.h1-line { display: block; white-space: nowrap; }
.hero-h1 em { font-style: italic; font-weight: 500; color: var(--lam-700); }
.h1-dot { color: var(--gold-500); }

.hero-sub {
  font-size: clamp(16.5px, 1.6vw, 19px); line-height: 1.7;
  color: var(--ink-2); max-width: 44ch; margin: 26px 0 0;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; align-items: center; }
.hero-trust { font-size: 13px; color: var(--ink-3); margin-top: 20px; letter-spacing: .01em; }

/* the living diary card */
.hero-diary { position: relative; justify-self: center; width: min(420px, 100%); }
.diary-card {
  position: relative; z-index: 2; margin: 0;
  background: var(--paper-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 30px 30px 24px;
  transform: rotate(1.6deg);
  background-image:
    linear-gradient(transparent calc(100% - 1px), rgba(59,74,132,.07) calc(100% - 1px));
  background-size: 100% 34px;
  background-position: 0 14px;
}
.diary-tape {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 92px; height: 26px; border-radius: 2px;
  background: rgba(217,162,78,.28);
  border: 1px solid rgba(217,162,78,.18);
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
}
.diary-date {
  font-family: var(--serif); font-style: italic; font-size: 14.5px;
  color: var(--ink-3); margin: 0 0 10px;
}
.diary-text {
  font-family: var(--serif); font-size: 19px; line-height: 34px;
  color: var(--ink); margin: 0; min-height: 102px;
}
.caret {
  display: inline-block; width: 2px; height: 1.1em; margin-left: 2px;
  background: var(--lam-600); vertical-align: -3px;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

.diary-meta {
  display: flex; align-items: center; gap: 12px; margin-top: 18px;
  font-size: 12.5px; color: var(--ink-3);
}
.diary-chan { color: var(--lam-500); font-weight: 500; }
.diary-lock { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.diary-lock svg { opacity: .75; }

.mood-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  background: var(--calm); flex-shrink: 0;
}
.mood-dot.joy { background: var(--joy); }
.mood-dot.calm { background: var(--calm); }
.mood-dot.grateful { background: var(--grateful); }
.mood-dot.tender { background: var(--tender); }

.diary-shadow-card {
  position: absolute; inset: 14px -14px -14px 14px; z-index: 1;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r-md); transform: rotate(-1.8deg);
}

.hero-foot { margin-top: clamp(24px, 6vh, 56px); display: flex; justify-content: center; }
.hero-scroll {
  width: 1px; height: 56px;
  background: linear-gradient(var(--ink-3), transparent);
  animation: drip 2.4s ease-in-out infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  35% { transform: scaleY(1); opacity: .9; }
  100% { transform: scaleY(1); transform-origin: top; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .hero-scroll { animation: none; opacity: .5; } }

/* ============================================================
   SECTIONS — shared scaffolding
   ============================================================ */
.sec { position: relative; padding: clamp(86px, 12vh, 150px) 0; }
.sec-paper { background: var(--paper-0); }
.sec-soft { background: var(--paper-2); }

.sec-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 88px); align-items: center;
}
.sec-grid-rev > .sec-copy { order: 2; }
.sec-grid-rev > :not(.sec-copy) { order: 1; }

.kicker {
  display: flex; align-items: center; gap: 14px; margin: 0 0 14px;
}
.kicker-center { justify-content: center; }
.k-num {
  font-family: var(--serif); font-style: italic; font-size: 17px;
  color: var(--gold-700); letter-spacing: .02em;
}
.k-rule { width: 44px; height: 1px; background: var(--gold-500); opacity: .55; }
.kicker-gold .k-num { color: var(--gold-300); }
.kicker-gold .k-rule { background: var(--gold-300); }

.sec-h2 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(38px, 4.6vw, 62px); line-height: 1.02;
  letter-spacing: -.01em; color: var(--lam-900); margin: 0;
}
.lead {
  font-size: clamp(16px, 1.4vw, 17.5px); line-height: 1.75;
  color: var(--ink-2); margin: 22px 0 0; max-width: 52ch;
}
.lead i, .collage-note i { font-family: var(--serif); }
.lead-2 { margin-top: 14px; color: var(--ink-3); font-style: italic; font-family: var(--serif); }
.sec-copy-center { text-align: center; }
.lead-center { margin-left: auto; margin-right: auto; max-width: 56ch; }

.plain-list { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 14px; }
.plain-list li { display: flex; gap: 13px; align-items: flex-start; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.plain-list i { font-family: var(--serif); color: var(--lam-600); }
.li-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); margin-top: 9px; flex-shrink: 0; }

/* ============================================================
   S1 — visibility demo
   ============================================================ */
.demo-entry { justify-self: center; width: min(440px, 100%); }
.entry-card {
  background: var(--paper-1); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: 22px 24px 18px;
  transition: box-shadow .4s ease, border-color .4s ease;
}
.entry-card.is-public { border-color: var(--gold-300); box-shadow: 0 2px 6px rgba(194,138,58,.08), 0 14px 36px rgba(194,138,58,.14); }

.entry-head { display: flex; align-items: center; gap: 11px; }
.entry-head > div { display: flex; flex-direction: column; line-height: 1.25; }
.entry-author { font-weight: 600; font-size: 14.5px; }
.entry-time { font-size: 12px; color: var(--ink-3); }
.entry-chan { margin-left: auto; font-size: 12.5px; color: var(--lam-500); font-weight: 500; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; flex-shrink: 0;
  font-family: var(--serif); font-weight: 600; font-size: 15px;
  color: var(--cream);
}
.avatar.sm { width: 24px; height: 24px; font-size: 11.5px; }
.av-m { background: var(--lam-500); }
.av-h { background: var(--grateful); }
.av-b { background: var(--tender); }
.av-l { background: var(--gold-600); }

.entry-body { font-family: var(--serif); font-size: 16.5px; line-height: 1.65; margin: 14px 0 16px; }

.entry-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.vis-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); transition: color .3s; }
.vis-state .vis-ic-leaf { display: none; }
.vis-state[data-public="true"] { color: var(--gold-700); }
.vis-state[data-public="true"] .vis-ic-lock { display: none; }
.vis-state[data-public="true"] .vis-ic-leaf { display: inline; }

.vis-toggle {
  position: relative; display: inline-flex; align-items: center;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px; cursor: pointer; gap: 0; transition: background .3s, border-color .3s;
}
.vis-lab {
  position: relative; z-index: 2; font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; transition: color .3s; color: var(--ink-3);
}
.vis-knob {
  position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px); border-radius: 999px;
  background: var(--lam-700); box-shadow: var(--shadow-sm);
  transition: transform .35s cubic-bezier(.34,1.4,.4,1), background .3s;
}
.vis-toggle[aria-checked="false"] .vis-lab-priv { color: var(--cream); }
.vis-toggle[aria-checked="true"] .vis-knob { transform: translateX(100%); background: var(--gold-500); }
.vis-toggle[aria-checked="true"] .vis-lab-pub { color: #3A2A0E; }
.vis-toggle[aria-checked="true"] .vis-lab-priv { color: var(--ink-3); }

.demo-note {
  font-size: 13px; color: var(--ink-3); text-align: center;
  margin: 18px 8px 0; font-style: italic; font-family: var(--serif);
}

/* ============================================================
   S2 — phone
   ============================================================ */
.phone-wrap { display: flex; justify-content: center; }
.phone {
  position: relative; width: min(330px, 86vw);
  border-radius: 46px; padding: 12px;
  background: linear-gradient(160deg, #2A3252, #181F38);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(246,241,228,.08);
}
.phone-notch {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 86px; height: 22px; border-radius: 999px; background: #10141F; z-index: 3;
}
.phone-screen {
  background: var(--paper-0); border-radius: 36px; overflow: hidden;
  display: flex; flex-direction: column; height: 600px;
}
.ph-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 56px 20px 12px;
}
.ph-space { font-family: var(--serif); font-weight: 600; font-size: 21px; color: var(--lam-900); }
.ph-members { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.ph-avs { display: flex; }
.ph-avs .avatar { width: 26px; height: 26px; font-size: 12px; border: 2px solid var(--paper-0); margin-left: -7px; }

.ph-chans { display: flex; gap: 7px; padding: 8px 20px 12px; }
.chan {
  font-size: 11.5px; font-weight: 500; color: var(--ink-2);
  background: var(--paper-1); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.chan.on { background: var(--lam-700); border-color: var(--lam-700); color: var(--cream); }

.ph-feed { flex: 1; padding: 4px 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.ph-card {
  background: var(--paper-1); border: 1px solid var(--line-soft);
  border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.ph-card p { font-family: var(--serif); font-size: 13.5px; line-height: 1.55; margin: 8px 0 0; color: var(--ink); }
.ph-card-fade { opacity: .55; }
.ph-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ph-time { margin-left: auto; font-size: 10.5px; color: var(--ink-3); }
.ph-meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.ph-react { font-size: 11px; color: var(--ink-3); }
.ph-photo {
  margin-top: 8px; height: 86px; border-radius: 10px;
  background:
    url("assets/photo-dinner.webp") center/cover no-repeat,
    radial-gradient(80% 90% at 25% 20%, rgba(217,162,78,.35), transparent 60%),
    radial-gradient(70% 80% at 80% 80%, rgba(138,161,124,.4), transparent 65%),
    linear-gradient(150deg, #E5DECE, #D9CDB4);
  display: grid; place-items: end start; padding: 8px;
}
.ph-photo span {
  font-size: 10px; color: #6B5E48; background: rgba(247,243,234,.82);
  border-radius: 6px; padding: 2px 7px;
}
.ph-tabs {
  display: flex; justify-content: space-around; align-items: center;
  border-top: 1px solid var(--line-soft); background: var(--paper-1);
  padding: 14px 10px 22px; font-size: 11px; color: var(--ink-3);
}
.ph-tabs .on { color: var(--lam-700); font-weight: 600; }

/* ============================================================
   S3 — memory collage
   ============================================================ */
.sec-collage { overflow: hidden; }
.collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin-top: clamp(40px, 7vh, 80px);
  min-height: 540px;
}
.mem {
  background: var(--paper-1); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  padding: 22px 24px; width: min(300px, 78vw);
  transition: box-shadow .3s ease;
  will-change: transform;
}
.mem:hover { box-shadow: var(--shadow-lg); }
.mem-date { font-family: var(--serif); font-style: italic; font-size: 12.5px; color: var(--ink-3); margin: 0 0 8px; }
.mem-text { font-family: var(--serif); font-size: 16.5px; line-height: 1.6; margin: 0; }
.mem-tags { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--lam-500); font-weight: 500; margin: 14px 0 0; }
.mem-photo {
  height: 120px; border-radius: 10px; margin: 0 0 12px;
  display: grid; place-items: end start; padding: 8px;
}
.mem-photo span { font-size: 10.5px; color: #5C637E; background: rgba(247,243,234,.85); border-radius: 6px; padding: 2px 8px; }
.mem-photo-rain {
  background:
    url("assets/photo-rain.webp") center bottom/cover no-repeat,
    repeating-linear-gradient(105deg, transparent 0 9px, rgba(246,241,228,.16) 9px 10px),
    radial-gradient(90% 90% at 70% 15%, rgba(110,132,184,.5), transparent 70%),
    linear-gradient(160deg, #8E9BBE, #5C6A92);
  place-items: end end;
}
.mem-photo-rain span { color: #44506E; }
.mem-photo-school {
  background:
    url("assets/photo-school.webp") center/cover no-repeat,
    radial-gradient(70% 70% at 30% 25%, rgba(236,203,140,.7), transparent 65%),
    linear-gradient(150deg, #E2C99A, #C9A56B);
}
.mem-photo-school span { color: #6B5630; }

.mem-1 { grid-area: 1 / 1 / 2 / 3; transform: rotate(-2.4deg); justify-self: start; align-self: start; margin-top: 30px; }
.mem-2 { grid-area: 1 / 3 / 2 / 5; transform: rotate(1.3deg); justify-self: center; align-self: start; }
.mem-3 { grid-area: 1 / 5 / 2 / 7; transform: rotate(2.2deg); justify-self: end; align-self: start; margin-top: 64px; }
.mem-4 { grid-area: 2 / 2 / 3 / 4; transform: rotate(-1.4deg); justify-self: center; align-self: end; margin-top: 34px; }
.mem-5 { grid-area: 2 / 4 / 3 / 6; transform: rotate(1.8deg); justify-self: center; align-self: end; margin-top: 70px; }

.collage-note {
  text-align: center; font-size: 14px; color: var(--ink-3);
  margin: clamp(40px, 6vh, 64px) auto 0; font-family: var(--serif); font-style: italic;
}

/* ============================================================
   S4 — NIGHT (chàm)
   ============================================================ */
.night {
  position: relative; color: var(--cream);
  background:
    radial-gradient(140% 70% at 50% 110%, #2E3A66 0%, transparent 60%),
    linear-gradient(#181F38 0%, #141A32 55%, #181F38 100%);
  padding: clamp(110px, 15vh, 180px) 0 clamp(96px, 13vh, 160px);
  overflow: hidden;
}
.night-dip {
  position: absolute; top: -1px; left: 0; right: 0; height: 110px;
  background: var(--paper-0);
  -webkit-clip-path: ellipse(75% 100% at 50% 0%);
          clip-path: ellipse(75% 100% at 50% 0%);
}
.stars {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(246,241,228,.65), transparent),
    radial-gradient(1px 1px at 28% 64%, rgba(246,241,228,.4), transparent),
    radial-gradient(1.5px 1.5px at 41% 16%, rgba(236,203,140,.5), transparent),
    radial-gradient(1px 1px at 56% 42%, rgba(246,241,228,.45), transparent),
    radial-gradient(2px 2px at 68% 14%, rgba(246,241,228,.5), transparent),
    radial-gradient(1px 1px at 79% 56%, rgba(246,241,228,.35), transparent),
    radial-gradient(1.5px 1.5px at 88% 30%, rgba(236,203,140,.45), transparent),
    radial-gradient(1px 1px at 7% 78%, rgba(246,241,228,.3), transparent),
    radial-gradient(1.2px 1.2px at 94% 82%, rgba(246,241,228,.35), transparent);
}

.fireflies { position: absolute; inset: 0; pointer-events: none; }
.fly {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-300);
  box-shadow: 0 0 8px 2px rgba(236,203,140,.55);
  opacity: 0;
  animation: fly var(--t, 11s) ease-in-out var(--dl, 0s) infinite;
}
@keyframes fly {
  0%   { transform: translate(0, 0) scale(.7); opacity: 0; }
  12%  { opacity: .9; }
  50%  { transform: translate(var(--x, 40px), var(--y, -60px)) scale(1); opacity: .35; }
  72%  { opacity: .85; }
  100% { transform: translate(calc(var(--x, 40px) * 1.6), calc(var(--y, -60px) * 1.9)) scale(.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .fly { animation: none; opacity: .5; } }

.night-inner { position: relative; }
.night-h2 { color: var(--cream); }
.night-lead { color: rgba(246,241,228,.72); }

.night-cols {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3.5vw, 44px); margin-top: clamp(48px, 7vh, 76px);
}
.ncol h3 {
  font-family: var(--serif); font-weight: 600; font-size: 20px;
  margin: 16px 0 8px; color: var(--cream);
}
.ncol p { font-size: 14.5px; line-height: 1.7; color: rgba(246,241,228,.66); margin: 0; }
.n-ic {
  width: 46px; height: 46px; border-radius: 14px;
  border: 1px solid rgba(236,203,140,.4); color: var(--gold-300);
  display: grid; place-items: center;
  background: rgba(236,203,140,.06);
}

.night-feed {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
  margin-top: clamp(80px, 11vh, 130px);
  padding-top: clamp(48px, 7vh, 72px);
  border-top: 1px solid rgba(246,241,228,.12);
}
.nf-h {
  font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.05; margin: 0; color: var(--cream);
}
.nf-p { font-size: 15.5px; line-height: 1.75; color: rgba(246,241,228,.68); margin: 18px 0 0; max-width: 46ch; }

.nf-card {
  background: rgba(246,241,228,.045);
  border: 1px solid rgba(246,241,228,.14);
  border-radius: var(--r-lg); padding: 24px 26px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.nf-entry p { font-family: var(--serif); font-size: 16px; line-height: 1.6; margin: 12px 0 0; color: rgba(246,241,228,.92); }
.nf-entry .ph-time { color: rgba(246,241,228,.4); }
.nf-entry b { font-weight: 600; font-size: 13px; }
.nf-end {
  display: flex; align-items: center; gap: 14px; margin-top: 26px;
  font-family: var(--serif); font-style: italic; font-size: 13.5px;
  color: rgba(236,203,140,.85); text-align: center;
}
.nf-end-rule { flex: 1; height: 1px; background: rgba(246,241,228,.14); }

/* ---- coming soon: time-locked letters + on this day ---- */
.soon {
  margin-top: clamp(80px, 11vh, 130px);
  padding-top: clamp(48px, 7vh, 72px);
  border-top: 1px solid rgba(246,241,228,.12);
}
.soon-head { max-width: 60ch; }
.soon-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  margin-top: clamp(40px, 6vh, 60px);
  align-items: start;
}
.otd, .letter { position: relative; padding-top: 18px; text-align: center; }

.soon-chip {
  position: absolute; top: 0; right: 0; z-index: 3;
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-300); background: rgba(236,203,140,.08);
  border: 1px solid rgba(236,203,140,.35); border-radius: 999px;
  padding: 5px 12px;
}

/* on-this-day: a memory glowing in the dark */
.otd-stack { position: relative; max-width: 360px; margin: 18px auto 0; }
.otd-sheet {
  position: absolute; inset: 0; z-index: 1;
  border-radius: var(--r-md); border: 1px solid rgba(246,241,228,.12);
}
.otd-sheet-1 { background: #E9E2D1; transform: rotate(2.6deg) translate(8px, 7px); opacity: .55; }
.otd-sheet-2 { background: #DDD5C2; transform: rotate(-3.2deg) translate(-9px, 12px); opacity: .35; }
.otd-card {
  position: relative; z-index: 2; margin: 0;
  background: var(--paper-1); color: var(--ink);
  border-radius: var(--r-md); padding: 24px 26px 22px;
  transform: rotate(-1.6deg); text-align: left;
  box-shadow:
    0 0 0 1px var(--line),
    0 18px 50px rgba(0,0,0,.45),
    0 0 80px rgba(217,162,78,.22);
}
.otd-kick {
  font-family: var(--serif); font-style: italic; font-size: 13.5px;
  color: var(--gold-700); margin: 0;
}
.otd-date { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }
.otd-text { font-family: var(--serif); font-size: 17px; line-height: 1.6; margin: 8px 0 0; }

/* the sealed letter */
.env {
  position: relative; margin: 18px auto 0; max-width: 360px;
  background: linear-gradient(168deg, #232C4E, #1A2140 70%);
  border: 1px solid rgba(246,241,228,.16);
  border-radius: 14px; overflow: hidden;
  padding: 86px 26px 30px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.env-flap {
  position: absolute; top: 0; left: 0; right: 0; height: 66px;
  background: linear-gradient(180deg, #2C3760, #222B4E);
  -webkit-clip-path: polygon(0 0, 100% 0, 50% 100%);
          clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.env-flap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(246,241,228,.06), transparent 60%);
}
.env-seal {
  position: absolute; left: 50%; top: 66px; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ECCB8C, #C28A3A 55%, #8F6224);
  border: 1px solid rgba(168,116,46,.7);
  color: #4A350F; font-family: var(--display); font-weight: 600; font-size: 27px;
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.45), inset 0 1px 2px rgba(255,255,255,.4);
}
.env-body { text-align: center; }
.env-to {
  font-family: var(--serif); font-style: italic; font-size: 19.5px;
  color: var(--cream); margin: 14px 0 0;
}
.env-sub { font-size: 13px; color: rgba(246,241,228,.55); margin: 6px 0 0; }
.env-sealed {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--serif); font-style: italic; font-size: 13.5px;
  color: var(--gold-300); margin: 18px 0 0;
}
.soon-cap {
  font-family: var(--serif); font-style: italic; font-size: 13.5px;
  color: rgba(246,241,228,.6); margin: 20px auto 0; max-width: 38ch;
}
.soon-more {
  text-align: center; font-size: 13px; color: rgba(246,241,228,.45);
  margin: clamp(40px, 6vh, 56px) auto 0;
}

/* ============================================================
   S5 — write one line
   ============================================================ */
.sec-write { text-align: center; }
.write-inner { position: relative; max-width: 720px; }
.write-form {
  display: flex; gap: 12px; margin: clamp(32px, 5vh, 48px) auto 0;
  max-width: 560px;
}
.write-input {
  flex: 1; min-width: 0;
  font-family: var(--serif); font-size: 17px; color: var(--ink);
  background: var(--paper-1); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.write-input::placeholder { color: var(--ink-3); font-style: italic; }
.write-input:focus { outline: none; border-color: var(--lam-400); box-shadow: 0 0 0 3px var(--lam-100); }

.kept { margin: clamp(36px, 5vh, 52px) auto 0; max-width: 480px; }
.kept-card { transform: rotate(-1.2deg); text-align: left; }
.kept-card .diary-text { min-height: 0; }
.kept.kept-enter .kept-card { animation: settle .7s cubic-bezier(.22,.9,.3,1.2) both; }
@keyframes settle {
  from { opacity: 0; transform: rotate(-1.2deg) translateY(34px) scale(.96); }
  to   { opacity: 1; transform: rotate(-1.2deg) translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .kept.kept-enter .kept-card { animation: none; } }
.kept-note {
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--ink-3); margin: 22px 0 0;
}
.kept-actions { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 18px; }
.kept-clear {
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 13px; color: var(--ink-3);
  text-decoration: underline; text-underline-offset: 3px; padding: 6px;
}
.kept-clear:hover { color: var(--ink-2); }

/* ============================================================
   S6 — pricing
   ============================================================ */
.plans {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-top: clamp(44px, 6vh, 64px);
  align-items: stretch;
}
.plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper-1); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 32px 30px 28px;
  box-shadow: var(--shadow-sm);
}
.plan-mid { border-color: var(--lam-200); }
.plan-night {
  background: linear-gradient(155deg, var(--lam-700), var(--lam-900) 70%);
  border-color: var(--lam-700); color: var(--cream); overflow: hidden;
}
.plan-night .grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.plan-name { font-family: var(--serif); font-weight: 600; font-size: 25px; margin: 0; }
.plan-name .plus { color: var(--gold-600); }
.plan-night .plan-name .together { font-family: var(--display); font-style: italic; font-weight: 500; color: var(--gold-300); }
.plan-price { font-size: 14px; color: var(--ink-3); margin: 8px 0 0; }
.plan-price b { font-size: 17px; color: var(--ink); font-weight: 600; }
.plan-night .plan-price { color: rgba(246,241,228,.6); }
.plan-night .plan-price b { color: var(--gold-300); }
.plan-yr { display: block; font-size: 12.5px; margin-top: 2px; }

.plan ul { list-style: none; padding: 0; margin: 22px 0 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.plan li { position: relative; padding-left: 24px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.plan li::before {
  content: ""; position: absolute; left: 2px; top: 7px;
  width: 10px; height: 6px;
  border-left: 2px solid var(--grateful); border-bottom: 2px solid var(--grateful);
  transform: rotate(-45deg);
}
.plan-night li { color: rgba(246,241,228,.82); }
.plan-night li::before { border-color: var(--gold-300); }
.plan-btn { width: 100%; }

.plans-note {
  text-align: center; font-size: 13.5px; color: var(--ink-3);
  margin: 30px auto 0; max-width: 56ch;
}

/* ============================================================
   CLOSING — dawn
   ============================================================ */
.closing {
  position: relative; text-align: center; color: var(--cream);
  background: linear-gradient(#181F38 0%, #1D2548 45%, #2E3A66 78%, #4A4870 100%);
  padding: clamp(110px, 16vh, 190px) 0 clamp(100px, 14vh, 170px);
  overflow: hidden;
}
.closing-dawn {
  position: absolute; left: 50%; bottom: -28vw; transform: translateX(-50%);
  width: 76vw; height: 76vw; max-width: 1000px; max-height: 1000px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,162,78,.32) 0%, rgba(217,162,78,.12) 38%, transparent 68%);
  pointer-events: none;
}
.closing-inner { position: relative; }
.closing-line {
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: clamp(28px, 4vw, 50px); line-height: 1.18;
  color: rgba(246,241,228,.92); margin: 0;
}
.closing-wm {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(90px, 14vw, 190px); line-height: 1;
  letter-spacing: -.02em; margin-top: clamp(28px, 5vh, 52px);
  color: var(--cream);
}
.closing-tag {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(17px, 2vw, 23px); color: var(--gold-300);
  margin: 14px 0 0;
}
.closing-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: clamp(34px, 5vh, 50px); }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--cream); color: var(--lam-900);
  border-radius: 16px; padding: 12px 22px;
  transition: transform .15s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-md);
}
.store-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.store-badge span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.store-badge small { font-size: 11px; color: var(--ink-2); }
.store-badge b { font-size: 16.5px; font-weight: 600; }
.closing-soon { font-size: 13px; color: rgba(246,241,228,.5); margin-top: 22px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: #101524; color: rgba(246,241,228,.62); padding: clamp(48px, 7vh, 72px) 0 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: clamp(28px, 4vw, 48px); padding-bottom: 44px;
}
.f-wm { color: var(--cream); font-size: 24px; }
.f-tag { font-family: var(--serif); font-style: italic; font-size: 14.5px; color: rgba(246,241,228,.55); margin: 8px 0 0; }
.f-made { font-size: 12.5px; color: rgba(246,241,228,.38); margin: 18px 0 0; }
.f-col { display: flex; flex-direction: column; gap: 10px; }
.f-col h4 {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(246,241,228,.4); margin: 0 0 6px;
}
.f-col a { font-size: 14px; color: rgba(246,241,228,.66); transition: color .2s; }
.f-col a:hover { color: var(--cream); }
.f-bottom {
  display: flex; gap: 10px; align-items: center;
  border-top: 1px solid rgba(246,241,228,.1);
  padding-top: 22px; padding-bottom: 26px; font-size: 12.5px;
  color: rgba(246,241,228,.4);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero { min-height: 0; }
  .hero-diary { width: min(440px, 100%); }
  .sec-grid { grid-template-columns: 1fr; gap: 48px; }
  .sec-grid-rev > .sec-copy { order: 1; }
  .sec-grid-rev > :not(.sec-copy) { order: 2; }
  .night-cols { grid-template-columns: 1fr; gap: 36px; }
  .night-feed { grid-template-columns: 1fr; }
  .soon-grid { grid-template-columns: 1fr; gap: 56px; }
  .plans { grid-template-columns: 1fr; max-width: 440px; margin-left: auto; margin-right: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .collage {
    display: flex; flex-direction: column; align-items: center; gap: 22px; min-height: 0;
  }
  .mem { width: min(360px, 100%); margin: 0 !important; }
  .mem-1 { transform: rotate(-1.6deg); }
  .mem-2 { transform: rotate(1.2deg); }
  .mem-3 { transform: rotate(1.8deg); }
  .mem-4 { transform: rotate(-1.2deg); }
  .mem-5 { transform: rotate(1.4deg); }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding-top: 104px; }
  .hero-h1 { font-size: clamp(46px, 13vw, 64px); }
  .hero-cta .btn { width: 100%; }
  .margin-line { left: 22px; }
  .write-form { flex-direction: column; }
  .write-input { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .diary-card { padding: 24px 22px 20px; }
  .closing-cta { flex-direction: column; align-items: center; }
  .store-badge { width: min(280px, 100%); justify-content: center; }
}
