/* ------------------------------------------------------------------
   The Png Family · jmj-amdg.com
   Palette drawn from Peranakan shophouse plaster and glazed floor tiles.
------------------------------------------------------------------ */
:root {
  /* Brand book palette: the family's tile colours */
  --cream: #F9F4F2;        /* the page */
  --paper: #FFFDE9;        /* cards and the medallion */
  --ink: #19233A;          /* text, dark grounds */
  --ink-soft: #4A5368;     /* body text */
  --magenta: #DC0963;      /* events, prayer wall, warnings */
  --orange: #F78B1F;       /* family, households */
  --marigold: #FFC20E;     /* journal, heritage, the heart */
  --marigold-deep: #B88A00;
  --teal: #0FB5A1;         /* home, tree, the ring, good states */
  --teal-deep: #0A6B5A;
  --grey: #939292;         /* in memoriam, what has faded */
  --grey-deep: #6B6B6B;
  --gilt: #C69C45;         /* hairlines, memorial rules */

  /* Second palette (brand book): shades are blood colourways 6–10, complements are worn by those who married in */
  --lasem: #9E0646; --tamarind: #C25E0A; --old-gold: #B88A00; --deep-teal: #0A6B5A; --sand: #D9C98F;
  --jade-green: #2E8B6E; --cobalt-blue: #2F5BB7; --lilac: #7B5EA7; --blush: #F4A6C8; --mint: #BFE3D6;
  --deep-jade: #1F6B52; --deep-cobalt: #23448C; --deep-lilac: #5A4480; --rose-pink: #D9769F; --sage: #8FBFAE;
  --line: rgba(25, 35, 58, 0.12);

  /* Legacy names, mapped onto the brand palette so every component re-skins at once */
  --ground: var(--cream);
  --ground-deep: #F1EAE6;
  --jade: var(--teal);
  --jade-deep: var(--teal-deep);
  --rose: var(--magenta);
  --rose-soft: #FDE3EC;
  --rose-red: #C8102E;      /* the flowers laid for the departed */
  --cobalt: var(--teal-deep);
  --mustard: var(--marigold);
  --lasem-red: var(--magenta);
  --soga: #7b5331;
  --batik-cream: var(--paper);
  --encim-salmon: #F7A6C1;
  --encim-mauve: #b48bab;
  --nyonya-turquoise: var(--teal);
  --old-gilt: var(--gilt);
  --mourning-plum: var(--grey-deep);

  --font-display: 'Baskervville', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Noto Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;   /* obituaries, written by hand */
  --font-zh: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;   /* Chinese on the headstone */

  --measure: 62ch;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 4px;          /* inputs, pills, small chrome */
  --radius-card: 14px;    /* every box: cards, panels, forms, the family carousel */
  --card: #FFFFFF;        /* every box is white, so any tile reads against it */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  /* The monogram lies over the whole page, faint, like a watermark on the paper */
  background: var(--ground) url("/images/monogram-page.svg") center top / 112px 112px repeat;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--jade-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--rose);
}

:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
}
h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
}
h3 {
  font-size: 1.35rem;
}
p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jade-deep);
  margin: 0 0 0.75rem;
}

.section {
  padding-block: clamp(3rem, 8vw, 6rem);
}
.section + .section {
  border-top: 0;
  position: relative;
}
.section + .section::before {
  /* a clean hairline where sections meet */
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 2 * var(--gutter), var(--wrap));
  height: 1px;
  background: var(--gilt);
  opacity: 0.6;
}
.section--intro {
  padding-bottom: clamp(1rem, 3vw, 2rem);
}
.section--intro + .section {
  padding-top: clamp(1.5rem, 4vw, 3rem);
}
.section--intro + .section::before {
  display: none;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}
.section-head p {
  margin: 0;
  color: var(--ink-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn--solid {
  background: var(--jade);
  border-color: var(--jade);
  color: var(--paper);
}
.btn--solid:hover {
  background: var(--jade-deep);
  border-color: var(--jade-deep);
  color: var(--paper);
}

/* Glazed tile card ------------------------------------------------ */
.tile {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
a.tile {
  color: inherit;
  text-decoration: none;
}
a.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px -24px rgba(25, 35, 58, 0.5);
}
.tile__inner {
  padding: 0.5rem;
}

/* Prose (journal entries) ---------------------------------------- */
.prose {
  max-width: var(--measure);
  font-size: 1.125rem;
}
.prose h2,
.prose h3 {
  margin-top: 2em;
  margin-bottom: 0.5em;
}
.prose blockquote {
  margin: 1.5em 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--rose);
  font-family: var(--font-display);
  font-size: 1.3em;
  color: var(--ink-soft);
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5em 0;
}

.date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}


/* ------------------------------------------------------------------
   Page-level styles (moved from per-page Astro components)
------------------------------------------------------------------ */
.lede { font-size: 1.2rem; color: var(--ink-soft); margin-top: 1.25rem; max-width: 58ch; }
.quiet { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.flash { margin: 1rem 0 0; padding: 0.75rem 1rem; background: var(--rose-soft); border-left: 3px solid var(--rose); border-radius: var(--radius); }

/* Hero */
.hero { background: var(--ground-deep); border-bottom: 1px solid var(--line); }
.hero__body { padding-block: clamp(3rem, 9vw, 7rem) clamp(3rem, 7vw, 5rem); animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero__eyebrow { color: var(--rose); }
.hero__title { max-width: 12ch; }
.hero__lede { font-size: clamp(1.15rem, 2vw, 1.4rem); max-width: 44ch; margin-top: 1.5rem; color: var(--ink-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero__motto { margin: 3rem 0 0; font-family: var(--font-display); font-style: italic; font-size: 1.15rem; color: var(--jade-deep); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.welcome { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.welcome h2 { margin-bottom: 0.75rem; }

/* Rooms */
.rooms__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.room { display: block; height: 100%; }
.room__motif { display: block; width: 44px; height: 44px; margin-bottom: 1.25rem; border-radius: 50%; background: var(--rose-soft); position: relative; }
.room__motif::after { content: ''; position: absolute; inset: 0; background-repeat: no-repeat; background-position: center; }
.room__motif--family::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c75b7a' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Ccircle cx='16' cy='9' r='2.4'/%3E%3Cpath d='M4 19c0-3 2.2-5 5-5s5 2 5 5M14 18c.3-2 1.6-3.4 3.5-3.4 1.6 0 2.5 1 2.5 2.4'/%3E%3C/svg%3E"); }
.room__motif--journal::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c75b7a' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M6 4h10a2 2 0 0 1 2 2v14H8a2 2 0 0 1-2-2z'/%3E%3Cpath d='M9 8h6M9 11h6M9 14h4'/%3E%3C/svg%3E"); }
.room__motif--heritage::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c75b7a' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M12 20v-7M12 13c-3 0-5-2-5-5M12 13c3 0 5-2 5-5M12 13V5'/%3E%3Ccircle cx='7' cy='7' r='1.6'/%3E%3Ccircle cx='17' cy='7' r='1.6'/%3E%3Ccircle cx='12' cy='4' r='1.6'/%3E%3C/svg%3E"); }
.room__motif--events::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c75b7a' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='4' y='6' width='16' height='14' rx='1.5'/%3E%3Cpath d='M4 10h16M8 4v4M16 4v4'/%3E%3C/svg%3E"); }
.room__title { font-size: 1.6rem; }
.room__text { margin: 0.6rem 0 1.25rem; color: var(--ink-soft); font-size: 0.98rem; }
.room__go { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--jade-deep); }

/* Journal entries */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.entry { padding-top: 1rem; border-top: 2px solid var(--rose); }
.entry__title { margin-top: 0.5rem; }
.entry__title a, .item__title a, .upcoming__title a { color: var(--ink); text-decoration: none; }
.entry__title a:hover, .item__title a:hover, .upcoming__title a:hover { color: var(--rose); text-decoration: underline; }
.entry__summary { margin: 0.5rem 0 0; color: var(--ink-soft); font-size: 0.98rem; }

.year { display: grid; grid-template-columns: 8rem 1fr; gap: 2rem; }
.year__label { font-size: 2.5rem; color: var(--cobalt); position: sticky; top: 5rem; align-self: start; }
.list { list-style: none; margin: 0; padding: 0; }
.item { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.item__meta { display: flex; gap: 1rem; align-items: baseline; margin-bottom: 0.5rem; }
.item__kind { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rose); }
.item__title { font-size: 1.7rem; }
.item__summary { margin: 0.5rem 0 0; color: var(--ink-soft); }
@media (max-width: 640px) { .year { grid-template-columns: 1fr; gap: 0.5rem; } .year__label { position: static; } }

.article-head { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.article-title { font-size: clamp(2.25rem, 5vw, 3.75rem); margin-top: 0.75rem; max-width: 18ch; }
.article-summary { font-size: 1.25rem; color: var(--ink-soft); margin-top: 1.25rem; max-width: 50ch; }
.byline { margin: 0; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--jade-deep); }
.eyebrow a { text-decoration: none; }

/* Events */
.upcoming { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.upcoming--stack { grid-template-columns: 1fr; }
.upcoming__row { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; }
.upcoming__date { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--cobalt); width: 4.5rem; text-align: center; padding-top: 0.2rem; border-right: 1px solid var(--line); }
.upcoming__meta { margin: 0.35rem 0 0.5rem; font-size: 0.9rem; color: var(--jade-deep); }
.upcoming__summary { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.past { list-style: none; margin: 0; padding: 0; }
.past__item { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .past__item { grid-template-columns: 1fr; gap: 0.2rem; } }
.facts { margin: 1.5rem 0; display: grid; gap: 0.5rem; font-size: 1.05rem; }
.facts div { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; }
.facts dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rose); padding-top: 0.3rem; }
.facts dd { margin: 0; }
.facts__time { display: block; color: var(--ink-soft); }

/* Family */
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.person__kin { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rose); margin: 0 0 0.4rem; }
.person__name { font-size: 1.7rem; }
.person__facts { margin: 1rem 0; padding: 0.75rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 0.35rem; font-size: 0.92rem; }
.person__facts div { display: flex; gap: 0.75rem; }
.person__facts dt { color: var(--ink-soft); min-width: 4rem; }
.person__facts dd { margin: 0; }
.person__note { color: var(--ink-soft); font-size: 0.98rem; }
.person__note p:last-child { margin-bottom: 0; }

/* Heritage */
.tree { list-style: none; margin: 0; padding: 0; }
.gen { position: relative; padding: 1.5rem 0 1.5rem 2rem; border-left: 2px solid var(--jade); }
.gen::before { content: ''; position: absolute; left: -7px; top: 2rem; width: 12px; height: 12px; border-radius: 50%; background: var(--rose); border: 2px solid var(--ground); }
.gen__label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--jade-deep); margin: 0 0 0.75rem; }
.gen__people { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.leaf { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 0.9rem 1rem; display: grid; gap: 0.15rem; }
.leaf__name { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.leaf__name:hover { color: var(--rose); }
.leaf__kin, .leaf__years, .leaf__parents { font-size: 0.85rem; color: var(--ink-soft); }
.leaf__years { font-family: var(--font-mono); }
.memorial { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 0.5rem; }
.memorial li { display: flex; gap: 1rem; align-items: baseline; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.memorial__name { font-family: var(--font-display); font-size: 1.3rem; }
.memorial__years { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); }
.prayer { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--jade-deep); max-width: 44ch; }
.obit-page .prayer, .obit-page .obit__kin { margin-inline: auto; text-align: center; }
.glossary { margin: 0; display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.glossary div { padding-top: 0.75rem; border-top: 2px solid var(--mustard); }
.glossary dt { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.3rem; }
.glossary dd { margin: 0; color: var(--ink-soft); }

/* Header & footer */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--ground) 96%, white); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header__row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 0.65rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; white-space: nowrap; }
.brand__motto { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.18em; color: var(--jade-deep); }
/* One row on wide screens: the pages, then the account links set apart on the right */
.site-nav { display: flex; align-items: center; gap: 1.25rem; min-width: 0; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; gap: clamp(0.5rem, 1.4vw, 1.1rem); }
.nav a, .nav .link-button { display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 0.92rem; padding-block: 0.35rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover, .nav a[aria-current='page'], .nav .link-button:hover { border-bottom-color: var(--magenta); color: var(--ink); }
.nav .icon { width: 1.05em; height: 1.05em; opacity: 0.85; }
.nav--account { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.nav--account a, .nav--account .link-button { color: var(--ink-soft); font-weight: 400; font-size: 0.86rem; }
.nav-check, .nav-burger { display: none; }
@media (max-width: 1240px) {
  .nav a, .nav .link-button { font-size: 0.84rem; }
  .nav .icon { display: none; }
}
@media (max-width: 1100px) {
  .site-header__row { flex-wrap: wrap; gap: 0.75rem 1rem; }
  .nav-burger { display: inline-flex; align-items: center; gap: 0.5rem; margin-left: auto; padding: 0.4rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); cursor: pointer; }
  .nav-burger__lines { width: 1rem; height: 2px; background: currentColor; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 0.25rem 0 0.75rem; border-top: 1px solid var(--line); }
  .nav-check:checked ~ .site-nav { display: flex; }
  .nav { flex-direction: column; gap: 0; }
  .nav li { border-bottom: 1px solid var(--line); }
  .nav a, .nav .link-button { display: flex; width: 100%; padding: 0.7rem 0.25rem; font-size: 1rem; border-bottom: 0; }
  .nav a[aria-current='page'] { color: var(--magenta); }
  .nav .icon { display: inline-block; }
  .nav--account { padding-left: 0; border-left: 0; margin-top: 0.5rem; }
  .brand__motto { display: none; }
}
.inline-form { display: inline; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--jade-deep); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.link-button:hover { color: var(--rose); }
.link-button--danger { color: var(--rose); }

.site-footer { margin-top: 0; background: var(--ink); color: var(--paper); }
.site-footer__row { display: grid; gap: 1.5rem 3rem; grid-template-columns: 1fr auto; align-items: start; padding-block: 2.5rem 2rem; }
.site-footer__motto { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 0.25rem; }
.site-footer__sub { margin: 0; color: rgba(250, 248, 241, 0.7); }
.site-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer__links a { color: var(--paper); text-decoration: none; }
.site-footer__links a:hover { color: var(--mustard); }
.site-footer__copy { grid-column: 1 / -1; margin: 0; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; color: rgba(250, 248, 241, 0.55); }
@media (max-width: 640px) { .site-footer__row { grid-template-columns: 1fr; } }
.tile-band { display: block; width: 100%; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; border-radius: var(--radius); z-index: 20; }
.skip:focus { top: 1rem; }

/* Forms */
.form-wrap { max-width: 36rem; }
.form { display: grid; gap: 1.25rem; margin-top: 2rem; }
.form--tight { margin-top: 0; gap: 0.75rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 500; }
.field .optional { font-weight: 400; color: var(--ink-soft); font-size: 0.85rem; margin-left: 0.3rem; }
.field input[type='text'], .field input[type='email'], .field input[type='password'], .field textarea {
  font: inherit; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); width: 100%;
}
.field input:focus, .field textarea:focus { outline: 3px solid var(--mustard); outline-offset: 1px; border-color: var(--jade); }
.field--check { grid-template-columns: auto 1fr; align-items: center; gap: 0.6rem; }
.hint { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }
.error { margin: 0; font-size: 0.9rem; color: var(--rose); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { justify-self: start; }
.form-foot { margin-top: 1.5rem; color: var(--ink-soft); }

/* Membership */
.progress { display: flex; align-items: center; gap: 0.5rem; margin: 1.5rem 0; }
.progress__dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--jade); background: transparent; }
.progress__dot.is-on { background: var(--jade); }
.progress__label { margin-left: 0.5rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }
.endorsed { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.5rem; }
.recap { margin: 1rem 0 0; display: grid; gap: 0.5rem; font-size: 0.95rem; }
.recap div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; }
.recap dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rose); padding-top: 0.25rem; }
.recap dd { margin: 0; color: var(--ink-soft); }
.applicants { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.applicant { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
.applicant__name { font-size: 1.6rem; }
.applicant__kin { font-size: 1rem; color: var(--ink-soft); font-family: var(--font-body); margin-left: 0.4rem; }
.applicant__count { margin: 1rem 0 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--jade-deep); }
@media (max-width: 720px) { .applicant { grid-template-columns: 1fr; } }

/* Admin table */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--card); border-radius: var(--radius-card); overflow: hidden; }
.table th, .table td { text-align: left; vertical-align: top; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); }
.table th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.actions form { display: inline; margin-right: 0.75rem; }
.badge { display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--cobalt); color: var(--paper); font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle; }
.badge--warn { background: var(--mustard); color: var(--ink); }
.status { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.status--active { color: var(--jade-deep); }
.status--pending { color: var(--mustard); }
.status--suspended, .status--rejected { color: var(--rose); }
.table { min-width: 46rem; }
.table td.date { white-space: nowrap; }

/* ------------------------------------------------------------------
   Family tree (nested lists drawn with connector lines)
------------------------------------------------------------------ */
.tree-scroll { overflow-x: auto; padding: 1rem var(--gutter) 2rem; }
.tree-canvas { display: inline-block; min-width: 100%; }
.ft, .ft ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.ft__children { padding-top: 2.25rem !important; position: relative; }
.ft__children::before { /* vertical stem down from the couple to the sibling bar */
  content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 1.25rem; background: var(--jade); transform: translateX(-1px);
}
.ft__node { position: relative; flex: 0 0 auto; padding: 0 0.5rem; display: flex; flex-direction: column; align-items: center; }
.ft__node::before, .ft__node::after { /* sibling bar: half to each side */
  content: ''; position: absolute; top: -1rem; width: 50%; height: 1rem; border-top: 2px solid var(--jade);
}
.ft__node::before { left: 0; }
.ft__node::after { right: 0; border-left: 2px solid var(--jade); }
.ft__node:only-child::before, .ft__node:only-child::after { border-top: 0; }
.ft__node:first-child::before { border: 0; }
.ft__node:last-child::after { border-top: 0; border-left: 0; }
.ft__node:last-child::before { border-right: 2px solid var(--jade); }
.ft__node:only-child::before { border-right: 2px solid var(--jade); }
.ft > .ft__node::before, .ft > .ft__node::after { display: none; } /* roots have no bar */
.ft__node:only-child { padding-top: 0; }
/* Every unit is one tile. Click it and its panel slides out to the right; the pill beneath unfolds the children. */
.ft__unit { display: flex; flex-direction: column; align-items: center; }
.ft__unit > summary { list-style: none; cursor: pointer; }
.ft__unit > summary::-webkit-details-marker { display: none; }
.ft__tilebox { position: relative; }
.ft__tilebox.is-open { z-index: 6; }
.ft__tile { display: block; width: 64px; height: 64px; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; line-height: 0; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.ft__tile .tile-svg { width: 64px; height: 64px; border-radius: 10px; }
/* Married again: one household tile per marriage, side by side in order, joined by a short line */
.ft__tile.ft__tile--again { display: flex; align-items: center; width: auto; gap: 0; }
.ft__link { display: block; width: 14px; height: 0; border-top: 2px solid var(--jade); flex: 0 0 auto; }
.ft__link::after { content: ''; display: block; width: 6px; height: 6px; margin: -4px auto 0; border-radius: 50%; background: var(--jade); }
.ft__tile:hover, .ft__tile[aria-expanded='true'] { transform: translateY(-2px); box-shadow: 0 14px 24px -16px rgba(25, 35, 58, 0.6); }
.ft__tile:focus-visible { outline: 3px solid var(--jade); outline-offset: 3px; }
.ft__tilebox.is-me .ft__tile { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--magenta); }
.ft-dot { position: absolute; top: -3px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--paper); box-sizing: border-box; }
.ft-dot--member { background: var(--jade); }
.ft-dot--r { right: -3px; } .ft-dot--l { left: -3px; }
.ft__panel { display: none; position: absolute; top: 0; left: calc(100% + 0.6rem); width: 16.5rem; padding: 0.9rem 1rem 0.9rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: 0 20px 36px -20px rgba(25, 35, 58, 0.55); text-align: left; }
.ft__tilebox.is-open .ft__panel { display: block; animation: ft-slide 0.18s ease; }
.ft__panel--left { left: auto; right: calc(100% + 0.6rem); animation-name: ft-slide-left !important; }
.ft__panel--up { top: auto; bottom: 0; }
@keyframes ft-slide { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes ft-slide-left { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.ft__close { position: absolute; top: 0.35rem; right: 0.5rem; border: 0; background: none; font-size: 1.2rem; line-height: 1; color: var(--ink-soft); cursor: pointer; padding: 0.2rem 0.4rem; }
.ft__close:hover { color: var(--magenta); }
.ft__who { display: grid; gap: 0.05rem; margin: 0 1.2rem 0.6rem 0; }
.ft__who.is-rip { opacity: 0.75; }
.ft__name { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.15; color: var(--ink); text-decoration: none; }
.ft__name:hover { color: var(--magenta); }
.ft__kin, .ft__years { font-size: 0.78rem; color: var(--ink-soft); }
.ft__years { font-family: var(--font-mono); }
.ft__story { font-size: 0.74rem; color: var(--teal-deep); }
.ft__kids { margin: 0.4rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--line); font-size: 0.85rem; line-height: 1.5; }
.ft__kids-n { display: block; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-deep); margin-bottom: 0.15rem; }
.ft__kids a { color: var(--ink); }
.ft__panel-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.7rem 0 0; }
.ft__toggle { margin-top: 0.4rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-deep); white-space: nowrap; }
.ft__toggle:hover { color: var(--magenta); border-color: var(--magenta); }
.ft__chev { display: inline-block; transition: transform 0.2s ease; }
.ft__unit[open] > summary .ft__chev { transform: rotate(180deg); }
.ft__children { padding-top: 2.25rem !important; }
.tile-svg { display: block; border-radius: 6px; flex: 0 0 auto; }
.tree-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
/* Direct-family pop-up */
.ft__dialog { border: 0; border-radius: var(--radius-card); padding: 1.5rem 1.75rem; max-width: min(44rem, calc(100vw - 2rem)); background: var(--card); box-shadow: 0 30px 60px -30px rgba(25, 35, 58, 0.7); }
.ft__dialog::backdrop { background: rgba(25, 35, 58, 0.45); }
.ft__dialog .ft__dialog-close { top: 0.6rem; right: 0.75rem; }
.fam { display: grid; gap: 1.25rem; justify-items: center; }
.fam__row { display: flex; flex-wrap: wrap; gap: 0.9rem 1.1rem; justify-content: center; align-items: flex-start; }
.fam__row--parents { gap: 1.5rem 2.5rem; }
.fam__set { display: grid; gap: 0.5rem; justify-items: center; }
.fam__set-label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-deep); }
.fam__p { display: grid; gap: 0.3rem; justify-items: center; width: 7.5rem; text-align: center; text-decoration: none; color: var(--ink); }
.fam__p.is-rip { opacity: 0.7; }
.fam__p--couple { width: auto; }
.fam__p .tile-svg { border-radius: 10px; }
.fam__name { font-family: var(--font-display); font-size: 0.98rem; line-height: 1.2; color: var(--ink); text-decoration: none; }
a.fam__p:hover .fam__name, .fam__name:hover { color: var(--magenta); }
.fam__names { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; justify-content: center; }
.fam__plus { color: var(--rose); }
.fam__years { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }
.tree-key { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-soft); }
.tree-key__item { display: inline-flex; align-items: center; gap: 0.4rem; }
.tree-key .ft-dot { position: static; }
.tree-key__ring { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); box-sizing: border-box; }

/* Admin forms */
.field--row { grid-template-columns: 1fr 1fr; gap: 1rem; }
.marriage-row { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 0.4rem 0.5rem; margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px dashed var(--line); }
.marriage-row > select:first-child { grid-column: 1 / -1; }
.marriage-row:last-of-type { border-bottom: 0; }
.field--group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 1rem 1.25rem 1.25rem; margin: 0; display: grid; gap: 1rem; }
.field--group legend { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--jade-deep); padding: 0 0.4rem; }
.field select, .field input[type='number'] { font: inherit; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); width: 100%; }
.field select:focus { outline: 3px solid var(--mustard); outline-offset: 1px; }
.actions a { margin-right: 0.75rem; }
@media (max-width: 560px) { .field--row { grid-template-columns: 1fr; } }

/* Footer credit */
.site-footer__bottom { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid rgba(250,248,241,.15); padding-top: 1.25rem; }
.site-footer__copy { grid-column: auto; }
.site-footer__credit { margin: 0; display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: rgba(250, 248, 241, 0.7); }
.site-footer__credit img { width: 40px; height: 40px; border-radius: 4px; }
.site-footer__credit strong { color: var(--paper); font-weight: 500; }
.site-footer__cloth { grid-column: 1 / -1; margin: 0; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; color: rgba(250, 248, 241, 0.45); }
.site-footer__cloth a { color: inherit; }

/* ------------------------------------------------------------------
   Batik: a Pekalongan sarong, c. 1890 (Honolulu Museum of Art, CC0),
   photographed flat. The cloth's own border runs along the top of key
   pages; its kepala panel is the hero.
------------------------------------------------------------------ */
.pinggir { display: block; height: 44px; background: #223b2e url("/images/batik/family-pinggir.jpg") repeat-x center / auto 100%; border-bottom: 1px solid var(--marigold); }
.pinggir--thin { height: 30px; }
.pinggir--family { height: 56px; background-image: url("/images/batik/family-pinggir.jpg"); background-color: #223b2e; border-bottom: 1px solid var(--mustard); }

.kepala { background: var(--paper); border-bottom: 1px solid var(--gilt); }
.kepala__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: stretch; gap: 0; width: min(100%, var(--wrap) + 2 * var(--gutter)); margin-inline: auto; }
.kepala .hero__body { padding: clamp(2.5rem, 7vw, 6rem) var(--gutter); }
.mark { position: relative; margin: 0; display: grid; place-items: center; padding: clamp(1.5rem, 4vw, 3rem) var(--gutter); }
.mark img { width: min(100%, 22rem); height: auto; filter: drop-shadow(0 18px 30px rgba(156, 47, 47, 0.18)); animation: rise 1.1s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.mark__caption { margin-top: 0.75rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }
.mark__caption [lang='zh'] { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0; text-transform: none; }
@media (max-width: 760px) { .mark { order: -1; padding-bottom: 0; } .mark img { width: 11rem; } }
.kepala .hero__eyebrow { color: var(--magenta); }
.kepala__cloth { position: relative; min-height: 22rem; margin: clamp(1rem, 3vw, 2rem) var(--gutter) clamp(1rem, 3vw, 2rem) 0; }
.kepala__cloth img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; box-shadow: 0 1px 0 var(--old-gilt), 0 24px 40px -28px rgba(25, 35, 58, 0.6); }
.kepala__caption { position: absolute; left: 0; right: 0; bottom: -1.6rem; margin: 0; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--ink-soft); text-align: right; }
@media (max-width: 760px) {
  .kepala__grid { grid-template-columns: 1fr; }
  .kepala__cloth { order: -1; min-height: 14rem; margin: 0; }
  .kepala__cloth img { box-shadow: none; }
  .kepala__caption { position: static; text-align: left; padding: 0.4rem var(--gutter) 0; }
}

/* Public hero on the household mosaic: every couple's tile, 1.5x, crossfading now and then under a scrim; white type, centred */
.kepala--mosaic { --mosaic-tile: 180px; --mosaic-gap: 10px; position: relative; isolation: isolate; overflow: hidden; background-color: var(--ink); background-repeat: repeat; background-position: center top; background-size: calc(423 * var(--mosaic-tile) / 32) auto; border-bottom: 0; }
.kepala--mosaic.is-live { background-image: none !important; }
.kepala--mosaic::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(25, 35, 58, 0.8) 0%, rgba(25, 35, 58, 0.58) 55%, rgba(25, 35, 58, 0.3) 100%); }
.kepala__cells { position: absolute; inset: 0; z-index: -2; display: grid; gap: var(--mosaic-gap); justify-content: center; align-content: center; pointer-events: none; }
.kepala__cell { position: relative; width: var(--mosaic-tile); height: var(--mosaic-tile); border-radius: calc(var(--mosaic-tile) / 14); overflow: hidden; background: var(--ink); }
.kepala__cell i { position: absolute; inset: 0; background-image: var(--sheet); background-repeat: no-repeat; transition: opacity 1.6s ease; }
.kepala__cell i + i { opacity: 0; }
.kepala__cell.is-b i:first-child { opacity: 0; }
.kepala__cell.is-b i + i { opacity: 1; }
.kepala--mosaic .kepala__grid { grid-template-columns: minmax(0, 1fr); min-height: clamp(28rem, 66vh, 40rem); align-items: center; }
.kepala--mosaic .hero__body { text-align: center; margin-inline: auto; max-width: 46rem; }
.kepala--mosaic .hero__title { max-width: none; margin-inline: auto; }
.kepala--mosaic .hero__lede { max-width: 38ch; margin-inline: auto; line-height: 1.2em; }
.kepala--mosaic .hero__actions { justify-content: center; }
.kepala--mosaic .hero__eyebrow { display: block; max-width: none; margin-inline: auto; text-align: center; color: var(--marigold); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.kepala--mosaic .hero__title, .kepala--mosaic .hero__lede, .kepala--mosaic .hero__motto { color: #FFFFFF; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55), 0 8px 28px rgba(0, 0, 0, 0.45); }
.kepala--mosaic .hero__lede { color: rgba(255, 255, 255, 0.94); }
.kepala--mosaic .hero__motto { display: inline-block; margin-top: 2.5rem; padding: 0.5rem 1.4rem; font-size: clamp(1.4rem, 2.4vw, 1.9rem); color: #FFFFFF; background: rgba(25, 35, 58, 0.62); border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kepala--mosaic .btn { border-color: #FFFFFF; color: #FFFFFF; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6); }
.kepala--mosaic .btn:hover { background: #FFFFFF; color: var(--ink); text-shadow: none; }
.kepala--mosaic .btn--solid { background: #FFFFFF; border-color: #FFFFFF; color: var(--ink); text-shadow: none; }
.kepala--mosaic .btn--solid:hover { background: var(--marigold); border-color: var(--marigold); color: var(--ink); }
@media (max-width: 760px) {
  .kepala--mosaic { --mosaic-tile: 110px; --mosaic-gap: 7px; }
  .kepala--mosaic .kepala__grid { min-height: 24rem; }
}
@media (prefers-reduced-motion: reduce) { .kepala__cell i { transition: none; } }

/* ------------------------------------------------------------------
   In memoriam — tok wi framing, mourning palette (no red), candles
------------------------------------------------------------------ */
.tokwi { position: relative; color: var(--paper); background: var(--ink) url("/images/batik/family-batik.jpg") center / cover no-repeat; border-bottom: 1px solid var(--gilt); }
.tokwi::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(25, 35, 58, 0.94) 0%, rgba(25, 35, 58, 0.86) 55%, rgba(25, 35, 58, 0.6) 100%); }
.tokwi__body { position: relative; padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem); }
.tokwi__eyebrow { color: var(--encim-salmon); }
.tokwi__eyebrow a { color: inherit; }
.tokwi h1 { color: var(--paper); }
.tokwi .lede { max-width: 52ch; color: rgba(250, 248, 241, 0.8); }
.tokwi .person__kin { color: var(--encim-salmon); }
.tokwi__dates { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 1.25rem 0 0.5rem; font-family: var(--font-mono); font-size: 0.85rem; color: rgba(250, 248, 241, 0.75); }
.tokwi__patron { font-family: var(--font-display); font-style: italic; color: var(--old-gilt); margin: 0.5rem 0 0; }

/* A person's In memoriam page */
.tokwi--person { display: flex; flex-direction: column; }
/* The vigil: a candle for every prayer, standing along the bottom of the banner; rows fill upward as prayers are added */
/* One row only, standing on the banner's bottom edge: wrap-reverse puts the first (full) line at the bottom, later lines above it where they are clipped */
.vigil { position: relative; z-index: 1; display: flex; flex-wrap: wrap-reverse; align-content: flex-start; justify-content: center; align-items: flex-end; height: 80px; overflow: hidden; padding: 0 var(--gutter); margin-top: -0.5rem; }
/* The wax is about 28% of the drawing's width. --pitch is how far apart candles stand, as a share of that width:
   0.45 leaves a clear space between them (the default), and it tightens only once the row is full, down to 0.25,
   where neighbouring candles overlap by about a tenth. The bottom margin removes the drawing's empty strip below the wax. */
.vigil__candle { position: relative; z-index: 1; height: auto; align-self: flex-end; margin: 0 0 calc(var(--w, 40px) * -0.056) calc(var(--w, 40px) * (var(--pitch, 0.45) - 1)); filter: drop-shadow(0 0 10px rgba(255, 194, 14, 0.25)); }
.vigil__candle:first-child { margin-left: 0; }
.vigil__candle .candle__flame, .vigil__candle .candle__core, .vigil__candle .candle__glow { animation-delay: var(--d, 0s); }
.vigil__candle--unlit { opacity: 0.55; filter: none; }
/* The memorial page's details band, as on the tree profile, sitting just under the banner */
.memo-details { padding-block: clamp(1.75rem, 4vw, 2.75rem) clamp(1rem, 3vw, 1.5rem); }
.memo-details .tags { margin-top: 0; }
.memo-details + .section::before { display: none; }
/* The plaque: gold letters on black granite, set in a terrazzo surround, with flowers laid at its foot */
.obit-page .wrap { display: grid; gap: 1.25rem; }
.memorial { display: grid; justify-content: center; }
.memorial__stone { position: relative; padding: clamp(14px, 3vw, 26px); border-radius: 4px;
  background: #9A9792 url("/images/terrazzo.svg") 0 0 / 200px 200px repeat; box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35), 0 18px 30px -22px rgba(25, 35, 58, 0.6); }
/* The headstone, Chinese style: an upright black granite stele with an eaved top, gold letters, the dates down the sides */
.memorial { grid-template-columns: minmax(0, 30rem); }
.stele { --gold: #D9B45A; --granite: linear-gradient(160deg, #222226 0%, #0B0B0D 55%, #18181B 100%); position: relative; color: var(--gold); }
.stele p, .stele h2 { color: var(--gold); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7), 0 -1px 0 rgba(255, 230, 160, 0.12); }
.stele__roof { /* the eaves: a low gable whose ends turn up */ height: 46px; margin: 0 -14px -1px; background: var(--granite); clip-path: polygon(0 100%, 3% 62%, 9% 78%, 50% 0, 91% 78%, 97% 62%, 100% 100%); position: relative; }
.stele__roof::after { content: ''; position: absolute; inset: 0; background: linear-gradient(var(--gold), var(--gold)) 50% 100% / 92% 2px no-repeat; opacity: 0.8; }
.stele__face { position: relative; display: grid; justify-items: center; gap: 0.9rem; padding: 1.4rem clamp(1rem, 4vw, 1.75rem) 1.6rem; background: var(--granite); border-radius: 0 0 2px 2px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 3px 6px rgba(0, 0, 0, 0.45); text-align: center; }
.stele__face::before { /* the carved double border */ content: ''; position: absolute; inset: 10px; border: 1px solid rgba(217, 180, 90, 0.55); box-shadow: inset 0 0 0 3px #0E0E10, inset 0 0 0 4px rgba(217, 180, 90, 0.35); pointer-events: none; }
.stele__cross { width: 22px; height: 33px; fill: var(--gold); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)); }
.stele__photo { width: 118px; height: 150px; border-radius: 50%; overflow: hidden; line-height: 0; border: 3px solid var(--gold); box-shadow: 0 0 0 4px #0E0E10, 0 0 0 5px rgba(217, 180, 90, 0.4); background: #EDE6D8; }
.stele__photo .portrait, .stele__photo .tile-svg { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.stele__cols { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) 2.2rem; gap: 0.75rem; align-items: start; width: 100%; }
.stele__side { margin: 0; writing-mode: vertical-rl; text-orientation: upright; justify-self: center; font-family: var(--font-zh); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.12em; line-height: 1.6; }
.stele__mark { display: inline-block; margin-bottom: 0.5em; font-weight: 700; font-size: 1.15em; }
.stele__centre { display: grid; justify-items: center; align-content: start; gap: 0.35rem; min-width: 0; }
.stele__zh { margin: 0 0 0.35rem; writing-mode: vertical-rl; text-orientation: upright; font-family: var(--font-zh); font-weight: 700; font-size: clamp(2.2rem, 6vw, 2.9rem); letter-spacing: 0.18em; line-height: 1.1; }
.stele__memory { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.stele__name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.45rem, 3.8vw, 2rem); line-height: 1.08; letter-spacing: 0.03em; text-transform: uppercase; text-wrap: balance; }
.stele__dates { margin: 0.2rem 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.06em; }
.stele__text { max-width: 30ch; font-family: var(--font-display); font-weight: 700; font-size: 0.98rem; line-height: 1.42; }
.stele__text p { margin: 0 0 0.7rem; } .stele__text p:last-child { margin-bottom: 0; }
.stele__rest { display: grid; gap: 0.15rem; margin: 0.2rem 0 0; padding-top: 0.8rem; border-top: 1px solid rgba(217, 180, 90, 0.45); }
.stele__rest [lang='zh'] { font-family: var(--font-zh); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.35em; padding-left: 0.35em; }
.stele__rest span:last-child { font-family: var(--font-display); font-style: italic; font-size: 0.85rem; letter-spacing: 0.04em; }
.flowerbed { position: relative; width: min(100%, 34rem); height: 72px; margin: -0.5rem auto 0; overflow: hidden; transition: height 0.4s ease; }
.flowerbed__rose { position: absolute; transform: rotate(var(--lie, 0deg)) scaleX(var(--flip, 1)); transform-origin: 50% 70%; filter: drop-shadow(0 2px 1px rgba(25, 35, 58, 0.35)); transition: opacity 0.9s ease; }
.flowerbed__rose.is-going { opacity: 0 !important; }
/* The small rose at the headstone's bottom corner: no words, no count; each click lays another rose beneath the prayer */
.tuck { position: absolute; right: -30px; bottom: -26px; margin: 0; z-index: 2; }
@media (max-width: 560px) { .tuck { right: -10px; } }
.tuck__rose { display: block; padding: 4px; border: 0; background: none; cursor: pointer; line-height: 0; border-radius: 50%; transform: rotate(-8deg); transition: transform 0.25s ease; }
.tuck__rose .rose { filter: drop-shadow(0 2px 2px rgba(25, 35, 58, 0.35)); }
.tuck__rose:hover { transform: rotate(2deg) scale(1.12); }
.tuck__rose:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
.tuck__rose.is-nudged { animation: tuck-nudge 0.5s ease; }
@keyframes tuck-nudge { 0%, 100% { transform: rotate(-8deg); } 30% { transform: rotate(-20deg); } 60% { transform: rotate(4deg); } }
/* The prayers, one card each, in a carousel */
/* The prayers: a big candle to light on the left, the prayers said so far in a carousel to its right */
.prayers__title { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
.prayers__row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.5rem); align-items: center; }
.prayers__row--empty { grid-template-columns: 1fr; justify-items: center; }
.light { display: grid; justify-items: center; }
.light__candle { display: grid; justify-items: center; gap: 0.4rem; padding: 0.25rem 0.5rem 0.5rem; border: 0; background: none; color: var(--ink); text-decoration: none; cursor: pointer; border-radius: 12px; }
.light__candle:focus-visible { outline: 3px solid var(--jade); outline-offset: 4px; }
.light__svg { transition: filter 0.4s ease; }
.light__svg:not(.is-lit) .candle__flame, .light__svg:not(.is-lit) .candle__core, .light__svg:not(.is-lit) .candle__glow { opacity: 0; }
.light__svg.is-lit { filter: drop-shadow(0 0 18px rgba(255, 194, 14, 0.55)); }
.light__candle:hover .light__svg:not(.is-lit) .candle__flame { opacity: 0.35; }
.light__note { font-family: var(--font-hand); font-size: 1.7rem; line-height: 1.05; text-align: center; color: var(--ink); }
.light__candle:hover .light__note { color: var(--magenta); }
.carousel--prayers { width: 100%; margin: 0; padding-inline: 0; }
.carousel--prayers .carousel__arrow--prev { left: -1.2rem; } .carousel--prayers .carousel__arrow--next { right: -1.2rem; }
.carousel--prayers .carousel__track { padding-top: 2.6rem; }
@media (max-width: 640px) { .prayers__row { grid-template-columns: 1fr; justify-items: stretch; } .light { justify-self: center; } }
/* A prayer card: its candle centred, standing half above the card's top edge */
.prayer-card { position: relative; flex: 0 0 min(80vw, 19rem); scroll-snap-align: start; display: grid; align-content: start; gap: 0.6rem; padding: 1.6rem 1.3rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--old-gilt); border-radius: var(--radius-card); text-align: center; }
/* The wax runs from about 48% to 96% of the drawing's height, so lifting it by 72% leaves half the wax above the card's edge */
.prayer-card__candle { position: absolute; top: 0; left: 50%; transform: translate(-50%, -72%); }
.prayer-card__text { margin: 0; font-family: var(--font-display); font-style: italic; font-size: 1.1rem; line-height: 1.45; color: var(--ink); }
.prayer-card__meta { margin: auto 0 0; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--ink-soft); }
.light__dialog { border: 0; border-radius: var(--radius-card); padding: 1.5rem 1.6rem; width: min(30rem, calc(100vw - 2rem)); background: var(--card); box-shadow: 0 30px 60px -30px rgba(25, 35, 58, 0.7); }
.light__dialog::backdrop { background: rgba(25, 35, 58, 0.45); }
.light__dialog-head { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; font-family: var(--font-hand); font-size: 1.8rem; line-height: 1.1; }
.light__dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin: 0; }
/* The columbarium: a stone wall of marble niches, one for each of the departed */
.columbarium { --stone: #CFC6BB; --marble: #F7F4EF; --engrave: #4A4A52; --bronze: #8A6A3A; list-style: none; margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: 12px; background: var(--stone) linear-gradient(135deg, rgba(255,255,255,0.18), rgba(0,0,0,0.06)); border-radius: 8px; box-shadow: inset 0 2px 8px rgba(25, 35, 58, 0.18); }
.niche { display: flex; }
.niche__plaque { position: relative; flex: 1; display: grid; justify-items: center; align-content: start; gap: 0.2rem; min-height: 15.5rem; padding: 1.75rem 1.6rem 4.75rem; text-align: center; text-decoration: none; color: var(--engrave);
  background: radial-gradient(ellipse at 20% 15%, rgba(255,255,255,0.9), transparent 55%), linear-gradient(160deg, var(--marble) 0%, #ECE7E0 60%, #E4DED6 100%);
  border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7), inset 0 -2px 0 rgba(0,0,0,0.06), 0 2px 3px rgba(25, 35, 58, 0.25); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.niche__plaque::before, .niche__plaque::after { /* the plaque's fixing screws */ content: ''; position: absolute; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: #9C958C; box-shadow: inset 0 1px 1px rgba(0,0,0,0.35); }
.niche__plaque::before { left: 6px; } .niche__plaque::after { right: 6px; }
.niche__plaque:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7), 0 10px 18px -8px rgba(25, 35, 58, 0.45); color: var(--engrave); }
.niche__plaque:focus-visible { outline: 3px solid var(--jade); outline-offset: 2px; }
.niche__no { position: absolute; top: 0.5rem; right: 0.7rem; font-family: var(--font-display); font-size: 0.85rem; color: #8C857C; }
.niche__face { line-height: 0; margin-bottom: 0.45rem; }
.niche__face .tile-svg, .niche__face .portrait { width: 52px; height: 52px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.niche__memory, .niche__rest { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: #8C857C; }
.niche__rest { margin-top: 0.35rem; }
.niche__name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.04em; text-wrap: balance; color: var(--engrave); text-shadow: 0 1px 0 rgba(255,255,255,0.8); }
.niche__plaque:hover .niche__name { color: var(--mourning-plum); }
.niche__kin { font-size: 0.78rem; font-style: italic; color: #6E6A66; }
.niche__years { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--engrave); }
.niche.is-featured .niche__plaque { box-shadow: inset 0 0 0 2px var(--old-gilt), 0 2px 3px rgba(25, 35, 58, 0.25); }
/* The flower holder on the plaque's edge: an empty bronze cup, or a red rose standing in it */
.niche__vase { position: absolute; right: 0.5rem; bottom: 0.5rem; width: 40px; display: grid; justify-items: center; }
/* The pot: a bronze cup, slightly wider at the top; the number of roses is stamped into it */
.niche__cup { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 21px; background: linear-gradient(90deg, #6B5230, var(--bronze) 45%, #5E4628); clip-path: polygon(0 0, 100% 0, 86% 100%, 14% 100%); border-radius: 0 0 2px 2px; opacity: 0.55; }
.niche.has-flowers .niche__cup { opacity: 1; }
/* The upright rose's stem ends near the left of its drawing, so nudge it right to stand in the pot */
.niche__rose { position: relative; z-index: 0; margin-bottom: -11px; transform: translateX(10px); }
.niche__flowers { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; line-height: 1; color: #FBF3DC; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); }
/* The candle in the niche's corner, its number set into the wax the way the pot carries the roses' count */
.niche__candles { position: absolute; left: 0.3rem; bottom: 0.4rem; line-height: 0; }
.niche__candle-n { position: absolute; left: 50%; top: 72%; transform: translate(-50%, -50%); font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; line-height: 1; color: #6B5E4E; }
/* Roses */
.rose { display: inline-block; vertical-align: middle; color: var(--rose-red); flex: none; }
.btn--rose { border-color: var(--rose-red); color: var(--rose-red); }
.btn--rose:not(:disabled):hover { background: var(--rose-red); color: #FFFFFF; }
.btn--rose:not(:disabled):hover .rose { color: #FFFFFF; }
.btn--rose:disabled { opacity: 1; cursor: default; border-color: var(--line); color: var(--ink-soft); background: transparent; }
.memorial-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.memorial-card__link { display: grid; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.memorial-card__link:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -24px rgba(25, 35, 58, 0.5); color: var(--ink); }
.memorial-card__flap { /* the upper flap of a tok wi altar cloth */
  display: block; height: 14px; margin: 5px 5px 0;
  background: repeating-linear-gradient(90deg, var(--ink) 0 10px, var(--mourning-plum) 10px 20px);
  border-bottom: 1px solid var(--old-gilt);
}
.memorial-card__face { display: block; aspect-ratio: 1; line-height: 0; background: var(--ground-deep); }
.memorial-card__face .tile-svg, .memorial-card__face .portrait { width: 100%; height: 100%; border-radius: 0; }
.portrait { display: block; object-fit: cover; background: var(--ground-deep); }
.portrait-current { display: flex; align-items: center; gap: 0.9rem; margin: 0 0 0.5rem; }
.portrait-current img { border-radius: 10px; object-fit: cover; }
.memorial-card__body { display: grid; gap: 0.2rem; padding: 1rem 1.2rem 1.2rem; }
.memorial-card__label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mourning-plum); margin-bottom: 0.4rem; }
.memorial-card__name { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; line-height: 1.15; }
.memorial-card__kin, .memorial-card__years { font-size: 0.88rem; color: var(--ink-soft); }
.memorial-card__years { font-family: var(--font-mono); }
.memorial-card__candles { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.75rem; font-size: 0.85rem; color: var(--ink-soft); }

.departed { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); column-gap: 2rem; }
.departed__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.85rem; align-items: center; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.departed__face { display: block; line-height: 0; }
.departed__face .tile-svg, .departed__face .portrait { width: 56px; height: 56px; border-radius: 10px; }
.departed__who { display: grid; gap: 0.05rem; min-width: 0; }
.departed__item.is-featured .departed__name { color: var(--mourning-plum); }
.departed__name { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2; color: var(--ink); text-decoration: none; }
.departed__name:hover { color: var(--mourning-plum); text-decoration: underline; }
.departed__kin { font-size: 0.85rem; color: var(--ink-soft); }
.departed__meta { display: grid; justify-items: end; gap: 0.15rem; }
.departed__years { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap; }
.departed__candles { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }

.obit { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.obit__kin { color: var(--ink-soft); }
.obit__candles { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); border-top: 3px solid var(--old-gilt); border-radius: var(--radius); padding: 1.25rem 1.4rem 1.5rem; position: sticky; top: 5rem; }
.obit__candles-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; margin-bottom: 1rem; }
.obit__candles .form { margin-top: 0; margin-bottom: 1.25rem; }
.candle-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; max-height: 60vh; overflow-y: auto; }
.candle-item { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.candle-item__prayer { margin: 0 0 0.25rem; font-size: 0.98rem; }
.candle-item__meta { margin: 0; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }
@media (max-width: 760px) { .obit { grid-template-columns: 1fr; } .obit__candles { position: static; } }

/* Candle: a layered flame that sways, breathes and glows while lit */
.candle { display: inline-block; vertical-align: middle; flex: none; overflow: visible; }
.candle__body { fill: var(--batik-cream); stroke: var(--line); stroke-width: 0.6; }
.candle__wax { fill: rgba(25, 35, 58, 0.06); }
.candle__wick { fill: var(--ink-soft); }
.candle__flame { fill: var(--line); }
.candle__core { fill: transparent; }
.candle__glow { fill: transparent; }
.candle.is-lit .candle__glow { fill: rgba(217, 165, 58, 0.22); transform-origin: 12px 12px; animation: candle-glow 1.9s ease-in-out infinite; }
.candle.is-lit .candle__flame { fill: var(--mustard); transform-origin: 12px 15px; animation: candle-sway 1.3s ease-in-out infinite; }
.candle.is-lit .candle__core { fill: #fff4cc; transform-origin: 12px 13px; animation: candle-core 0.7s ease-in-out infinite alternate; }
.candle.is-lit .candle__wick { fill: #3b2a1a; }
@keyframes candle-sway {
  0%   { transform: skewX(0deg)  scale(1, 1); }
  18%  { transform: skewX(-4deg) scale(1.04, 1.12); }
  37%  { transform: skewX(3deg)  scale(0.97, 0.94); }
  55%  { transform: skewX(-2deg) scale(1.02, 1.08); }
  76%  { transform: skewX(5deg)  scale(0.98, 1.02); }
  100% { transform: skewX(0deg)  scale(1, 1); }
}
@keyframes candle-core {
  from { transform: scale(0.85, 0.9); opacity: 0.85; }
  to   { transform: scale(1.1, 1.2);  opacity: 1; }
}
@keyframes candle-glow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  40%      { transform: scale(1.25); opacity: 1; }
  70%      { transform: scale(1.05); opacity: 0.7; }
}

.tokwi .pinggir { position: relative; z-index: 1; }


/* ------------------------------------------------------------------
   Brand book: medallion, icons, tiles, badges
------------------------------------------------------------------ */
.medallion { display: inline-block; vertical-align: middle; flex: none; }
.icon { display: inline-block; vertical-align: -0.2em; flex: none; width: 1.25em; height: 1.25em; }
.tilerow { display: none; }

/* Section band: the section's tile across the top of its page */
/* The running head of a page: the medallion monogram, attached straight under the header */
.band { display: none; }
.band + .section { padding-top: clamp(2.25rem, 5vw, 3.5rem); }
.band + .section--intro { padding-top: clamp(2.25rem, 5vw, 3.5rem); }


/* Rooms: tile cards */
.rooms__grid { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.room { display: grid; grid-template-rows: 150px auto; overflow: hidden; padding: 0; border-radius: var(--radius-card); box-shadow: 0 1px 0 var(--line), 0 18px 30px -26px rgba(25, 35, 58, 0.5); }
.room:hover { box-shadow: 0 1px 0 var(--line), 0 18px 30px -22px rgba(25, 35, 58, 0.55); transform: translateY(-2px); }
.room__pattern { position: relative; isolation: isolate; display: grid; place-items: center; height: 150px; color: var(--paper); }
.room__pattern::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: url("/images/monogram-paper.svg"); background-size: 96px 96px; background-position: center; opacity: 0.5; }
.room__pattern--memo::before { background-image: url("/images/monogram-ink.svg"); }
.room__pattern .icon { width: 5.2rem; height: 5.2rem; stroke-width: 1.3; }
.room__pattern--family { background-color: var(--orange); } .room__pattern--tree { background-color: var(--teal); } .room__pattern--journal { background-color: var(--marigold); } .room__pattern--events { background-color: var(--magenta); } .room__pattern--prayer { background-color: var(--magenta); } .room__pattern--memo { background-color: var(--grey); }
.room__body { padding: 1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; }
.room__label { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.room__text { margin: 0; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; }

/* Section colours */
.c-home, .c-tree { color: var(--teal-deep); }
.c-family { color: var(--orange); }
.c-journal, .c-heritage { color: var(--marigold-deep); }
.c-events, .c-prayer { color: var(--magenta); }
.c-memo { color: var(--grey-deep); }

/* Badges and states */
.badge { background: var(--teal); color: var(--paper); }
.badge--warn { background: var(--marigold); color: var(--ink); }
.badge--admin { background: var(--magenta); color: var(--paper); }
.badge--memo { background: var(--grey); color: var(--paper); }
.badge--gen { background: var(--cobalt); color: var(--paper); }
.badge--pos { background: var(--marigold); color: var(--ink); }
/* Tag row under a person's name: generation, place among siblings, member */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 0; }
.tags .badge { margin-left: 0; padding: 0.25rem 0.65rem; font-size: 0.68rem; }
.pill { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* Nav icons */

/* Member home */
.welcome-hero { display: grid; grid-template-columns: minmax(14rem, 20rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: stretch; }
.welcome-hero__text { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.welcome-hero__text .eyebrow { margin: 0; }
.welcome-hero__text h1 { margin: 0; line-height: 1.02; }
.welcome-hero__tile { position: relative; aspect-ratio: 1; width: 100%; border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 18px 30px -26px rgba(25, 35, 58, 0.6); }
.welcome-hero__tile img, .welcome-hero__tile .tile-svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.welcome-hero__cap { position: absolute; left: 1rem; bottom: 0.9rem; padding: 0.35rem 0.7rem; border-radius: 999px; background: rgba(255, 253, 233, 0.92); font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-deep); }
.needs { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
/* Member home: sections alternate grounds, cream (the page) then paper, so each one reads as its own room */
.section--paper { background: var(--paper); }
.section--paper::before, .section--paper + .section::before { display: none; }
.home-hero { padding-bottom: clamp(2rem, 5vw, 3.5rem); }
/* Tickets: what is coming up, each one a link to where you can act on it */
.tickets { list-style: none; margin: clamp(1.75rem, 4vw, 2.5rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 0.9rem; }
.tickets__none { margin: 1.5rem 0 0; }
.ticket { --tk: var(--jade); position: relative; display: grid; grid-template-columns: 5.5rem 1fr; min-height: 6.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); text-decoration: none; color: var(--ink); overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.ticket:hover { transform: translateY(-2px); box-shadow: 0 18px 28px -22px rgba(25, 35, 58, 0.55); color: var(--ink); }
.ticket:focus-visible { outline: 3px solid var(--tk); outline-offset: 3px; }
.ticket--memo { --tk: var(--grey-deep); } .ticket--events { --tk: var(--magenta); } .ticket--applicants { --tk: var(--marigold); }
.ticket__stub { display: grid; place-content: center; justify-items: center; gap: 0.05rem; background: var(--tk); color: var(--paper); border-right: 2px dashed var(--card); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; }
.ticket--applicants .ticket__stub { color: var(--ink); }
.ticket__stub::before, .ticket__stub::after { content: ''; position: absolute; left: calc(5.5rem - 9px); width: 16px; height: 16px; border-radius: 50%; background: var(--ground); border: 1px solid var(--line); }
.ticket__stub::before { top: -9px; } .ticket__stub::after { bottom: -9px; }
.ticket__day { font-size: 0.62rem; opacity: 0.85; }
.ticket__date { font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; line-height: 1; letter-spacing: 0; text-transform: none; }
.ticket__month { font-size: 0.62rem; }
.ticket__body { display: grid; align-content: center; gap: 0.2rem; padding: 0.85rem 1.1rem 0.85rem 1.3rem; }
.ticket__eyebrow { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tk); }
.ticket--applicants .ticket__eyebrow { color: var(--teal-deep); }
.ticket__eyebrow .icon { width: 1rem; height: 1rem; }
.ticket__title { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; line-height: 1.2; }
.ticket__cta { font-size: 0.88rem; color: var(--jade-deep); }
.ticket:hover .ticket__cta { color: var(--magenta); }
/* Prayer wall and remembrance side by side; the journal has its own section below */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.two h2 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.4rem; }
.two h2 .icon { width: 1.15em; height: 1.15em; }
.journal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1.25rem 2rem; }
.journal-grid .entry { margin: 0; }
.section-head h2 .icon { width: 1em; height: 1em; vertical-align: -0.1em; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 2rem; }
.three h2 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.4rem; }
.memo-card { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.9rem; align-items: center; padding: 0.9rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); }
.memo-card img { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; filter: grayscale(1); opacity: 0.5; }
@media (max-width: 760px) { .welcome-hero { grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; } .welcome-hero__cap { display: none; } }
@media (max-width: 480px) { .welcome-hero { grid-template-columns: 1fr; } .welcome-hero__tile { width: 9rem; } .welcome-hero__text { gap: 0.6rem; } }

/* Footer brand row and nav tidy-ups */
.site-footer__brand { display: flex; align-items: center; gap: 1rem; }
.site-footer__brand .site-footer__motto { margin-bottom: 0.15rem; }
.nav a[aria-current='false'] { border-bottom-color: transparent; }
.btn .icon { width: 1.1em; height: 1.1em; }
.eyebrow .icon { width: 1em; height: 1em; vertical-align: -0.15em; }
.three h2 .icon { width: 1.15em; height: 1.15em; }

.nav a, .nav .link-button { font-size: 0.92rem; }


/* Prayer wall */
.pw { display: grid; grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.pw__post { position: sticky; top: 5rem; }
.pw__form { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--magenta); border-radius: var(--radius-card); padding: 1.25rem; }
.pw__kinds { display: flex; gap: 1rem; }
.pw__kind { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; }
.pw__h { display: flex; align-items: center; gap: 0.6rem; font-size: 1.5rem; margin-bottom: 1rem; }
.pw__h .date { margin-left: 0.25rem; }
.intentions { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.intention { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); }
.intention--thanks { border-top: 2px solid var(--marigold); }
.intention--answered { opacity: 0.75; }
.intention__pin .icon { width: 1.5rem; height: 1.5rem; }
.intention__text { margin: 0 0 0.35rem; font-size: 1.02rem; line-height: 1.5; }
.intention__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--ink-soft); }
.intention__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 0.75rem; }
.intention__actions form { display: inline; }
.pill--outline { background: transparent; color: var(--magenta); border: 1.5px solid var(--magenta); cursor: pointer; }
.pill--outline:hover { background: var(--rose-soft); }
button.pill { font: inherit; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; border: 1.5px solid transparent; }
button.badge { cursor: default; }
.pw__answered { margin-top: 2.5rem; }
.pw__answered summary { cursor: pointer; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1rem; }
.intentions--quiet .intention { background: transparent; }
@media (max-width: 760px) { .pw { grid-template-columns: 1fr; } .pw__post { position: static; } }

/* A person's tile, explained (tree person page) */
/* The person's tile card: their own tile, why it looks so, and (for the married) the household tile to the right */
.tile-card { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.tile-card--married { grid-template-columns: auto 1fr auto; }
.tile-card__why { margin: 0; padding-left: 1.1rem; font-size: 0.95rem; color: var(--ink-soft); display: grid; gap: 0.3rem; }
.tile-card__households { display: grid; gap: 1rem; justify-items: center; align-self: start; padding-left: 1.5rem; border-left: 1px solid var(--line); }
.tile-card__hh { display: grid; justify-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); text-align: center; max-width: 11rem; }
.tile-card__hh .tile-svg { border-radius: 10px; }
/* Bento: the personal details as a grid of white cells; the tile card is the big one */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 0.9rem; margin: 1.5rem 0; }
.bento__cell { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 1rem 1.15rem; min-width: 0; }
.bento__cell--2 { grid-column: span 2; }
.bento__cell--4 { grid-column: span 4; }
.bento__cell--tile { grid-column: span 2; grid-row: span 2; display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; padding: 1.25rem 1.35rem; }
.bento__cell--tile.tile-card--married { grid-template-columns: auto 1fr auto; }
.bento__cell--memo { border-top: 3px solid var(--grey); }
.bento__label { margin: 0 0 0.45rem; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-deep); }
.bento__value { margin: 0; font-family: var(--font-display); font-size: 1.35rem; line-height: 1.2; }
.bento__note { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.marriages { display: grid; gap: 0.7rem; }
.marriage { display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.6rem; align-items: center; }
.marriage__n { grid-row: span 2; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: inline-grid; place-items: center; font-family: var(--font-mono); font-size: 0.66rem; background: var(--ground-deep); color: var(--ink-soft); }
.marriage .chip { grid-column: 2; }
.marriage__story { grid-column: 2; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.03em; color: var(--teal-deep); }
.marriage--parted .marriage__story { color: var(--grey-deep); }
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; }
.chips--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.6rem 1rem; }
.chip { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; text-decoration: none; color: var(--ink); }
.chip .tile-svg { width: 40px; height: 40px; border-radius: 8px; flex: 0 0 auto; }
.chip__text { display: grid; gap: 0.05rem; min-width: 0; }
.chip__name { font-family: var(--font-display); font-size: 1.02rem; line-height: 1.2; }
.chip:hover .chip__name { color: var(--magenta); }
.chip__kin, .chip__years { font-size: 0.74rem; color: var(--ink-soft); }
.chip__years { font-family: var(--font-mono); }
.chip.is-rip .chip__name { color: var(--ink-soft); }
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bento__cell--4 { grid-column: span 2; } .bento__cell--tile { grid-row: auto; } .bento__cell--tile.tile-card--married { grid-template-columns: auto 1fr; } .bento__cell--tile .tile-card__households { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; padding-left: 0; padding-top: 1rem; border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } .bento__cell--2, .bento__cell--4, .bento__cell--tile { grid-column: span 1; } .bento__cell--tile { grid-template-columns: 1fr; } .bento__cell--tile.tile-card--married { grid-template-columns: 1fr; } }
.badge--zodiac { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--card); color: var(--z); border: 1.5px solid var(--z); padding-block: 0.15rem; }
.badge--zodiac .zodiac { width: 1.1rem; height: 1.1rem; }
.zodiac { display: inline-block; vertical-align: middle; }
@media (max-width: 760px) { .tile-card, .tile-card--married { grid-template-columns: auto 1fr; } .tile-card__households { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; padding-left: 0; padding-top: 1rem; border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 600px) { .tile-card, .tile-card--married { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------
   Member pages: posts and photos (Phase 4)
------------------------------------------------------------------ */
.profile { margin-top: 2.5rem; }
.btn--small { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.gallery--wide { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; }
.gallery__item { position: relative; }
.gallery__item img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-card); border: 1px solid var(--line); background: var(--ground-deep); }
.gallery__item a:hover img { box-shadow: 0 0 0 3px var(--teal); }
.gallery__caption { font-size: 0.85rem; color: var(--ink-soft); margin: 0.35rem 0 0; }
.gallery__flag { position: absolute; left: 0.4rem; top: 0.4rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(255, 253, 233, 0.92); font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--magenta); }
.gallery__remove { position: absolute; right: 0.3rem; top: 0.2rem; }
.gallery__remove button { background: rgba(255, 253, 233, 0.92); border-radius: 999px; width: 1.6rem; height: 1.6rem; line-height: 1; font-size: 1rem; }
.upload { margin-top: 1.5rem; padding: 1.25rem 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); display: grid; gap: 1rem; }
.upload .btn { justify-self: start; }
.label-text { display: block; font-weight: 500; margin-bottom: 0.3rem; }
.wrap--narrow { max-width: 46rem; }
.choice { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 1rem; font-weight: 400; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 500; margin-bottom: 0.4rem; }

/* Monogram grounds where tiles used to sit */
.memo-card__pattern { display: grid; place-items: center; width: 5.5rem; min-height: 5.5rem; background: var(--grey) url("/images/monogram-ink.svg") center / 64px 64px; color: var(--paper); border-radius: 4px; }
.memo-card__pattern .icon { width: 1.8rem; height: 1.8rem; }
.welcome-hero__pattern { position: absolute; inset: 0; display: grid; place-items: center; background: var(--paper) url("/images/monogram.svg") center / 96px 96px; }
@media (max-width: 640px) { .section { padding-block: clamp(2rem, 7vw, 3.5rem); } .section--intro { padding-bottom: 1rem; } h1 { font-size: clamp(2rem, 9vw, 3rem); } }

/* ------------------------------------------------------------------
   Family page: one carousel per generation, one card per person
------------------------------------------------------------------ */
.carousel { position: relative; width: min(100%, var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.carousel__track { list-style: none; margin: 0; padding: 0.25rem 0 1rem; display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--gilt) transparent; }
.carousel__track::-webkit-scrollbar { height: 6px; } .carousel__track::-webkit-scrollbar-thumb { background: var(--gilt); border-radius: 999px; }
.pcard { flex: 0 0 13rem; scroll-snap-align: start; }
.pcard__link { display: grid; grid-template-rows: auto 1fr; height: 100%; background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.pcard__link:hover { transform: translateY(-3px); box-shadow: 0 18px 30px -24px rgba(25, 35, 58, 0.5); color: var(--ink); }
/* the tile fills the whole top of the card */
.pcard__tile { display: block; aspect-ratio: 1; width: 100%; }
.pcard__tile .tile-svg { width: 100%; height: 100%; border-radius: 0; }
.pcard__body { display: grid; gap: 0.15rem; padding: 0.75rem 0.85rem 0.8rem; }
.pcard__name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.2; text-wrap: balance; }
.pcard__kin { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--magenta); }
.pcard__pos { font-size: 0.78rem; color: var(--ink-soft); font-style: italic; }
.pcard__facts { margin: 0.45rem 0 0; padding-top: 0.45rem; border-top: 1px solid var(--line); display: grid; gap: 0.05rem; font-size: 0.74rem; line-height: 1.35; }
.pcard__facts div { display: flex; justify-content: space-between; gap: 0.5rem; }
.pcard__facts dt { color: var(--ink-soft); }
.pcard__facts dd { margin: 0; font-family: var(--font-mono); font-size: 0.7rem; }
/* Branch chips and name search above the carousels */
.ffilter { display: grid; gap: 0.9rem; margin-top: 1.5rem; }
.bchips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bchip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.8rem 0.3rem 0.35rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.bchip .tile-svg, .bchip__all { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; }
.bchip__all { display: grid; place-items: center; background: var(--ground-deep); }
.bchip:hover { border-color: var(--hue, var(--ink)); }
.bchip.is-active { border-color: var(--hue, var(--ink)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hue, var(--ink)) 25%, transparent); }
.fsearch { display: grid; gap: 0.3rem; max-width: 22rem; }
.fsearch__label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-deep); }
.fsearch__input { padding: 0.55rem 0.9rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font: inherit; font-size: 0.95rem; }
.fsearch__input:focus { outline: 2px solid var(--jade); outline-offset: 2px; }
.ffilter__count { margin: 0; min-height: 1.2em; }
/* A sibling set's divider in the carousel: the parents' household tile, standing on its own */
.carousel__divider { flex: 0 0 auto; display: grid; justify-items: center; align-content: center; gap: 0.4rem; width: 6.5rem; padding: 0 0.25rem; margin-right: 0.25rem; border-right: 1px dashed var(--gilt); scroll-snap-align: start; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); text-align: center; }
.carousel__divider .tile-svg { border-radius: 10px; }
[data-gen][hidden], .pcard[hidden], .carousel__divider[hidden] { display: none; }
.carousel__arrow { position: absolute; top: 40%; z-index: 2; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 8px 18px -12px rgba(25, 35, 58, 0.5); display: grid; place-items: center; }
.carousel__arrow:hover { color: var(--magenta); border-color: var(--magenta); }
.carousel__arrow--prev { left: calc(var(--gutter) - 1.2rem); } .carousel__arrow--next { right: calc(var(--gutter) - 1.2rem); }
@media (max-width: 640px) { .pcard { flex-basis: 10.5rem; } .carousel__arrow { display: none; } .carousel__track { scroll-snap-type: x proximity; } }
