/* OILIVE homepage — "Five Worlds". One screen, a wheel of five bottles, a
   world behind the front bottle. Colours follow the world in front. */

/* Phones: no double-tap zoom (it fires on quick taps and jumps the page);
   pinch-zoom and panning stay exactly as the browser gives them. */
html, body, a, button, label, input, select, textarea, summary, [role="button"], [role="tab"] { touch-action: manipulation; }
:root {
  --paper: #F3EEE4; --ink: #2A2722; --pigment: #9A3A2C; --soft: rgba(42,39,34,.62); --line: rgba(42,39,34,.18);
  --ease: cubic-bezier(.165,1,.32,1); --ease-io: cubic-bezier(.645,.045,.355,1);
  --pad: clamp(16px, 2.4vw, 36px);
  --ink-65: var(--soft); --ink-25: var(--line);
}
body[data-world="tulip-court"]   { --paper:#F3EEE4; --ink:#2C2420; --pigment:#9A3A2C; }
body[data-world="cappadocia"]    { --paper:#EEDFCB; --ink:#4A3324; --pigment:#C27C4C; }
body[data-world="kilim-weave"]   { --paper:#EFE7DA; --ink:#25231F; --pigment:#9B3B2A; }
body[data-world="ebru-flow"]     { --paper:#F1EBDD; --ink:#24324A; --pigment:#C49A45; }
body[data-world="nazar-eclipse"] { --paper:#0F1E3D; --ink:#F1ECE0; --pigment:#D9A441; --soft: rgba(241,236,224,.66); --line: rgba(241,236,224,.2); }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.home {
  margin: 0; overflow: hidden; overscroll-behavior: none;
  background: var(--paper); color: var(--ink);
  font-family: 'Instrument Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  transition: background-color .9s var(--ease-io), color .9s var(--ease-io);
}
a { color: inherit; text-decoration: none; }
.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; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; font-size: 13px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--pigment); outline-offset: 3px; }
.oilive-logo-protect { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }

/* ── top bar ── */
.h-top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(var(--pad) + env(safe-area-inset-top, 0px)) var(--pad) 0;
  pointer-events: none;
}
.h-top > * { pointer-events: auto; }
.h-langs .lang-switch { gap: 6px !important; }
.h-langs .lang-switch > span[aria-hidden] { display: none; }
.h-langs .lang-switch a, .h-langs .lang-switch span[aria-current] {
  display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 14px;
  border: 1px solid var(--line) !important; color: var(--ink) !important; font: 600 10px/1 'Instrument Sans', sans-serif !important;
  letter-spacing: .14em !important; text-transform: uppercase;
}
.h-langs .lang-switch span[aria-current] { background: var(--ink); color: var(--paper) !important; border-color: var(--ink) !important; }
.h-langs .lang-switch a { font-size: 0 !important; }
.h-langs .lang-switch a::after, .h-langs .lang-switch span[aria-current]::after { content: attr(lang); font-size: 10px; }
.h-langs .lang-switch span[aria-current] { font-size: 0 !important; }
.h-logo img { display: block; width: clamp(84px, 8vw, 118px); height: auto; transition: filter .9s var(--ease-io); }
body[data-world="nazar-eclipse"] .h-logo img { filter: invert(1) hue-rotate(180deg) brightness(1.08); }
.h-menu-btn {
  justify-self: end; height: 34px; padding: 0 16px; border-radius: 17px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; font: 600 10px/1 'Instrument Sans', sans-serif; letter-spacing: .2em; text-transform: uppercase;
}
.h-menu-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }

/* ── menu ── */
.h-menu {
  position: fixed; inset: 0; z-index: 15; background: var(--paper);
  display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(24px, 9vw, 140px);
}
.h-menu[hidden] { display: none; }
.h-menu ul { list-style: none; margin: 0; padding: 0; }
.h-menu li { overflow: hidden; border-bottom: 1px solid var(--line); }
.h-menu a {
  display: flex; align-items: baseline; gap: 22px; padding: clamp(14px, 2.4vh, 22px) 0;
  font: 400 clamp(32px, 5.6vw, 72px)/1.05 'Playfair Display', serif; letter-spacing: -.01em;
  transform: translateY(105%); transition: transform .9s var(--ease);
}
.h-menu a:hover { font-style: italic; }
.h-menu.is-open a { transform: none; }
.h-menu li:nth-child(2) a { transition-delay: .06s } .h-menu li:nth-child(3) a { transition-delay: .12s } .h-menu li:nth-child(4) a { transition-delay: .18s }
.h-menu-no { font: 500 11px/1 'Instrument Sans', sans-serif; letter-spacing: .2em; color: var(--soft); }
.h-menu-foot { margin: 40px 0 0; font: italic 400 18px/1.4 'Playfair Display', serif; color: var(--soft); }

/* ── stage ── */
main { position: fixed; inset: 0; }
.h-stage { position: absolute; inset: 0; touch-action: pinch-zoom; }
.h-world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.h-bottles { position: absolute; inset: 0; pointer-events: none; }
.h-bottle {
  position: absolute; left: 0; top: 0; will-change: transform, opacity; transform-origin: 50% 100%;
  pointer-events: auto; cursor: pointer;
}
.h-bottle img, .h-bottle canvas { display: block; width: 100%; height: 100%; -webkit-user-drag: none; user-select: none; }
.h-bottle canvas { position: absolute; inset: 0; }
.h-bottle { position: absolute; }
.h-bottle .h-front, .h-bottle .h-rock { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.h-bottle.is-front .h-front { opacity: 1; }
.h-bottle.is-front > img:first-child { opacity: 0; transition: opacity .45s ease; }
.h-bottle.rocking .h-rock { opacity: 1; transition: none; }
.h-bottle.rocking .h-rock + .h-rock { opacity: 0; }
.h-bottle.rocking > img:first-child { opacity: 0; transition: none; }

.h-cursor {
  position: fixed; left: 0; top: 0; z-index: 12; pointer-events: none;
  padding: 9px 14px; border-radius: 18px; background: var(--ink); color: var(--paper);
  font: 600 10px/1 'Instrument Sans', sans-serif; letter-spacing: .18em; text-transform: uppercase;
  opacity: 0; transform: translate(-50%, -150%) scale(.8); transition: opacity .3s, transform .4s var(--ease);
}
.h-cursor.on { opacity: 1; transform: translate(-50%, -150%) scale(1); }
@media (pointer: coarse) { .h-cursor { display: none; } }

/* touch: the front bottle says it opens, and a first visit is shown the swipe once */
.h-tap, .h-coach { display: none; }
@media (pointer: coarse) {
  .h-tap, .h-coach {
    display: flex; align-items: center; gap: 8px; position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none;
    font: 600 10px/1 'Instrument Sans', sans-serif; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
    opacity: 0; transition: opacity .35s, transform .5s var(--ease);
  }
  .h-tap { padding: 8px 12px; border-radius: 16px; background: var(--ink); color: var(--paper); transform: translate(-50%, -100%) translateY(6px); }
  .h-tap::after { content: ''; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; margin-left: -4px; background: inherit; transform: rotate(45deg); border-radius: 1px; }
  .h-tap.on { opacity: 1; transform: translate(-50%, -100%); }
  .h-coach { left: auto; right: var(--pad); z-index: 11; gap: 10px; color: var(--ink); transform: translateY(-50%) translateX(8px); }
  .h-coach.on { opacity: 1; transform: translateY(-50%); }
  .h-coach-track { position: relative; width: 46px; height: 1px; background: currentColor; opacity: .45; }
  .h-coach-track i { position: absolute; top: -4px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); animation: h-coach 1.8s var(--ease-io) infinite; }
  @keyframes h-coach { 0% { transform: translateX(37px); opacity: 0 } 15% { opacity: 1 } 70% { transform: translateX(0); opacity: 1 } 100% { transform: translateX(0); opacity: 0 } }
}

/* ── panel ── */
.h-panel {
  position: fixed; z-index: 10; left: var(--pad); bottom: calc(var(--pad) + 46px + env(safe-area-inset-bottom, 0px));
  width: min(360px, 38vw);
}
.h-panel::before {
  content: ''; position: absolute; z-index: -1; inset: -90px -120px -70px -90px; pointer-events: none;
  background: radial-gradient(closest-side, var(--paper) 35%, color-mix(in srgb, var(--paper) 70%, transparent) 62%, transparent);
  filter: blur(8px); transition: background .9s var(--ease-io);
}
.h-wheel::before {
  content: ''; position: absolute; z-index: -1; inset: -60px -60px -40px -80px; pointer-events: none;
  background: radial-gradient(closest-side, var(--paper) 30%, color-mix(in srgb, var(--paper) 65%, transparent) 60%, transparent);
  filter: blur(8px);
}
.h-count { margin: 0 0 12px; font: 500 11px/1 'Instrument Sans', sans-serif; letter-spacing: .22em; color: var(--soft); }
.h-of { margin-left: 6px; }
.h-name { margin: 0; font: italic 400 clamp(38px, 4.4vw, 68px)/1 'Playfair Display', serif; letter-spacing: -.015em; }
.h-note { margin: 16px 0 22px; max-width: 34ch; font-size: 14px; line-height: 1.65; color: var(--soft); text-wrap: pretty; }
.h-cta {
  display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 22px; border-radius: 22px;
  background: var(--ink); color: var(--paper); font: 600 11px/1 'Instrument Sans', sans-serif; letter-spacing: .18em; text-transform: uppercase;
  transition: transform .5s var(--ease), background-color .9s var(--ease-io), color .9s var(--ease-io);
}
.h-cta:hover { transform: translateX(4px); }
.h-ritual { margin: 18px 0 0; font: italic 400 14px/1.4 'Playfair Display', serif; color: var(--soft); min-height: 1.4em; }
.h-panel .reveal { display: block; overflow: hidden; }
.h-panel .reveal > span { display: block; transform: translateY(0); transition: transform .9s var(--ease); }
.h-panel.is-out .reveal > span { transform: translateY(110%); transition: transform .35s var(--ease-io); }
.h-panel.is-out .h-note, .h-panel.is-out .h-ritual { opacity: 0; transition: opacity .3s; }
.h-note, .h-ritual { transition: opacity .9s var(--ease) .15s; }

/* ── wheel tabs (also the accessible list) ── */
.h-wheel {
  position: fixed; z-index: 11; right: var(--pad); bottom: calc(var(--pad) + 46px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 2px; align-items: flex-end;
}
.h-tab {
  display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border: 0; background: none; cursor: pointer;
  color: var(--soft); font: 500 11px/1 'Instrument Sans', sans-serif; letter-spacing: .16em; text-transform: uppercase;
}
.h-tab-no { font-size: 10px; opacity: .7; }
.h-tab-note { display: none; }
.h-tab[aria-selected="true"] { color: var(--ink); }
.h-tab[aria-selected="true"] .h-tab-name::before { content: ''; display: inline-block; width: 18px; height: 1px; background: currentColor; vertical-align: middle; margin: 0 10px 2px 0; }

/* ── footer bar ── */
.h-foot {
  position: fixed; z-index: 10; inset: auto 0 0 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  font: 500 10px/1 'Instrument Sans', sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--soft);
}
.h-foot-link:last-child { justify-self: end; }
.h-foot-link:hover { color: var(--ink); }
.h-hint { display: inline-flex; align-items: center; gap: 10px; }
.h-hint::before { content: ''; width: 1px; height: 18px; background: var(--pigment); animation: h-hint 2.4s var(--ease-io) infinite; transform-origin: top; }
@keyframes h-hint { 0%,100% { transform: scaleY(.2) } 50% { transform: scaleY(1) } }
.h-hint-touch { display: none; }
@media (pointer: coarse) { .h-hint-desk { display: none; } .h-hint-touch { display: inline; } }

/* ── loader: a serif count buried by falling olives, then an olive curtain ── */
.h-loader { position: fixed; inset: 0; z-index: 40; background: var(--paper); overflow: hidden; }
.h-loader.is-done { background: transparent; pointer-events: none; }
.h-loader.is-buried .h-loader-canvas, .h-loader.is-buried .h-loader-count { display: none; }
.h-loader-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.h-loader-count {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 0; white-space: nowrap;
  font: italic 400 clamp(120px, 24vw, 360px)/1 'Playfair Display', serif; letter-spacing: -.04em; color: var(--ink);
  font-variant-numeric: lining-nums; animation: h-count-in .5s cubic-bezier(.165,1,.32,1) both .08s;
}
.h-loader-pct { font-size: .32em; letter-spacing: 0; margin-left: .06em; vertical-align: .9em; color: var(--soft); }
@keyframes h-count-in { from { opacity: 0; transform: translate(-50%, -42%); } }
.h-loader-curtain {
  position: absolute; inset: 0; z-index: 2; background: #556B2F; display: grid; place-items: start center;
  transform: translateY(101%);
}
.h-loader-curtain.in { transform: none; transition: transform .67s cubic-bezier(.215,.61,.355,1); }
.h-loader-curtain.out { transform: translateY(-101%); transition: transform .62s cubic-bezier(.25,.46,.45,.94); }
.h-loader-drop { position: absolute; left: 0; top: 0; z-index: 3; width: 30px; height: 42px; opacity: 0; will-change: transform; pointer-events: none; }
.h-loader-drop path { fill: #C9A23F; } .h-loader-drop .hi { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 2.2; stroke-linecap: round; }
html.h-seen .h-loader { display: none; }

/* ── phones ── */
@media (max-width: 760px) {
  .h-top { grid-template-columns: 1fr auto 1fr; }
  .h-logo { justify-self: center; }
  .h-panel { left: var(--pad); right: var(--pad); width: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .h-name { font-size: clamp(32px, 9vw, 44px); }
  .h-note { margin: 10px 0 14px; font-size: 13px; max-width: none; }
  .h-ritual { display: none; }
  .h-wheel { left: 0; right: 0; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); flex-direction: row; justify-content: center; gap: 6px; }
  .h-tab { width: 34px; height: 30px; justify-content: center; padding: 0; }
  .h-tab-name { display: none; }
  .h-tab-no { font-size: 10px; }
  .h-tab[aria-selected="true"] { border-bottom: 1px solid var(--ink); }
  .h-foot .h-hint { display: none; }
  .h-wheel::before { display: none; }
  .h-foot { display: flex; justify-content: space-between; }
  .h-panel { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .h-cta { height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
