/*!
 * TeaLabs — The Island (header, droplet, scroll level, section announce, mobile sheet).
 * Depends on the shared tokens in styles.css :root (curves, durations, --island*, --liquid*, --z-*).
 * Geometry: the island box never changes size. Its visible shape is a clip-path on two pseudo
 * layers of .island__bg (::after = 1px hairline ring, ::before = obsidian core), so every state
 * change (top -> compact -> announce) is a clip morph + translates: no layout animation.
 */
:root {
  --island-h-top: 76px;   /* desktop top state (also read by hero.css) */
  --island-h: 56px;       /* compact / mobile */
  --island-ext: 30px;     /* announce extension below the row */
}
html { scroll-padding-top: calc(var(--island-h) + 28px); }

/* ------------------------------------------------------------ shell */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: max(12px, env(safe-area-inset-top));
  z-index: var(--z-header);
  height: auto;
  pointer-events: none;
  background: none;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.site-header.is-scrolled { background: none; box-shadow: none; }
.site-header::after, .motion-ok .site-header::after { content: none; animation: none; }

.island {
  --ir: 22px;            /* visible radius */
  --cb: var(--island-ext); /* bottom clip of the bg layers (hides the announce extension) */
  --cy: 0px;             /* vertical offset of the row content */
  --cell: 66px;          /* logo cell (used by the no-intro "pill expands" entrance) */
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  max-width: calc(100vw - 2 * var(--gutter));
  height: var(--island-h-top);
  margin-inline: auto;
  padding-inline: 18px 12px;
  color: var(--island-ink);
  pointer-events: none;
  view-transition-name: tl-island;
}
.island > :is(.brand, .nav, .lang, .island__cta, .burger) { position: relative; z-index: 1; pointer-events: auto; }

/* Background: wrapper carries the shadow (drop-shadow follows the clipped shape); the
   pseudo layers carry the shape. The wrapper box equals the top-state island (intro curtain target). */
.island__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter: drop-shadow(0 16px 20px rgba(13, 27, 33, .26));
}
.island__bg::before, .island__bg::after {
  content: "";
  position: absolute;
  inset: 0 0 calc(-1 * var(--island-ext)) 0;
}
.island__bg::after { background: var(--island-line); clip-path: inset(0 0 var(--cb) 0 round var(--ir)); }
.island__bg::before {
  z-index: 1;
  background: var(--island);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  clip-path: inset(1px 1px calc(var(--cb) + 1px) 1px round calc(var(--ir) - 1px));
}

/* ------------------------------------------------------------ brand (stacked logo) */
.island .brand {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 0;
  color: var(--steam);
  border-radius: 10px;
}
.brand__logo {
  display: block;
  width: 38.14px;           /* 52 * 512 / 698 */
  height: 52px;
  fill: currentColor;
  overflow: visible;
  transform-origin: 0 50%;
}
[dir="rtl"] .brand__logo { transform-origin: 100% 50%; }
/* Steam wisps of every <use href="#logo-full">: driven by custom properties that nav.js sets on
   the header logo only (inherits into the use-tree). Origin = base of the wisps. */
.lg-w {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: translateY(var(--wy, 0px)) skewX(var(--wk, 0deg));
  opacity: var(--wo, 1);
}
/* Logo is hidden while the intro flies its own copy into this box (C2). */
html.intro-active .brand__logo, .intro-root.is-running ~ * .brand__logo { opacity: 0; }

/* ------------------------------------------------------------ desktop links */
.nav { display: none; }
.nav__list { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.island .nav__a {   /* .island prefix outranks the legacy `.nav__list a` rules */
  position: relative;
  display: block;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--island-ink);
  transition: color var(--dur-1) var(--ease), transform var(--dur-press) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.island .nav__a:active { transform: scale(.97); }
.island .nav__a::after { content: none; }
.island .nav__list .nav__a, .island .nav__list .nav__a:hover { background: transparent; }
.island .nav__list .nav__a { color: var(--island-ink); }   /* also neutralises legacy .is-active ink */
.nav__idx {
  position: absolute;
  bottom: calc(100% - 3px);
  inset-inline-start: 14px;
  font: 500 10px/1 var(--mono);
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .38);
  pointer-events: none;
}
/* Liquid droplet: a copy of the list styled "active", clipped to a pill by nav.js. */
.nav__list--drop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--liquid);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  clip-path: inset(50% 50% 50% 50% round 999px);
  opacity: 0;
  pointer-events: none;
}
.island .nav__list--drop .nav__a { color: #fff; }
.nav__list--drop .nav__idx { visibility: hidden; }
/* Hover bead (fine pointers): a translucent pill behind the labels, steered by clip-path. */
.nav__bead {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  clip-path: inset(50% 50% 50% 50% round 999px);
  opacity: 0;
  pointer-events: none;
  transition: clip-path var(--dur-1) var(--ease), opacity 150ms var(--ease);
}
.nav__bead.is-on { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .nav__list:not(.nav__list--drop) .nav__a:hover { color: var(--island-ink-hi); }
}

/* Focus: always visible, drawn above the droplet. */
.island :is(.brand, .nav__a, .lang a, .island__cta, .burger):focus-visible,
.drawer__panel :is(a, button):focus-visible {
  outline: 2px solid #5b97a6;
  outline-offset: 3px;
  z-index: 3;
}
.nav__a[aria-current]:focus-visible { color: #fff; }

/* ------------------------------------------------------------ section status */
.island__status {
  position: absolute;
  top: var(--island-h);
  inset-inline: 22px;
  height: var(--island-ext);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  overflow: hidden;
  font: 500 12px/1 var(--mono);
  letter-spacing: .02em;
  white-space: nowrap;
  color: var(--island-ink);
  opacity: 0;
  pointer-events: none;
}
.island__status > * { display: inline-block; transform: translateY(110%); }
.st__idx { font-weight: 500; color: #8fc3cf; direction: ltr; unicode-bidi: isolate; }
.st__lbl:not(:empty)::before { content: "·"; margin-inline-end: .5em; color: rgba(255, 255, 255, .3); }
.island.is-announce { --cb: 0px; }
.island.is-announce .island__status { opacity: 1; }
.island.is-announce .island__status > * { transform: none; }

/* ------------------------------------------------------------ scroll level */
.island__level {
  position: absolute;
  top: calc(var(--island-h-top) - 2px);
  inset-inline: 24px;
  height: 1px;
  background: rgba(255, 255, 255, .08);
  clip-path: inset(-3px 0);
  transform-origin: 0 50%;
  pointer-events: none;
}
[dir="rtl"] .island__level { transform-origin: 100% 50%; }
.island__level-fill {
  position: absolute;
  inset: 0;
  background: var(--liquid);
  transform: translateX(calc(-100% * var(--dir, 1)));
}
.island__level-fill::after {   /* the bead at the liquid's leading edge */
  content: "";
  position: absolute;
  top: -2px;
  inset-inline-end: -2.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--liquid-top);
  box-shadow: 0 0 6px rgba(91, 151, 166, .7);
}
@supports (animation-timeline: scroll()) {
  .island__level-fill { animation: tl-level linear both; animation-timeline: scroll(root block); }
  .island__level-fill.is-mapped { animation: none; }   /* desktop: nav.js maps the line to the links */
  @keyframes tl-level { to { transform: none; } }
}

/* ------------------------------------------------------------ language vial */
.lang--vial {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 72px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--island-line);
  border-radius: 999px;
  background: transparent;
  isolation: isolate;
  flex: none;
}
.lang--vial a {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;   /* the chamber is the tap target; overrides the global 44px .lang a rule */
  padding: 0;
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
  color: var(--island-ink);
  font: 500 11px/1 var(--mono);
  letter-spacing: .04em;
  text-box: trim-both cap alphabetic;   /* optical centring of the caps in the chamber */
}
.lang--vial a[aria-current] { background: transparent; color: #fff; }
.lang__liquid {   /* default: right chamber (true for both shipped pages); flipped below */
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 999px;
  background: var(--liquid);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  clip-path: inset(3px 3px 3px calc(50% + 1px) round 999px);
  pointer-events: none;
}
:is([dir="ltr"] .lang--vial:has(> a:first-child[aria-current]),
    [dir="rtl"] .lang--vial:has(> a:nth-child(2)[aria-current])) .lang__liquid {
  clip-path: inset(3px calc(50% + 1px) 3px 3px round 999px);
}
.lang--vial a:not([aria-current])::after {   /* meniscus that rises on hover */
  content: "";
  position: absolute;
  inset-inline: 7px;
  bottom: 5px;
  height: 3px;
  border-radius: 3px;
  background: rgba(46, 107, 124, .35);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 180ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .lang--vial a:not([aria-current]):hover { color: var(--island-ink-hi); }
  .lang--vial a:not([aria-current]):hover::after { transform: none; }
}

/* ------------------------------------------------------------ CTA */
.island__cta { height: 40px; padding-inline: 16px; border-radius: 999px; overflow: hidden; display: none; }
.island__cta::after {   /* meniscus shine: a wave-topped strip of light that sweeps up once per hover */
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 70%;
  background: linear-gradient(rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
  -webkit-mask: var(--wave) 0 0 / 48px 6px repeat-x, linear-gradient(#000 0 0) 0 5px / 100% 100% no-repeat;
  mask: var(--wave) 0 0 / 48px 6px repeat-x, linear-gradient(#000 0 0) 0 5px / 100% 100% no-repeat;
  transform: translateY(160%);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .motion-ok .island__cta:hover::after { animation: tl-shine 600ms var(--ease) both; }
}
@keyframes tl-shine { from { transform: translateY(160%); } to { transform: translateY(-160%); } }

/* ------------------------------------------------------------ burger */
.island .burger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--steam);
  flex: none;
}
.burger__svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; overflow: visible; }
.burger__svg path { transform-origin: 12px 12px; }
.burger__svg .b1w { opacity: 0; }
.burger[aria-expanded="true"] .b1 { opacity: 0; }
.burger[aria-expanded="true"] .b1w { opacity: 1; }
.burger[aria-expanded="true"] :is(.b1, .b1w) { transform: rotate(45deg) translateY(3px); }
.burger[aria-expanded="true"] .b2 { transform: rotate(-45deg) translateY(-3px); }
.motion-ok .burger__svg path { transition: opacity 120ms var(--ease), transform 260ms var(--ease); }
.motion-ok .burger[aria-expanded="true"] .burger__svg path { transition-delay: 0s, 120ms; }

/* ------------------------------------------------------------ desktop (>= 1024) */
@media (min-width: 1024px) {
  .nav { display: block; position: relative; isolation: isolate; }
  .island__cta { display: inline-flex; }
  .island .burger { display: none; }
  .island > .lang { margin-inline-start: auto; }

  /* COMPACT: the visible shape loses 20px at the bottom, content rides up 10px to stay centred. */
  .island[data-state="compact"] { --ir: 28px; --cb: calc(var(--island-ext) + 20px); --cy: -10px; }
  .island[data-state="compact"].is-announce { --cb: 20px; }
  .island > :is(.nav, .lang, .island__cta) { translate: 0 var(--cy); }
  .island__level { translate: 0 calc(var(--cy) * 2); }
  .island[data-state="compact"] .brand__logo { transform: translateY(var(--cy)) scale(.74); }
  .island[data-state="compact"] .nav__idx { opacity: 0; transform: translateY(-6px); }
  .island__status { top: calc(var(--island-h-top) - 20px); }
}

/* ------------------------------------------------------------ mobile (< 1024): always compact */
@media (max-width: 1023.98px) {
  .island {
    --ir: 28px;
    --cell: 52px;
    width: calc(100vw - 2 * var(--gutter));
    height: var(--island-h);
    gap: 10px;
    padding-inline: 18px 6px;
  }
  .brand__logo { width: 27.88px; height: 38px; }
  .island__status {   /* the current-section label lives inside the row */
    position: relative;
    top: auto;
    inset-inline: auto;
    flex: 1;
    min-width: 0;
    height: 20px;
    justify-content: flex-start;
    opacity: 1;
  }
  .island__status > * { transform: none; }
  .island__level { top: calc(var(--island-h) - 2px); }
  .lang--vial { width: 64px; height: 30px; }
}

/* ------------------------------------------------------------ motion: state morphs */
.motion-ok .island__bg::before, .motion-ok .island__bg::after { transition: clip-path var(--dur-morph) var(--ease-drawer); }
.motion-ok .island > :is(.nav, .lang, .island__cta),
.motion-ok .island__level { transition: translate var(--dur-morph) var(--ease-drawer); }
.motion-ok .brand__logo { transition: transform var(--dur-morph) var(--ease-drawer); }
.motion-ok .nav__idx { transition: opacity var(--dur-2) var(--ease), transform var(--dur-morph) var(--ease-drawer); }
/* announce: grows 420ms, the label rolls in +120ms; retracts 280ms (gravity). */
.motion-ok .island.is-announce .island__bg::before,
.motion-ok .island.is-announce .island__bg::after { transition-duration: 420ms; }
.motion-ok .island:not(.is-announce) .island__bg::before,
.motion-ok .island:not(.is-announce) .island__bg::after { transition-timing-function: var(--ease-drawer); }
.motion-ok .island.is-leaving .island__bg::before,
.motion-ok .island.is-leaving .island__bg::after { transition: clip-path 280ms var(--ease-drain); }
@media (min-width: 1024px) {
  .motion-ok .island__status { transition: opacity 160ms var(--ease); }
  .motion-ok .island__status > * { transition: transform 200ms var(--ease-drain); }
  .motion-ok .island.is-announce .island__status { transition-delay: 120ms; }
  .motion-ok .island.is-announce .island__status > * { transition: transform var(--dur-2) var(--ease) 120ms; }
}
/* reduced motion: state changes are short crossfades only */
html:not(.motion-ok) .nav__idx { transition: opacity 150ms linear; }

/* ------------------------------------------------------------ entrance (C2) */
/* With the intro the items wait (hidden under the overlay) and stagger in at intro-done + 450ms.
   Without it the island opens from a logo-only pill (700ms) while items stagger from +200ms. */
.island .nav__list:not(.nav__list--drop) > li:nth-child(2) { --i: 1; }
.island .nav__list:not(.nav__list--drop) > li:nth-child(3) { --i: 2; }
.island .nav__list:not(.nav__list--drop) > li:nth-child(4) { --i: 3; }
.island .nav__list:not(.nav__list--drop) > li:nth-child(5) { --i: 4; }
.island > .island__status { --i: 1; }
.island > .lang { --i: 5; }
.island > .island__cta { --i: 6; }
.island > .burger { --i: 7; }
@media (max-width: 1023.98px) { .island > .lang { --i: 2; } .island > .burger { --i: 3; } }

html.intro-active .island :is(.nav__list:not(.nav__list--drop) > li, .lang, .island__cta, .burger, .island__status, .island__level) { opacity: 0; }

html.intro-done.motion-ok:not(.lang-arrive):not(.lang-arrived) .island {
  --t0: 200ms;
}
html.intro-done.motion-ok:not(.lang-arrive):not(.lang-arrived) .island.is-from-intro { --t0: 450ms; }
html.intro-done.motion-ok:not(.lang-arrive):not(.lang-arrived) .island :is(.nav__list:not(.nav__list--drop) > li, .island > .lang, .island > .island__cta, .island > .burger) {
  animation: tl-item-in 360ms var(--ease) backwards;
  animation-delay: calc(var(--t0) + var(--i, 0) * 40ms);
}
@media (max-width: 1023.98px) {
  html.intro-done.motion-ok:not(.lang-arrive):not(.lang-arrived) .island > .island__status {
    animation: tl-item-in 360ms var(--ease) backwards;
    animation-delay: calc(var(--t0) + var(--i, 0) * 40ms);
  }
}
html.intro-done.motion-ok:not(.lang-arrive):not(.lang-arrived) .island__level {
  animation: tl-level-draw 500ms var(--ease-in-out) backwards;
  animation-delay: calc(var(--t0) + 300ms);
}
html.intro-done.motion-ok:not(.lang-arrive):not(.lang-arrived) .island:not(.is-from-intro) .island__bg::after {
  animation: tl-open-ring 700ms var(--ease-drawer) backwards;
}
html.intro-done.motion-ok:not(.lang-arrive):not(.lang-arrived) .island:not(.is-from-intro) .island__bg::before {
  animation: tl-open-core 700ms var(--ease-drawer) backwards;
}
.island { --open-r: calc(100% - var(--cell)); --open-l: 0px; }
[dir="rtl"] .island { --open-r: 0px; --open-l: calc(100% - var(--cell)); }
@keyframes tl-open-ring { from { clip-path: inset(0 var(--open-r) var(--island-ext) var(--open-l) round 22px); } }
@keyframes tl-open-core { from { clip-path: inset(1px calc(var(--open-r) + 1px) calc(var(--island-ext) + 1px) calc(var(--open-l) + 1px) round 21px); } }
@keyframes tl-item-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes tl-level-draw { from { transform: scaleX(0); } }

/* ------------------------------------------------------------ mobile sheet (#drawer) */
.drawer { z-index: var(--z-drawer); transition: visibility 0s linear 320ms; }   /* hidden the moment the sheet lands on the island */
.drawer__backdrop { background: rgba(11, 13, 16, .4); }
.drawer__panel {
  inset: 0;
  width: auto;
  padding: 18px 28px max(28px, calc(env(safe-area-inset-bottom) + 20px));
  border: 0;
  background: var(--island);
  color: var(--steam);
  transform: none;
  clip-path: var(--sheet-from, inset(12px 16px calc(100% - 68px) 16px round 28px));
  transition: clip-path 320ms var(--ease-drain);
}
.drawer.is-open .drawer__panel {
  transform: none;
  clip-path: inset(8px 8px max(8px, env(safe-area-inset-bottom)) 8px round 28px);
  transition: clip-path var(--dur-morph) var(--ease-drawer);
}
html:not(.motion-ok) .drawer__panel {
  clip-path: inset(8px 8px max(8px, env(safe-area-inset-bottom)) 8px round 28px);
  opacity: 0;
  transition: opacity 200ms linear;
}
html:not(.motion-ok) .drawer.is-open .drawer__panel { opacity: 1; }
.drawer__top { min-height: 72px; border-bottom: 1px solid var(--island-line); padding-inline: 2px; }
.drawer__logo { display: block; width: 41.07px; height: 56px; fill: var(--steam); }
.drawer .icon-btn { border-color: var(--island-line); background: transparent; color: var(--steam); border-radius: 22px; }
.drawer__links li { border-bottom: 1px solid var(--island-line); }
.drawer__links a {
  min-height: 76px;
  gap: 18px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--steam);
  transition: transform var(--dur-press) var(--ease);
}
.drawer__links a:active { transform: scale(.98); }
.drawer__links a.is-active { color: var(--steam); }
.drawer__links a .dir-arrow { color: var(--island-ink); }
.drawer__num {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  border-radius: 999px;
  font-size: 12px;
  color: #8fc3cf;
}
.drawer__links a[aria-current] .drawer__num { background: var(--liquid); color: #fff; }
.drawer__links a[aria-current] .dir-arrow { color: #8fc3cf; }
.drawer__foot { justify-items: stretch; }
.drawer__note { color: var(--island-ink); }
.drawer .lang--vial.lang--lg { width: 120px; height: 44px; justify-self: start; }
.drawer .lang--vial.lang--lg a { font-size: 13px; min-width: 0; padding: 0; }
/* Cascade: rows rise in after the sheet has mostly opened; they vanish without stagger on close. */
.motion-ok .drawer__links li, .motion-ok .drawer__foot {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 120ms var(--ease), transform 120ms var(--ease);
}
.motion-ok .drawer.is-open :is(.drawer__links li, .drawer__foot) {
  opacity: 1;
  transform: none;
  transition-duration: 360ms;
  transition-delay: calc(180ms + var(--i, 0) * 40ms);
}

/* ------------------------------------------------------------ footer + legal page */
.footer__logo { display: block; width: 52.8px; height: 72px; fill: currentColor; color: var(--ink); }
.legal-header .island { width: max-content; }
.legal-header .island > .lang { margin-inline-start: 0; }
.legal-header ~ main.legal { padding-top: calc(var(--island-h-top) + 12px + clamp(40px, 6vw, 72px)); }

@media print { .site-header { display: none !important; } }
