html {
  scroll-behavior: smooth;
}

html:not(.enhanced) .reveal {
  opacity: 1;
  transform: none;
}

:focus-visible {
  outline: 2px solid #7026c5;
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

#site-header.is-scrolled {
  background: rgba(255, 250, 253, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px rgba(180, 140, 54, 0.18);
}

.mobile-nav {
  position: fixed;
  z-index: 51;
  top: 4rem;
  inset-inline: 0.75rem;
  max-width: 22rem;
  padding: 0.35rem 1.25rem;
  border: 1px solid #e8d2c3;
  border-radius: 1rem;
  background: rgba(255, 249, 253, 0.97);
  box-shadow: 0 16px 40px rgba(58, 24, 77, 0.14);
  backdrop-filter: blur(12px);
}

.mobile-nav a {
  display: block;
  padding-block: 0.7rem;
  font-size: 0.9rem;
}

.mobile-nav a + a {
  border-top: 1px solid #eedee9;
}

.mobile-nav a:hover {
  color: hsl(var(--primary));
}

.art-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-image:is([src$="crown.webp"], [src$="flowers.webp"]) {
  object-fit: contain;
}

.photo-open {
  display: block;
  width: 100%;
  cursor: zoom-in;
}

.photo-open:focus-visible {
  outline-offset: -4px;
}

.gallery {
  width: min(56rem, calc(100% - 1.5rem));
  max-height: 92svh;
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border: 0;
  border-radius: 1.8rem;
  background: #fff;
  color: hsl(var(--foreground));
  box-shadow: 0 24px 70px rgba(25, 12, 35, 0.28);
}

.gallery::backdrop {
  background: rgba(27, 20, 32, 0.8);
  backdrop-filter: blur(12px);
}

html:has(.gallery[open]) {
  overflow: hidden;
}

.gallery-stage {
  position: relative;
  height: min(62svh, 35rem);
  background: #f7edf9;
}

.gallery-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-stage button {
  position: absolute;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 2px 10px rgba(27, 20, 32, 0.14);
  font-family: sans-serif;
  font-size: 1.45rem;
  line-height: 1;
}

.gallery-stage button:hover {
  background: #fff;
}

.gallery-close { top: 1rem; inset-inline-end: 1rem; }
.gallery-prev { top: calc(50% - 1.25rem); inset-inline-start: 0.75rem; }
.gallery-next { top: calc(50% - 1.25rem); inset-inline-end: 0.75rem; }
[dir="rtl"] :is(.gallery-prev, .gallery-next) { transform: scaleX(-1); }

.gallery-caption {
  padding: 1.25rem clamp(1.2rem, 4vw, 2rem) 1.5rem;
}

.gallery-caption h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.85rem);
  font-weight: 600;
  line-height: 1.35;
}

.gallery-date {
  margin-bottom: 0.35rem;
  color: hsl(var(--accent));
  font-size: 0.75rem;
}

.gallery-description {
  margin-top: 0.65rem;
  color: hsl(var(--muted-foreground));
  white-space: pre-line;
}

.gallery-thumbs {
  display: flex;
  gap: 0.45rem;
  margin-top: 1.1rem;
  overflow: auto;
  padding: 3px;
}

.gallery-thumbs button {
  flex: 0 0 4rem;
  height: 4rem;
  overflow: hidden;
  border-radius: 0.7rem;
  opacity: 0.72;
}

.gallery-thumbs button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #b48c36;
  opacity: 1;
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-status {
  position: fixed;
  z-index: 70;
  inset-inline: 1rem;
  bottom: 1.5rem;
  width: max-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto;
  padding: 0.6rem 1rem;
  border-radius: 0.85rem;
  background: #3e2060;
  color: #fff;
  overflow-wrap: anywhere;
}

@media (max-width: 639px) and (orientation: portrait) {
  .gallery-stage {
    height: min(54svh, 32rem);
  }
}

@media (min-width: 768px) {
  .mobile-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Header brand (English name with crown, top right) ---------- */
#site-header > div {
  height: auto;
  min-height: 4.5rem;
  padding-block: 0.55rem;
}

[dir="ltr"] #site-header > div {
  flex-direction: row-reverse;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  transition: transform 0.2s;
}

.brand:active { transform: scale(0.97); }

.brand-top,
.brand-bottom {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.3rem;
}

.brand-line {
  flex: 1;
  height: 1.5px;
  min-width: 1.4rem;
  background: linear-gradient(90deg, transparent, #c9a227 35%, #f3e2a8 60%, #b48c36);
}

.brand-top .brand-line:last-child,
.brand-bottom .brand-line:last-child {
  transform: scaleX(-1);
}

.brand-crown {
  width: 2.6rem;
  height: 2.1rem;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(143, 109, 36, 0.4));
}

.brand-name {
  margin-block: 0.05rem 0.1rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.3rem, 5.6vw, 1.85rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #3d0b63;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 6px rgba(201, 162, 39, 0.35);
}

.brand-bottom { justify-content: center; }

.brand-scroll {
  width: 1.5rem;
  height: 1rem;
}

.brand-scroll--end { transform: scaleX(-1); }

.brand-bottom .gem {
  width: 0.95rem;
  height: 0.95rem;
  margin-inline: -0.1rem;
}

.gem {
  flex: none;
  filter: drop-shadow(0 1px 2px rgba(61, 11, 99, 0.35));
}

/* ---------- Language toggle & menu (bigger pills like the reference) ---------- */
.lang-toggle {
  padding: 0.25rem;
  border-color: rgba(201, 162, 39, 0.25);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 18px -8px rgba(106, 27, 154, 0.35);
  font-size: 0.9rem;
  font-weight: 700;
}

.lang-toggle button {
  min-width: 2.9rem;
  padding: 0.45rem 0.85rem;
}

.lang-toggle button[aria-pressed="true"] {
  background: linear-gradient(180deg, #9b4dff, #7026c5);
}

.lang-toggle button[aria-pressed="false"] {
  color: #3d0b63;
}

.menu-btn {
  width: 2.9rem;
  height: 2.9rem;
  border-color: rgba(201, 162, 39, 0.2);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 18px -8px rgba(106, 27, 154, 0.35);
  color: #3d0b63;
}

.menu-btn svg {
  width: 1.3rem;
  height: 1.3rem;
}

.mobile-nav { top: 5.4rem; }

/* ---------- Social icons, top-left column ---------- */
.hero-social {
  position: absolute;
  z-index: 20;
  top: 6.4rem;
  left: 0.85rem;
}

.hero-social-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hero-social-list a {
  width: 2.65rem;
  height: 2.65rem;
}

.hero-social-list a svg {
  width: 1.3rem;
  height: 1.3rem;
}

#home-reference {
  padding-top: 9.5rem;
}

/* ---------- Ornate Arabic name plaque ---------- */
.name-plaque {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(3.6rem, 13vw, 5.4rem);
}

.plaque-crown {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 50%;
  width: clamp(6rem, 24vw, 9rem);
  height: clamp(5rem, 20vw, 7.5rem);
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 16px rgba(143, 109, 36, 0.45));
}

.plaque-flower {
  position: absolute;
  z-index: 2;
  top: 52%;
  width: clamp(5.5rem, 24vw, 9.5rem);
  height: clamp(5.5rem, 24vw, 9.5rem);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(106, 27, 154, 0.25));
}

.plaque-flower--left { left: clamp(-3.4rem, -9vw, -2rem); transform: translateY(-50%) rotate(-12deg); }
.plaque-flower--right { right: clamp(-3.4rem, -9vw, -2rem); transform: translateY(-50%) scaleX(-1) rotate(-12deg); }

.plaque-frame {
  position: relative;
  z-index: 1;
  padding: 5px;
  border-radius: 46% / 40%;
  background: linear-gradient(135deg, #f7e9b8 0%, #d3ae4f 16%, #a9822b 32%, #f3e2a8 48%, #c9a227 64%, #8a6720 82%, #ecd79a 100%);
  box-shadow: 0 30px 60px -30px rgba(120, 90, 25, 0.9), 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.plaque-inner {
  position: relative;
  overflow: hidden;
  padding: clamp(0.9rem, 3vw, 1.4rem) clamp(3rem, 11vw, 5.5rem);
  border-radius: 46% / 40%;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.98) 0%, rgba(255, 246, 236, 0.97) 55%, rgba(251, 228, 240, 0.96) 100%);
  box-shadow: inset 0 0 0 2px rgba(201, 162, 39, 0.55), inset 0 0 0 7px rgba(255, 255, 255, 0.9), inset 0 0 0 8.5px rgba(201, 162, 39, 0.35);
}

.plaque-corner {
  position: absolute;
  width: clamp(1.9rem, 7vw, 2.8rem);
  height: clamp(1.9rem, 7vw, 2.8rem);
  pointer-events: none;
}

.plaque-corner.tl { top: 10%; left: 6%; }
.plaque-corner.tr { top: 10%; right: 6%; transform: scaleX(-1); }
.plaque-corner.bl { bottom: 10%; left: 6%; transform: scaleY(-1); }
.plaque-corner.br { bottom: 10%; right: 6%; transform: scale(-1); }

.plaque-swirl {
  position: absolute;
  inset: 10% 14%;
  width: 72%;
  height: 80%;
  opacity: 0.55;
  pointer-events: none;
}

.plaque-title {
  position: relative;
  font-size: clamp(3.6rem, 17vw, 6.6rem);
  font-weight: 700;
  line-height: 1.45;
  background: linear-gradient(180deg, #a24fd6 0%, #6a1b9a 45%, #3d0b63 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(212, 175, 55, 0.55)) drop-shadow(0 8px 14px rgba(106, 27, 154, 0.25));
}

.plaque-gem {
  position: relative;
  z-index: 2;
  margin-top: -0.95rem;
}

.plaque-gem .gem {
  width: 1.8rem;
  height: 1.8rem;
}

/* ---------- Divider with purple diamond ---------- */
.gem-divider {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: min(17rem, 75%);
  margin-top: 1.4rem;
}

.gem-divider i {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #c9a227 50%, #f3e2a8);
}

.gem-divider i:last-child { transform: scaleX(-1); }

.gem-divider .gem {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- "Explore my memories" button with gold-framed purple pill ---------- */
.explore-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 2.2rem;
}

.explore-scroll {
  width: clamp(2.4rem, 9vw, 3.6rem);
  height: clamp(1.6rem, 6vw, 2.4rem);
  flex: none;
}

.explore-scroll--left { margin-inline-end: -0.5rem; }
.explore-scroll--right { margin-inline-start: -0.5rem; transform: scaleX(-1); }
[dir="rtl"] .explore-scroll--left { transform: scaleX(-1); }
[dir="rtl"] .explore-scroll--right { transform: none; }

.explore-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  overflow: hidden;
  padding: 0.75rem 1.1rem 0.75rem 1.9rem;
  border: 3px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #9b3fd0 0%, #6a1b9a 55%, #4a148c 100%) padding-box,
    linear-gradient(135deg, #f7e9b8, #c9a227 30%, #fff3c4 50%, #a9822b 75%, #ecd79a) border-box;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 4px rgba(201, 162, 39, 0.55), 0 22px 44px -18px rgba(74, 20, 140, 0.85);
  color: #fff;
  font-size: clamp(1.05rem, 4.4vw, 1.3rem);
  font-weight: 700;
  transition: transform 0.3s, box-shadow 0.3s;
}

[dir="ltr"] .explore-btn { padding: 0.75rem 1.9rem 0.75rem 1.1rem; }

.explore-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 4px rgba(201, 162, 39, 0.7), 0 28px 54px -18px rgba(74, 20, 140, 0.9);
}

.explore-shine {
  position: absolute;
  inset-inline: 1.4rem;
  top: 3px;
  height: 45%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  filter: blur(2px);
  pointer-events: none;
}

.explore-arrow {
  position: relative;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #3d0b63;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.explore-arrow svg {
  width: 1.35rem;
  height: 1.35rem;
}

@media (max-width: 380px) {
  .hero-social { top: 6rem; left: 0.5rem; }
  .hero-social-list a { width: 2.3rem; height: 2.3rem; }
  .plaque-inner { padding-inline: 2.4rem; }
}

/* Main hero background photo, shown softly so it reads as a transparent backdrop */
.hero-bg-image {
  object-position: center 45%;
  opacity: 0.55;
}
