/* EVERMIRA — страница памяти (демо, цель QR). Дополняет style.css */

.mem-hero {
  position: relative; padding: 120px 0 60px; overflow: hidden;
}
.mem-hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(800px 420px at 70% 0%, rgba(224,177,115,0.14), transparent 60%),
    linear-gradient(180deg, var(--ink-2), var(--ink));
}
.mem-hero .wrap { position: relative; z-index: 2; }
.mem-head { display: flex; gap: 38px; align-items: flex-end; flex-wrap: wrap; }
.portrait {
  width: 188px; height: 232px; flex: none; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(224,177,115,0.4);
  background: linear-gradient(160deg, #2a2f3c, #14171f);
  display: grid; place-items: center; position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait__mono { font-family: var(--serif); font-size: 64px; color: var(--gold); opacity: .8; }
.mem-id { flex: 1; min-width: 260px; }
.mem-id .eyebrow { margin-bottom: 12px; }
.mem-id h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.02; }
.mem-years { font-family: var(--serif); font-size: 22px; color: var(--gold); margin-top: 8px; letter-spacing: 2px; }
.mem-epitaph { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--muted); margin-top: 18px; max-width: 520px; }

.mem-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

/* секции страницы памяти */
.mem-section { padding: 64px 0; border-top: 1px solid var(--line-soft); }
.mem-section h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 8px; }
.mem-section .sub { color: var(--faint); margin-bottom: 34px; font-size: 14.5px; }

/* О человеке */
.about-text { font-size: 17.5px; color: var(--text); max-width: 720px; }
.about-text + .about-text { margin-top: 18px; }
.about-text.lead { font-family: var(--serif); font-size: 22px; color: var(--muted); }

/* таймлайн */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--gold), transparent); }
.tl-item { position: relative; padding: 0 0 30px 18px; }
.tl-item::before { content: ""; position: absolute; left: -28px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(224,177,115,0.15); }
.tl-year { font-family: var(--serif); font-size: 20px; color: var(--gold); }
.tl-item h4 { font-family: var(--sans); font-size: 16px; font-weight: 650; margin: 4px 0 4px; }
.tl-item p { color: var(--muted); font-size: 14.5px; max-width: 560px; }

/* ===== порядок секций: История → Лента → Голоса → Галерея → Голос ===== */
#mem-root { display: flex; flex-direction: column; }
#mem-root > .mem-hero { order: 0; }
#mem-root > #bio { order: 1; }
#mem-root > #timeline { order: 2; }
#mem-root > #stories { order: 3; }
#mem-root > #gallery { order: 4; }
#mem-root > #voice { order: 5; }
#mem-root > footer { order: 9; }

/* ===== История жизни — единый рассказ ===== */
.life .wrap { max-width: 760px; }
.life-lead { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.5; color: var(--text); margin-bottom: 24px; }
.life-p { font-size: 17.5px; line-height: 1.8; color: var(--muted); margin-bottom: 18px; }
.life-p.dropcap::first-letter { font-family: var(--serif); font-size: 58px; line-height: .76; float: left; color: var(--gold); padding: 6px 12px 0 0; }

/* ===== Голоса близких (masonry-карточки-цитаты) ===== */
.voices { columns: 3 290px; column-gap: 18px; }
.voice-card { break-inside: avoid; margin: 0 0 18px; padding: 22px 24px 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-soft); border-left: 3px solid var(--gold); transition: transform .3s var(--ease); }
.voice-card:hover { transform: translateY(-3px); }
.voice-card[data-mood="happy"] { border-left-color: #e7c987; }
.voice-card[data-mood="sad"] { border-left-color: #9fb6d6; }
.voice-card[data-mood="warm"] { border-left-color: #e0a9a0; }
.voice-q { font-family: var(--serif); font-size: 54px; line-height: .3; color: var(--gold); opacity: .45; height: 24px; }
.voice-card blockquote { font-size: 16px; line-height: 1.62; color: var(--text); font-style: italic; margin: 0 0 18px; }
.voice-card figcaption { display: flex; align-items: center; gap: 11px; }
.voice-ava { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--serif); font-size: 15px; color: var(--ink); background: linear-gradient(150deg, var(--gold), var(--gold-soft)); }
.voice-who { display: flex; flex-direction: column; line-height: 1.2; }
.voice-who b { font-size: 14px; }
.voice-who span { font-size: 12px; color: var(--faint); }
.voice-card figcaption .tline-mood { margin: 0 0 0 auto; }
@media (max-width: 560px) { .voices { columns: 1; } .life-p.dropcap::first-letter { font-size: 46px; } }

/* ===== живая лента жизни (зигзаг: события + воспоминания родных) ===== */
.tline-filter { display: flex; gap: 8px; margin: 4px 0 26px; flex-wrap: wrap; }
.tlf { font-size: 12.5px; padding: 7px 15px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); transition: .2s; }
.tlf:hover { color: var(--text); }
.tlf.sel { color: var(--gold); border-color: var(--gold); background: rgba(224,177,115,0.08); }

.tline { position: relative; margin-top: 8px; }
.tline::before { content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 2px; transform: translateX(-50%); background: linear-gradient(180deg, transparent, var(--gold) 7%, var(--gold) 93%, transparent); opacity: .35; }
.tline-item { position: relative; width: 50%; padding: 0 46px 30px; box-sizing: border-box; }
.tline-item.l { left: 0; }
.tline-item.r { left: 50%; }
.tline-item.hide { display: none; }
.tline-dot { position: absolute; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(224,177,115,0.15); z-index: 2; }
.tline-item.l .tline-dot { right: -7px; }
.tline-item.r .tline-dot { left: -7px; }
/* якорь десятилетия на оси */
.tline-era { position: relative; width: 100%; left: 0; text-align: center; padding: 8px 0 22px; }
.tline-era.hide { display: none; }
.tline-era span { display: inline-block; background: var(--ink); border: 1px solid var(--line); color: var(--gold); font-family: var(--serif); font-size: 15px; letter-spacing: 1px; padding: 4px 16px; border-radius: 20px; position: relative; z-index: 2; }
/* mood-акцент карточки-воспоминания */
.tline-item[data-mood="happy"] .tline-card { border-color: rgba(231,201,135,0.4); }
.tline-item[data-mood="sad"] .tline-card { border-color: rgba(159,182,214,0.4); }
.tline-item[data-mood="warm"] .tline-card { border-color: rgba(224,169,160,0.4); }
.tline-item[data-kind="memory"] .tline-dot { background: var(--azure); box-shadow: 0 0 0 4px rgba(143,176,212,0.15); }

.tline-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 18px 20px; transition: transform .3s var(--ease), border-color .3s; }
.tline-card:hover { transform: translateY(-3px); border-color: rgba(224,177,115,0.3); }
.tline-item[data-kind="memory"] .tline-card { background: linear-gradient(160deg, rgba(143,176,212,0.08), var(--ink-2)); }
.tline-when { font-family: var(--serif); font-size: 20px; color: var(--gold); margin-bottom: 4px; }
.tline-item[data-kind="memory"] .tline-when { color: var(--azure); }
.tline-card h4 { font-family: var(--sans); font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.tline-card p { font-size: 14.5px; color: var(--muted); }
.tline-media { width: 100%; max-height: 190px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; }
.tline-video { position: relative; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.tline-video img { width: 100%; max-height: 190px; object-fit: cover; display: block; }
.tline-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,9,12,0.25); }
.tline-play svg { width: 44px; height: 44px; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.55)); }
.tline-author { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 13px; color: var(--text); }
.tline-ava { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--serif); font-size: 13px; color: var(--ink); background: linear-gradient(150deg, var(--gold), var(--gold-soft)); }
.tline-mood { display: inline-block; margin-top: 10px; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); }
.tline-mood.happy { color: #e7c987; border-color: rgba(231,201,135,0.4); }
.tline-mood.sad { color: #9fb6d6; border-color: rgba(159,182,214,0.4); }
.tline-mood.warm { color: #e0a9a0; border-color: rgba(224,169,160,0.4); }

.reveal-tl { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-tl.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .tline::before { left: 18px; }
  .tline-item.l, .tline-item.r { width: 100%; left: 0; padding: 0 0 26px 46px; }
  .tline-item .tline-dot { left: 11px !important; right: auto !important; top: 8px; }
  .tline-era { text-align: left; padding-left: 6px; }
}

/* галерея */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ph {
  position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, #283041, #161a24);
  border: 1px solid var(--line-soft);
}
.ph.tall { aspect-ratio: 3 / 4; grid-row: span 2; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.ph:hover img { transform: scale(1.06); }
.ph__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 14px 10px; font-size: 12.5px; color: #fff; background: linear-gradient(0deg, rgba(8,9,12,0.85), transparent); }

/* воспоминания (карточки родных) */
.memories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.memo {
  padding: 26px 24px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-soft);
  transition: transform .35s var(--ease), border-color .35s;
}
.memo:hover { transform: translateY(-4px); border-color: var(--line); }
.memo__who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.memo__ava { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--serif); font-size: 18px; color: var(--ink); background: linear-gradient(150deg, var(--gold), var(--gold-soft)); }
.memo__name { font-weight: 650; font-size: 15px; }
.memo__rel { font-size: 12.5px; color: var(--faint); }
.memo p { color: var(--muted); font-size: 14.8px; font-style: italic; }
.memo--audio { display: flex; align-items: center; gap: 14px; }
.memo--audio .play { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(224,177,115,0.15); border: 1px solid rgba(224,177,115,0.35); }
.memo--audio .play svg { width: 18px; height: 18px; color: var(--gold); }
.memo--audio .wave { flex: 1; height: 30px; display: flex; align-items: center; gap: 3px; }
.memo--audio .wave i { width: 3px; border-radius: 3px; background: var(--gold-soft); opacity: .55; display: block; }

/* контрибьютор-приглашение */
.invite {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 30px 32px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(143,176,212,0.10), var(--ink-2)); border: 1px solid var(--line);
}
.invite h3 { font-size: 24px; margin-bottom: 6px; }
.invite p { color: var(--muted); font-size: 14.5px; max-width: 460px; }

/* ИИ-аватар блок */
.ai-card {
  display: grid; grid-template-columns: 200px 1fr; gap: 30px; align-items: center;
  padding: 34px; border-radius: 20px; background: linear-gradient(155deg, var(--panel), var(--ink-2)); border: 1px solid rgba(224,177,115,0.25);
}
.ai-orb {
  width: 200px; height: 200px; border-radius: 50%; position: relative; place-self: center;
  background: radial-gradient(circle at 50% 38%, rgba(224,177,115,0.55), rgba(224,177,115,0.05) 62%, transparent 70%);
}
.ai-orb::before, .ai-orb::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(224,177,115,0.3);
  animation: pulse 3.4s ease-in-out infinite;
}
.ai-orb::after { animation-delay: 1.7s; }
@keyframes pulse { 0% { transform: scale(.7); opacity: .8; } 100% { transform: scale(1.25); opacity: 0; } }
.ai-orb__core { position: absolute; inset: 38%; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fff3d6, var(--gold)); box-shadow: 0 0 40px var(--glow-gold); }
.ai-card h3 { font-size: 26px; margin-bottom: 8px; }
.ai-card p { color: var(--muted); font-size: 15px; margin-bottom: 8px; }
.ai-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--azure); border: 1px solid rgba(143,176,212,0.35); padding: 6px 12px; border-radius: 20px; margin-bottom: 16px; }
.ai-badge svg { width: 14px; height: 14px; }

/* QR-блок */
.qr-band { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; padding: 30px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-soft); }
.qr-code { width: 132px; height: 132px; flex: none; border-radius: 14px; background: #fff; padding: 12px; }
.qr-code svg { width: 100%; height: 100%; }

@media (max-width: 760px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .memories { grid-template-columns: 1fr; }
  .ai-card { grid-template-columns: 1fr; text-align: center; }
  .ph.tall { grid-row: span 1; }
}
