/* Matches the Subt iPhone app: SF Rounded on Apple devices, system UI
   elsewhere. No web fonts, so no third-party requests at all. */
:root {
  --subt-accent: #00e6ff;
  --subt-bg: #000;
  --subt-panel: #1e1e1e;
  --subt-text: #fff;
  --subt-muted: #a6acb6;
  --subt-faint: #8b919b;
  --subt-footer: #d1d1d1;
  --subt-font: ui-rounded, "SF Pro Rounded", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --subt-caption-size: 36px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--subt-bg);
  color: var(--subt-text);
  font-family: var(--subt-font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--subt-accent); }

.subt-icon { width: 1em; height: 1em; display: block; }

.subt-logo { width: 84px; height: auto; display: block; }

/* App ---------------------------------------------------------------- */

.subt-app-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  overscroll-behavior: none;
}

.subt {
  width: 100%;
  max-width: 520px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) 0 max(8px, env(safe-area-inset-bottom));
}

.subt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 24px 16px;
}

.subt-shield { width: 24px; height: 24px; color: var(--subt-accent); }
.subt-shield[hidden] { display: none; }

.subt-panel {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  background: var(--subt-panel);
}

.subt-captions {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: 72px 24px 16px;
  font-size: var(--subt-caption-size);
  line-height: 1.3;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}

.subt-captions::-webkit-scrollbar { display: none; }

.subt-panel.is-stopped .subt-captions { padding-bottom: 84px; }

.subt-line {
  margin: 0;
  color: var(--subt-muted);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.subt-line--active { color: var(--subt-text); font-weight: 600; }
.subt-line--hint { color: var(--subt-muted); font-weight: 600; }
.subt-line--note { color: var(--subt-accent); font-weight: 600; }

/* Floating glass bar shown once a conversation stops. */
.subt-stopped {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 8px 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  animation: subt-rise .25s ease-out;
}

.subt-stopped[hidden] { display: none; }

@keyframes subt-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.subt-stopped-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--subt-accent); flex: none; }

.subt-stopped-text {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subt-chip {
  flex: none;
  height: 40px;
  min-width: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: 600 15px/1 var(--subt-font);
  cursor: pointer;
}

.subt-chip:active { background: rgba(255, 255, 255, 0.26); }
.subt-chip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.subt-controls {
  display: flex;
  justify-content: center;
  padding: 18px 0 10px;
}

.subt-mic {
  width: 96px;
  height: 96px;
  border: 2px solid var(--subt-accent);
  border-radius: 16px;
  background: var(--subt-accent);
  color: #000;
  font-size: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}

.subt-mic:active { transform: scale(.94); }
.subt-mic:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.subt-mic:disabled { background: #2a2a2a; border-color: #2a2a2a; color: var(--subt-faint); cursor: not-allowed; }
.subt-mic .subt-icon--stop { display: none; }
.subt-mic[aria-pressed="true"] { background: var(--subt-bg); color: var(--subt-accent); transform: scale(.95); }
.subt-mic[aria-pressed="true"] .subt-icon--mic { display: none; }
.subt-mic[aria-pressed="true"] .subt-icon--stop { display: block; font-size: 34px; }

.subt-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
  text-align: center;
}

.subt-privacy {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--subt-footer);
}

.subt-privacy .subt-icon { color: var(--subt-accent); font-size: 16px; flex: none; }
.subt-privacy.is-error { color: var(--subt-accent); }

.subt-links { display: flex; gap: 16px; font-size: 13px; }
.subt-links a { color: var(--subt-faint); text-decoration: none; padding: 6px 0; }
.subt-links a:hover { color: var(--subt-muted); }

@media (min-width: 768px) {
  .subt { height: min(100dvh, 900px); align-self: center; }
  .subt-panel { margin: 0 16px; border-radius: 20px; overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .subt-stopped { animation: none; }
  .subt-mic { transition: none; }
}

/* Info pages ---------------------------------------------------------- */

.subt-page {
  max-width: 640px;
  margin: 0 auto;
  padding:
    max(24px, env(safe-area-inset-top))
    20px
    max(32px, env(safe-area-inset-bottom));
}

.subt-page-header { padding: 8px 0 32px; }

.subt-prose { font-size: 18px; line-height: 1.6; color: #d9dce1; }

.subt-prose h1 { font-size: 36px; line-height: 1.1; margin: 0 0 16px; color: #fff; }

.subt-prose h2 { font-size: 21px; margin: 36px 0 8px; color: #fff; }

.subt-prose h3 { font-size: 17px; margin: 20px 0 4px; color: var(--subt-accent); }

.subt-prose p, .subt-prose ul { margin: 0 0 14px; }

.subt-prose ul { padding-left: 20px; }

.subt-prose li { margin-bottom: 6px; }

.subt-lede { font-size: 20px; color: #fff; }

.subt-meta { margin-top: 32px; font-size: 14px; color: var(--subt-faint); }

.subt-page-footer {
  display: flex;
  gap: 20px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid #222;
  font-size: 14px;
}

.subt-page-footer a { color: var(--subt-muted); text-decoration: none; }
