:root {
  --bg: #f4eee6;
  --cream: #fbf6ee;
  --ink: #050505;
  --muted: #514b45;
  --line: #1b1714;
  --coffee: #9d715c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
body.locked > :not(.gate) { visibility: hidden; }
a { color: inherit; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.1rem, 3vh, 2rem);
  overflow: auto;
  padding: clamp(1rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.65), transparent 24rem),
    linear-gradient(180deg, #fbf3e6, #f5ead9);
  transition: opacity 520ms ease, visibility 520ms ease;
}
body.unlocked .gate { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-card {
  position: relative;
  z-index: 2;
  width: min(88vw, 25rem);
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  text-align: center;
  box-shadow: none;
}
.gate-kicker { margin: 0 0 0.55rem; color: var(--coffee); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.24em; text-transform: uppercase; }
.gate-card h1 { margin: 0; color: var(--ink); font-size: clamp(2rem, 5vw, 3.5rem); line-height: 0.96; font-weight: 650; }
.gate-card p { max-width: 20rem; margin: 0.8rem auto 0; color: var(--muted); }
.gate-card label { display: block; margin-top: 1.55rem; color: var(--muted); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.gate-card input {
  width: 100%; min-height: 3.1rem; margin-top: 0.55rem; border: 0; border-bottom: 1px solid rgba(27, 23, 20, 0.45); border-radius: 0;
  background: transparent; padding: 0.75rem 0.1rem; color: var(--ink); font: inherit; text-align: center;
}
.gate-card input:focus {
  outline: 0;
  border-bottom-color: var(--coffee);
}
.gate-card button {
  width: 100%; min-height: 3.1rem; margin-top: 1rem; border: 1px solid var(--line); border-radius: 999px;
  background: #050505; color: #fff; cursor: pointer; font-weight: 850;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.gate-card button:hover {
  border-color: #050505;
  background: var(--coffee);
  transform: translateY(-1px);
}
.gate-notice { min-height: 1.3rem; margin: 0.8rem 0 0; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.gate-crest {
  position: relative;
  z-index: 1;
  width: min(80vw, 34rem);
  aspect-ratio: 1;
  flex: 0 0 auto;
  pointer-events: none;
  filter: drop-shadow(0 24px 34px rgba(86, 60, 36, 0.24));
}
.crest-half {
  position: absolute; top: 0; width: 50%; height: 100%;
  background-image: url("zarfloridiaz-crest.png"); background-size: auto 100%;
  filter: none;
  transition: transform 1100ms cubic-bezier(0.77, 0, 0.18, 1), opacity 420ms ease 820ms;
}
.crest-half-left { left: 0; background-position: left center; transform: translate(0, 0); }
.crest-half-right { right: 0; background-position: right center; transform: translate(0, 0); }
body.opening .crest-half-left { transform: translate(calc(-50vw - 2rem), calc(-50vh - 2rem)) scale(0.58) rotate(-10deg); opacity: 0; }
body.opening .crest-half-right { transform: translate(calc(50vw + 2rem), calc(-50vh - 2rem)) scale(0.58) rotate(10deg); opacity: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 6.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.4rem clamp(1.2rem, 3vw, 3.5rem);
  border-bottom: 1px solid var(--line); background: rgba(251, 246, 238, 0.95); backdrop-filter: blur(14px);
}
.brand-mark { display: inline-flex; align-items: center; gap: 0.8rem; font-size: 1.02rem; font-weight: 800; text-decoration: none; }
.brand-mark img { width: 3.2rem; height: 3.2rem; border-radius: 50%; object-fit: cover; }
.menu-toggle { display: none; }
.family-nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.2rem; border-radius: 999px; background: #050505; padding: 0.25rem 0.75rem; }
.family-nav a { color: #fff; padding: 0.38rem 0.55rem; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; text-decoration: none; }
.family-nav a:hover, .family-nav a.active { color: #e7cdbd; }
.nav-language { min-height: 2.35rem; border: 1px solid #050505; border-radius: 999px; padding: 0.45rem 0.85rem; font-size: 0.82rem; font-weight: 800; text-transform: uppercase; text-decoration: none; }

.site-header {
  min-height: calc(100vh - 6.25rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 31rem); align-items: stretch;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: var(--cream);
  --hero-pan-x: 0px;
  --hero-pan-y: 0px;
}
.site-header::before {
  content: "";
  position: absolute;
  top: -4%;
  bottom: -4%;
  left: -4%;
  z-index: 0;
  right: min(31rem, 34vw);
  background: url("family-hero-20260614.jpeg") 55% 66% / cover no-repeat;
  transform: translate(var(--hero-pan-x), var(--hero-pan-y)) scale(1.05);
  transform-origin: 54% 68%;
  animation: heroPhotoDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}
.site-header::after {
  content: "";
  position: absolute;
  inset: 0 min(31rem, 34vw) 0 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.site-header > * {
  position: relative;
  z-index: 2;
}
.hero-copy {
  grid-column: 2; align-self: stretch; justify-self: stretch; width: 100%; background: var(--cream);
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0;
  overflow: hidden;
  padding: clamp(1.4rem, 4vw, 3.2rem); box-shadow: -18px 0 50px rgba(32, 24, 18, 0.08);
}
.eyebrow, .section-eyebrow { margin: 0 0 0.4rem; font-size: 0.82rem; font-weight: 850; }
h1 { margin: 0; max-width: 100%; font-size: clamp(2.45rem, 4.35vw, 4.6rem); line-height: 0.92; letter-spacing: 0; overflow-wrap: normal; }
.hero-copy h1 { font-size: clamp(2.45rem, 4.2vw, 3.6rem); overflow-wrap: break-word; }
h2 { margin: 0; font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: 0.96; }
.intro { max-width: 44rem; margin: 1rem 0 0; color: #16120f; font-size: clamp(1rem, 1.5vw, 1.22rem); }
.hero-actions { display: grid; grid-template-columns: 1fr; align-items: center; gap: 0.7rem; margin-top: 1.35rem; padding-top: 1.35rem; border-top: 1px solid var(--line); }
.hero-link { display: inline-flex; justify-content: center; align-items: center; min-height: 3rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.75rem 1rem; font-weight: 850; text-decoration: none; }
.hero-link.primary { border-color: var(--coffee); background: var(--coffee); color: #fff; }

.home-main, .page-main { padding: clamp(2.5rem, 5vw, 5.5rem) clamp(1.4rem, 5vw, 5rem); }
.home-intro, .page-hero, .page-content { border-top: 1px solid var(--line); padding-top: clamp(1.6rem, 3vw, 2.4rem); }
.home-grid, .content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.home-card, .content-card { border: 1px solid var(--line); background: var(--cream); padding: 1.1rem; min-height: 11rem; text-decoration: none; box-shadow: 0 16px 36px rgba(40, 30, 22, 0.08); }
.home-card strong, .content-card strong { display: block; margin-bottom: 0.5rem; color: var(--coffee); font-size: 0.76rem; font-weight: 900; text-transform: uppercase; }
.home-card span, .content-card p { margin: 0; color: var(--muted); }
.home-card:hover { transform: translateY(-2px); }
.page-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 28rem); align-items: end; gap: clamp(1.5rem, 4vw, 4rem); }
.page-photo { margin: 0; border: 1px solid var(--line); background: var(--cream); }
.page-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 62% 82%; }
.page-content { margin-top: clamp(2rem, 5vw, 4rem); }
.person-card span { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; margin-bottom: 0.8rem; border-radius: 999px; background: #050505; color: #fff; font-weight: 900; }
.content-card h2 { font-size: clamp(1.35rem, 2vw, 2rem); line-height: 1.05; margin-bottom: 0.55rem; }
footer { border-top: 1px solid var(--line); padding: 1.4rem clamp(1.4rem, 5vw, 5rem) 2rem; color: var(--muted); background: var(--bg); font-size: 0.92rem; }

@media (max-width: 860px) {
  .gate { justify-content: start; padding-top: clamp(1rem, 5vh, 2rem); }
  .gate-crest { width: min(92vw, 26rem); }
  .gate-card h1 { font-size: clamp(2.15rem, 12vw, 3.8rem); }
  .topbar { position: static; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.7rem; padding: 1rem; }
  .brand-mark { min-width: 0; }
  .brand-mark img { width: 2.85rem; height: 2.85rem; }
  .brand-mark span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.45rem;
    border: 1px solid #050505;
    border-radius: 999px;
    background: #050505;
    color: #fff;
    padding: 0.48rem 0.9rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 850;
    text-transform: uppercase;
  }
  .nav-language { min-height: 2.45rem; padding: 0.48rem 0.85rem; }
  .family-nav {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    gap: 0;
    border-radius: 1rem;
    background: #050505;
    padding: 0.35rem;
  }
  .topbar.menu-open .family-nav { display: grid; }
  .family-nav a {
    display: block;
    border-radius: 0.75rem;
    padding: 0.78rem 0.9rem;
  }
  .family-nav a + a { border-top: 1px solid rgba(255, 255, 255, 0.14); }
  .site-header { min-height: calc(100vh - 5rem); display: grid; grid-template-rows: minmax(52vh, 1fr) auto; grid-template-columns: 1fr; padding: 0; }
  .site-header::before { inset: -4% -4% auto -4%; right: auto; height: 58vh; background-position: 53% 67%; background-size: cover; }
  .site-header::after { inset: 0 0 auto 0; height: 58vh; }
  .hero-copy { grid-column: 1; grid-row: 2; width: 100%; margin: 0; box-shadow: 0 -18px 40px rgba(32, 24, 18, 0.08); }
  .hero-actions { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.35rem, 12vw, 4.2rem); }
  .page-hero { grid-template-columns: 1fr; }
  .page-photo { order: -1; }
}

@keyframes heroPhotoDrift {
  0% {
    transform: translate(calc(var(--hero-pan-x) - 10px), calc(var(--hero-pan-y) - 6px)) scale(1.05);
  }
  100% {
    transform: translate(calc(var(--hero-pan-x) + 12px), calc(var(--hero-pan-y) + 8px)) scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header::before {
    animation: none;
    transform: translate(var(--hero-pan-x), var(--hero-pan-y)) scale(1.06);
  }
}
