:root {
  --background: #f5f1e8;
  --foreground: #142235;
  --card: rgba(255, 253, 248, 0.9);
  --card-strong: #fcfaf5;
  --muted-surface: #ede7db;
  --primary: #142235;
  --primary-strong: #0d1724;
  --secondary-text: #586474;
  --border: rgba(20, 34, 53, 0.12);
  --border-strong: rgba(20, 34, 53, 0.2);
  --accent: #b4904f;
  --accent-soft: rgba(180, 144, 79, 0.14);
  --shadow: 0 22px 60px rgba(16, 30, 46, 0.08);
  --shadow-soft: 0 12px 32px rgba(16, 30, 46, 0.06);
  --radius: 22px;
  --radius-sm: 16px;
  --header-height: 88px;
  --container: min(1180px, calc(100vw - 48px));
  --container-narrow: min(980px, calc(100vw - 48px));
  --container-wide: min(1240px, calc(100vw - 48px));
  --font-display: "Cormorant Garamond", serif;
  --font-body: "Alegreya Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(180, 144, 79, 0.07), transparent 26%),
    radial-gradient(circle at 85% 15%, rgba(20, 34, 53, 0.06), transparent 24%),
    var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image: radial-gradient(rgba(20, 34, 53, 0.055) 0.65px, transparent 0.65px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 90%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

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

p,
ul,
blockquote,
h1,
h2,
h3 {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.container.narrow,
.narrow {
  width: var(--container-narrow);
}

.container.wide,
.wide {
  width: var(--container-wide);
}

.site-shell {
  position: relative;
  overflow: clip;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(245, 241, 232, 0.8);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.tree-branding {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-title,
.footer-brand {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.brand-subtitle,
.footer-subtitle {
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.36em;
  font-size: 0.68rem;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px 24px;
}

.site-nav a,
.footer-nav a,
.back-link,
.tree-footer-bottom a {
  font-family: var(--font-body);
  color: var(--secondary-text);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.015em;
  transition: color 180ms ease, transform 180ms ease;
}

.site-nav a:hover,
.footer-nav a:hover,
.back-link:hover,
.tree-footer-bottom a:hover,
.text-link:hover {
  color: var(--foreground);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}

.menu-toggle span:not(.sr-only) {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: var(--foreground);
  transition: transform 220ms ease, opacity 220ms ease, top 220ms ease;
}

.menu-toggle span:nth-child(1) {
  top: 16px;
}

.menu-toggle span:nth-child(2) {
  top: 23px;
}

.menu-toggle span:nth-child(3) {
  top: 30px;
}

.menu-toggle.is-open span:nth-child(1) {
  top: 23px;
  transform: rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  top: 23px;
  transform: rotate(-45deg);
}

.section {
  padding: 112px 0;
  position: relative;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-height) + 56px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 14% 18%, rgba(180, 144, 79, 0.15), transparent 24%),
    radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.05), transparent 22%),
    linear-gradient(180deg, var(--primary), var(--primary-strong));
  color: #f5f1e8;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.38;
  filter: saturate(0.82) brightness(0.46) contrast(1.04);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(180, 144, 79, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(13, 23, 36, 0.14), rgba(13, 23, 36, 0.32));
}

.hero-panel {
  text-align: center;
  max-width: 900px;
  position: relative;
  z-index: 2;
}

.hero-line {
  display: block;
}

.hero-line:last-child {
  white-space: nowrap;
}

.eyebrow {
  margin-bottom: 20px;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.78rem;
}

.hero .eyebrow,
.hero .hero-copy,
.hero .hero-era {
  color: rgba(245, 241, 232, 0.78);
}

.hero h1,
.tree-title-block h1,
.section-heading h2,
.history-quote p,
.quote-block p,
.tree-quote blockquote {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.75rem, 5.4vw, 5rem);
  line-height: 0.98;
  max-width: 12ch;
  margin: 0 auto 30px;
  text-wrap: balance;
  color: #f5f1e8;
}

.hero-copy,
.section-heading p,
.history-copy p,
.tree-title-block p {
  color: var(--secondary-text);
  font-size: 1.08rem;
}

.hero-copy {
  max-width: 730px;
  margin: 0 auto 42px;
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.34rem);
}

.hero-era {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--secondary-text);
  text-transform: uppercase;
  font-size: 0.83rem;
}

.hero-era-line,
.tree-title-divider {
  width: 76px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0.35);
  opacity: 0;
  transform-origin: center;
}

.hero-era-value {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.hero-era-group {
  display: inline-flex;
  gap: 0.16em;
}

.hero-era-glyph,
.hero-era-separator {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.92rem + 0.55vw, 1.55rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--foreground);
}

.hero .hero-era-glyph,
.hero .hero-era-separator {
  color: #f5f1e8;
}

.hero-era-glyph {
  --hero-era-step: 1.02em;
  --hero-era-end: calc(var(--hero-era-step) * -4);
  position: relative;
  width: 0.84em;
  height: calc(var(--hero-era-step) + 0.06em);
  overflow: hidden;
  vertical-align: top;
  opacity: 0;
  background: transparent;
  mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
}

.hero-era-reel {
  display: grid;
  grid-auto-rows: var(--hero-era-step);
  transform: translateY(0);
  will-change: transform;
}

.hero-era-reel span {
  display: grid;
  place-items: center;
  height: var(--hero-era-step);
  line-height: 1;
  text-shadow: 0 0 0 rgba(180, 144, 79, 0);
}

.hero-era-separator {
  color: var(--accent);
  opacity: 0;
  transform: scaleY(0.2);
  transform-origin: center;
}

.hero.is-visible .hero-era-line {
  animation: heroEraLineBloom 1.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero.is-visible .hero-era-value {
  animation: heroEraHalo 1.1s ease-out both;
}

.hero.is-visible .hero-era-glyph {
  animation: heroEraGlyphFade 140ms linear forwards;
  animation-delay: calc(120ms + var(--glyph-index, 0) * 92ms);
}

.hero.is-visible .hero-era-reel {
  animation: heroEraSlot 1.38s cubic-bezier(0.18, 0.96, 0.24, 1) forwards;
  animation-delay: calc(120ms + var(--glyph-index, 0) * 92ms);
}

.hero.is-visible .hero-era-separator {
  animation: heroEraSeparator 780ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 760ms;
}

.hero.is-visible .hero-era-reel span:last-child {
  color: #f5f1e8;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.12),
    0 0 12px rgba(180, 144, 79, 0.14);
}

@keyframes heroEraGlyphFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes heroEraSlot {
  0% {
    transform: translateY(0);
    filter: blur(8px);
  }
  14% {
    filter: blur(3px);
  }
  58% {
    transform: translateY(calc(var(--hero-era-end) + 0.34em));
    filter: blur(0);
  }
  76% {
    transform: translateY(calc(var(--hero-era-end) - 0.15em));
    filter: blur(0);
  }
  100% {
    filter: blur(0);
    transform: translateY(var(--hero-era-end));
  }
}

@keyframes heroEraSeparator {
  from {
    opacity: 0;
    transform: scaleY(0.2);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes heroEraLineBloom {
  from {
    opacity: 0;
    transform: scaleX(0.35);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes heroEraHalo {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tree-title-divider.short {
  width: 48px;
}

.section-muted {
  background: linear-gradient(180deg, rgba(237, 231, 219, 0.55), rgba(237, 231, 219, 0.18));
}

.section-primary {
  background:
    radial-gradient(circle at 15% 15%, rgba(180, 144, 79, 0.12), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05), transparent 22%),
    linear-gradient(180deg, var(--primary), var(--primary-strong));
  color: #f5f1e8;
}

.history-section {
  overflow: hidden;
  isolation: isolate;
  background: var(--background);
  color: var(--foreground);
}

.history-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("multimedia/storia.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.24;
  filter: saturate(0.72) sepia(0.08) brightness(1.04) contrast(0.9);
  transform: scale(1.02);
}

.history-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 15% 15%, rgba(180, 144, 79, 0.08), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(245, 241, 232, 0.74), rgba(245, 241, 232, 0.9));
}

.section-heading {
  max-width: 760px;
  margin-bottom: 58px;
}

.section-heading-center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.compact-heading {
  margin-bottom: 0;
}

.section-heading h2,
.tree-title-block h1 {
  font-size: clamp(2.45rem, 4vw, 4rem);
  margin-bottom: 22px;
  line-height: 0.98;
}

.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

.section-note {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  max-width: 720px;
  color: var(--secondary-text);
  font-size: 0.97rem;
  font-style: italic;
}

[data-typing-note] {
  position: relative;
  max-width: 72ch;
}

[data-typing-note].is-typing,
[data-typing-note].is-typed {
  color: var(--foreground);
}

[data-typing-note].is-typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1.05em;
  margin-left: 0.18em;
  vertical-align: -0.12em;
  background: linear-gradient(180deg, rgba(180, 144, 79, 0.2), var(--accent), rgba(20, 34, 53, 0.24));
  box-shadow: 0 0 10px rgba(180, 144, 79, 0.16);
  animation: typingCaretBlink 0.9s steps(1, end) infinite;
}

@keyframes typingCaretBlink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0;
  }
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-spacious {
  gap: 26px;
}

.card,
.stat-card,
.manifesto-item,
.family-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card::before,
.stat-card::before,
.family-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 44%);
}

.feature-card,
.asset-card {
  padding: 32px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feature-card,
.manifesto-item {
  background: var(--background);
}

.feature-card::before {
  content: none;
}

.manifesto-item {
  box-shadow: none;
}

.feature-card h3,
.asset-card h3,
.fintech-card h3,
.manifesto-item h3,
.family-card h2 {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.08;
}

.feature-card h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  width: 100%;
  margin-inline: auto;
}

.feature-card h3::before,
.feature-card h3::after {
  content: "";
  flex: 0 0 26px;
  width: 26px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.95;
  box-shadow: none;
}

.feature-card p,
.asset-card p,
.fintech-card p,
.fintech-features span,
.manifesto-item p,
.footer-copy,
.family-card p {
  color: var(--secondary-text);
  font-size: 0.97rem;
}

.icon-box,
.fintech-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(20, 34, 53, 0.96), rgba(20, 34, 53, 0.88));
  color: #f8f3e8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 1.35rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--foreground);
  font-weight: 700;
  transition: color 180ms ease, transform 180ms ease;
}

.fintech-card {
  padding: 38px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
}

.fintech-mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 1.8rem;
}

.fintech-headline,
.asset-head,
.section-head-split,
.footer-top,
.footer-bottom,
.tree-footer-bottom,
.family-row {
  display: flex;
}

.fintech-headline,
.section-head-split,
.footer-bottom,
.tree-footer-bottom {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.fintech-link {
  align-self: flex-start;
  margin-top: 4px;
}

.fintech-body p {
  margin-bottom: 28px;
}

.fintech-features {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.fintech-features strong {
  display: block;
  margin-bottom: 6px;
  color: var(--foreground);
  font-size: 0.95rem;
}

.stat-card {
  padding: 26px 28px;
  min-width: 250px;
  text-align: right;
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
}

.stat-card strong {
  font-family: var(--font-display);
  font-size: clamp(2rem, 2vw + 1rem, 2.7rem);
  line-height: 1;
}

.stat-card em {
  font-style: normal;
  font-size: 0.58em;
}

.asset-head {
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.asset-card ul {
  list-style: none;
  padding: 18px 0 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.asset-card li {
  position: relative;
  padding-left: 18px;
  color: var(--secondary-text);
  font-size: 0.95rem;
}

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

.asset-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.manifesto-grid {
  gap: 30px 34px;
}

.feature-reveal-grid[data-feature-reveal-grid] {
  perspective: 1200px;
}

.feature-reveal-grid[data-feature-reveal-grid] .feature-reveal-item {
  opacity: 1;
  transform: translateY(0) scale(1) rotateX(0deg);
  filter: blur(0);
  box-shadow: 0 18px 46px rgba(20, 34, 53, 0.08);
  transition:
    box-shadow 760ms ease,
    border-color 320ms ease,
    transform 320ms ease;
}

.feature-reveal-grid[data-feature-reveal-grid] .feature-reveal-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 18%, rgba(255, 255, 255, 0.56) 48%, transparent 74%);
  transform: translateX(-135%);
  opacity: 0;
}

.feature-reveal-grid[data-feature-reveal-grid] .feature-reveal-item:hover,
.feature-reveal-grid[data-feature-reveal-grid] .feature-reveal-item:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(20, 34, 53, 0.1);
}

.feature-reveal-grid[data-feature-reveal-grid] .feature-reveal-item:hover::after,
.feature-reveal-grid[data-feature-reveal-grid] .feature-reveal-item:focus-within::after {
  animation: manifestoSheen 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.manifesto-grid[data-manifesto-grid] {
  perspective: 1200px;
}

.manifesto-grid[data-manifesto-grid] .manifesto-item {
  opacity: 1;
  transform: translateY(0) scale(1) rotateX(0deg);
  filter: blur(0);
  box-shadow: 0 18px 46px rgba(20, 34, 53, 0.08);
  transition:
    box-shadow 760ms ease,
    border-color 320ms ease,
    transform 320ms ease;
}

.manifesto-grid[data-manifesto-grid] .manifesto-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 18%, rgba(255, 255, 255, 0.56) 48%, transparent 74%);
  transform: translateX(-135%);
  opacity: 0;
}

.manifesto-grid[data-manifesto-grid] .manifesto-item:hover,
.manifesto-grid[data-manifesto-grid] .manifesto-item:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(20, 34, 53, 0.1);
}

.manifesto-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px 16px;
  padding: 32px;
  border-left: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.manifesto-grid[data-manifesto-grid] .manifesto-item:hover::after,
.manifesto-grid[data-manifesto-grid] .manifesto-item:focus-within::after {
  animation: manifestoSheen 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.manifesto-grid[data-manifesto-grid] .manifesto-index,
.manifesto-grid[data-manifesto-grid] .manifesto-item h3,
.manifesto-grid[data-manifesto-grid] .manifesto-item p {
  opacity: 1;
  transform: translateY(0);
}

.manifesto-index {
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  padding-top: 0;
  letter-spacing: 0.28em;
}

.manifesto-grid[data-manifesto-grid] .manifesto-item:hover .manifesto-index,
.manifesto-grid[data-manifesto-grid] .manifesto-item:focus-within .manifesto-index {
  text-shadow: 0 0 18px rgba(180, 144, 79, 0.12);
}

@keyframes manifestoSheen {
  0% {
    opacity: 0;
    transform: translateX(-135%);
  }
  20% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
    transform: translateX(145%);
  }
}

.quote-block,
.history-quote,
.tree-quote {
  text-align: center;
}

.quote-block {
  margin-top: 70px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}

.quote-block p,
.tree-quote blockquote {
  font-size: clamp(1.35rem, 2vw, 1.95rem);
  font-style: italic;
  margin-bottom: 0;
}

.history-shell {
  position: relative;
  z-index: 2;
  width: min(900px, calc(100vw - 48px));
}

.history-section .section-heading.on-dark .eyebrow,
.history-section .section-heading.on-dark p,
.history-copy p,
.history-quote span {
  color: var(--secondary-text);
}

.history-section .section-heading.on-dark h2,
.history-section .history-quote p {
  color: var(--foreground);
}

.history-copy {
  display: grid;
  gap: 28px;
}

.history-copy p {
  font-size: 1.05rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.history-quote {
  margin-top: 48px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}

.history-quote p {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  margin-bottom: 10px;
}

.site-footer {
  background: rgba(255, 253, 248, 0.8);
  border-top: 1px solid var(--border);
}

.footer-top {
  padding: 72px 0 48px;
  gap: 64px;
  justify-content: space-between;
}

.footer-copy {
  max-width: 360px;
  margin-top: 18px;
}

.footer-label {
  margin: 0 0 18px;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px 30px;
}

.footer-bottom,
.tree-footer-bottom {
  padding: 24px 0 36px;
  border-top: 1px solid var(--border);
  color: var(--secondary-text);
  font-size: 0.8rem;
}

.footer-legal {
  display: grid;
  gap: 6px;
}

.footer-legal p,
.footer-bottom > p,
.tree-footer-bottom > a {
  margin: 0;
}

.tree-page .site-header {
  background: rgba(245, 241, 232, 0.86);
}

.tree-header-inner {
  min-height: 84px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tree-main {
  position: relative;
  padding-top: calc(var(--header-height) + 24px);
  isolation: isolate;
}

.tree-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
  background:
    radial-gradient(circle at 18% 24%, rgba(180, 144, 79, 0.08), transparent 0 18%),
    radial-gradient(circle at 82% 20%, rgba(20, 34, 53, 0.08), transparent 0 16%),
    radial-gradient(circle at 1px 1px, rgba(20, 34, 53, 0.16) 1px, transparent 0);
  background-size: auto, auto, 40px 40px;
}

.tree-background::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(245, 241, 232, 0.34), rgba(245, 241, 232, 0.12) 24%, rgba(245, 241, 232, 0.2) 100%),
    radial-gradient(circle at center, transparent 0 38%, rgba(245, 241, 232, 0.26) 82%, rgba(245, 241, 232, 0.46) 100%);
}

.tree-background-glow,
.tree-branch-mist {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
}

.tree-background-glow {
  width: min(34vw, 420px);
  height: min(52vw, 680px);
  top: 6%;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(180, 144, 79, 0.2), rgba(180, 144, 79, 0.06) 46%, transparent 74%);
  animation: branchAuraReveal 2.8s ease-out forwards;
}

.tree-background-glow-left {
  left: -8%;
}

.tree-background-glow-right {
  right: -10%;
  animation-delay: 0.35s;
}

.tree-branches {
  position: absolute;
  top: -2%;
  width: min(42vw, 540px);
  height: 112%;
  opacity: 0.84;
  filter: drop-shadow(0 0 18px rgba(180, 144, 79, 0.06));
}

.tree-branches-left {
  left: -3%;
}

.tree-branches-right {
  right: -3%;
}

.tree-branches path {
  fill: none;
  stroke: rgba(20, 34, 53, 0.22);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  opacity: 0;
  animation:
    branchGrow 2.8s cubic-bezier(0.2, 0.82, 0.18, 1) forwards var(--branch-delay),
    branchFloat 16s ease-in-out infinite calc(var(--branch-delay) + 2.6s);
}

.tree-branches path:nth-child(odd) {
  stroke: rgba(20, 34, 53, 0.28);
}

.tree-branches path:nth-child(3n) {
  stroke: rgba(180, 144, 79, 0.24);
}

.tree-branch-mist {
  width: 34vw;
  max-width: 440px;
  height: 54vh;
  max-height: 560px;
  bottom: 8%;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(20, 34, 53, 0.1), transparent 72%);
  animation: branchMistDrift 10s ease-in-out infinite alternate, branchAuraReveal 2.4s ease-out forwards;
}

.tree-branch-mist-left {
  left: -8%;
}

.tree-branch-mist-right {
  right: -8%;
  animation-delay: 0.4s;
}

.tree-hero,
.tree-footer {
  position: relative;
  z-index: 1;
}

.tree-hero {
  min-height: calc(100vh - 84px);
}

.tree-title-block {
  max-width: 760px;
  margin-bottom: 92px;
}

.tree-title-divider {
  margin: 0 auto 24px;
}

.family-tree {
  position: relative;
  display: grid;
  gap: 144px;
  justify-items: center;
  isolation: isolate;
  padding: 12px 0 8px;
}

.tree-connector-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.tree-connector {
  fill: none;
  stroke: rgba(180, 144, 79, 0.92);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(180, 144, 79, 0.14));
  opacity: 0.98;
}

.tree-connector-glow {
  stroke: rgba(180, 144, 79, 0.24);
  stroke-width: 10;
  filter: blur(8px);
  opacity: 0.85;
}

.tree-generation {
  width: 100%;
  display: grid;
  justify-items: center;
  position: relative;
  z-index: 1;
}

.generation-label {
  margin-bottom: 24px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.76rem;
}

.family-row {
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 100%;
}

.family-row.dual {
  flex-wrap: nowrap;
}

.family-row.single {
  justify-content: center;
}

.family-tree[data-heir-reveal-tree] {
  perspective: 1200px;
}

.family-card {
  width: min(100%, 310px);
  min-height: 248px;
  overflow: visible;
  padding: 42px 28px 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.family-card p {
  margin-bottom: 0;
}

.family-card:hover,
.heir-card:hover {
  transform: translateY(-3px);
  border-color: rgba(180, 144, 79, 0.44);
  box-shadow: var(--shadow);
}

.family-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 8px);
  transition: border-color 220ms ease;
}

.family-card:hover::after,
.heir-card:hover::after {
  border-color: rgba(180, 144, 79, 0.4);
}

.heir-card {
  border-color: rgba(180, 144, 79, 0.28);
  box-shadow: var(--shadow-soft);
}

.heir-badge {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.monogram {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  border-radius: 999px;
  border: 2px solid rgba(180, 144, 79, 0.55);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.55rem;
  background: linear-gradient(180deg, rgba(180, 144, 79, 0.08), rgba(180, 144, 79, 0.02));
}

.marriage-node {
  position: relative;
  width: 56px;
  height: 24px;
  overflow: visible;
  border-radius: 999px;
  border: 1px solid rgba(180, 144, 79, 0.26);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.78), rgba(255, 253, 248, 0.36));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 8px 18px rgba(20, 34, 53, 0.06);
  backdrop-filter: blur(10px);
}

.marriage-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -28px;
  right: -28px;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(180, 144, 79, 0.08), rgba(180, 144, 79, 0.72), rgba(180, 144, 79, 0.08));
  box-shadow: 0 0 10px rgba(180, 144, 79, 0.08);
}

.marriage-node::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(180, 144, 79, 0.62);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(180, 144, 79, 0.9), rgba(180, 144, 79, 0.52));
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 14px rgba(180, 144, 79, 0.16);
}

.tree-quote {
  max-width: 720px;
  margin: 92px auto 0;
}

.tree-quote p {
  margin-top: 14px;
  color: var(--secondary-text);
}

.tree-footer {
  background: transparent;
}

@keyframes branchGrow {
  0% {
    opacity: 0;
    stroke-dashoffset: 1600;
  }
  18% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

@keyframes branchFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -10px, 0) scale(1.01);
  }
}

@keyframes branchAuraReveal {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes branchMistDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(0, -22px, 0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .site-nav {
    position: absolute;
    top: calc(100% + 14px);
    left: 24px;
    right: 24px;
    padding: 18px;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    background: rgba(252, 250, 245, 0.96);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 900px) {
  .section {
    padding: 92px 0;
  }

  .grid-2,
  .grid-3,
  .fintech-card,
  .footer-top,
  .section-head-split,
  .footer-bottom,
  .tree-footer-bottom {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .fintech-card {
    gap: 22px;
  }

  .stat-card {
    text-align: left;
    min-width: 0;
  }

  .footer-nav {
    grid-template-columns: 1fr;
  }

  .history-shell,
  .container,
  .container.narrow,
  .container.wide,
  .narrow,
  .wide {
    width: min(100vw - 32px, 100%);
  }

  .family-row.dual {
    flex-direction: column;
  }

  .marriage-node {
    width: 38px;
    height: 38px;
  }

  .tree-connector {
    stroke-width: 2;
  }

  .tree-connector-glow {
    stroke-width: 8;
  }

  .tree-background-glow {
    width: min(46vw, 320px);
  }

  .text-link-end-mobile {
    align-self: flex-end;
  }

  .tree-branches {
    width: min(58vw, 420px);
    opacity: 0.62;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 80px;
  }

  .header-inner,
  .tree-header-inner {
    min-height: var(--header-height);
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + 64px);
    padding-bottom: 88px;
  }

  .hero h1 {
    max-width: 15ch;
    font-size: clamp(2.2rem, 11vw, 3.15rem);
  }

  .hero-line {
    white-space: nowrap;
  }

  .hero-era {
    gap: 10px;
  }

  .hero-era-line {
    width: 36px;
  }

  .hero-era-value {
    gap: 0.6rem;
    padding: 0;
  }

  .hero-era-glyph,
  .hero-era-separator {
    font-size: 0.98rem;
  }

  .history-section::after {
    background-image: url("multimedia/storia_mobile.jpg");
    background-position: right center;
  }

  .feature-card,
  .asset-card,
  .fintech-card,
  .manifesto-item,
  .family-card {
    padding: 36px 22px 26px;
  }

  .quote-block,
  .history-quote,
  .tree-quote {
    margin-top: 58px;
  }

  .footer-top {
    padding-top: 58px;
  }

  .tree-background {
    background-size: auto, auto, 28px 28px;
  }

  .tree-branches {
    width: 62vw;
    height: 108%;
    opacity: 0.42;
  }

  .tree-background-glow,
  .tree-branch-mist {
    filter: blur(24px);
    opacity: 0.52;
  }

  .family-row.dual {
    gap: 16px;
    flex-direction: column;
  }

  .family-tree {
    gap: 88px;
  }

  .tree-connector {
    stroke-width: 1.8;
  }

  .tree-connector-glow {
    stroke-width: 6;
  }

  .text-link-end-mobile {
    align-self: flex-end;
  }

  .marriage-node::before {
    left: -16px;
    right: -16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-era-line,
  .hero-era-glyph,
  [data-typing-note].is-typing::after,
  .hero-era-reel,
  .hero-era-separator,
  .hero-era-value {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    text-shadow: none !important;
  }

  .hero-era-reel {
    transform: translateY(var(--hero-era-end)) !important;
  }

  .manifesto-grid[data-manifesto-grid] .manifesto-item,
  .manifesto-grid[data-manifesto-grid] .manifesto-index,
  .manifesto-grid[data-manifesto-grid] .manifesto-item h3,
  .feature-reveal-grid[data-feature-reveal-grid] .feature-reveal-item,
  .manifesto-grid[data-manifesto-grid] .manifesto-item p {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .family-tree[data-heir-reveal-tree] .heir-card[data-heir-reveal-item],
  .family-tree[data-heir-reveal-tree] .heir-card[data-heir-reveal-item]::before,
  .family-tree[data-heir-reveal-tree] .heir-card[data-heir-reveal-item]::after {
    transition: none !important;
  }

  .family-tree[data-heir-reveal-tree] .heir-card[data-heir-reveal-item].is-visible::after {
    animation: none !important;
    opacity: 0.38 !important;
    transform: rotate(10deg) scale(1) !important;
  }

  .feature-reveal-grid[data-feature-reveal-grid] .feature-reveal-item::after {
    animation: none !important;
    opacity: 0 !important;
  }

  .tree-branches path,
  .tree-background-glow,
  .tree-branch-mist {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .tree-branches path {
    stroke-dashoffset: 0 !important;
  }
}
