/* Live Ada notch replica (same geometry as the app: 150x30 collapsed,
   420x140 expanded, concave top "ears", springy resize). */
.ada {
  --w: 230px;
  --h: 30px;
  --r: 14px;
  --ear: 10px;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  font-family: "Segoe UI Variable Text", "Segoe UI", "Plus Jakarta Sans", sans-serif;
  color: #fff;
  user-select: none;
}
.ada[data-state="collapsed"] { --w: 230px; --h: 30px; --r: 14px; --ear: 10px; }
.ada[data-state="mascot"] { --w: 150px; --h: 30px; --r: 14px; --ear: 10px; }
.ada[data-state="peek"] { --w: 360px; --h: 64px; --r: 22px; --ear: 15px; }
.ada[data-state="expanded"] { --w: 420px; --h: 140px; --r: 32px; --ear: 22px; }

.ada-body {
  position: relative;
  width: var(--w);
  height: var(--h);
  background: #000;
  border-radius: 0 0 var(--r) var(--r);
  transition:
    width 0.62s cubic-bezier(0.34, 1.42, 0.52, 1),
    height 0.62s cubic-bezier(0.34, 1.42, 0.52, 1),
    border-radius 0.5s ease;
  box-shadow: 0 10px 40px -10px rgba(227, 10, 23, 0.35);
}
/* Concave ears: a square minus a quarter circle, flush with the top edge. */
.ada-body::before,
.ada-body::after {
  content: "";
  position: absolute;
  top: 0;
  width: var(--ear);
  height: var(--ear);
  transition: width 0.5s, height 0.5s;
}
.ada-body::before { right: 100%; background: radial-gradient(circle at 0 100%, transparent calc(var(--ear) - 0.5px), #000 var(--ear)); }
.ada-body::after { left: 100%; background: radial-gradient(circle at 100% 100%, transparent calc(var(--ear) - 0.5px), #000 var(--ear)); }

.ada-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow: hidden;
  border-radius: inherit;
}
.ada[data-state="collapsed"] .ada-collapsed,
.ada[data-state="peek"] .ada-peek,
.ada[data-state="mascot"] .ada-mascot,
.ada[data-state="expanded"] .ada-panel { opacity: 1; pointer-events: auto; transition-delay: 0.18s; }

/* ---- collapsed: live activity (music) ---- */
.ada-collapsed { display: flex; align-items: center; gap: 10px; padding: 0 14px 0 10px; }
.ada-art { width: 20px; height: 20px; flex: none; border-radius: 5px; background: radial-gradient(circle at 30% 25%, #ffd36a, transparent 50%), linear-gradient(135deg, #ff3b3b, #7a0612); }
.ada-song { flex: 1; min-width: 0; font-size: 11px; color: rgba(255, 255, 255, 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ada-bars { display: flex; gap: 2.5px; align-items: center; height: 14px; }
.ada-bars i { width: 2.5px; height: 30%; border-radius: 2px; background: #fff; animation: ada-eq 0.9s ease-in-out infinite; }
.ada-bars i:nth-child(2) { animation-delay: -0.25s; }
.ada-bars i:nth-child(3) { animation-delay: -0.5s; }
.ada-bars i:nth-child(4) { animation-delay: -0.12s; }
@keyframes ada-eq { 50% { height: 100%; } }

/* ---- peek ---- */
.ada-peek { display: flex; align-items: center; gap: 12px; padding: 6px 18px 0 16px; }
.ada-bubble { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 59, 59, 0.2); overflow: visible; }
.ada-bubble img { width: 26px; height: 26px; display: block; transform-origin: 70% 80%; animation: ada-peek-wave 1.6s ease-in-out 2; }
@keyframes ada-peek-wave { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-16deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-10deg); } 80% { transform: rotate(6deg); } }
.ada-peek b { display: block; font-size: 13.5px; }
.ada-peek b + span { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- expanded panel ---- */
.ada-panel { font-size: 12px; }
.ada-head { position: absolute; left: 0; right: 0; top: 0; height: 30px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ada-title { position: absolute; left: 14px; font-weight: 700; font-size: 14.5px; }
.ada-date { color: #fff; font-size: 12.5px; }
.ada-clock { font-weight: 700; font-size: 13.5px; }
.ada-ring { width: 15px; height: 15px; }
.ada-viewport { position: absolute; left: 38px; right: 38px; top: 32px; height: 88px; overflow: hidden; }
.ada-track { display: flex; height: 100%; transition: transform 0.55s cubic-bezier(0.34, 1.2, 0.5, 1); }
.ada-page { flex: 0 0 100%; height: 100%; position: relative; }
.ada-arrow {
  position: absolute;
  top: 67px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: 10px/18px sans-serif;
  padding: 0;
  cursor: pointer;
}
.ada-arrow:hover { background: rgba(255, 255, 255, 0.24); }
.ada-prev { left: 9px; }
.ada-next { right: 9px; }
.ada-dots { position: absolute; bottom: 7px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.ada-dots button { width: 5px; height: 5px; padding: 0; border: 0; border-radius: 3px; background: rgba(255, 255, 255, 0.38); cursor: pointer; transition: width 0.3s, background 0.3s; }
.ada-dots button.on { width: 14px; background: #fff; }

/* pages */
.pg-media { display: flex; gap: 14px; align-items: center; }
.pg-media .cover { width: 64px; height: 64px; flex: none; border-radius: 12px; background: radial-gradient(circle at 30% 25%, #ffd36a, transparent 45%), linear-gradient(135deg, #ff3b3b, #7a0612); }
.pg-media .info { flex: 1; min-width: 0; }
.pg-media b { display: block; font-size: 14px; }
.pg-media .artist { color: rgba(255, 255, 255, 0.62); font-size: 12px; }
.pg-media .bar { height: 3px; margin: 9px 0 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.pg-media .bar i { display: block; height: 100%; width: 35%; background: #fff; border-radius: 2px; transition: width 1s linear; }
.pg-media .ctrls { display: flex; gap: 22px; justify-content: center; font-size: 13px; }
.pg-ring { display: flex; align-items: center; gap: 18px; height: 100%; }
.pg-ring .big { position: relative; width: 70px; height: 70px; flex: none; }
.pg-ring .big svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pg-ring .big b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; }
.pg-ring .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pg-ring .pills span { padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); font-size: 12px; }
.pg-ring .note { margin-top: 8px; font-size: 11px; color: rgba(255, 255, 255, 0.5); }
.pg-weather { display: flex; align-items: center; gap: 16px; height: 100%; }
.pg-weather .now { display: flex; align-items: center; gap: 6px; }
.pg-weather .emoji { font-size: 30px; }
.pg-weather .temp { font-size: 28px; font-weight: 700; }
.pg-weather .cond { font-size: 11px; color: rgba(255, 255, 255, 0.62); }
.pg-weather .hours { flex: 1; display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); text-align: center; font-size: 11px; }
.pg-weather .hours span { display: block; color: rgba(255, 255, 255, 0.62); }
.pg-system { display: flex; align-items: center; gap: 14px; height: 100%; }
.pg-system .gauge { position: relative; width: 56px; height: 56px; flex: none; text-align: center; }
.pg-system .gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pg-system .gauge b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; }
.pg-system .spark { flex: 1; height: 64px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); padding: 6px 8px; }
.pg-system .spark svg { width: 100%; height: 100%; }
.ring-track { fill: none; stroke-width: 5; }
.ring-value { fill: none; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }

/* ---- mascot ---- */
.ada-mascot { border-radius: 0 0 var(--r) var(--r); }
.ada-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ff5459, #c8102e);
  opacity: 0;
  transition: opacity 0.6s;
  animation: ada-shimmer 4s ease-in-out infinite alternate;
  background-size: 160% 100%;
}
.ada-glow::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 100%); }
@keyframes ada-shimmer { to { background-position: 100% 0; } }
.ada-hello {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 600 21px/1 "Caveat", "Segoe Script", cursive;
  color: #fff;
  clip-path: inset(0 100% 0 0);
  opacity: 0;
}
.ada-eyes { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 13px; opacity: 0; transition: opacity 0.4s; padding-top: 2px; }
.ada-eye {
  width: 8px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px rgba(255, 220, 220, 0.7);
  transition: transform 0.35s cubic-bezier(0.34, 1.5, 0.6, 1), height 0.25s, border-radius 0.25s;
}
.ada-hand {
  position: absolute;
  top: 6px;
  left: calc(50% + 19px);
  width: 18px;
  height: 18px;
  background: url("assets/hand.png") center / contain no-repeat;
  transform-origin: 30% 85%;
  transform: scale(0);
}

/* mascot phases (set on .ada as data-phase) */
.ada[data-phase="greeting"] .ada-glow,
.ada[data-phase="looking"] .ada-glow,
.ada[data-phase="sleeping"] .ada-glow,
.ada[data-phase="waking"] .ada-glow { opacity: 0.85; }
.ada[data-phase="greeting"] .ada-hello { animation: ada-write 3.1s ease forwards; }
@keyframes ada-write {
  0% { opacity: 1; clip-path: inset(0 100% 0 0); }
  52% { opacity: 1; clip-path: inset(0 0 0 0); }
  84% { opacity: 1; clip-path: inset(0 0 0 0); }
  100% { opacity: 0; clip-path: inset(0 0 0 0); }
}
.ada[data-phase="looking"] .ada-eyes,
.ada[data-phase="sleeping"] .ada-eyes,
.ada[data-phase="waking"] .ada-eyes { opacity: 1; }
.ada[data-phase="looking"] .ada-eyes { animation: ada-look 3s ease-in-out infinite; }
@keyframes ada-look { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-3.5px); } 70% { transform: translateX(3.5px); } }
.ada[data-phase="looking"] .ada-eye { animation: ada-blink 3.6s infinite; }
@keyframes ada-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
/* sleeping: "^ ^" eyes and a waving 3D hand */
.ada[data-phase="sleeping"] .ada-eye {
  height: 6px;
  width: 11px;
  background: transparent;
  border: 2.6px solid #fff;
  border-bottom: 0;
  border-radius: 11px 11px 0 0;
  box-shadow: 0 -3px 10px -2px rgba(255, 220, 220, 0.7);
}
.ada[data-phase="sleeping"] .ada-hand { animation: ada-wave 4s ease-in-out infinite; }
@keyframes ada-wave {
  0% { transform: scale(0) rotate(0); }
  6% { transform: scale(1.15) rotate(0); }
  10%, 18%, 26%, 34% { transform: scale(1) rotate(-20deg); }
  14%, 22%, 30%, 38% { transform: scale(1) rotate(20deg); }
  42% { transform: scale(1) rotate(0); }
  47%, 100% { transform: scale(0) rotate(0); }
}
.ada[data-phase="waking"] .ada-eye { transform: translateX(var(--look, 0px)) scale(1.18); }

/* demo instance inside the mascot section */
.ada-demo {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scale(1.7);
  transform-origin: 50% 0;
  z-index: 1;
}
@media (max-width: 600px) {
  .ada:not(.ada-demo) { transform: translateX(-50%) scale(0.8); transform-origin: 50% 0; }
  .ada-demo { transform: translateX(-50%) scale(1.25); }
}
