:root {
  --ink: #20201d;
  --muted: #69645c;
  --paper: #f7f1e6;
  --cream: #fffaf0;
  --green: #2f6b4f;
  --red: #a13a34;
  --gold: #9f6f1f;
  --blue: #315f7d;
  --line: rgba(32, 32, 29, 0.16);
  --shadow: 0 24px 60px rgba(38, 31, 21, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, Arial, sans-serif;
}

a {
  color: inherit;
}

.hero {
  min-height: 94vh;
  padding: 28px clamp(18px, 4vw, 64px) 52px;
  background:
    linear-gradient(120deg, rgba(37, 82, 58, 0.86), rgba(120, 44, 39, 0.76)),
    url("assets/serravalle-all-adige.jpg") center / cover;
  color: #fffdf6;
}

.page-hero,
.sub-hero {
  padding: 28px clamp(18px, 4vw, 64px) 52px;
  color: #fffdf6;
}

.home-hero {
  min-height: 94vh;
  background:
    linear-gradient(120deg, rgba(37, 82, 58, 0.86), rgba(120, 44, 39, 0.76)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.sub-hero {
  min-height: 56vh;
  background:
    linear-gradient(120deg, rgba(31, 62, 47, 0.91), rgba(126, 55, 43, 0.82)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.region-hero {
  background:
    linear-gradient(120deg, rgba(41, 82, 62, 0.9), rgba(58, 69, 88, 0.82)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.ancestors-hero {
  background:
    linear-gradient(120deg, rgba(104, 52, 38, 0.9), rgba(45, 81, 60, 0.82)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.tree-hero {
  background:
    linear-gradient(120deg, rgba(44, 74, 93, 0.88), rgba(116, 45, 65, 0.78)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.sources-hero {
  background:
    linear-gradient(120deg, rgba(45, 73, 54, 0.9), rgba(83, 63, 42, 0.82)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.malena-hero {
  background:
    linear-gradient(120deg, rgba(42, 82, 62, 0.88), rgba(123, 58, 56, 0.78)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.heraldry-hero {
  background:
    linear-gradient(120deg, rgba(31, 54, 79, 0.9), rgba(104, 73, 38, 0.78)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.branches-hero {
  background:
    linear-gradient(120deg, rgba(47, 80, 61, 0.9), rgba(74, 49, 39, 0.78)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.people-hero {
  background:
    linear-gradient(120deg, rgba(75, 49, 41, 0.9), rgba(39, 63, 87, 0.78)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.companies-hero {
  background:
    linear-gradient(120deg, rgba(20, 54, 84, 0.9), rgba(101, 72, 36, 0.78)),
    url("assets/serravalle-all-adige.jpg") center / cover;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  font-family: Cinzel, Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.08);
}

.nav-links a.active {
  background: rgba(255, 255, 255, 0.94);
  color: #243b2d;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
  max-width: 1180px;
  margin: 18vh auto 0;
}

.sub-hero-copy {
  max-width: 900px;
  margin: 14vh auto 0;
}

.sub-hero-copy h1 {
  max-width: 860px;
  font-size: clamp(2.35rem, 5.5vw, 4.6rem);
}

.sub-hero-copy p:not(.eyebrow) {
  max-width: 760px;
  margin: 24px 0 0;
  color: rgba(255, 253, 246, 0.9);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #e4b557;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
}

h1 {
  max-width: 760px;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.lead {
  max-width: 690px;
  margin: 28px 0 0;
  color: rgba(255, 253, 246, 0.9);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}

.primary {
  background: #fff8e8;
  color: #243b2d;
}

.ghost {
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #fff8e8;
}

.origin-panel {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(30, 35, 27, 0.36);
  backdrop-filter: blur(12px);
}

.stamp {
  display: inline-block;
  margin-bottom: 20px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.origin-panel h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.origin-panel p {
  color: rgba(255, 253, 246, 0.86);
  line-height: 1.72;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 82px clamp(18px, 4vw, 34px);
}

.section-title {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 0.58fr);
  gap: 34px;
  align-items: start;
  margin-bottom: 34px;
}

.section-title h2 {
  font-size: clamp(1.65rem, 3.2vw, 2.8rem);
  line-height: 1.08;
}

.story {
  columns: 2 320px;
  column-gap: 42px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.8;
}

.story p {
  break-inside: avoid;
  margin-top: 0;
}

.memory {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  max-width: 1180px;
  padding-top: 10px;
}

.memory-photo {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #141414;
}

.memory-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.memory-copy h2 {
  margin-bottom: 20px;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 1.08;
}

.memory-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-top: 0;
}

.feature-card {
  min-height: 170px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(38, 31, 21, 0.08);
}

.feature-card strong {
  display: block;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 1.2rem;
}

.feature-card span {
  color: var(--muted);
  line-height: 1.58;
}

.region-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(24px, 5vw, 60px);
  align-items: start;
}

.article {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.82;
}

.article h2 {
  margin-bottom: 22px;
  color: var(--ink);
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 1.1;
}

.note-card {
  position: sticky;
  top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.note-card h3 {
  margin-bottom: 14px;
  color: var(--green);
}

.note-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.places-section {
  padding-top: 24px;
}

.tyrol-history {
  background: #fffdf8;
}

.history-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 24px;
}

.history-panel article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 12px 28px rgba(38, 31, 21, 0.06);
}

.history-panel h3 {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.history-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.history-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
}

.history-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 14px 34px rgba(38, 31, 21, 0.08);
}

.history-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #fffdf8;
}

.history-gallery figcaption {
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.42;
}

.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
}

.place-card {
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 12px 28px rgba(38, 31, 21, 0.06);
}

.place-card span {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 8px;
  border: 1px solid rgba(47, 107, 79, 0.24);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.place-card h3 {
  margin-bottom: 12px;
  font-size: 1.35rem;
  line-height: 1.14;
}

.place-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.place-photo {
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid rgba(91, 74, 54, 0.14);
  border-radius: 8px;
  background: #fffdf8;
}

.place-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.place-photo figcaption {
  padding: 9px 10px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-top: 0;
}

.facts article,
.research-grid article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
}

.facts strong {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 1.05rem;
}

.facts span,
.research span,
.research li {
  color: var(--muted);
  line-height: 1.55;
}

.timeline {
  max-width: none;
  background: #e9dfcf;
}

.timeline .section-title,
.timeline-list {
  max-width: 1112px;
  margin-left: auto;
  margin-right: auto;
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-list article {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid rgba(32, 32, 29, 0.18);
}

time {
  color: var(--red);
  font-weight: 900;
}

.timeline-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.person-list {
  display: grid;
  gap: 24px;
}

.lineage-intro {
  max-width: 920px;
}

.lineage-intro h2 {
  margin-bottom: 18px;
  font-size: clamp(1.65rem, 3.2vw, 2.8rem);
  line-height: 1.1;
}

.lineage-intro p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.75;
}

.couple-list {
  display: grid;
  gap: 28px;
  padding-top: 0;
}

.couple-card {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 250, 240, 0.98));
  box-shadow: 0 14px 34px rgba(38, 31, 21, 0.07);
}

.branch-card {
  background: #fbf7ee;
}

.featured-couple {
  border-color: rgba(47, 107, 79, 0.36);
  background: #fffdf8;
}

.couple-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(32, 32, 29, 0.12);
}

.couple-title h2 {
  font-size: clamp(1.45rem, 2.6vw, 2.25rem);
  line-height: 1.12;
}

.mini-profiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.mini-profile {
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 8px;
  background: #fffdf8;
}

.mini-profile.female {
  border-top-color: #ca3c68;
}

.mini-profile h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.mini-profile a {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--green);
  font-weight: 900;
}

.mini-profile dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
}

.mini-profile dl div {
  padding: 10px;
  border: 1px solid rgba(32, 32, 29, 0.11);
  border-radius: 8px;
  background: #fffaf0;
}

.mini-profile dl .wide {
  grid-column: 1 / -1;
}

.parent-note {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(47, 107, 79, 0.22);
  border-radius: 8px;
  background: rgba(47, 107, 79, 0.07);
}

.children-note {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(32, 32, 29, 0.12);
  border-radius: 8px;
  background: #f6efe2;
}

.children-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.children-head strong {
  color: var(--red);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.children-head span {
  padding: 5px 9px;
  border: 1px solid rgba(32, 32, 29, 0.14);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.children-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.child-card {
  min-height: 134px;
  padding: 14px;
  border: 1px solid rgba(32, 32, 29, 0.13);
  border-left: 4px solid rgba(49, 95, 125, 0.46);
  border-radius: 8px;
  background: #fffdf8;
}

.child-card a,
.child-card .child-name {
  display: block;
  color: var(--green);
  font-weight: 900;
  line-height: 1.25;
  text-decoration: none;
}

.child-card small {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(47, 107, 79, 0.1);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.child-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.child-card.continues {
  border-color: rgba(201, 154, 74, 0.5);
  border-left-color: var(--gold);
  background: #fff8e8;
}

.child-card.continues::before {
  content: "Linha principal";
  display: inline-block;
  margin-bottom: 9px;
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.document-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.document-strip figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.document-strip img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
  background: #f4efe5;
}

.document-strip figcaption {
  padding: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.family-strip {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.family-strip img {
  max-height: 520px;
}

.parent-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.parent-note a,
.parent-note span {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.parent-note a {
  color: var(--green);
  font-weight: 900;
}

.couple-card > p {
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.profile {
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 18px 42px rgba(38, 31, 21, 0.08);
}

.profile-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 20px;
  align-items: end;
  margin-bottom: 24px;
}

.profile-head .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.profile h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.45rem);
  line-height: 1.1;
}

.profile a {
  color: var(--green);
  font-weight: 900;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 22px;
}

.profile-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.profile-grid .wide {
  grid-column: span 2;
}

dt {
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd {
  margin: 8px 0 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.profile p {
  max-width: 940px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.72;
}

.bio-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 62px);
  align-items: start;
}

.bio-card {
  position: sticky;
  top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.bio-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
}

.bio-card div {
  padding: 22px;
}

.bio-card h2 {
  margin-bottom: 10px;
  font-size: 1.75rem;
}

.bio-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.bio-text p + p {
  margin-top: 18px;
}

.split-band {
  max-width: none;
  background: #e9dfcf;
}

.split-band article {
  max-width: 900px;
  margin: 0 auto;
}

.split-band h2 {
  margin-bottom: 22px;
  font-size: clamp(1.65rem, 3.2vw, 2.8rem);
  line-height: 1.1;
}

.split-band p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.78;
}

.meaning-card {
  margin-top: 28px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(165, 65, 49, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.58);
  box-shadow: 0 14px 32px rgba(38, 31, 21, 0.08);
}

.meaning-card span {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meaning-card p:not(.eyebrow) {
  max-width: 780px;
  color: #4e473d;
  font-size: 0.98rem;
  line-height: 1.72;
}

.meaning-card p + p {
  margin-top: 12px;
}

.roots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.root-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 14px 34px rgba(38, 31, 21, 0.08);
}

.root-card span {
  display: block;
  margin-bottom: 14px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.root-card h3 {
  margin-bottom: 16px;
  font-size: 1.55rem;
}

.closing-text {
  display: flex;
  justify-content: center;
  padding: 30px 24px 72px;
}

.closing-card {
  position: relative;
  max-width: 860px;
  padding: clamp(24px, 4vw, 38px) clamp(24px, 5vw, 48px);
  border: 1px solid rgba(47, 107, 79, 0.2);
  border-left: 6px solid var(--green);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(242, 232, 216, 0.92));
  box-shadow: 0 18px 46px rgba(38, 31, 21, 0.12);
}

.closing-card::before {
  content: "“";
  position: absolute;
  top: 16px;
  right: 28px;
  color: rgba(47, 107, 79, 0.12);
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(4rem, 9vw, 7rem);
  line-height: 1;
}

.closing-card span {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.closing-card p {
  margin: 0;
  max-width: 760px;
  color: #315f49;
  font-size: clamp(1rem, 1.2vw, 1.14rem);
  font-weight: 600;
  line-height: 1.78;
}

.root-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.shot {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  cursor: zoom-in;
  box-shadow: var(--shadow);
}

.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.shot span {
  display: block;
  padding: 14px 16px;
  text-align: left;
  font-weight: 800;
}

.tree-section {
  max-width: none;
  background: #fbf7ee;
}

.tree-section .section-title {
  max-width: 1112px;
  margin-left: auto;
  margin-right: auto;
}

.tree {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  overflow-x: auto;
  padding: 8px 4px 18px;
}

.generation {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  min-width: 780px;
}

.generation.generation-split {
  flex-wrap: wrap;
  max-width: 1180px;
  min-width: 0;
  row-gap: 16px;
}

.generation + .generation::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  width: 1px;
  height: 18px;
  background: var(--line);
}

.person {
  width: 160px;
  min-height: 94px;
  padding: 16px 13px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 8px;
  background: #fffdf8;
  text-align: center;
  box-shadow: 0 12px 24px rgba(37, 31, 22, 0.08);
}

.person.couple-node {
  width: 240px;
  min-height: 138px;
  text-align: left;
}

.person.female {
  border-top-color: #ca3c68;
}

.person.important {
  background: #fff8e8;
  border-color: rgba(201, 154, 74, 0.58);
}

.person.sibling {
  background: #f7f1e8;
  border-style: dashed;
}

.person.focus {
  background: #f7fff3;
  border-color: #6d9e26;
  border-width: 2px;
}

.person span {
  display: block;
  font-weight: 900;
  line-height: 1.22;
}

.person small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.person b {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(37, 31, 22, 0.12);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.25;
}

.person em {
  display: block;
  margin-top: 9px;
  color: var(--green);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.28;
}

.person.with-parents {
  min-height: 132px;
}

.site-footer {
  padding: 28px 24px;
  border-top: 1px solid var(--line);
  background: #efe7d9;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.research h3 {
  margin-bottom: 18px;
  font-size: 1.25rem;
}

.research a {
  display: block;
  margin: 0 0 12px;
  color: var(--green);
  font-weight: 800;
}

.research article span {
  display: block;
  margin-top: 10px;
}

.research ul {
  margin: 0;
  padding-left: 20px;
}

.research li + li {
  margin-top: 10px;
}

.heraldry-intro {
  background: #fffdf8;
}

.heraldry-old-photos {
  background: #f7f1e8;
}

.heraldry-catalog {
  background: #fffdf8;
}

.old-coats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.old-coats-grid figure {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 14px 34px rgba(38, 31, 21, 0.08);
}

.old-coats-grid img {
  display: block;
  width: 100%;
  height: clamp(260px, 32vw, 390px);
  border-radius: 8px;
  background: #fffdf8;
  object-fit: contain;
}

.old-coats-grid figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.coat-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.12fr);
  gap: clamp(24px, 4vw, 54px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.coat-card + .coat-card {
  margin-top: 28px;
}

.coat-media {
  display: grid;
  gap: 18px;
  align-self: start;
}

.coat-image {
  margin: 0;
}

.coat-image img {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: #fffdf8;
  object-fit: contain;
}

.coat-image figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.coat-content h3 {
  margin: 18px 0 12px;
  font-size: 1.55rem;
}

.coat-content p {
  color: var(--muted);
  line-height: 1.72;
}

.blazon {
  padding: 18px;
  border-left: 4px solid var(--gold);
  background: #fffdf8;
  color: var(--ink);
  font-weight: 600;
}

.coat-details {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.coat-details div {
  padding: 14px 16px;
  border: 1px solid rgba(32, 32, 29, 0.12);
  border-radius: 8px;
  background: #fffdf8;
}

.coat-details strong,
.coat-details span {
  display: block;
}

.coat-details strong {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.coat-details span {
  color: var(--muted);
  line-height: 1.45;
}

.branches-intro {
  background: #fffdf8;
}

.branches-list {
  display: grid;
  gap: 22px;
  background: #f7f1e8;
}

.branch-card {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.branch-card h2 {
  margin: 18px 0 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.branch-card p {
  color: var(--muted);
  line-height: 1.72;
}

.branch-card .button {
  margin-top: 16px;
}

.people-feature {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  background: #fffdf8;
}

.people-feature figure {
  margin: 0;
}

.people-feature img {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.people-lists {
  background: #fffdf8;
}

.people-lists.alternate,
.isabella-section {
  background: #f7f1e8;
}

.branches-context {
  background: #f7f1e8;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
  max-width: 1180px;
  margin: 22px auto 0;
}

.branch-mini {
  min-height: 230px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 12px 28px rgba(38, 31, 21, 0.06);
}

.branch-mini span {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.branch-mini h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  line-height: 1.18;
}

.branch-mini p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.story.compact {
  margin-top: 20px;
}

.personalities-visual {
  background: #fffdf8;
}

.personality-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.personality-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 16px 34px rgba(38, 31, 21, 0.08);
}

.personality-card figure {
  margin: 0;
  background: #fffdf8;
}

.personality-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.personality-card .portrait-contain img {
  padding: 18px;
  object-fit: contain;
}

.isabella-profile {
  display: grid;
  grid-template-columns: minmax(220px, 0.48fr) minmax(0, 1.52fr);
  gap: clamp(22px, 4vw, 42px);
  align-items: start;
}

.isabella-profile figure {
  margin: 0;
}

.isabella-profile img {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(38, 31, 21, 0.12);
}

.isabella-profile figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.personality-card.text-only {
  display: flex;
  min-height: 100%;
  border-top: 4px solid var(--gold);
}

.personality-card div {
  padding: 18px;
}

.personality-card span {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.personality-card h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  line-height: 1.18;
}

.personality-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.58;
}

.personality-card a {
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.company-feature,
.company-profile {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
}

.company-feature {
  background: #fffdf8;
}

.company-feature figure,
.company-logo-panel {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.company-feature img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.company-facts {
  background: #f7f1e8;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.fact-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 12px 28px rgba(38, 31, 21, 0.07);
}

.fact-grid span,
.timeline-list span {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fact-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: Cinzel, Georgia, serif;
  font-size: 1.32rem;
  line-height: 1.15;
}

.fact-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.company-profile {
  background: #fffdf8;
}

.rh-profile {
  background: #f7f1e8;
}

.digital-profile {
  background: #fffdf8;
}

.construction-profile {
  background: #f7f1e8;
}

.equipment-profile {
  background: #fffdf8;
}

.company-logo-panel {
  padding: clamp(26px, 5vw, 58px);
}

.rh-logo-panel {
  background: #fff;
}

.digital-logo-panel {
  padding: 0;
  background: #071a3b;
}

.digital-logo-panel img {
  aspect-ratio: 6 / 1;
  object-fit: cover;
}

.construction-logo-panel,
.equipment-logo-panel {
  background: #fff;
}

.construction-logo-panel img {
  object-fit: contain;
}

.equipment-logo-panel {
  background: #171717;
}

.equipment-logo-panel img {
  margin: 0 auto;
  max-width: 280px;
}

.company-logo-panel img {
  display: block;
  width: 100%;
}

.company-story h2 {
  margin-bottom: 24px;
  font-size: clamp(1.6rem, 3vw, 2.7rem);
  line-height: 1.1;
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-list article {
  padding: 18px 20px;
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  background: var(--cream);
  box-shadow: 0 10px 24px rgba(38, 31, 21, 0.06);
}

.timeline-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.company-story > .button {
  margin-top: 20px;
}

.company-directory {
  background: #f7f1e8;
}

.company-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.company-mini-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 14px 32px rgba(38, 31, 21, 0.08);
}

.company-mini-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  padding: 18px;
  background: #fff;
}

.company-mini-card.dark-card img {
  background: #111;
}

.company-mini-card.wine-card img {
  background: #4d102c;
}

.company-mini-card div {
  padding: 18px;
}

.company-mini-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.company-mini-card h3 {
  margin-bottom: 10px;
  font-size: 1.14rem;
  line-height: 1.2;
}

.company-mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.58;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.people-grid a {
  display: block;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(38, 31, 21, 0.08);
}

.people-grid a:hover {
  border-color: rgba(47, 107, 79, 0.44);
  transform: translateY(-1px);
}

.people-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
}

.lightbox {
  width: min(94vw, 1200px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #141414;
  box-shadow: var(--shadow);
}

.lightbox::backdrop {
  background: rgba(12, 12, 10, 0.72);
}

.lightbox img {
  display: block;
  width: 100%;
  height: auto;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #141414;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 860px) {
  .hero-grid,
  .section-title,
  .memory,
  .cards,
  .region-layout,
  .bio-layout,
  .roots-grid,
  .facts,
  .gallery-grid,
  .research-grid,
  .history-panel,
  .history-gallery,
  .old-coats-grid,
  .coat-card,
  .isabella-profile,
  .people-feature,
  .company-feature,
  .company-profile,
  .fact-grid,
  .company-card-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    margin-top: 12vh;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-list article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-head,
  .profile-grid,
  .mini-profiles,
  .mini-profile dl,
  .document-strip {
    grid-template-columns: 1fr;
  }

  .couple-title,
  .children-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-grid .wide,
  .mini-profile dl .wide {
    grid-column: auto;
  }

  .note-card {
    position: static;
  }

  .bio-card {
    position: static;
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: auto;
  }

  h1 {
    font-size: clamp(2.6rem, 16vw, 4.2rem);
  }

  .origin-panel {
    padding: 20px;
  }

  .section {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .person {
    width: 148px;
  }

  .generation {
    min-width: 680px;
  }
}
