/* ---- tokens ---------------------------------------------------- */
:root {
  --bg: #0a0a0c;
  --bg-vignette: radial-gradient(ellipse 70% 60% at 50% 30%, #0d1418 0%, #0a0a0c 65%);
  --ink: #f2ede4;
  --ink-muted: #948d82;
  --ink-faint: #55504a;
  --neon-core: #eafcff;
  --neon-mid: #35d7ff;
  --neon-deep: #0a8fb3;
  --sage: #7fa07a;
  --panel-bg: rgba(18, 16, 15, 0.92);
  --line: rgba(242, 237, 228, 0.09);
  --display-font: "Fraunces", ui-serif, Georgia, serif;
  --body-font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono-font: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg-vignette), var(--bg);
  color: var(--ink);
  font-family: var(--body-font);
  overflow-y: auto;
}

button { font-family: inherit; }

/* ---- stage ------------------------------------------------------ */
.stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 110px 24px 24px;
  text-align: center;
}

.wordmark {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
}

.neon-logo {
  display: block;
  width: clamp(160px, 30vw, 230px);
  height: auto;
  /* A little extra glow on top of the sign's own baked-in glow, plus the
     flicker below — the PNG background is now transparent. */
  filter: drop-shadow(0 0 10px rgba(53, 215, 255, 0.35));
  animation: neon-flicker-logo 6.4s infinite;
}

/* Multiple uneven, non-repeating-looking keyframe stops is the simplest
   reliable way to fake a random neon flicker in pure CSS. */
@keyframes neon-flicker-logo {
  0%, 3%, 6%, 9%, 100% { opacity: 1; }
  4% { opacity: 0.5; }
  5% { opacity: 0.88; }
  37% { opacity: 1; }
  38% { opacity: 0.6; }
  39% { opacity: 1; }
  61% { opacity: 1; }
  62% { opacity: 0.8; }
  63% { opacity: 1; }
  73% { opacity: 1; }
  74% { opacity: 0.35; }
  75% { opacity: 0.92; }
  76% { opacity: 1; }
}

/* ---- orb ---------------------------------------------------- */
.orb-wrap {
  position: relative;
  width: clamp(160px, 32vw, 220px);
  height: clamp(160px, 32vw, 220px);
}

.orb {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.orb-core {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--neon-core), var(--neon-mid) 55%, var(--neon-deep) 100%);
  box-shadow: 0 0 40px rgba(53, 215, 255, 0.35), inset 0 0 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.6s ease, box-shadow 0.6s ease;
  animation: breathe 4.5s ease-in-out infinite;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(53, 215, 255, 0.28);
  transition: opacity 0.4s ease, border-color 0.4s ease;
}
.ring-1 { inset: 8%; animation: pulse-ring 4.5s ease-in-out infinite; }
.ring-2 { inset: -6%; animation: pulse-ring 4.5s ease-in-out infinite 0.6s; opacity: 0.5; }

.orb-icon {
  position: relative;
  width: 30%;
  height: 30%;
  color: rgba(10, 8, 6, 0.75);
  z-index: 2;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.12); opacity: 0.05; }
}

/* state: connecting — slow spin on the outer ring */
.orb[data-state="connecting"] .ring-2 {
  animation: spin 2.2s linear infinite;
  border-style: dashed;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* state: listening — rings tighten and brighten, user is speaking */
.orb[data-state="listening"] .orb-core {
  animation: none;
  transform: scale(1.08);
  box-shadow: 0 0 55px rgba(53, 215, 255, 0.55), inset 0 0 30px rgba(0, 0, 0, 0.2);
}
.orb[data-state="listening"] .orb-ring {
  border-color: rgba(53, 215, 255, 0.6);
  animation: pulse-ring 1.1s ease-in-out infinite;
}

/* state: thinking — quiet, dimmer, steady */
.orb[data-state="thinking"] .orb-core {
  animation: none;
  transform: scale(0.97);
  box-shadow: 0 0 20px rgba(53, 215, 255, 0.25), inset 0 0 30px rgba(0, 0, 0, 0.3);
  filter: saturate(0.75);
}
.orb[data-state="thinking"] .ring-1 { animation: pulse-ring 1.6s ease-in-out infinite; }

/* state: speaking — warm outward radiation */
.orb[data-state="speaking"] .orb-core {
  animation: speak-pulse 0.9s ease-in-out infinite;
  box-shadow: 0 0 65px rgba(53, 215, 255, 0.65), inset 0 0 30px rgba(0, 0, 0, 0.15);
}
.orb[data-state="speaking"] .orb-ring {
  border-color: rgba(53, 215, 255, 0.75);
  animation: pulse-ring 0.9s ease-in-out infinite;
}
@keyframes speak-pulse {
  0%, 100% { transform: scale(1.03); }
  50% { transform: scale(1.12); }
}

/* ---- power toggle ------------------------------------------------ */
.power-toggle {
  background: rgba(242, 237, 228, 0.06);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.power-toggle:hover { background: rgba(242, 237, 228, 0.1); color: var(--ink); }
.power-toggle[data-on="true"] {
  border-color: rgba(53, 215, 255, 0.45);
  color: var(--neon-core);
  background: rgba(53, 215, 255, 0.08);
}

.orb[disabled] {
  cursor: not-allowed;
}
.orb[disabled] .orb-core {
  animation: none;
  filter: grayscale(0.6) saturate(0.5);
  box-shadow: none;
  opacity: 0.55;
}
.orb[disabled] .orb-ring { opacity: 0.15; animation: none; }

.tagline {
  font-family: var(--display-font);
  font-weight: 300;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--ink);
  margin: 0;
  opacity: 0.92;
}

.status-line {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.transcript-line {
  margin: 0;
  min-height: 1.4em;
  max-width: 480px;
  font-size: 0.95rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ---- reminders toggle + panel ------------------------------- */
.panel-toggle {
  position: absolute;
  bottom: 28px;
  right: 28px;
  background: rgba(242, 237, 228, 0.06);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.panel-toggle:hover { background: rgba(242, 237, 228, 0.1); color: var(--ink); }
.panel-toggle span { font-family: var(--mono-font); color: var(--neon-core); margin-right: 4px; }

.panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(340px, 88vw);
  background: var(--panel-bg);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 10;
  display: flex;
  flex-direction: column;
}
.panel.open { transform: translateX(0); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
}
.panel-close {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.panel-close:hover { color: var(--ink); }

.reminder-list {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1;
}

.reminder-empty {
  color: var(--ink-faint);
  font-size: 0.85rem;
  padding: 20px 8px;
  text-align: center;
  font-style: italic;
}

.reminder-item {
  padding: 12px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid transparent;
}
.reminder-item:hover { background: rgba(242, 237, 228, 0.04); }

.reminder-task {
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.reminder-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono-font);
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.reminder-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-mid);
  flex-shrink: 0;
}
.reminder-item[data-status="completed"] .reminder-dot { background: var(--sage); }
.reminder-item[data-status="completed"] .reminder-task {
  color: var(--ink-faint);
  text-decoration: line-through;
}

/* ---- responsive ------------------------------------------------ */
@media (max-width: 480px) {
  .wordmark { top: 20px; }
  .panel-toggle { bottom: 20px; right: 16px; }
}

/* ---- reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .orb-core, .orb-ring { animation: none !important; }
  .neon-logo { animation: none !important; }
}

/* ---- focus visibility -------------------------------------------- */
button:focus-visible {
  outline: 2px solid var(--neon-core);
  outline-offset: 3px;
}
