:root {
  --night: #130b08;
  --espresso: #24150f;
  --bronze: #8f6946;
  --champagne: #dcc29a;
  --ivory: #f7ecdd;
  --line: rgba(255, 240, 214, 0.12);
}

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

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Bodoni Moda", serif;
  color: var(--ivory);
  background:
    radial-gradient(circle at 50% 14%, rgba(185, 136, 88, 0.14), transparent 24%),
    linear-gradient(180deg, #130b08 0%, #281811 48%, #140c09 100%);
}

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

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.page-shell__backdrop {
  position: absolute;
  inset: -8%;
  z-index: 0;
}

.page-shell__backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(12, 7, 5, 0.6), rgba(12, 7, 5, 0.34) 36%, rgba(12, 7, 5, 0.76) 100%);
}

.page-shell__backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at center, transparent 30%, rgba(12, 7, 5, 0.54) 100%);
}

.page-shell__backdrop picture,
.page-shell__backdrop img {
  width: 100%;
  height: 100%;
}

.page-shell__backdrop img {
  object-fit: cover;
  filter: blur(28px) saturate(0.78) brightness(0.58);
  transform: scale(1.12);
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12, 7, 5, 0.28), transparent 18%, transparent 82%, rgba(12, 7, 5, 0.28));
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: soft-light;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23noise)' opacity='0.2'/%3E%3C/svg%3E");
}

.residence {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(1rem, 2.4vw, 2.6rem);
}

.tableau {
  position: relative;
  width: min(100%, 88rem);
  min-height: min(88vh, 54rem);
}

.tableau::before {
  content: "";
  position: absolute;
  inset: auto 14% 4%;
  height: 14%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(8, 4, 3, 0.6), transparent 74%);
  filter: blur(14px);
  pointer-events: none;
}

.tableau::after {
  content: "";
  position: absolute;
  inset: 4% 6%;
  border: 1px solid rgba(255, 240, 214, 0.06);
  border-radius: 2.75rem;
  pointer-events: none;
}

.tableau__panel {
  position: absolute;
  overflow: hidden;
  background: rgba(255, 250, 242, 0.04);
  border: 1px solid rgba(255, 239, 214, 0.18);
  box-shadow:
    0 32px 72px rgba(7, 4, 3, 0.32),
    inset 0 1px 0 rgba(255, 247, 233, 0.14);
}

.tableau__panel::before {
  content: "";
  position: absolute;
  inset: 0.7rem;
  z-index: 1;
  border: 1px solid rgba(255, 243, 221, 0.14);
  border-radius: inherit;
  pointer-events: none;
}

.tableau__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%, rgba(10, 6, 4, 0.12) 100%);
  pointer-events: none;
}

.tableau__panel picture,
.tableau__panel img {
  width: 100%;
  height: 100%;
}

.tableau__panel img {
  object-fit: cover;
}

.tableau__panel--hero {
  inset: 7% 24% 18% 6%;
  border-radius: 8.5rem 8.5rem 2rem 2rem;
}

.tableau__panel--hero img {
  object-position: center center;
  filter: saturate(0.94) contrast(1.03) brightness(0.97);
}

.tableau__panel--portrait {
  top: 13%;
  right: 11%;
  width: min(23%, 19rem);
  height: 52%;
  border-radius: 999px 999px 1.7rem 1.7rem;
}

.tableau__panel--portrait img {
  object-position: center top;
  filter: saturate(0.88) contrast(1.04) brightness(0.94);
}

.seal {
  position: absolute;
  left: 58%;
  bottom: 16%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(5.6rem, 7vw, 6.6rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 249, 239, 0.96), rgba(224, 197, 154, 0.82) 44%, rgba(105, 67, 44, 0.9) 100%);
  box-shadow:
    0 22px 34px rgba(6, 4, 3, 0.3),
    0 0 0 1px rgba(255, 232, 196, 0.18),
    inset 0 1px 0 rgba(255, 252, 243, 0.44);
}

.seal::before {
  content: "";
  position: absolute;
  inset: -0.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 235, 204, 0.12);
  pointer-events: none;
}

.seal__face {
  position: relative;
  display: grid;
  place-items: center;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 253, 248, 1), rgba(245, 231, 209, 0.92) 62%, rgba(196, 156, 112, 0.44) 100%);
}

.seal__logo {
  width: 58%;
  height: auto;
  filter: drop-shadow(0 10px 10px rgba(34, 18, 12, 0.14));
}

.tableau__motto {
  position: absolute;
  left: 7%;
  bottom: 6%;
  z-index: 2;
  max-width: 9ch;
  margin: 0;
  color: rgba(248, 236, 219, 0.94);
  font-size: clamp(2.3rem, 1.05rem + 2vw, 4.1rem);
  line-height: 0.92;
  font-weight: 600;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 10px 18px rgba(7, 4, 3, 0.24);
}

.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;
}

@media (max-width: 960px) {
  .tableau {
    min-height: 92vh;
  }

  .tableau::after {
    inset: 3% 3%;
    border-radius: 2.2rem;
  }

  .tableau__panel--hero {
    inset: 5% 8% 28% 2%;
    border-radius: 7rem 7rem 1.8rem 1.8rem;
  }

  .tableau__panel--portrait {
    top: 17%;
    right: 4%;
    width: 34%;
    height: 44%;
  }

  .seal {
    left: 50%;
    bottom: 18%;
    transform: translateX(-50%);
  }

  .tableau__motto {
    left: 6%;
    bottom: 7%;
    max-width: 11ch;
    font-size: clamp(2.2rem, 1.3rem + 2vw, 3.6rem);
  }
}

@media (max-width: 640px) {
  .residence {
    padding: 0.6rem;
  }

  .tableau {
    min-height: 100vh;
  }

  .tableau::before {
    inset: auto 10% 4% 10%;
    height: 13%;
  }

  .tableau::after {
    inset: 1rem 0.25rem;
    border-radius: 1.6rem;
  }

  .tableau__panel--hero {
    inset: 5rem 4% 22rem 2%;
    border-radius: 4.6rem 4.6rem 1.5rem 1.5rem;
  }

  .tableau__panel--portrait {
    top: 10rem;
    right: 0;
    width: 44%;
    height: 34%;
    border-radius: 999px 999px 1.2rem 1.2rem;
  }

  .seal {
    bottom: 11rem;
    width: 5.8rem;
  }

  .seal::before {
    inset: -0.55rem;
  }

  .tableau__motto {
    left: 50%;
    bottom: 3rem;
    max-width: 9ch;
    transform: translateX(-50%);
    text-align: center;
    font-size: clamp(2.15rem, 10vw, 3rem);
  }
}

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