.inner-page { min-height: 100vh; background: #fffaf5; }
.inner-header { color: var(--ink); }
.inner-header nav a.active { color: var(--red); }
.privacy-label { color: #5e514d; font-size: 12px; }
.detail-page { background: #0b0909; }
.detail-page .site-header { color: #fff; border-bottom-color: rgba(255,255,255,.22); }
.detail-page .site-header {
  background:
    linear-gradient(rgba(8,6,6,.76), rgba(8,6,6,.76)),
    var(--kerose-memorial-art) center top / cover no-repeat;
}
.detail-page .site-header .brand-logo { padding: 0; background: transparent; border-radius: 0; filter: brightness(0) invert(1); }
.detail-page .site-header .brand strong { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.65); }
.detail-page .site-header .brand small,
.detail-page .site-header nav a,
.detail-page .privacy-label { color: #f3e9e7; }
.detail-page .site-header nav a:hover,
.detail-page .site-header nav a.active { color: #ff6674; }
.detail-page .site-header > nav { border-top-color: rgba(255,255,255,.22); }
.library-hero {
  position: relative;
  min-height: 390px;
  padding: 174px 24px 34px;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  background:
    radial-gradient(circle at 50% 55%, rgba(255,255,255,.98) 0 28%, rgba(255,244,240,.92) 56%, rgba(242,215,207,.55) 100%);
  border-bottom: 1px solid #eadbd2;
  overflow: hidden;
}
.library-hero::before {
  content: "";
  position: absolute;
  width: 285px;
  height: 285px;
  top: 42px;
  border: 1px solid rgba(200,31,45,.14);
  border-radius: 50%;
}
.library-hero > *:not(.library-rose) { position: relative; z-index: 2; }
.library-hero .eyebrow { margin-bottom: 10px; }
.library-hero h1 { max-width: 760px; margin-bottom: 9px; font-size: clamp(36px, 4vw, 50px); line-height: 1.08; letter-spacing: -.035em; }
.library-hero > p:not(.eyebrow):not(.privacy-line) { max-width: 680px; margin-bottom: 0; color: #6d5e58; font-size: 14px; line-height: 1.55; }
.library-rose { position: absolute; z-index: 1; width: 250px; pointer-events: none; filter: drop-shadow(0 20px 24px rgba(90,20,29,.14)); }
.library-rose-left { left: 3%; bottom: -92px; transform: rotate(-24deg); }
.library-rose-right { right: 2%; top: 92px; transform: scaleX(-1) rotate(-18deg); opacity: .83; }
.tribute-search { width: min(660px, 100%); min-height: 56px; margin-top: 14px; padding: 0 20px; display: flex; align-items: center; gap: 14px; text-align: left; background: #fff; border: 1px solid #d8c8c0; box-shadow: 0 13px 38px rgba(79,45,36,.09); }
.tribute-search > span { color: var(--red); font-size: 28px; }
.tribute-search input { flex: 1; min-width: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 14px; }
.tribute-search input::placeholder { color: #9a8d87; }
.tribute-search kbd { color: #9b8c85; background: none; font-family: "Manrope", sans-serif; font-size: 8px; letter-spacing: .15em; }
.library-hero .privacy-line { margin: 8px 0 0; color: #9a8a84; font-size: 9px; }
.tribute-directory { padding: 46px max(40px, calc((100vw - 1180px)/2)) 120px; background: #fffdf9; }
.directory-heading { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.directory-heading h2 { margin: 0; font-size: clamp(38px, 5vw, 58px); }
.directory-heading > p { margin: 0; color: #8e7f78; font-size: 11px; }
.tribute-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tribute-card { min-height: 590px; padding: 32px; display: flex; flex-direction: column; text-align: center; border: 1px solid #eadfd7; box-shadow: 0 18px 50px rgba(68,40,33,.08); transition: transform .25s, box-shadow .25s; }
.tribute-card-white { color: #211a18; background: #fff; }
.tribute-card-red { color: #fff; background: linear-gradient(145deg, #b61d2c, #7b111c); border-color: #85131e; }
.tribute-card-black { color: #fff; background: linear-gradient(145deg, #241b1a, #080808); border-color: #241d1c; }
.tribute-card[hidden], .empty-state[hidden] { display: none; }
.tribute-card:hover { transform: translateY(-5px); box-shadow: 0 26px 65px rgba(68,40,33,.12); }
.tribute-portrait { position: relative; height: 300px; margin-bottom: 28px; display: grid; place-items: center; background: linear-gradient(145deg, #f8e8e3, #ecd1c9); overflow: hidden; }
.tribute-portrait::before { content: ""; position: absolute; width: 148px; height: 148px; border: 1px solid rgba(200,31,45,.25); border-radius: 50%; }
.tribute-portrait span { position: relative; z-index: 2; color: #6d2b31; font-family: "Libre Baskerville", Georgia, serif; font-size: 46px; }
.tribute-portrait.has-photo { background: #1c1716; }
.tribute-portrait.has-photo::before, .tribute-portrait.has-photo span { display: none; }
.tribute-portrait-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: center; }
.portrait-two { background: linear-gradient(145deg, #f6ede5, #eadbd0); }
.portrait-three { background: linear-gradient(145deg, #f5e6e0, #e7c7c3); }
.tribute-card .mini-label { margin-bottom: 9px; }
.tribute-card h3 { margin-bottom: 8px; font-size: 24px; line-height: 1.3; }
.tribute-card .card-years { margin-bottom: 18px; color: #9a8580; font-size: 9px; letter-spacing: .18em; }
.tribute-card .card-forever { margin: 2px 0 24px; color: #861725; font-size: 20px; line-height: 1.3; letter-spacing: .02em; }
.tribute-card > a { margin-top: auto; padding-top: 18px; display: flex; justify-content: center; gap: 10px; color: var(--red); border-top: 1px solid #eee3dc; text-decoration: none; font-size: 11px; font-weight: 700; }
.tribute-card-red .mini-label, .tribute-card-black .mini-label { color: #ffd7da; }
.tribute-card-red h3, .tribute-card-black h3 { color: #fff; }
.tribute-card-red .card-years, .tribute-card-black .card-years { color: #f0c9cc; }
.tribute-card-red .card-forever, .tribute-card-black .card-forever { color: #fff; }
.tribute-card-red > a, .tribute-card-black > a { color: #fff; border-top-color: rgba(255,255,255,.25); }
.tribute-card-red .tribute-portrait, .tribute-card-black .tribute-portrait { border: 1px solid rgba(255,255,255,.3); }
.empty-state { padding: 80px 20px; text-align: center; }
.empty-state img { width: 90px; height: 110px; object-fit: cover; object-position: top; }
.empty-state h3 { margin: 8px 0; font-size: 25px; }
.empty-state p { color: #887a74; font-size: 12px; }
.directory-submit-link { margin-top: 18px; text-decoration: none; }
.inner-footer {
  color: #bdb5b0;
  background:
    linear-gradient(rgba(10,8,8,.95), rgba(10,8,8,.95)),
    var(--kerose-memorial-art) center bottom / cover no-repeat;
  border-top-color: #3a1519;
}
.inner-footer .footer-brand,
.inner-footer .brand strong { color: #fff; }
.inner-footer .brand small,
.inner-footer .prototype-note { color: #8f817c; }

.tribute-profile {
  position: relative;
  min-height: 860px;
  padding: 190px 30px 105px;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.2)),
    url("assets/kerose-memorial-doves-roses.png") center top / cover no-repeat,
    #090707;
  border-bottom: 6px solid #a91927;
  overflow: hidden;
}
.back-link { position: absolute; z-index: 4; left: max(18px, calc((100vw - 1240px)/2)); top: 12px; padding: 12px 17px; color: #171111; background: #fff; border: 1px solid rgba(255,255,255,.8); box-shadow: 0 8px 22px rgba(0,0,0,.28); text-decoration: none; font-size: 13px; font-weight: 700; }
.back-link:hover, .back-link:focus-visible { color: #fff; background: var(--red); border-color: var(--red); }
.profile-rose { position: absolute; width: 260px; filter: drop-shadow(0 20px 25px rgba(89,16,25,.15)); }
.profile-rose-left { left: 2%; bottom: -70px; transform: rotate(-22deg); }
.profile-rose-right { right: 2%; bottom: -60px; transform: scaleX(-1) rotate(-22deg); }
.profile-monogram { position: relative; z-index: 1; width: min(330px, 70vw); aspect-ratio: 1; margin-bottom: 40px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, rgba(169,25,39,.92), rgba(10,8,8,.94)); border: 8px solid #fff; border-radius: 4px; box-shadow: 0 0 0 2px #a91927, 0 26px 65px rgba(0,0,0,.48); font-family: "Libre Baskerville", Georgia, serif; font-size: 64px; overflow: hidden; }
.profile-monogram.has-photo { color: transparent; background: #171313; }
.profile-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: center; }
.tribute-profile > *:not(.profile-rose):not(.back-link) { position: relative; z-index: 2; }
.tribute-profile h1 { margin-bottom: 18px; color: #fff; font-size: clamp(48px, 7vw, 80px); line-height: 1.08; text-shadow: 0 4px 22px rgba(0,0,0,.75); }
.tribute-profile .eyebrow { color: #ff7a86; }
.profile-years { display: flex; align-items: center; gap: 14px; color: #f5dedb; font-size: 11px; letter-spacing: .2em; }
.profile-years span { width: 38px; height: 1px; background: var(--red); }
.profile-line { margin: 16px 0 24px; color: #fff; font-family: "Manrope", sans-serif; font-size: 17px; font-weight: 700; letter-spacing: .12em; text-shadow: 0 3px 14px rgba(0,0,0,.75); }
.legacy-row { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; }
.legacy-row span { padding: 7px 10px; color: #fff; background: rgba(9,7,7,.72); border: 1px solid rgba(255,255,255,.42); font-size: 8px; letter-spacing: .15em; }
.tribute-gallery-section { padding: 90px max(40px, calc((100vw - 1180px)/2)); color: #fff; background: #111; }
.tribute-gallery-section[hidden] { display: none; }
.tribute-section-heading { max-width: 760px; margin-bottom: 38px; }
.tribute-section-heading .eyebrow { color: #ef6a76; }
.tribute-section-heading h2 { margin: 6px 0 0; color: #fff; font-size: clamp(34px, 5vw, 54px); }
.tribute-gallery-shell { position: relative; }
.tribute-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x pan-y; }
.tribute-gallery::-webkit-scrollbar { display: none; }
.tribute-gallery-page { min-width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; scroll-snap-align: start; }
.tribute-gallery-frame { position: relative; aspect-ratio: 1; margin: 0; background: #2d2322; border: 1px solid rgba(255,255,255,.2); overflow: hidden; }
.tribute-gallery-photo { width: 100%; height: 100%; object-fit: cover; transform-origin: center; }
.tribute-video { color: #fff; background: #090808; transform: none !important; }
.gallery-arrow { position: absolute; z-index: 2; top: 50%; width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: rgba(8,6,7,.82); border: 1px solid rgba(255,255,255,.55); border-radius: 50%; transform: translateY(-50%); cursor: pointer; }
.gallery-arrow:hover { background: #a91927; }
.gallery-arrow:disabled { opacity: .28; cursor: default; }
.gallery-arrow-prev { left: -23px; }
.gallery-arrow-next { right: -23px; }
.gallery-dots { margin-top: 22px; display: flex; justify-content: center; gap: 9px; }
.gallery-dots[hidden] { display: none; }
.gallery-dots button { width: 9px; height: 9px; padding: 0; background: #625655; border: 0; border-radius: 50%; cursor: pointer; }
.gallery-dots button.active { background: #e52a3c; transform: scale(1.25); }
.gallery-swipe-note { margin: 13px 0 0; color: #c8bcba; text-align: center; font-size: 13px; }
.tribute-story-and-comments { padding: 100px max(40px, calc((100vw - 1180px)/2)) 120px; display: block; background: linear-gradient(180deg, #fff 0%, #fff9f5 100%); border-top: 1px solid #a91927; }
.full-story { max-width: 980px; margin: 0 auto; padding: 0; }
.full-story h2, .memory-wall h2 { margin-bottom: 25px; font-size: clamp(34px, 4vw, 48px); }
.story-copy { color: #493d39; font-family: "Libre Baskerville", Georgia, serif; font-size: clamp(17px, 2vw, 21px); line-height: 2; white-space: pre-line; }
.full-story blockquote { margin: 38px 0; padding: 4px 0 4px 22px; color: #4e3f3b; border-left: 2px solid var(--red); font-family: "Libre Baskerville", Georgia, serif; font-size: 18px; line-height: 1.7; }
.profile-important-dates { margin-top: 45px; display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 14px; }
.profile-important-dates[hidden] { display: none; }
.important-date { padding-top: 26px; display: flex; align-items: center; gap: 15px; border-top: 1px solid #eadfd8; }
.important-date > span { color: var(--red); font-size: 21px; }
.important-date div { display: grid; gap: 6px; }
.important-date small { color: #998983; font-size: 8px; letter-spacing: .16em; }
.important-date strong { font-family: "Libre Baskerville", Georgia, serif; font-size: 15px; }
.profile-awareness { margin-top: 54px; padding: 36px; color: #fff; background: linear-gradient(135deg, #171313 0%, #2b1719 58%, #85121e 100%); border-left: 5px solid #c72030; }
.profile-awareness[hidden] { display: none; }
.profile-awareness .eyebrow { color: #f27a84; }
.profile-awareness h3 { margin: 8px 0 22px; color: #fff; font-size: clamp(24px, 3vw, 34px); }
.profile-awareness-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.profile-awareness-tags span { padding: 10px 12px; color: #fff; background: rgba(169,25,39,.7); border: 1px solid rgba(255,255,255,.36); font-size: 11px; font-weight: 700; }
.memory-wall { max-width: 980px; margin: 100px auto 0; padding: 52px; color: #fff; background: linear-gradient(145deg, #a91927 0%, #77111b 52%, #171111 100%); box-shadow: 0 24px 65px rgba(80,14,23,.16); }
.memory-wall .eyebrow, .memory-wall .comment-card small { color: #ffd7da; }
.memory-wall h2 { color: #fff; }
.memory-wall-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.memory-wall-heading h2 { margin-bottom: 0; }
.memory-wall-heading span { color: #f0c8cb; font-size: 10px; }
.comment-intro { margin: 15px 0 25px; color: #f1d7d9; font-size: 11px; line-height: 1.6; }
.comment-form { padding: 28px; color: var(--ink); background: #fffaf6; border: 1px solid rgba(255,255,255,.55); }
.comment-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.comment-form label { display: grid; gap: 8px; color: #665854; font-size: 10px; font-weight: 600; }
.comment-form input, .comment-form textarea { width: 100%; padding: 12px 0; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid #cdbdb5; border-radius: 0; outline: none; font-size: 13px; font-weight: 400; resize: vertical; }
.comment-form textarea { padding: 12px; border: 1px solid #cdbdb5; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--red); box-shadow: 0 1px 0 var(--red); }
.comment-form > label { margin-top: 20px; }
.memory-photo-field { margin-top: 22px; padding: 18px; background: #fff; border: 1px solid #dfd0c8; }
.memory-photo-field > label { margin-bottom: 12px; display: grid; gap: 5px; }
.memory-photo-field > label strong { color: #332724; font-family: "Libre Baskerville", Georgia, serif; font-size: 14px; font-weight: 400; }
.memory-photo-field > label span { color: #897a74; font-size: 9px; line-height: 1.5; }
.memory-photo-field input[type="file"] { padding: 10px; background: #fffaf6; border: 1px dashed #bca9a0; }
.memory-photo-preview { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.memory-photo-preview:empty { display: none; }
.memory-photo-thumb { position: relative; aspect-ratio: 1; overflow: hidden; background: #241b19; }
.memory-photo-thumb img, .memory-photo-thumb video { width: 100%; height: 100%; object-fit: cover; }
.memory-photo-thumb button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; color: #fff; background: rgba(25,16,15,.85); border: 1px solid rgba(255,255,255,.6); border-radius: 50%; }
.comment-submit-row { margin-top: 17px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.comment-submit-row > span { color: var(--red); font-size: 10px; }
.comments-list { margin-top: 32px; display: grid; gap: 14px; }
.comment-card { padding: 23px; background: #fff; border: 1px solid #eadfd8; animation: comment-in .35s ease; }
@keyframes comment-in { from { opacity: 0; transform: translateY(8px); } }
.comment-card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.comment-card-header strong { font-family: "Libre Baskerville", Georgia, serif; font-size: 14px; }
.comment-card-header time { color: #a0918a; font-size: 8px; }
.comment-card small { display: block; margin-top: 4px; color: var(--red); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.comment-card p { margin: 14px 0 0; color: #635752; font-size: 12px; line-height: 1.75; }
.comment-photo-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.comment-photo-grid figure { margin: 0; aspect-ratio: 1; overflow: hidden; background: #211918; }
.comment-photo-grid img, .comment-photo-grid video { width: 100%; height: 100%; object-fit: cover; transform-origin: center; }
.detail-page .inner-footer { color: #e8dcda; background: #0b0909; border-top: 4px solid #a91927; }
.detail-page .inner-footer .footer-brand,
.detail-page .inner-footer .brand strong { color: #fff; }
.detail-page .inner-footer .brand small,
.detail-page .inner-footer .prototype-note { color: #9e8f8b; }

@media (max-width: 900px) {
  .tribute-grid { grid-template-columns: 1fr 1fr; }
  .memory-wall { margin-top: 70px; }
}

@media (max-width: 600px) {
  .tribute-gallery-page { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gallery-arrow { display: none; }
  .privacy-label { font-size: 0; }
  .privacy-label .lock-icon { font-size: 7px; }
  .library-hero { min-height: 0; padding: 170px 18px 28px; }
  .library-hero h1 { font-size: 34px; }
  .library-hero > p:not(.eyebrow):not(.privacy-line) { font-size: 13px; }
  .library-rose { width: 150px; }
  .library-rose-left { left: -54px; }
  .library-rose-right { right: -52px; top: 100px; }
  .tribute-search { min-height: 54px; padding: 0 15px; }
  .tribute-search kbd { display: none; }
  .tribute-directory, .tribute-story-and-comments, .tribute-gallery-section { padding-left: 20px; padding-right: 20px; }
  .tribute-directory { padding-top: 34px; }
  .directory-heading { margin-bottom: 22px; }
  .directory-heading h2 { font-size: 34px; }
  .directory-heading { align-items: flex-start; flex-direction: column; }
  .tribute-grid { grid-template-columns: 1fr; }
  .tribute-card { min-height: 565px; }
  .tribute-portrait { height: 280px; }
  .tribute-profile { min-height: 720px; padding-top: 205px; }
  .back-link { left: 10px; top: 8px; }
  .profile-rose { width: 165px; }
  .profile-rose-left { left: -60px; }
  .profile-rose-right { right: -60px; }
  .profile-monogram { width: min(280px, 78vw); font-size: 52px; }
  .tribute-profile h1 { font-size: 44px; }
  .profile-years { max-width: 330px; justify-content: center; gap: 8px; font-size: 9px; letter-spacing: .08em; }
  .profile-years span { width: 22px; }
  .memory-wall { padding: 34px 20px; }
  .profile-awareness { padding: 28px 22px; }
  .comment-fields { grid-template-columns: 1fr; }
  .comment-submit-row { align-items: stretch; flex-direction: column; }
  .comment-submit-row .primary-button { width: 100%; }
  .memory-photo-preview, .comment-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The tribute directory carries a lighter echo of the memorial artwork */
.library-hero {
  background:
    linear-gradient(rgba(255,250,247,.89), rgba(248,229,223,.9)),
    var(--kerose-memorial-art) center top / cover no-repeat;
}
.tribute-directory {
  background:
    linear-gradient(rgba(255,253,249,.97), rgba(255,253,249,.97)),
    var(--kerose-memorial-art) center / cover no-repeat;
  background-attachment: scroll, fixed;
}
