/* Snak & skridt — Agentic Live house style.
   Aurora plasma hero + the orange mirrored-bar audiogram (from the
   VoiceCoachLinkedin Remotion piece), near-black canvas, mono chrome. */

:root {
  --bg: #0a0a0a;            /* canvas */
  --panel: #141418;         /* cards / elevated surfaces */
  --panel-2: #1c1c20;
  --fg: #ededef;
  --muted: #a1a1aa;
  --faint: #71717a;
  --hairline: #27272a;

  --orange: #f87f2e;        /* Agentic Orange — never raw tailwind orange */
  --ember: #ffa85e;
  --forge: #d66a1f;
  --orange-12: rgba(248, 127, 46, 0.12);
  --orange-22: rgba(248, 127, 46, 0.22);
  --orange-35: rgba(248, 127, 46, 0.35);
  --orange-55: rgba(248, 127, 46, 0.55);

  --success: #34d399;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Cascadia Code", monospace;
  --sans: -apple-system, system-ui, "Segoe UI", Roboto, "Inter", sans-serif;

  --tabbar-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overscroll-behavior-y: contain;
}

/* soft orange glow bleeding from the top-left corner (matches the OG/Remotion) */
.glow {
  position: fixed;
  top: -220px; left: -220px;
  width: 620px; height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 127, 46, 0.16) 0%, rgba(248, 127, 46, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 540px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 16px) 20px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}

/* ---- mono chrome top bar ------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 12px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 18px;
}
.brandline { display: flex; align-items: center; gap: 12px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px var(--orange-55); }
.mono { font-family: var(--mono); font-size: 14px; color: var(--muted); letter-spacing: -0.01em; }
.statuspill {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--orange);
  border: 1px solid var(--orange-55);
  background: var(--orange-12);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.statuspill.connecting { color: var(--muted); border-color: var(--hairline); background: transparent; }

/* ---- tabs ---------------------------------------------------------------- */
.tab { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tab.hidden { display: none !important; }

/* ---- home: mode + brief chips ------------------------------------------- */
.home { display: flex; flex-direction: column; gap: 16px; }
.queue { display: flex; flex-direction: column; gap: 10px; }
.queue-label { margin: 0; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip, .mode {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14.5px;
  font-family: var(--mono);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.mode[aria-pressed="true"] {
  border-color: transparent;
  background: var(--orange);
  color: #1a0c02;
  font-weight: 600;
}
.mode.brief { border-style: dashed; }
.mode.brief[aria-pressed="true"] { background: var(--orange-22); color: var(--ember); border-color: var(--orange-55); border-style: solid; }
.mode.brief[data-status="in-progress"]::after { content: " ⏳"; opacity: .7; }

/* ---- brief detail card --------------------------------------------------- */
.detail { display: flex; flex-direction: column; gap: 10px; }
.detail h2 { margin: 2px 0 0; font-size: 22px; letter-spacing: -0.02em; }
.teaser {
  margin: 0; background: var(--panel); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.5; color: #d6dbe7;
}
.hint { margin: 0; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.link-btn { align-self: flex-start; background: none; border: none; color: var(--muted); font-family: var(--mono); font-size: 13px; padding: 4px 0; cursor: pointer; }

/* ---- hero: aurora orb + radial waveform --------------------------------- */
.hero {
  position: relative;
  flex: 1;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.orb-wrap {
  position: relative;
  width: 188px; height: 188px;
  display: flex; align-items: center; justify-content: center;
}
/* The orb is now drawn procedurally on the .viz canvas (see app.js
   drawAuroraOrb); .orb-wrap just centres the call button over it. */

@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* the tappable label sitting on the orb pre-call */
.callbtn {
  position: relative;
  z-index: 2;
  width: 168px; height: 168px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #1a0c02;
  font-size: 18px; font-weight: 700; letter-spacing: .01em;
  font-family: var(--sans);
  cursor: pointer;
  transition: transform .12s, opacity .2s;
  text-shadow: 0 1px 8px rgba(0,0,0,.25);
}
.callbtn:active { transform: scale(0.96); }
.callbtn:disabled { opacity: 0; }      /* nothing selected → no label, just the calm orb */
/* a dark chip keeps the label readable over the bright plasma core */
.orb-label {
  pointer-events: none;
  display: inline-block;
  background: rgba(8, 8, 8, 0.58);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* in-call control */
.dial-actions { display: flex; justify-content: center; min-height: 0; }
.afslut {
  border: none;
  background: var(--orange);
  color: #1a0c02;
  font-weight: 700; font-size: 16px;
  font-family: var(--sans);
  border-radius: 999px;
  padding: 13px 38px;
  cursor: pointer;
  box-shadow: 0 6px 24px var(--orange-22);
  transition: transform .12s;
}
.afslut:active { transform: scale(0.97); }

/* ---- summarizing wait-state --------------------------------------------- */
.summarizing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 10px;
}
.sum-orb {
  position: relative;
  width: 150px; height: 150px;
  display: flex; align-items: center; justify-content: center;
}
.sum-orb::after {                 /* the plasma core (matches the home orb) */
  content: "";
  width: 96px; height: 96px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0%, #ffe6cc 8%, var(--ember) 26%, var(--orange) 52%, var(--forge) 74%, rgba(214,106,31,0) 86%);
  background-size: cover; background-position: center;
  box-shadow: 0 0 70px 10px var(--orange-35);
  animation: breathe 3.4s ease-in-out infinite;
  z-index: 1;
}
/* concentric sonar pulses radiating out — the "condense" look */
.sum-pulse {
  position: absolute;
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 2px solid var(--orange-55);
  animation: sonar 2.4s ease-out infinite;
}
.sum-pulse:nth-child(2) { animation-delay: .8s; }
.sum-pulse:nth-child(3) { animation-delay: 1.6s; }
@keyframes sonar {
  0%   { transform: scale(1);   opacity: .7; }
  100% { transform: scale(2.4); opacity: 0; }
}
.sum-title { margin: 0; font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.sum-sub { margin: -4px 0 0; color: var(--faint); font-family: var(--mono); font-size: 13px; }
.sum-steps { color: var(--faint); font-family: var(--mono); font-size: 13px; display: flex; gap: 8px; }
.sum-steps .done { color: var(--orange); }
.sum-steps .active { color: var(--fg); }
.sum-steps .sep { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .sum-ring { animation-duration: 2.4s; }
}

/* ---- caption ------------------------------------------------------------- */
.caption {
  min-height: 52px;
  font-size: 16.5px;
  line-height: 1.45;
  text-align: center;
  color: var(--fg);
  padding: 6px 4px 0;
}
.caption .who { color: var(--faint); font-size: 12px; font-family: var(--mono); display: block; margin-top: 6px; }

/* ---- summary / review ---------------------------------------------------- */
.summary {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 16px 18px;
  margin-top: 14px;
}
.summary h2 { margin: 0 0 8px; font-size: 17px; }
.summary-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  background: transparent; border: none;
  color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer;
}
.btn.danger { background: transparent; border-color: rgba(239,68,68,0.45); color: #f6a5a5; }
.btn.danger:active { background: rgba(239,68,68,0.08); }
#summaryBody { font-size: 15px; line-height: 1.55; color: #d6dbe7; }
#summaryBody h2 { font-size: 14px; color: var(--orange); font-family: var(--mono); margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.review { display: flex; gap: 10px; margin-top: 14px; }
.btn { flex: 1; border-radius: 12px; padding: 13px 16px; font-size: 16px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font-family: var(--sans); }
.btn.primary { background: var(--orange); color: #1a0c02; }
.btn.ghost { background: transparent; border-color: var(--hairline); color: var(--fg); }
.btn:disabled { opacity: .5; }

/* ---- Ture (session history) --------------------------------------------- */
.ture { display: flex; flex-direction: column; gap: 14px; }
.screen-title { margin: 0; font-size: 30px; letter-spacing: -0.03em; }
.screen-sub { margin: -8px 0 0; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.search {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--fg);
  font-family: var(--mono);
}
.search::placeholder { color: var(--faint); }
.search:focus { outline: none; border-color: var(--orange-55); }
.session-list { display: flex; flex-direction: column; gap: 12px; }
.session-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: left;
}
.session-card:active { background: var(--panel-2); }
.session-card .sc-main { flex: 1; min-width: 0; }
.session-card .sc-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-card .sc-meta { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--faint); font-family: var(--mono); font-size: 12.5px; }
.tag { color: var(--ember); border: 1px solid var(--orange-55); border-radius: 999px; padding: 1px 9px; font-size: 11.5px; }
.sc-thumb { width: 92px; height: 44px; flex: none; }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; font-family: var(--mono); font-size: 13px; }

/* ---- Ture detail --------------------------------------------------------- */
.ture-detail { display: flex; flex-direction: column; gap: 16px; }
.detail-head { display: flex; align-items: flex-start; gap: 12px; }
.back-chip { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px 2px 0; }
.detail-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.detail-head .dh-meta { margin-top: 4px; color: var(--faint); font-family: var(--mono); font-size: 12.5px; }

.player {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.player .pl-label { font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.player .pl-wave { width: 100%; height: 96px; cursor: pointer; touch-action: none; }
.player .pl-row { display: flex; align-items: center; gap: 14px; }
.play-btn {
  width: 56px; height: 56px; flex: none;
  border-radius: 50%;
  border: none;
  background: var(--orange);
  color: #1a0c02;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.play-btn svg { width: 24px; height: 24px; }
.pl-file { font-family: var(--mono); font-size: 14px; color: var(--fg); }
.pl-time { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 2px; }

.seg { display: flex; background: var(--panel); border: 1px solid var(--hairline); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; border: none; background: transparent; color: var(--muted); padding: 9px; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
.seg button.active { background: var(--orange-22); color: var(--ember); }

.transcript { display: flex; flex-direction: column; }
.t-row { padding: 12px 2px; border-bottom: 1px solid var(--hairline); }
.t-row:last-child { border-bottom: none; }
.t-who { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.t-row.user .t-who { color: var(--orange); }
.t-text { font-size: 15px; line-height: 1.5; color: var(--fg); }
.resume-body { font-size: 15px; line-height: 1.6; color: #d6dbe7; }
.resume-body h2 { font-size: 13px; color: var(--orange); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; margin: 16px 0 4px; }

.ghost-link { align-self: center; background: transparent; border: 1px solid var(--hairline); color: var(--fg); border-radius: 999px; padding: 11px 22px; font-size: 14px; cursor: pointer; text-decoration: none; }

/* ---- Profil -------------------------------------------------------------- */
.profil { display: flex; flex-direction: column; gap: 22px; }
.avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; }
.avatar {
  width: 86px; height: 86px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 30px; font-weight: 700; color: #1a0c02;
  background: radial-gradient(circle at 36% 32%, var(--ember), var(--orange) 55%, var(--forge));
  box-shadow: 0 0 40px var(--orange-22);
}
.avatar-wrap .name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.avatar-wrap .handle { color: var(--faint); font-family: var(--mono); font-size: 13px; }
.stats { display: flex; gap: 12px; }
.stat { flex: 1; border: 1px solid var(--hairline); border-radius: 16px; padding: 16px 10px; text-align: center; background: var(--panel); }
.stat .num { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--orange); line-height: 1; }
.stat .lbl { margin-top: 6px; color: var(--muted); font-size: 12.5px; }

.settings { display: flex; flex-direction: column; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 2px; border-bottom: 1px solid var(--hairline); }
.setting .s-label { font-size: 16px; }
.setting .s-sub { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.setting select { background: var(--panel); color: var(--fg); border: 1px solid var(--hairline); border-radius: 10px; padding: 8px 10px; font-family: var(--mono); font-size: 13px; }
.setting .s-static { color: var(--muted); font-family: var(--mono); font-size: 14px; }

.toggle { width: 50px; height: 30px; border-radius: 999px; border: none; background: var(--hairline); position: relative; cursor: pointer; transition: background .18s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .18s; }
.toggle[aria-pressed="true"] { background: var(--orange); }
.toggle[aria-pressed="true"]::after { transform: translateX(20px); }

.logout { margin-top: 4px; background: transparent; border: none; color: var(--faint); font-family: var(--mono); font-size: 14px; padding: 14px 2px; text-align: left; cursor: pointer; }

/* ---- bottom tab bar ------------------------------------------------------ */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(10, 10, 10, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--hairline);
}
.tabbtn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: var(--faint);
  font-family: var(--mono); font-size: 11px;
  transition: color .15s;
}
.tabbtn svg { width: 22px; height: 22px; }
.tabbtn.active { color: var(--orange); }

/* ---- pull-to-refresh ----------------------------------------------------- */
.ptr {
  position: fixed; top: env(safe-area-inset-top, 0); left: 0; right: 0;
  display: flex; align-items: center; justify-content: center;
  height: 44px; font-size: 13px; color: var(--muted); font-family: var(--mono);
  transform: translateY(-56px);
  transition: transform .18s ease, color .18s;
  pointer-events: none; z-index: 20;
}
.ptr.show { transform: translateY(0); }
.ptr.spin { color: var(--orange); }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .sum-orb::after { animation: none !important; }
}

/* ===================== Auth gate (login / biometric unlock) ===================== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 0%, rgba(248,127,46,0.10), transparent 60%), var(--bg);
  padding: 24px;
}
.auth-gate.hidden { display: none; }
.auth-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.auth-orb {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--orange), #7a2d06 70%, #2a1003);
  box-shadow: 0 0 48px var(--orange-55), inset 0 0 24px rgba(0,0,0,0.4);
  animation: authpulse 3.2s ease-in-out infinite;
}
@keyframes authpulse { 0%,100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.05); opacity: 1; } }
.auth-title { margin: 4px 0 0; font-size: 22px; letter-spacing: -0.02em; }
.auth-msg { margin: 0; color: var(--muted); font-size: 15px; }
.auth-btn { width: 100%; margin-top: 6px; }
.auth-alt { margin-top: 2px; color: var(--muted); }
