/* =====================================================================
   The island: Swaey's signature. A black shape that drops out of the
   notch, glows electric blue at the bottom, and carries the face, the
   waveform and the words. Everything is in em so one component works in
   the site menubar, inside the laptop screen and on feature stages.
   ===================================================================== */

.island-host { position: absolute; z-index: 30; pointer-events: none; }
.island-host > .island { pointer-events: auto; }

.island {
  --w-closed: 11em;
  --h-closed: 2.3em;
  position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  width: var(--w-closed); height: var(--h-closed);
  color: #fff;
  background: #000;
  border-radius: 0 0 1.05em 1.05em;
  transition:
    width .62s var(--ease-island),
    height .62s var(--ease-island),
    border-radius .5s var(--ease-out),
    box-shadow .5s var(--ease-out),
    opacity .3s;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  font-family: var(--font-sf);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}
.island.is-hidden { opacity: 0; pointer-events: none; }
.island.is-open {
  border-radius: 0 0 1.9em 1.9em;
  box-shadow: 0 1.6em 3.4em -1em rgba(var(--electric-rgb), .38), 0 1em 2em -1em rgba(0,0,0,.5);
}

/* Concave "ears" where the island meets the top edge, like the real notch. */
.island::before, .island::after {
  content: ""; position: absolute; top: 0; width: .7em; height: .7em; pointer-events: none;
}
.island::before { left: -.7em; background: radial-gradient(circle at 0 100%, transparent .69em, #000 .72em); }
.island::after { right: -.7em; background: radial-gradient(circle at 100% 100%, transparent .69em, #000 .72em); }

.isl-clip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.isl-glow {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(70% 62% at 50% 118%, rgba(70, 130, 255, .95) 0%, rgba(33, 97, 255, .7) 30%, rgba(18, 69, 235, .22) 62%, rgba(18,69,235,0) 82%),
    radial-gradient(40% 40% at 50% 112%, rgba(219,240,255,.55), rgba(219,240,255,0) 70%);
  opacity: 0;
  transform: translateY(18%);
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out);
}
.island.is-open .isl-glow { opacity: .9; transform: none; }
.island[data-phase="speaking"] .isl-glow { opacity: 1; }
.island[data-phase="thinking"] .isl-glow { opacity: .75; animation: glow-breathe 2.2s ease-in-out infinite; }
.island[data-phase="error"] .isl-glow { filter: hue-rotate(150deg) saturate(1.2); }
@keyframes glow-breathe { 50% { opacity: .5; } }
.isl-grain {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: var(--grain); background-size: 120px;
  mix-blend-mode: overlay; opacity: 0; transition: opacity .6s;
}
.island.is-open .isl-grain { opacity: .5; }

.isl-inner {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  padding: 0 1.3em 1.25em;
  opacity: 0;
  transition: opacity .12s;
}
.island.is-open .isl-inner { opacity: 1; transition: opacity .4s .18s; }

.isl-top { display: flex; align-items: center; justify-content: space-between; height: 3.3em; flex: none; }
.isl-face { width: 2.15em; height: 2.15em; display: grid; place-items: center; }
.isl-face .face-svg { width: 100%; height: 100%; }
.isl-icon { width: 1.5em; height: 1.5em; display: grid; place-items: center; color: #fff; position: relative; }
.isl-icon svg { width: 100%; height: 100%; }
.isl-icon .rec { width: 1.05em; height: 1.05em; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #9cc6ff, var(--electric) 70%); box-shadow: 0 0 0 .2em rgba(var(--electric-rgb), .35), 0 0 .9em rgba(var(--electric-rgb), .9); animation: rec 1.3s ease-in-out infinite; }
@keyframes rec { 50% { box-shadow: 0 0 0 .32em rgba(var(--electric-rgb), .18), 0 0 1.2em rgba(var(--electric-rgb), 1); } }
.isl-icon .spin { width: 1.2em; height: 1.2em; border-radius: 50%; border: .16em solid rgba(255,255,255,.18); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.isl-icon.pop { animation: icon-pop .45s var(--ease-spring); }
@keyframes icon-pop { from { transform: scale(.4); opacity: 0; } }

.isl-wave { width: calc(100% + .5em); margin: -.2em -.25em .65em; height: 2.4em; flex: none; display: block; }
.island[data-wave="off"] .isl-wave { display: none; }

.isl-text {
  font-size: 1.12em; font-weight: 620; line-height: 1.32; letter-spacing: -0.012em;
  min-height: 1.32em;
  position: relative;
}
.isl-text:empty { display: none; }
.isl-text .w { opacity: .42; transition: opacity .18s; }
.isl-text .w.on { opacity: 1; }
.isl-text .dim { opacity: .5; }
.isl-text .sub { display: block; margin-top: .2em; font-size: .88em; font-weight: 500; opacity: .55; }
.isl-text .typing::after, .caret-after::after {
  content: ""; display: inline-block; width: .08em; height: 1.05em; margin-left: .06em; vertical-align: -.16em;
  background: currentColor; animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.42) 38%, #fff 50%, rgba(255,255,255,.42) 62%, rgba(255,255,255,.42) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.8s linear infinite;
}
.shimmer b { color: transparent; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.line-in { animation: line-in .5s var(--ease-out); }
@keyframes line-in { from { opacity: 0; transform: translateY(.7em); filter: blur(3px); } }

.isl-actions { display: none; justify-content: flex-end; gap: .55em; margin-top: 1em; }
.island[data-phase="confirming"] .isl-actions { display: flex; }
.isl-btn {
  height: 2.5em; padding: 0 1.2em; border-radius: 1.25em;
  font-size: 1em; font-weight: 650; letter-spacing: -0.01em;
  color: #fff; background: rgba(255,255,255,.14);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12);
  transition: transform .2s, background .2s;
}
.isl-btn:hover { background: rgba(255,255,255,.22); }
.isl-btn--primary { color: #000; background: #f1f2f6; box-shadow: 0 .3em 1em -0.3em rgba(255,255,255,.35); }
.isl-btn--primary:hover { background: #fff; }
.isl-btn.pressed { transform: scale(.94); }

.isl-input { display: none; margin-top: .2em; }
.island[data-input="on"] .isl-input { display: flex; gap: .5em; align-items: center; }
.isl-input input {
  flex: 1; min-width: 0; height: 2.6em; padding: 0 1em; border-radius: 1.3em;
  font: 500 1em/1 var(--font-sans); color: #fff;
  background: rgba(255,255,255,.1); border: 0; outline: none;
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.18);
}
.isl-input input::placeholder { color: rgba(255,255,255,.45); }
.isl-input button { height: 2.6em; width: 2.6em; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; flex: none; }
.isl-input button svg { width: 1.1em; height: 1.1em; }
.isl-link { display: flex; width: max-content; margin-top: .9em; align-self: flex-start; align-items: center; gap: .4em; height: 2.4em; padding: 0 1.1em; border-radius: 1.2em; background: #f1f2f6; color: #000; font-weight: 650; font-size: .95em; }
.isl-link svg { width: 1.1em; height: 1.1em; }
.isl-close { position: absolute; right: .9em; top: .95em; width: 1.6em; height: 1.6em; border-radius: 50%; display: none; place-items: center; color: rgba(255,255,255,.55); }
.isl-close svg { width: 1em; height: 1em; }
.island[data-closable="on"].is-open .isl-close { display: grid; }
.island[data-closable="on"] .isl-icon { margin-right: 2em; }

/* ---------- Talk-to-Swaey island: drops from the top edge of the window ---------- */
.island-host--nav { position: fixed; left: 50%; top: 0; width: 0; height: 0; font-size: 14px; z-index: 260; }
.island-host--nav .island { --w-closed: 150px; --h-closed: 0px; }
.island-host--nav .island:not(.is-open) { opacity: 0; pointer-events: none; transition: width .5s var(--ease-island), height .5s var(--ease-island), border-radius .4s var(--ease-out), opacity .2s .3s; }
.island-host--nav .island.is-open { box-shadow: 0 1.6em 3.4em -1em rgba(15,127,255,.45), 0 1em 2.4em -1em rgba(0,0,0,.45); }

.notch-hint {
  position: absolute; top: calc(100% + 18px); left: 50%;
  transform: translate(-50%, -6px);
  white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; letter-spacing: -0.01em; color: #1c1c1e;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 10px 30px -10px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none;
  transition: opacity .5s var(--ease-out), transform .6s var(--ease-spring);
}
.notch-hint::before { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: rgba(255,255,255,.95); box-shadow: -.5px -.5px 0 rgba(0,0,0,.08); border-radius: 2px; }
.notch-hint b { font-weight: 600; margin-left: 3px; }
.notch-hint.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 640px) {
  .island-host--nav { font-size: 12.5px; }
  .notch-hint { font-size: 12px; white-space: normal; width: min(300px, 80vw); text-align: center; justify-content: center; flex-wrap: wrap; }
}
.isl-type { display: block; margin-top: .55em; font-size: .82em; font-weight: 600; color: #9cc6ff; opacity: .9; }
.isl-type:hover { color: #fff; }
