/* LeMarchant family hub — "heritage" landscape tree (see Design_References/heritage-c-landscape.html). */

:root {
  --paper: #f2efe6;
  --paper-deep: #e9e5d8;
  --ink: #26302a;
  --muted: #77806f;
  --line: #a9b39c;
  --accent: #4f6b4a;
  --accent-soft: #e3e9dc;
  --card: #fbfaf5;
  --rule: #e1ddcf;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --card-w: 268px;
  --gen-gap: 96px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 50% 45%, rgba(255, 255, 255, .55), transparent 70%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.panel-open:not(.panel-docked) { overflow: hidden; }

/* Docked panel (wide screens): the page makes room for it and stays usable. */
body { transition: padding-right .45s var(--ease); }
body.panel-docked { padding-right: min(440px, 94vw); }
/* With the panel docked there's less room: tighter cards and columns keep the focus view on screen. */
body.panel-docked { --card-w: 236px; --gen-gap: 60px; }
body.panel-docked .scroller { padding-left: 40px; padding-right: 40px; }
body.panel-docked .masthead, body.panel-docked .toolbar { padding-left: 40px; padding-right: 40px; }

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

a { color: inherit; }

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

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 3px; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 40px 56px 0;
}

.masthead__titles {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.masthead h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -.01em;
}
.masthead h1 i { color: var(--accent); }

.masthead__tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--muted);
}

.monogram {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -.02em;
  color: var(--ink);
  transition: border-color .25s, color .25s, transform .4s var(--ease);
}
.monogram i { color: var(--accent); }
.monogram:hover { border-color: var(--accent); transform: rotate(-6deg); }

/* ---------- Toolbar: line of descent, search, view ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  padding: 22px 56px 0;
}

.crumbs {
  flex: 1 1 420px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs__link {
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  padding: 6px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: background .2s;
}
.crumbs__link:hover { background: var(--accent-soft); }
.crumbs__sep { color: var(--line); }
.crumbs__here {
  padding: 6px 10px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 500;
}

.toolbar__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 280px;
  max-width: 100%;
  height: 44px;
  padding: 0 16px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  transition: border-color .2s;
}
.search:focus-within { border-color: var(--accent); }
.search svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.search input::placeholder { color: var(--muted); }

.viewswitch { display: flex; padding: 4px; border-radius: 999px; background: var(--paper-deep); }
.viewswitch button {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 500 13px var(--sans);
  color: var(--muted);
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}
.viewswitch button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(40, 50, 40, .14); }

/* "← Silvia's parents" links under the Parents column in the focus view. */
.jump {
  align-self: center;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  border-radius: 3px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  transition: background .2s;
}
.jump:hover { background: var(--accent-soft); }

/* The focus view is a small tree: keep it centred and calm. */
body[data-view="focus"] .stage { justify-content: center; }
body[data-view="focus"] .generation { justify-content: center; }

/* ---------- Stage & tree ---------- */

.stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 420px;
}

.scroller {
  overflow-x: auto;
  padding: 40px 72px 48px;
  scrollbar-width: none;
  cursor: grab;
}
.scroller::-webkit-scrollbar { display: none; }
.is-dragging .scroller { cursor: grabbing; user-select: none; }
.is-dragging .person { pointer-events: none; }

/* Soft paper-coloured fades show there is more tree off-screen. */
.stage::before, .stage::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.stage::before { left: 0; background: linear-gradient(90deg, var(--paper) 15%, rgba(242, 239, 230, 0)); }
.stage::after { right: 0; background: linear-gradient(270deg, var(--paper) 15%, rgba(242, 239, 230, 0)); }
.stage.can-left::before, .stage.can-right::after { opacity: 1; }

.stage__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(40, 50, 40, .1);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility 0s linear .3s, border-color .2s, transform .3s var(--ease);
}
.stage__nav svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stage__nav--left { left: 20px; }
.stage__nav--right { right: 20px; }
.stage.can-left .stage__nav--left, .stage.can-right .stage__nav--right { opacity: 1; visibility: visible; transition: opacity .3s, border-color .2s, transform .3s var(--ease); }
.stage__nav:hover { border-color: var(--accent); }
.stage__nav--left:hover { transform: translateX(-2px); }
.stage__nav--right:hover { transform: translateX(2px); }

.tree {
  position: relative;
  display: flex;
  gap: var(--gen-gap);
  width: max-content;
  margin: 0 auto;
  align-items: stretch;
}

.tree__lines {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}
.tree__lines path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: stroke .3s, stroke-width .3s;
}
.tree__lines path.is-drawing { transition: stroke-dashoffset 1.1s var(--ease) .35s; }
.tree__lines path.is-hot { stroke: var(--accent); stroke-width: 2.2; }

.generation {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 26px;
  padding-top: 62px;
}

.generation__label {
  position: absolute;
  top: 0; left: 0; right: 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  color: var(--muted);
}
.generation__label small {
  display: block;
  margin-top: 1px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.generation__label::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin: 6px auto 0;
  background: var(--line);
}

/* ---------- Couples ---------- */

.single, .couple { display: flex; flex-direction: column; align-items: center; }
.couple { gap: 2px; }
.couple__amp { font-family: var(--serif); font-size: 20px; line-height: 1.1; color: var(--accent); }
.couple__gap { display: block; height: 12px; }

/* ---------- Person card ---------- */

.person {
  display: flex;
  gap: 14px;
  align-items: center;
  width: var(--card-w);
  padding: 9px 16px 9px 9px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity .7s var(--ease) var(--delay, 0s),
    transform .7s var(--ease) var(--delay, 0s),
    box-shadow .25s, border-color .25s;
}
.is-ready .person { opacity: 1; transform: none; }
.is-ready .person:hover { box-shadow: 0 10px 26px rgba(40, 50, 40, .12); transform: translateX(3px); transition-delay: 0s; }
.person.is-active { background: #f7f9f3; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 10px 26px rgba(40, 50, 40, .12); }

.portrait {
  position: relative;
  flex: none;
  width: 54px;
  height: 66px;
  border-radius: 2px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--tone, #6b7f5e);
  color: rgba(255, 255, 255, .92);
  font-family: var(--serif);
  font-size: 22px;
}
.portrait img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.8);
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.portrait.has-image img { opacity: 1; }

.person__text { min-width: 0; }
.person__name {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.12;
}
.person__meta {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}
.person__site {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 8px;
  border: 1px solid #cdd5c3;
  border-radius: 99px;
  font-size: 10.5px;
  letter-spacing: .03em;
  color: var(--accent);
  background: var(--accent-soft);
}
.person.has-site { border-color: #cfd8c4; }

/* ---------- Messages ---------- */

.stage__message {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--muted);
  padding: 0 24px 40px;
}

/* ---------- Colophon ---------- */

.colophon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px 34px;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.colophon__rule { width: 36px; height: 1px; background: var(--line); }

/* ---------- Panel ---------- */

.scrim {
  position: fixed; inset: 0; z-index: 9;
  background: rgba(38, 48, 42, .18);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.scrim.is-visible { opacity: 1; }

.panel {
  position: fixed;
  top: 0; right: 0; z-index: 10;
  width: min(440px, 94vw);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--card);
  box-shadow: -20px 0 50px rgba(30, 40, 30, .15);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .45s var(--ease), visibility 0s linear .45s;
}
.panel.is-open { transform: none; visibility: visible; transition: transform .45s var(--ease); }
.panel:focus { outline: none; }

.panel__close {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  cursor: pointer;
  transition: background .2s, transform .3s var(--ease);
}
.panel__close svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 1.6; fill: none; stroke-linecap: round; }
.panel__close:hover { background: #fff; transform: rotate(90deg); }

.hero {
  position: relative;
  height: 300px;
  display: grid;
  place-items: start center;
  padding-top: 46px;
  overflow: hidden;
  background: var(--tone, #6b7f5e);
  color: rgba(255, 255, 255, .8);
  font-family: var(--serif);
  font-size: 84px;
  line-height: 1;
}
.hero img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.85);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .7s var(--ease), transform 1.2s var(--ease);
}
.hero.has-image img { opacity: 1; transform: none; }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(transparent 45%, rgba(0, 0, 0, .42));
}
.hero h2 {
  position: absolute; left: 30px; right: 30px; bottom: 22px; z-index: 1;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  color: #fff;
}

.panel__body { padding: 26px 30px 44px; }
.panel__role {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.panel__bio { font-size: 15px; line-height: 1.75; margin-bottom: 26px; }

.primary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: background .25s;
}
.primary small { display: block; font-size: 11.5px; opacity: .75; margin-top: 2px; }
.primary .arrow { transition: transform .3s var(--ease); }
.primary:hover { background: var(--ink); }
.primary:hover .arrow { transform: translateX(4px); }

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.links a {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #dcd8ca;
  border-radius: 3px;
  font-size: 13px;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.links a:hover { border-color: var(--accent); color: var(--accent); }

.relatives { margin-top: 30px; padding-top: 18px; border-top: 1px solid #e6e2d6; }
.relatives h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 6px;
}
.relatives__group { margin-top: 12px; }
.relatives h4 {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.relatives__list { display: flex; flex-wrap: wrap; gap: 8px; }
.relative {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid #dcd8ca;
  border-radius: 99px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s;
}
.relative:hover { border-color: var(--accent); }
.relative .dot {
  position: relative;
  width: 26px; height: 26px; border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--tone, #6b7f5e);
  color: #fff;
  font-size: 10px;
}
.relative .dot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.relative small { color: var(--muted); }

/* ---------- Notice pages (404 / unavailable) ---------- */

.notice-page { justify-content: center; align-items: center; }
.notice { max-width: 520px; padding: 40px 28px; text-align: center; }
.notice .monogram { margin: 0 auto 28px; }
.notice h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 5vw, 44px); line-height: 1.1; margin-bottom: 12px; }
.notice p { color: var(--muted); margin-bottom: 28px; }
.notice__link { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* ---------- Small screens: same left-to-right tree, swiped sideways ---------- */

@media (max-width: 760px) {
  :root { --card-w: 232px; --gen-gap: 56px; }
  .masthead { padding: 28px 24px 0; align-items: flex-start; }
  .monogram { width: 44px; height: 44px; font-size: 18px; margin-top: 4px; }
  .masthead__titles { flex-direction: column; }
  .masthead__tagline { font-size: 16px; }
  .toolbar { padding: 16px 24px 0; }
  .toolbar__tools, .search { width: 100%; }
  .crumbs { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .crumbs::-webkit-scrollbar { display: none; }
  .search { flex: 1; }
  .scroller { padding: 28px 28px 36px; }
  .stage::before, .stage::after { width: 44px; }
  .stage__nav { display: none; }
  .person__name { font-size: 17.5px; }
  .colophon { flex-wrap: wrap; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; }
}
