/* Liquid Tabs — a glass lens on a smoked-glass bar; the chosen icon comes alive */
/* 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: 344px;
  --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");
}
.frame {                              /* the phone-shaped composition: 432 × 768, scaled to the screen */
  position: relative; width: 432px; height: 768px; flex: none;
  display: grid; place-items: center;
  transform: scale(var(--k, 1));
}
.title { position: absolute; top: 88px; left: 0; right: 0; text-align: center; }
.series {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 0 0 18px; font-size: 10.5px; font-weight: 700; letter-spacing: .38em; text-transform: uppercase; color: var(--dim);
}
.series b {
  display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 7px 0 8px; margin-left: -4px;
  border-radius: 999px; font-size: 10px; letter-spacing: .08em; color: #1B1514;
  background: linear-gradient(180deg, #FFB48C, var(--accent));
  box-shadow: 0 0 18px rgba(255, 107, 53, .45);
}
.title h1 { margin: 0; font-size: 62px; font-weight: 800; line-height: .9; letter-spacing: -.05em; }
.title h1 .word {
  background: linear-gradient(180deg, #FFFFFF 20%, #CFC7BE 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title h1 em {
  font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 1.08em; letter-spacing: -.02em;
  color: var(--accent); text-shadow: 0 0 28px rgba(255, 107, 53, .45);
}
.hint { margin: 16px 0 0; font-size: 13px; font-weight: 500; letter-spacing: .02em; color: rgba(244, 241, 236, .55); }

/* ---- the frame's footer ---- */
.tutorial {
  position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); margin: 0;
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  padding: 10px 18px 10px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: -.005em; color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 24px -12px rgba(0, 0, 0, .8);
}
.tutorial svg { width: 22px; height: 22px; padding: 5px; border-radius: 50%; fill: #1B1514; background: linear-gradient(180deg, #FFB48C, var(--accent)); }
.tutorial span { font-weight: 500; color: var(--dim); }
.credits {
  position: absolute; left: 28px; right: 24px; bottom: 34px;
  display: flex; align-items: center; justify-content: space-between;
}
.stack { margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: rgba(244, 241, 236, .62); }
.stack i { font-style: normal; color: var(--accent); margin: 0 3px; }
.logo { margin: 0; display: flex; align-items: center; gap: 7px; }
.logo .avatar { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1.2px rgba(255, 255, 255, .8), 0 4px 12px -5px rgba(0, 0, 0, .8); }
.logo .lockup { height: 24px; width: auto; opacity: .95; }

/* ---- 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);
}
.icon { width: 25px; height: 25px; overflow: visible; }
.icon .line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon .line .dot, .icon .line .sun { fill: currentColor; stroke: none; }
.icon .fill { fill: url(#accent-fill); stroke: none; opacity: 0; }
.icon .fill .cut { fill: #1B1514; }
.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 span { font: 700 10px/1 var(--sans); letter-spacing: .02em; white-space: nowrap; }
.ghost i { display: inline-block; font-style: normal; }

/* ---- the chosen one comes alive ---- */
.ghost.is-on { color: #FFD7C2; }
.ghost.is-on .icon { animation: pop .62s cubic-bezier(.28, 1.6, .5, 1) both; }
.ghost.is-on .icon .fill { opacity: 1; animation: pour .55s cubic-bezier(.3, .8, .3, 1) both; }
.ghost.is-on .icon .line { stroke: #FFB48C; }
.ghost.is-on i { animation: rise .5s cubic-bezier(.25, 1.4, .5, 1) both; animation-delay: calc(.12s + var(--k) * 32ms); }
@keyframes pop  { 0% { transform: scale(.72); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes pour { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(7px) scale(.8); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }

/* each icon's own move */
.icon g, .icon circle, .icon path { transform-box: fill-box; transform-origin: center; }
.ghost.is-on .icon-home { transform-origin: 50% 90%; animation: squash .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes squash { 0% { transform: scale(.8, .8); } 30% { transform: scale(1.22, .78); } 60% { transform: scale(.92, 1.12); } 100% { transform: scale(1); } }
.ghost.is-on .icon-profile .head { animation: nod .7s .12s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes nod { 0% { transform: translateY(2.5px); } 45% { transform: translateY(-2px); } 100% { transform: none; } }
.ghost.is-on .icon-messages .dot { animation: type .42s ease-in-out 2 both; }
.ghost.is-on .icon-messages .dot:nth-child(2) { animation-delay: .1s; }
.ghost.is-on .icon-messages .dot:nth-child(3) { animation-delay: .2s; }
@keyframes type { 0%, 100% { transform: none; } 50% { transform: translateY(-2.2px); } }
.ghost.is-on .icon-photos .sun { animation: sunrise .8s .15s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes sunrise { from { transform: translateY(4px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.ghost.is-on .icon-settings .gear { animation: turn .9s cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes turn { from { transform: rotate(-90deg); } to { transform: rotate(0deg); } }

/* ---- 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; }
  .ghost.is-on .icon, .ghost.is-on .icon *, .ghost.is-on i { animation: none !important; }
}
