/* Not Wine, coming soon. Self-hosted OFL fonts: each file covers only the script it renders. */
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-500-latin.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-500-italic-latin.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Amiri"; src: url("fonts/amiri-400-arabic.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Amiri"; src: url("fonts/amiri-700-arabic.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-500-latin.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-400-arabic.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-500-arabic.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-2011, U+FB50-FDFF, U+FE70-FEFC; }

:root {
  color-scheme: dark;
  --night: #0c0708;
  --cellar: #170b0e;
  --bordeaux: #2a0f14;
  --gold: #d9a957;
  --gold-soft: #ebc67e;
  --cream: #f1e6d3;
  --cream-dim: rgba(241, 230, 211, 0.72);
  --line: rgba(217, 169, 87, 0.28);
  --display: "Cormorant Garamond", "Amiri", Georgia, "Times New Roman", serif;
  --ui: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}
:root[data-lang="ar"] {
  --display: "Amiri", "Cormorant Garamond", Georgia, serif;
  --ui: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, -apple-system, Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--night);
  color: var(--cream);
  font: 400 16px/1.6 var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* Each line of copy exists in both languages; only the chosen one is shown (and read aloud). */
:root[data-lang="en"] [lang="ar"]:not(.lang-switch *), :root[data-lang="ar"] [lang="en"]:not(.lang-switch *) { display: none !important; }
:root[data-lang="ar"] .lang-switch [data-to="ar"], :root[data-lang="en"] .lang-switch [data-to="en"] { display: none; }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 4px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.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; }

/* ------------------------------------------------------------------ The cellar */

.cellar { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* Painted fallback: a barrel vault receding towards one warm light. The photograph, when present, sits above it. */
.cellar__paint {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 14% 22% at 50% 44%, rgba(235, 186, 110, 0.55), rgba(217, 169, 87, 0.12) 55%, transparent 75%),
    radial-gradient(ellipse 34% 44% at 50% 44%, rgba(120, 44, 38, 0.38), transparent 70%),
    repeating-radial-gradient(ellipse 60% 80% at 50% 44%, transparent 0 40px, rgba(0, 0, 0, 0.1) 52px, transparent 64px 96px),
    radial-gradient(ellipse 80% 95% at 50% 44%, var(--bordeaux), var(--cellar) 55%, var(--night) 85%);
}
.cellar__photo {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.cellar__photo.is-ready { opacity: 1; }
.cellar__shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 46%, transparent 0, rgba(12, 7, 8, 0.35) 60%, rgba(12, 7, 8, 0.82) 100%),
    linear-gradient(to bottom, rgba(12, 7, 8, 0.55), transparent 22%, transparent 70%, rgba(12, 7, 8, 0.9));
}
.cellar__grain {
  position: absolute;
  inset: -50%;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------------------ Frame */

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--gutter) 0;
}
.wordmark { width: clamp(108px, 12vw, 140px); height: auto; display: block; }
.lang-switch {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 7, 8, 0.4);
  color: var(--cream);
  font: 500 14px/1 var(--ui);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, background 0.2s;
}
.lang-switch:hover { border-color: var(--gold); background: rgba(42, 15, 20, 0.6); }
.lang-switch [lang="ar"] { font-family: "IBM Plex Sans Arabic", var(--ui); }
.lang-switch [lang="en"] { font-family: "IBM Plex Sans", var(--ui); }

/* ------------------------------------------------------------------ Hero */

.hero {
  position: relative;
  z-index: 3;
  min-height: calc(100dvh - 58px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vh, 26px);
  padding: 12px var(--gutter) clamp(20px, 4vh, 56px);
  text-align: center;
  /* The glow behind the glass may be wider than a phone; it must never widen the page. */
  overflow-x: clip;
}
.glass {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(150px, 29vh, 270px);
  aspect-ratio: 96.66 / 143.66;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.glass:active { cursor: grabbing; }
.glass::before {
  /* The glow of the far light, caught in the glass. */
  content: "";
  position: absolute;
  inset: -22% -30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(217, 169, 87, 0.2), transparent);
  opacity: calc(0.55 + var(--energy, 0) * 0.45);
  transition: opacity 0.4s;
  pointer-events: none;
}
.glass svg { position: relative; width: 100%; height: 100%; overflow: visible; }
/* The wine's surface catches the light while it moves, and fades out at rest so the logo reads as drawn. */
.glass .surface { stroke: #fbe7b4; stroke-width: 0.75; stroke-linecap: round; opacity: 0; }
.glass:focus-visible { outline-offset: 10px; border-radius: 999px; }


h1 {
  margin: 0;
  font: 500 clamp(38px, 5.8vw, 70px)/1.06 var(--display);
  letter-spacing: -0.01em;
  color: var(--cream);
  text-wrap: balance;
}
/* The joke lands on its own line. */
h1 em { display: block; font-style: italic; color: var(--gold-soft); }
:root[data-lang="ar"] h1 { font-weight: 700; line-height: 1.3; letter-spacing: 0; }
:root[data-lang="ar"] h1 em { font-style: normal; }

.soon {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
:root[data-lang="ar"] .soon { letter-spacing: 0; font-size: 17px; text-transform: none; }

/* The swirl prompt, and the line it turns into. */
.prompt {
  display: grid;
  place-items: center;
  min-height: 46px;
  margin-top: -4px;
}
.prompt > * { grid-area: 1 / 1; margin: 0; transition: opacity 0.6s ease, transform 0.6s ease; }
.prompt__hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border: 1px solid rgba(235, 198, 126, 0.55);
  border-radius: 999px;
  background: rgba(12, 7, 8, 0.62);
  color: var(--cream);
  font-size: 15px;
  font-weight: 500;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
:root[dir="rtl"] .prompt__hint { padding: 0 14px 0 18px; }
.prompt__hint svg { width: 20px; height: 20px; flex: none; color: var(--gold-soft); animation: orbit 3s linear infinite; }
:root[dir="rtl"] .prompt__hint svg { animation-direction: reverse; }
@keyframes orbit { to { transform: rotate(360deg); } }
.prompt__done {
  font: italic 500 clamp(24px, 2.6vw, 30px)/1.2 var(--display);
  color: var(--gold-soft);
  opacity: 0;
  transform: translateY(6px);
}
:root[data-lang="ar"] .prompt__done { font-style: normal; font-weight: 700; }
.is-breathed .prompt__hint { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.is-breathed .prompt__done { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ Small screens and motion */

@media (max-width: 520px) {
  .hero { gap: 14px; }
  .prompt__hint { font-size: 14px; }
  .glass { width: clamp(140px, 29vh, 220px); }
}
@media (max-height: 640px) and (orientation: landscape) {
  .glass { width: 112px; }
  h1 { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .cellar__grain, .prompt__hint svg { animation: none; }
  .cellar__photo, .prompt > * { transition: none; }
}
