/* Liquid Tabs — step 5: the glass lens follows the finger, stretches, settles on a spring and magnifies */
/* the icons under the lens fade out (app.js) and the lens shows its own magnified copy, so nothing is doubled */
:root {
  --stage: #0C0D10;
  --ink: #F4F1EC;
  --dim: #8B8F99;
  --accent: #FF6B35;
  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --bar-w: min(344px, 86vw);
  --bar-h: 76px;
  --pad: 7px;
  --tabs: 5;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--stage);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  overflow: hidden;
}

/* ---- the stage ---- */
.stage {
  position: relative; height: 100dvh; display: grid; place-items: center;
  background:
    radial-gradient(60% 34% at 50% 54%, rgba(255, 107, 53, .15), transparent 70%),
    radial-gradient(90% 60% at 50% 0%, #1A1C22 0%, transparent 70%),
    var(--stage);
}
.stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
.title { position: absolute; top: 12dvh; left: 0; right: 0; text-align: center; }
.series { margin: 0 0 14px; font-size: 11px; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--dim); }
.series b { color: var(--accent); font-weight: 800; }
.title h1 { margin: 0; font-size: clamp(44px, 14vw, 60px); font-weight: 800; line-height: .9; letter-spacing: -.045em; }
.title h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.02em; color: var(--accent); }

/* ---- the tab bar: smoked glass, icons centred ---- */
.tabbar {
  position: relative; touch-action: none;
  width: var(--bar-w); height: var(--bar-h);
  display: grid; grid-template-columns: repeat(var(--tabs), 1fr);
  padding: var(--pad); border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .03));
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    inset 0 -1px 0 rgba(0, 0, 0, .35),
    0 30px 60px -20px rgba(0, 0, 0, .8),
    0 12px 24px -12px rgba(0, 0, 0, .6);
}
.tab {
  display: grid; place-items: center; position: relative; z-index: 1;
  min-width: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--dim);
}
.tab svg, .ghost svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }   /* read by screen readers, not shown */
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -6px; border-radius: 999px; }

/* ---- the lens: clear, thick glass. The middle is almost invisible; the rim is where glass shows ---- */
.lens {
  position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none;
  border-radius: 999px; overflow: hidden;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 0) 58%, rgba(255, 255, 255, .07) 80%, rgba(255, 255, 255, .22) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02) 45%, rgba(255, 107, 53, .10));
  -webkit-backdrop-filter: brightness(1.12) saturate(1.5);
  backdrop-filter: brightness(1.12) saturate(1.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .30),
    inset 0 2px 5px rgba(255, 255, 255, .30),
    inset 0 -3px 8px rgba(255, 107, 53, .22),
    0 12px 28px -10px rgba(255, 107, 53, .45),
    0 6px 14px -8px rgba(0, 0, 0, .7);
  will-change: transform, width, height;
}
.lens::before {                         /* a thin bright arc along the top rim */
  content: ''; position: absolute; inset: 2px 12% auto; height: 44%;
  border-radius: 999px 999px 40% 40% / 999px 999px 30% 30%;
  border-top: 1.5px solid rgba(255, 255, 255, .75);
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%);
  z-index: 1;
}
.lens::after {                          /* a small hot glint */
  content: ''; position: absolute; top: 12%; left: 24%; width: 16%; height: 10%;
  border-radius: 999px; background: rgba(255, 255, 255, .85); filter: blur(1.5px); z-index: 1;
}
.lens-view {                            /* a copy of the whole bar, laid out exactly like it, then magnified */
  position: absolute; top: 0; left: 0;
  display: grid; grid-template-columns: repeat(var(--tabs), 1fr);
  padding: var(--pad);
  will-change: transform;
}
.ghost { display: grid; justify-items: center; align-content: center; gap: 4px; color: var(--ink); }
.ghost svg { transform: translateY(-1px); }
.ghost span { font: 700 10px/1 var(--sans); letter-spacing: .02em; }

/* ---- the touch circle: where the finger is, only while it is down ---- */
.touch {
  position: fixed; top: 0; left: 0; z-index: 10; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  border: 1.5px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .14);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .06);
  transition: opacity .12s;
}
.touch.is-on { opacity: 1; }

@media (prefers-reduced-motion: reduce) { .touch { transition: none; } }
