:root {
  --espresso: #4f1000;
  --espresso-dark: #200700;
  --gold: #febb15;
  --cream: #fff6e6;
  --soft-gold: #f7d98a;
  --muted: rgba(255, 246, 230, 0.68);
  --border: rgba(254, 187, 21, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--espresso-dark);
  color: var(--cream);
  font-family: "Outfit", sans-serif;
  overflow-x: hidden;
}

button, a { font: inherit; }

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 20%, rgba(254,187,21,.08), transparent 30%),
    linear-gradient(125deg, #250800 0%, #4f1000 58%, #310a00 100%);
  isolation: isolate;
}

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .09;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

.ambient {
  position: absolute;
  border: 1px solid rgba(254,187,21,.14);
  border-radius: 50%;
  z-index: -1;
  animation: drift 16s ease-in-out infinite alternate;
}

.ambient-one { width: 520px; height: 520px; top: -240px; left: -180px; }
.ambient-two { width: 390px; height: 390px; right: -120px; bottom: -170px; animation-delay: -7s; }

.topbar, .footer {
  width: min(1380px, calc(100% - 64px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar { padding-top: 28px; }

.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  gap: 13px;
  align-items: center;
}

.brand-mark, .loader-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  letter-spacing: .04em;
}

.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font-family: "Cormorant Garamond", serif; font-size: 1.15rem; letter-spacing: .03em; }
.brand-copy small { color: var(--muted); margin-top: 4px; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; }
.location { color: var(--muted); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }

.hero {
  width: min(1380px, calc(100% - 64px));
  margin: 48px auto 26px;
  min-height: calc(100vh - 160px);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  align-items: center;
  gap: clamp(48px, 6vw, 100px);
}

.hero-copy { padding: 32px 0; animation: revealUp .9s both; }
.eyebrow { margin: 0 0 20px; color: var(--gold); text-transform: uppercase; letter-spacing: .26em; font-size: .72rem; }

h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(4rem, 7vw, 7.8rem);
  font-weight: 500;
  line-height: .82;
  letter-spacing: -.05em;
}

h1 span { color: var(--gold); font-style: italic; }
.intro { max-width: 640px; margin: 28px 0 34px; color: var(--muted); line-height: 1.8; font-weight: 300; }

.language-grid { display: grid; gap: 11px; max-width: 660px; }
.language-card {
  position: relative;
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 38px 54px 1fr 40px;
  gap: 14px;
  align-items: center;
  padding: 13px 18px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
  color: var(--cream);
  cursor: pointer;
  text-align: left;
  transition: transform .35s ease, border-color .35s ease, background .35s ease, box-shadow .35s ease;
  backdrop-filter: blur(12px);
}

.language-card::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(254,187,21,.14), transparent);
  transition: width .4s ease;
}

.language-card:hover { transform: translateX(8px); border-color: rgba(254,187,21,.5); }
.language-card:hover::before, .language-card.active::before { width: 100%; }
.language-card.active { border-color: var(--gold); box-shadow: 0 14px 45px rgba(0,0,0,.22); }
.language-number { color: rgba(255,255,255,.38); font-size: .68rem; }
.language-icon { position: relative; z-index: 1; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: rgba(254,187,21,.11); border: 1px solid var(--border); color: var(--gold); font-weight: 600; }
.language-icon.arabic { font-family: "Noto Naskh Arabic", serif; font-size: 1.25rem; }
.language-text { position: relative; z-index: 1; display: grid; }
.language-text strong { font-family: "Cormorant Garamond", serif; font-size: 1.28rem; letter-spacing: .02em; }
.language-text small { color: var(--muted); margin-top: 3px; font-size: .75rem; }
.language-text.arabic { font-family: "Noto Naskh Arabic", serif; }
.language-text.arabic strong { font-family: "Noto Naskh Arabic", serif; font-size: 1.18rem; }
.arrow { position: relative; z-index: 1; justify-self: end; color: var(--gold); font-size: 1.15rem; transition: transform .3s ease; }
.language-card:hover .arrow { transform: translate(3px,-3px); }

.continue-button {
  margin-top: 22px;
  width: min(100%, 660px);
  min-height: 58px;
  border: 0;
  background: var(--gold);
  color: var(--espresso-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  transition: transform .3s ease, box-shadow .3s ease;
}
.continue-button:hover { transform: translateY(-3px); box-shadow: 0 18px 45px rgba(254,187,21,.18); }
.button-line { width: 46px; height: 1px; background: currentColor; opacity: .45; }
.button-icon { font-size: 1.2rem; }

.visual-panel { animation: revealVisual 1.1s .12s both; }
.image-frame { position: relative; height: min(720px, 72vh); min-height: 540px; overflow: hidden; border-radius: 240px 240px 18px 18px; border: 1px solid rgba(254,187,21,.34); box-shadow: 0 40px 90px rgba(0,0,0,.42); }
.image-frame::before { content: ""; position: absolute; inset: 18px; border: 1px solid rgba(255,246,230,.26); border-radius: inherit; z-index: 2; pointer-events: none; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); animation: imageFloat 12s ease-in-out infinite alternate; }
.image-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(31,6,0,.92), rgba(79,16,0,.08) 58%, rgba(254,187,21,.08)); }
.visual-caption { position: absolute; left: 52px; right: 52px; bottom: 48px; z-index: 3; }
.visual-caption p { color: var(--gold); text-transform: uppercase; letter-spacing: .2em; font-size: .68rem; }
.visual-caption h2 { max-width: 430px; margin: 10px 0 0; font-family: "Cormorant Garamond", serif; font-size: clamp(2.2rem, 4vw, 4.5rem); line-height: .95; font-weight: 500; }
.floating-badge { position: absolute; z-index: 4; width: 102px; height: 102px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: rgba(33,7,0,.82); border: 1px solid var(--gold); backdrop-filter: blur(10px); animation: badgeFloat 5s ease-in-out infinite; }
.floating-badge span { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .15em; }
.floating-badge strong { color: var(--gold); font-family: "Cormorant Garamond", serif; font-size: 1.25rem; margin-top: 2px; }
.badge-top { top: 18%; left: -32px; }
.badge-bottom { right: -30px; bottom: 27%; animation-delay: -2.5s; }

.footer { padding: 0 0 24px; color: rgba(255,255,255,.42); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }

.transition-overlay { position: fixed; inset: 0; z-index: 99; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--espresso-dark); opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.transition-overlay.show { opacity: 1; pointer-events: auto; }
.transition-overlay .loader-logo { width: 74px; height: 74px; font-size: 1.35rem; animation: pulse 1s infinite alternate; }
.transition-overlay p { color: var(--soft-gold); letter-spacing: .16em; text-transform: uppercase; font-size: .72rem; }

@keyframes revealUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes revealVisual { from { opacity: 0; transform: translateX(45px) scale(.97); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes imageFloat { to { transform: scale(1.13) translateY(-10px); } }
@keyframes badgeFloat { 50% { transform: translateY(-10px); } }
@keyframes drift { to { transform: translate(38px, 28px) rotate(10deg); } }
@keyframes pulse { to { transform: scale(1.08); box-shadow: 0 0 32px rgba(254,187,21,.2); } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; margin-top: 30px; }
  .visual-panel { order: -1; }
  .image-frame { height: 430px; min-height: 0; border-radius: 210px 210px 18px 18px; }
  h1 { font-size: clamp(3.6rem, 12vw, 6.6rem); }
  .badge-top { left: 20px; }
  .badge-bottom { right: 20px; }
}

@media (max-width: 640px) {
  .topbar, .hero, .footer { width: min(100% - 30px, 1380px); }
  .topbar { padding-top: 18px; }
  .location, .footer span:first-child { display: none; }
  .hero { gap: 24px; margin-top: 24px; }
  .hero-copy { padding-top: 10px; }
  .image-frame { height: 360px; }
  .visual-caption { left: 30px; right: 30px; bottom: 32px; }
  .visual-caption h2 { font-size: 2.35rem; }
  .floating-badge { width: 82px; height: 82px; }
  .badge-bottom { display: none; }
  .language-card { grid-template-columns: 28px 48px 1fr 26px; padding-inline: 13px; }
  .language-icon { width: 43px; height: 43px; }
  .intro { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
