:root {
  --bg: #E3E2EB;
  --bg-2: #ECE9F1;
  --bg-3: #E4E3F9;
  --ink: #010131;
  --ink-soft: #2A2A55;
  --muted-2: #76767E;
  --muted-3: #606066;
  --surface: #FFFFFF;
  --grad-primary: linear-gradient(90deg, #589EF9 0%, #AA47F8 100%);
  --grad-hot: linear-gradient(90deg, #F312FF 0%, #29A7FE 100%);
  --grad-logo: linear-gradient(180deg, #08BFFE 0%, #F312FF 100%);
  --grad-orb: linear-gradient(135deg, #08BFFE 0%, #6965F4 50%, #F312FF 100%);
  --shadow-card: 0 1px 0 rgba(1,1,49,.04), 0 8px 24px rgba(1,1,49,.06);
  --shadow-orb: 0 24px 60px -16px rgba(105, 101, 244, 0.55);
  --radius-card: 18px;
  --radius-tasks: 16px;
  --font-body: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* GATE — пэйвол по паролю. Активен пока html.locked. */
html.locked body > main { display: none; }
html:not(.locked) .gate { display: none; }
.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(8, 191, 254, 0.18), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(243, 18, 255, 0.12), transparent 50%),
    var(--bg);
  font-family: var(--font-body);
}
.gate__card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.gate__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.gate__dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad-orb);
  box-shadow: 0 4px 12px -4px rgba(105,101,244,.6);
}
.gate__brandname {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.gate__title {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 6px;
}
.gate__subtitle {
  font-size: 14px;
  color: var(--muted-3);
  margin-bottom: 8px;
}
.gate__input {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.18em;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(1,1,49,.12);
  background: var(--bg-2);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
}
.gate__input:focus { border-color: rgba(89,158,249,.6); background: #fff; }
.gate__submit { width: 100%; min-width: 0; }
.gate__error {
  text-align: center;
  font-size: 13px;
  color: #d32f4d;
  margin-top: -2px;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(8, 191, 254, 0.12), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(243, 18, 255, 0.08), transparent 50%),
    var(--bg);
}

.display { font-family: var(--font-display); letter-spacing: -0.02em; }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 16px;
}
.logo svg { height: 44px; width: auto; display: block; }
.tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: right;
}

/* HERO */
.hero {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 22px;
}
.avatar {
  width: 110px;
  height: 110px;
  flex: 0 0 110px;
  border-radius: 50%;
  background-image: url('assets/vitaly.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 8px 20px rgba(1,1,49,.08);
}
.hero-text h1 {
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 8px;
}
.hero-text .role {
  font-size: 14px;
  color: var(--muted-3);
  font-weight: 500;
  margin-bottom: 6px;
}
.hero-text .role b { color: var(--ink); font-weight: 600; }
.hero-text .addr { font-size: 13px; color: var(--muted-2); }

/* HOOK */
.hook {
  margin: 4px 0 22px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hook .grad {
  background: var(--grad-hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* SECTION LABEL */
.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}

/* TASKS */
.tasks {
  background: var(--surface);
  border-radius: var(--radius-tasks);
  padding: 18px 22px;
  margin-bottom: 22px;
  list-style: none;
  counter-reset: t;
  box-shadow: var(--shadow-card);
}
.tasks li {
  counter-increment: t;
  display: flex;
  gap: 12px;
  padding: 10px 0;
  align-items: flex-start;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.tasks li:not(:last-child) { border-bottom: 1px solid var(--bg-2); }
.tasks li::before {
  content: counter(t);
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: white;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  margin-top: 1px;
}
.tasks li b { font-weight: 600; color: var(--ink); }

/* CALLER (DEMO) */
.caller {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 36px 24px 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.orb {
  position: relative;
  width: 180px; height: 180px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
}
.orb__core {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--grad-orb);
  box-shadow: var(--shadow-orb);
  transition: transform .4s cubic-bezier(.2,.8,.2,1), filter .3s;
  position: relative;
  z-index: 2;
}
.orb__ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(105, 101, 244, .35);
  opacity: 0;
}
.orb__ring--1 { width: 130px; height: 130px; }
.orb__ring--2 { width: 155px; height: 155px; }
.orb__ring--3 { width: 180px; height: 180px; }

.orb[data-state="idle"] .orb__core { transform: scale(.9); filter: saturate(.85); }
.orb[data-state="connecting"] .orb__core { animation: pulse 1.2s ease-in-out infinite; }
.orb[data-state="listening"] .orb__core { transform: scale(1); }
.orb[data-state="listening"] .orb__ring { animation: ripple 2.4s ease-out infinite; }
.orb[data-state="listening"] .orb__ring--2 { animation-delay: .6s; }
.orb[data-state="listening"] .orb__ring--3 { animation-delay: 1.2s; }
.orb[data-state="speaking"] .orb__core { animation: speak .7s ease-in-out infinite alternate; }

@keyframes pulse {
  0%, 100% { transform: scale(.9); }
  50% { transform: scale(1.05); }
}
@keyframes speak {
  from { transform: scale(.95); filter: brightness(1); }
  to   { transform: scale(1.1);  filter: brightness(1.15); }
}
@keyframes ripple {
  0% { opacity: .7; transform: scale(.6); }
  100% { opacity: 0; transform: scale(1.3); }
}

.status {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.timer {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-items: center;
}
.btn {
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  padding: 15px 26px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .15s, box-shadow .2s, opacity .2s;
  min-width: 260px;
  justify-content: center;
  letter-spacing: -0.01em;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); }
.btn--primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(89,158,249,.32);
}
.btn--primary:not(:disabled):hover { box-shadow: 0 12px 32px rgba(89,158,249,.45); }
.btn--ghost {
  background: transparent;
  color: var(--muted-3);
  border: 1.5px solid rgba(1,1,49,.12);
}
.btn--ghost:not(:disabled):hover { background: var(--bg-2); }
.btn__icon { display: inline-flex; }

.disclaimer {
  margin-top: 6px;
  max-width: 420px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted-2);
}

/* FOOTER */
.foot {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(1,1,49,.08);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted-2);
}
.foot .grad-text {
  background: var(--grad-logo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* MOBILE */
@media (max-width: 520px) {
  .page { padding: 20px 16px 24px; }
  .header { margin-bottom: 18px; }
  .logo svg { height: 36px; }
  .tag { font-size: 10px; }
  .hero { padding: 18px; gap: 16px; flex-direction: column; align-items: flex-start; text-align: left; }
  .avatar { width: 84px; height: 84px; flex: 0 0 84px; }
  .hero-text h1 { font-size: 32px; }
  .hook { font-size: 19px; }
  .caller { padding: 28px 18px 22px; }
  .orb { width: 160px; height: 160px; }
  .orb__core { width: 96px; height: 96px; }
  .orb__ring--1 { width: 116px; height: 116px; }
  .orb__ring--2 { width: 138px; height: 138px; }
  .orb__ring--3 { width: 160px; height: 160px; }
  .btn { min-width: 100%; }
}
