/* ============================================================
   In Loving Memory of William Anthony Miecuna
   Self-contained memorial stylesheet — warm, muted, elegant.
   Works fully without any CDN (Tailwind is additive only).
   ============================================================ */

:root {
  /* Warm, muted, dignified palette */
  --bg-0: #140f0b;
  --bg-1: #1a1510;
  --bg-2: #201a13;
  --surface: #241d15;
  --surface-2: #2b2318;
  --border: rgba(212, 180, 120, 0.16);
  --border-strong: rgba(212, 180, 120, 0.34);
  --ink: #f2ead9;
  --ink-soft: #cabfa9;
  --ink-muted: #9a8f7b;
  --gold: #d4b483;
  --gold-bright: #ecd6a8;
  --gold-deep: #b9924e;
  --glow: rgba(212, 180, 120, 0.14);
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);

  --font-display: "Cormorant Garamond", "Hoefler Text", Garamond, Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset (own reset so we never depend on Tailwind Preflight) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.12; }
p { margin: 0 0 1.15em; }
button { font-family: inherit; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { position: relative; padding: clamp(72px, 11vw, 140px) 0; }
.section--tint { background: linear-gradient(180deg, var(--bg-1), var(--bg-2)); }
.center { text-align: center; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
}
.eyebrow--center { display: flex; align-items: center; justify-content: center; gap: 14px; }
.eyebrow--center::before, .eyebrow--center::after {
  content: ""; height: 1px; width: 42px;
  background: linear-gradient(90deg, transparent, var(--gold-deep));
}
.eyebrow--center::after { background: linear-gradient(90deg, var(--gold-deep), transparent); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-bottom: 0.4em;
}
.section-lead {
  max-width: 640px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.08rem;
}
.rule {
  width: 64px; height: 2px; margin: 26px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border: 0;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 48px);
  transition: background-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(20, 15, 11, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--border);
  padding-top: 12px; padding-bottom: 12px;
}
.nav__brand {
  font-family: var(--font-display);
  font-size: 1.32rem; letter-spacing: 0.04em; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.nav__brand .flame { color: var(--gold); font-size: 1.1rem; }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a {
  font-size: 0.86rem; letter-spacing: 0.04em; color: var(--ink-soft);
  position: relative; padding: 4px 0; transition: color 0.25s ease;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--gold); transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--gold-bright); }
.nav__links a:hover::after { width: 100%; }
.nav__links a.btn-give { color: var(--gold); }

.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px;
  color: var(--ink);
}
.nav__toggle svg { width: 26px; height: 26px; }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(16, 12, 8, 0.97);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
.mobile-menu.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.mobile-menu a {
  font-family: var(--font-display); font-size: 1.9rem; color: var(--ink-soft);
  padding: 10px 0; transition: color 0.2s ease;
}
.mobile-menu a:hover { color: var(--gold); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 80px;
  text-align: center; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(212, 180, 120, 0.15), transparent 55%),
    radial-gradient(80% 60% at 50% 120%, rgba(120, 78, 30, 0.10), transparent 60%),
    linear-gradient(180deg, #17120d 0%, #140f0b 60%, #120d09 100%);
}
.hero__glow {
  position: absolute; top: -18%; left: 50%; transform: translateX(-50%);
  width: 680px; height: 680px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 62%);
  filter: blur(12px); pointer-events: none;
  animation: flicker 6s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) { .hero__glow { animation: none; } }

.hero__inner { position: relative; z-index: 2; max-width: 760px; }
.hero__eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 28px;
  opacity: 0; animation: fadeUp 1.1s var(--ease) 0.15s forwards;
}
.hero__portrait {
  width: min(340px, 74vw); aspect-ratio: 4 / 3.05; margin: 0 auto 34px;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 6px rgba(212,180,120,0.05), var(--shadow);
  opacity: 0; transform: scale(0.965); animation: portraitIn 1.6s var(--ease) 0.1s forwards;
}
.hero__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
@keyframes portraitIn { to { opacity: 1; transform: scale(1); } }

.hero__name {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.9rem, 8vw, 5.6rem); line-height: 1.02;
  letter-spacing: 0.01em; color: var(--ink);
  opacity: 0; animation: fadeUp 1.2s var(--ease) 0.35s forwards;
}
.hero__name .mid { display: block; font-style: italic; font-size: 0.62em; color: var(--gold-bright); font-weight: 400; margin: 2px 0; }
.hero__dates {
  display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 16px;
  margin-top: 22px; font-size: clamp(0.9rem, 3.4vw, 1.05rem); letter-spacing: 0.14em;
  color: var(--ink-soft); text-transform: uppercase;
  opacity: 0; animation: fadeUp 1.2s var(--ease) 0.5s forwards;
}
.hero__dates .star { color: var(--gold); font-size: 0.7em; }
.hero__epitaph {
  margin-top: 30px; font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem); color: var(--ink-soft); line-height: 1.5;
  max-width: 560px; margin-left: auto; margin-right: auto;
  opacity: 0; animation: fadeUp 1.2s var(--ease) 0.65s forwards;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.scroll-cue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 2; color: var(--ink-muted); font-size: 0.72rem; letter-spacing: 0.24em;
  text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; animation: fadeUp 1s var(--ease) 1s forwards;
}
.scroll-cue .chev { width: 20px; height: 20px; animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) {
  .scroll-cue .chev { animation: none; }
  .hero__eyebrow, .hero__portrait, .hero__name, .hero__dates, .hero__epitaph, .scroll-cue { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   Tribute Video
   ============================================================ */
.video-frame {
  position: relative; width: 100%; max-width: 960px; margin: 44px auto 0;
  aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow); background: #0d0a07;
}
.video-frame video, .video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-frame video { object-fit: cover; background: #0d0a07; }

.video-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 14px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(18,13,9,0.55), rgba(18,13,9,0.82)),
    center/cover no-repeat var(--poster, #16110c);
}
.video-placeholder__icon {
  width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong); color: var(--gold);
  background: rgba(20,15,11,0.5);
}
.video-placeholder h3 { font-family: var(--font-display); font-size: 1.8rem; color: var(--ink); }
.video-placeholder p { color: var(--ink-soft); max-width: 420px; margin: 0; }
.video-note {
  margin-top: 20px; text-align: center; color: var(--ink-muted); font-size: 0.86rem;
}

/* ============================================================
   Arrangements (service cards)
   ============================================================ */
.cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 54px;
}
.card {
  position: relative; background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: 14px;
  padding: 36px 30px; display: flex; flex-direction: column;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card__icon {
  width: 52px; height: 52px; border-radius: 12px; margin-bottom: 20px;
  display: grid; place-items: center; color: var(--gold);
  background: rgba(212, 180, 120, 0.08); border: 1px solid var(--border);
}
.card__icon svg { width: 26px; height: 26px; }
.card__kicker { font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.card__title { font-family: var(--font-display); font-size: 1.75rem; color: var(--ink); margin-bottom: 4px; }
.card__when { color: var(--ink); font-weight: 600; margin: 12px 0 2px; }
.card__when .time { display: block; color: var(--ink-soft); font-weight: 400; font-size: 0.97rem; }
.card__where { color: var(--ink-soft); margin-top: 14px; font-size: 0.97rem; }
.card__where .place { color: var(--ink); font-weight: 600; display: block; }
.card__link {
  margin-top: auto; padding-top: 20px; display: inline-flex; align-items: center; gap: 7px;
  color: var(--gold); font-size: 0.88rem; letter-spacing: 0.02em; font-weight: 600;
  transition: gap 0.25s var(--ease), color 0.25s ease;
}
.card__link:hover { gap: 12px; color: var(--gold-bright); }
.card__link svg { width: 15px; height: 15px; }

/* ============================================================
   Donations (In lieu of flowers)
   ============================================================ */
.donate {
  position: relative; overflow: hidden;
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(212, 180, 120, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
}
.donate__card {
  max-width: 820px; margin: 0 auto; text-align: center;
  background: linear-gradient(180deg, rgba(43, 35, 24, 0.7), rgba(32, 26, 19, 0.6));
  border: 1px solid var(--border-strong); border-radius: 20px;
  padding: clamp(38px, 6vw, 64px);
  box-shadow: var(--shadow);
}
.donate__symbol { color: var(--gold); margin: 0 auto 22px; width: 46px; height: 46px; }
.donate__title { font-family: var(--font-display); font-size: clamp(2rem, 4.6vw, 3rem); color: var(--ink); margin-bottom: 18px; }
.donate__text { color: var(--ink-soft); font-size: 1.1rem; max-width: 620px; margin: 0 auto 12px; }
.donate__text strong { color: var(--gold-bright); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 600; letter-spacing: 0.02em; font-size: 1.02rem;
  padding: 17px 34px; border-radius: 999px; cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease), background 0.3s ease;
}
.btn--gold {
  color: #241a0c;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 14px 30px -10px rgba(212, 180, 120, 0.5);
}
.btn--gold:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -12px rgba(212, 180, 120, 0.65); }
.btn svg { width: 18px; height: 18px; }
.donate__cta { margin-top: 34px; }
.donate__fineprint { margin-top: 22px; color: var(--ink-muted); font-size: 0.9rem; }
.donate__fineprint a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   Story / His Life
   ============================================================ */
.story { max-width: 760px; margin: 0 auto; }
.story__body { font-size: 1.14rem; color: var(--ink-soft); line-height: 1.85; }
.story__body p { margin-bottom: 1.5em; }
.story__body p.lede::first-letter {
  font-family: var(--font-display); float: left; font-size: 4.4rem; line-height: 0.82;
  padding: 6px 14px 0 0; color: var(--gold);
}
.story__body strong { color: var(--ink); font-weight: 600; }
.story__figure { margin: 48px 0; }
.story__figure img { width: 100%; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.story__figure figcaption { margin-top: 12px; text-align: center; color: var(--ink-muted); font-size: 0.9rem; font-style: italic; }
.pullquote {
  font-family: var(--font-display); font-style: italic; font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  line-height: 1.35; color: var(--gold-bright); text-align: center;
  margin: 50px auto; max-width: 640px; padding: 0 10px; position: relative;
}
.pullquote::before { content: "\201C"; display: block; font-size: 3rem; color: var(--gold-deep); line-height: 0.5; margin-bottom: 12px; }
.story__editnote {
  margin-top: 40px; padding: 16px 20px; border-left: 2px solid var(--gold-deep);
  background: rgba(212,180,120,0.05); border-radius: 0 8px 8px 0;
  color: var(--ink-muted); font-size: 0.9rem;
}
.story__farewell {
  text-align: center; font-family: var(--font-display); font-style: italic;
  color: var(--gold-bright); font-size: clamp(1.5rem, 3.6vw, 2.05rem); line-height: 1.55;
  margin-top: 2.4em; letter-spacing: 0.01em;
}

/* ============================================================
   Gallery
   ============================================================ */
.gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 52px;
}
.gallery__item {
  position: relative; overflow: hidden; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  aspect-ratio: 4 / 3;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.gallery__item:hover img { transform: scale(1.06); }
.gallery__item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 14px;
  color: var(--ink); font-size: 0.85rem; letter-spacing: 0.02em;
  background: linear-gradient(180deg, transparent, rgba(12, 8, 5, 0.85));
  opacity: 0; transform: translateY(8px); transition: opacity 0.35s ease, transform 0.35s var(--ease);
}
.gallery__item:hover figcaption { opacity: 1; transform: none; }
/* Touch devices have no hover — show captions so labels aren't hidden on phones */
@media (hover: none) {
  .gallery__item figcaption { opacity: 1; transform: none; }
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: 28px; background: rgba(10, 7, 4, 0.94); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--border-strong); }
.lightbox__cap { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; color: var(--ink-soft); font-style: italic; font-family: var(--font-display); font-size: 1.2rem; }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(36,29,21,0.7); border: 1px solid var(--border); color: var(--ink);
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.lightbox__close:hover, .lightbox__nav:hover { background: var(--gold); color: #241a0c; }
.lightbox__close { top: 22px; right: 22px; }
.lightbox__nav svg, .lightbox__close svg { width: 22px; height: 22px; }
.lightbox__nav.prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox__nav.next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center; padding: 80px 24px 60px;
  background: linear-gradient(180deg, var(--bg-1), #100b07);
  border-top: 1px solid var(--border);
}
.footer .flame { font-size: 1.6rem; color: var(--gold); }
.footer__name { font-family: var(--font-display); font-size: 2rem; color: var(--ink); margin: 18px 0 6px; }
.footer__dates { color: var(--ink-soft); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.9rem; }
.footer__verse { font-family: var(--font-display); font-style: italic; color: var(--ink-soft); max-width: 520px; margin: 30px auto 0; font-size: 1.2rem; line-height: 1.5; }
.footer__meta { margin-top: 40px; color: var(--ink-muted); font-size: 0.82rem; }
.footer__meta a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; max-width: 480px; margin-left: auto; margin-right: auto; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
  body { font-size: 16px; }
}
@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr; }
  .lightbox__nav.prev { left: 10px; }
  .lightbox__nav.next { right: 10px; }
}

/* Reduced motion: also neutralize interaction transforms */
@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .gallery__item:hover img { transform: none; }
}

/* Focus visibility for keyboard users (incl. keyboard-operable gallery figures) */
a:focus-visible, button:focus-visible, .gallery__item:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px;
}
