:root {
  --black: #000;
  --ink: #0b0a09;
  --gold: #ae9a64;
  --gold-hi: #d8c088;
  --gold-lo: #8a7746;
  --cream: #efe6d2;
  --muted: rgba(239, 230, 210, 0.62);
  --line: rgba(174, 154, 100, 0.32);
  --head: 'Saira Condensed', 'Noto Kufi Arabic', 'Helvetica Neue', Arial Narrow, sans-serif;
  --body: 'Archivo Narrow', 'Noto Sans Arabic', 'Helvetica Neue', Arial Narrow, sans-serif;
  --script: 'Caveat', cursive;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--black); color: var(--cream); overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--body); -webkit-font-smoothing: antialiased; touch-action: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
#fontwarm { position: absolute; opacity: 0; pointer-events: none; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#veil { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .32s ease; z-index: 2; }
#veil.on { opacity: 1; }

/* top bar */
.top { position: fixed; z-index: 5; left: 0; right: 0; top: 0; padding: calc(var(--safe-t) + 14px) 18px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: linear-gradient(#000 0%, rgba(0,0,0,.55) 55%, transparent); pointer-events: none; height: calc(var(--safe-t) + 76px); }
.top > * { pointer-events: auto; }
.wordmark { height: 26px; display: block; }
.kicker { font-family: var(--head); font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.top-right { justify-self: end; }
.lang { font-family: var(--head); font-size: 12px; letter-spacing: .2em; color: var(--muted); padding: 8px 2px 8px 10px; }
.lang .sep { opacity: .4; margin: 0 4px; }
.lang [data-l].on { color: var(--gold-hi); }

/* title block */
.title { position: fixed; z-index: 4; left: 20px; top: calc(var(--safe-t) + 78px); pointer-events: none; transition: opacity .45s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.title.out { opacity: 0; transform: translateY(6px); }
.title.zoomed { opacity: 0; }
.t-coll { font-family: var(--head); font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); }
.t-year { font-family: var(--head); font-weight: 500; font-size: 54px; line-height: .95; letter-spacing: .06em; color: var(--gold-hi); margin-top: 6px;
  background: linear-gradient(180deg, #f3dc9a, #ae9a64 70%, #8a7746); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.t-name { font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream); margin-top: 2px; }
.t-meta { font-size: 13px; letter-spacing: .06em; color: var(--muted); margin-top: 4px; max-width: 34vw; line-height: 1.45; }

.hint { position: fixed; z-index: 4; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 228px); font-family: var(--head); font-size: 11px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--cream); background: rgba(0,0,0,.45); border: 1px solid var(--line); padding: 8px 14px; border-radius: 40px; backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); transition: opacity .6s ease; white-space: nowrap; pointer-events: none; }
.hint.gone { opacity: 0; }

/* personal gift */
.pill { position: fixed; z-index: 4; left: 50%; transform: translate(-50%, 8px); bottom: calc(var(--safe-b) + 228px); display: flex; align-items: center; gap: 8px; max-width: 78vw;
  font-family: var(--head); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-hi); background: rgba(0,0,0,.5); border: 1px solid var(--gold);
  padding: 9px 16px; border-radius: 40px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .6s ease, transform .6s ease; }
.pill span { overflow: hidden; text-overflow: ellipsis; }
.pill svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
body.gifted .pill { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
body.gifted .hint, body.pre .pill { opacity: 0; pointer-events: none; }
body.gifted .t-meta { opacity: 0; } /* the open box reaches up into that line */
.t-meta { transition: opacity .5s ease; }
.sheet.top-sheet { align-items: flex-start; }
.sheet.top-sheet .sheet-card { border-top: 0; border-bottom: 1px solid var(--line); padding: calc(var(--safe-t) + 18px) 20px 20px; transform: translateY(-30px); }
.sheet.top-sheet.open .sheet-card { transform: none; }
.personal { display: flex; flex-direction: column; gap: 12px; }
.personal .sheet-head { margin-bottom: 2px; }
.field { width: 100%; height: 50px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 2px; color: var(--cream); font: 400 17px var(--body); padding: 0 14px; outline: none; touch-action: manipulation; }
.field:focus { border-color: var(--gold); }
.field::placeholder { color: rgba(239,230,210,.38); }
.script-field { font: 500 26px var(--script); color: var(--gold-hi); }
.script-field::placeholder { font: 400 17px var(--body); }
.field.link { height: 40px; font-size: 13px; color: var(--muted); }
.personal .ar { width: 100%; margin: 2px 0 0; max-width: none; border: 0; cursor: pointer; }
.ghost { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border: 1px solid var(--gold); border-radius: 2px; color: var(--gold-hi); font-family: var(--head); font-weight: 500; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }
.ghost svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.textbtn { align-self: center; color: var(--muted); font-size: 13px; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 3px; padding: 4px 8px; }
.personal .fine { margin: 2px 0 0; }
[hidden] { display: none !important; }

/* dock */
.dock { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; padding: 0 0 calc(var(--safe-b) + 14px);
  background: linear-gradient(transparent, rgba(0,0,0,.78) 26%, #000 70%); }
.rail { display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 26px 16px 10px; scrollbar-width: none; touch-action: pan-x; }
.rail::-webkit-scrollbar { display: none; }
.rel { flex: 0 0 auto; scroll-snap-align: center; text-align: left; padding: 8px 12px 10px; border-bottom: 1px solid transparent; opacity: .5; transition: opacity .3s, border-color .3s; min-width: 92px; }
.rel .y { font-family: var(--head); font-size: 24px; font-weight: 500; letter-spacing: .05em; color: var(--gold-hi); line-height: 1; }
.rel .n { font-family: var(--head); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--cream); margin-top: 5px; white-space: nowrap; }
.rel[aria-selected="true"] { opacity: 1; border-color: var(--gold); }

.actions { display: flex; justify-content: space-between; padding: 6px 18px 12px; max-width: 520px; margin: 0 auto; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--head); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 6px 4px; min-width: 56px; transition: color .25s; }
.act svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.act[aria-pressed="true"] { color: var(--gold-hi); }
.act:active { color: var(--gold-hi); }

.ar { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 16px; width: calc(100% - 32px); max-width: 488px; margin-inline: auto; height: 54px; border-radius: 2px;
  background: linear-gradient(100deg, #8a7746 0%, #c8ad6e 30%, #ead08f 50%, #c8ad6e 70%, #8a7746 100%); background-size: 220% 100%; color: #0b0a09;
  font-family: var(--head); font-weight: 600; font-size: 14px; letter-spacing: .22em; text-transform: uppercase; animation: sheen 6s ease-in-out infinite; text-decoration: none; }
.dock .ar { width: calc(100% - 32px); }
.ar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.ar.small { height: 46px; font-size: 12px; }
@keyframes sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .3s ease; display: flex; align-items: flex-end; justify-content: center; }
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-card { width: 100%; max-width: 560px; background: linear-gradient(#0d0c0a, #050505); border-top: 1px solid var(--line); padding: 20px 20px calc(var(--safe-b) + 24px);
  transform: translateY(30px); transition: transform .4s cubic-bezier(.2,.7,.2,1); max-height: 82vh; overflow: auto; touch-action: pan-y; }
.sheet.open .sheet-card { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet h2 { margin: 0; font-family: var(--head); font-weight: 500; font-size: 15px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-hi); }
.x { font-size: 28px; line-height: 1; color: var(--muted); padding: 0 4px; }
.rooms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.room { position: relative; aspect-ratio: 3/2; overflow: hidden; border: 1px solid transparent; }
.room img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.92); }
.room span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-family: var(--head); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  background: linear-gradient(transparent, rgba(0,0,0,.85)); text-align: left; }
.room[aria-selected="true"] { border-color: var(--gold); }
.room[aria-selected="true"] span { color: var(--gold-hi); }
.notes dl { margin: 0; }
.notes dt { font-family: var(--head); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-top: 14px; }
.notes dd { margin: 5px 0 0; font-size: 16px; line-height: 1.45; color: var(--cream); }
.fine { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; margin-top: 18px; line-height: 1.5; }
.script { font-family: var(--script); font-size: 26px; color: var(--gold); margin: 10px 0 0; }
.qr { text-align: center; }
.qr p { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 16px; }
.qr img { width: 220px; height: 220px; image-rendering: pixelated; background: #fff; padding: 10px; }
.shot img { width: 100%; display: block; border: 1px solid var(--line); }
.shot-actions { margin-top: 14px; }

/* intro */
#intro { position: fixed; inset: 0; z-index: 30; background: radial-gradient(ellipse at 50% 38%, #1b150c 0%, #000 62%); display: flex; align-items: center; justify-content: center; transition: opacity .9s ease; }
#intro.gone { opacity: 0; pointer-events: none; }
.intro-inner { text-align: center; padding: 24px; display: flex; flex-direction: column; align-items: center; }
.emblem { width: min(42vw, 190px); opacity: 0; transform: scale(.96); animation: rise 1.6s .2s cubic-bezier(.2,.7,.2,1) forwards; filter: drop-shadow(0 0 30px rgba(216,192,136,.18)); }
.unprec { width: min(56vw, 250px); margin-top: 28px; opacity: 0; animation: rise 1.4s .9s ease forwards; }
.intro-line { opacity: 0; animation: rise 1.4s 1.3s ease forwards; font-size: 30px; margin-top: 18px; }
.enter { margin-top: 34px; width: min(78vw, 320px); opacity: 0; animation: rise 1s 1.6s ease forwards; }
.enter[disabled] { filter: grayscale(.6) brightness(.6); }
.intro-fine { font-size: 12px; letter-spacing: .08em; color: var(--muted); margin-top: 18px; max-width: 300px; line-height: 1.5; opacity: 0; animation: rise 1s 1.9s ease forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* before the opening: only the room is on stage; the interface arrives once the bottle is lit */
.dock { transition: opacity 1s ease .25s, transform 1.1s cubic-bezier(.2,.7,.2,1) .25s; }
body.pre .title { opacity: 0; transform: translateY(8px); }
body.pre .dock { opacity: 0; transform: translateY(26px); pointer-events: none; }
body.pre .hint { opacity: 0; }

/* landscape / desktop */
@media (min-aspect-ratio: 1/1) {
  .title { left: 48px; top: calc(var(--safe-t) + 110px); }
  .t-year { font-size: 84px; }
  .t-name { font-size: 30px; }
  .t-meta { font-size: 15px; max-width: none; }
  .dock { left: auto; right: 0; top: 0; width: 380px; padding: calc(var(--safe-t) + 96px) 0 28px; background: linear-gradient(90deg, transparent, rgba(0,0,0,.7) 22%, #000 60%);
    display: flex; flex-direction: column; justify-content: flex-end; }
  .rail { flex-wrap: wrap; overflow: visible; padding: 0 28px 14px 48px; gap: 2px; }
  .rel { min-width: 0; flex: 0 0 calc(50% - 2px); }
  .actions { padding: 10px 28px 18px 44px; }
  .dock .ar { width: calc(100% - 76px); margin: 0 28px 0 48px; }
  .hint { top: auto; bottom: 28px; left: 48px; transform: none; }
  .pill { bottom: 28px; left: 48px; transform: translateY(8px); }
  body.gifted .pill { transform: none; }
  .sheet.top-sheet { align-items: center; }
  .sheet.top-sheet .sheet-card { border: 1px solid var(--line); padding: 22px; }
}
/* Arabic: right to left, no letter-spacing (it would break the joined script), slightly larger for legibility.
   Years, distillery names and the brand lines stay Latin and keep their own styling. */
.lang [data-l="ar"] { letter-spacing: 0; font-size: 13px; }
body.rtl [data-i18n], body.rtl [data-room], body.rtl #tMeta, body.rtl #nFine, body.rtl .notes dd, body.rtl #enterLabel, body.rtl .pill { direction: rtl; letter-spacing: 0; }
body.rtl .kicker, body.rtl .t-coll, body.rtl .hint, body.rtl .pill, body.rtl .room span, body.rtl .notes dt { font-size: 13px; }
body.rtl .hint { font-size: 12.5px; padding: 7px 14px; }
body.rtl .t-meta { font-size: 13.5px; line-height: 1.6; }
body.rtl .act { letter-spacing: 0; font-size: 12px; }
body.rtl .ar { letter-spacing: 0; font-size: 16px; flex-direction: row-reverse; }
body.rtl .ar.small, body.rtl .ghost { letter-spacing: 0; font-size: 14.5px; }
body.rtl .ghost, body.rtl .pill { flex-direction: row-reverse; }
body.rtl .sheet h2:not(#notesT) { font-size: 17px; }
body.rtl .sheet-head { flex-direction: row-reverse; }
body.rtl .room span { text-align: right; }
body.rtl .notes dd { line-height: 1.7; }
body.rtl .fine, body.rtl .intro-fine { font-size: 13.5px; line-height: 1.7; letter-spacing: 0; }
body.rtl .qr p { line-height: 1.7; }
body.rtl .notes .script { text-align: right; }
body.rtl .field:placeholder-shown { direction: rtl; }
body.rtl .field::placeholder { letter-spacing: 0; }
@media (max-aspect-ratio: 1/1) {
  body.rtl:not(.gifted) .title { left: auto; right: 20px; text-align: right; }
  body.rtl:not(.gifted) .t-meta { margin-left: auto; }
  body.rtl.gifted .t-coll { text-align: left; } /* the open box stands on the right, so the title goes back to the left */
}
@media (min-aspect-ratio: 1/1) { body.rtl .t-coll, body.rtl .t-meta { text-align: left; } }

/* phone held sideways */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .title { left: 24px; top: calc(var(--safe-t) + 58px); }
  .t-year { font-size: 44px; } .t-name { font-size: 18px; } .t-meta { font-size: 12px; }
  .dock { width: 330px; padding: calc(var(--safe-t) + 52px) 0 12px; }
  .rail { padding: 0 20px 6px 40px; } .rel { padding: 4px 10px 6px; } .rel .y { font-size: 18px; } .rel .n { font-size: 10px; margin-top: 3px; }
  .actions { padding: 4px 20px 8px 36px; } .dock .ar { height: 44px; width: calc(100% - 60px); margin: 0 20px 0 40px; }
  .hint, .pill { bottom: 12px; left: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
