/* /ring/ — voice-first companion demo. System fonts. Dark + gold.
   Phone-frame look from the LifeGuard Agent sketch; ceremony from the
   Lifeguard X Ring Agent prototype. House chrome keeps its own type. */

body.ring-demo {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}

body.ring-demo .ring-page {
  --ring-panel: #181510;
  --ring-panel-2: #1f1b14;
  --ring-line: #2e291e;
  --ring-gold: #d2a94e;
  --ring-gold-bright: #ecca76;
  --ring-gold-deep: #8a6d2f;
  --ring-muted: #a99c7e;
  --ring-ink-dim: #cfc3a6;
  --ring-danger-bg: #2b1414;
  --ring-danger-line: #8a3a32;
  --ring-danger-ink: #f6d9d2;
  --ring-radius: 14px;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

body.ring-demo .ring-page h1,
body.ring-demo .ring-page h2,
body.ring-demo .ring-page h3 {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

.ring-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 0;
}
.ring-kicker .org {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ring-muted);
}
.demo-pill {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #14100a;
  background: var(--ring-gold);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

.ring-hero {
  margin: 18px 0 0;
}
.ring-hero h1 {
  font-size: 2.05rem;
  line-height: 1.12;
  margin: 0 0 10px;
  font-weight: 600;
}
.ring-hero h1 .gold {
  color: var(--ring-gold-bright);
}
.ring-lede {
  margin: 0;
  color: var(--ring-ink-dim);
  font-size: 1.02rem;
  max-width: 42ch;
}

.status-card {
  margin-top: 18px;
  background: var(--ring-panel);
  border: 1px solid var(--ring-line);
  border-radius: var(--ring-radius);
  padding: 13px 15px;
}
.status-card h2 {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ring-muted);
  font-weight: 700;
}
.status-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 3px 0;
  font-size: 0.92rem;
  color: var(--ring-ink-dim);
}
.status-row b {
  color: var(--ink);
  font-weight: 600;
}
.dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 7px;
  background: var(--ring-gold-deep);
}
.dot.pending {
  background: #6b5a2e;
  box-shadow: 0 0 0 3px rgba(210, 169, 78, 0.12);
}

/* Phone frame — 390×844 on desktop; full-bleed under 450px */
.phone-stage {
  display: flex;
  justify-content: center;
  margin: 22px 0 8px;
}
.phone {
  width: 390px;
  height: 844px;
  flex-shrink: 0;
  background: #12100d;
  border-radius: 48px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 10px #05060c,
    0 0 0 11px var(--ring-line),
    0 40px 100px rgba(0, 0, 0, 0.7),
    0 0 180px rgba(210, 169, 78, 0.06);
}
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 36px;
  background: #000;
  border-radius: 0 0 22px 22px;
  z-index: 4;
}
.sbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}
.sbar-r {
  color: var(--ring-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}
.shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.ring-zone {
  text-align: center;
  padding: 18px 16px 8px;
  flex-shrink: 0;
}
.ring-btn {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.ring-btn:focus-visible {
  outline: 3px solid var(--ring-gold-bright);
  outline-offset: 6px;
}
.ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #6e5620, var(--ring-gold) 30%, var(--ring-gold-bright) 50%, var(--ring-gold) 70%, #6e5620);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(236, 202, 118, 0.15);
  transition: transform 0.18s ease;
}
.ring-btn:active .ring-outer {
  transform: scale(0.96);
}
.ring-inner {
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: radial-gradient(90% 90% at 50% 32%, #26211a 0%, #14110d 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--ring-gold-bright);
}
.ring-inner .press-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ring-muted);
}
.ring-hint {
  color: var(--ring-muted);
  font-size: 0.88rem;
  margin: 10px auto 0;
  max-width: 34ch;
}
.ring-hint b {
  color: var(--ring-ink-dim);
  font-weight: 600;
}
.listen-status {
  min-height: 1.3em;
  color: var(--ring-gold-bright);
  font-size: 0.88rem;
  margin: 4px 0 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
  flex-shrink: 0;
}
.ctl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: var(--ring-panel);
  border: 1px solid var(--ring-line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--ring-ink-dim);
  cursor: pointer;
  font-family: inherit;
}
.ctl .state {
  color: var(--ring-gold-bright);
  font-weight: 700;
}

.chips-label {
  margin: 14px 16px 8px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ring-muted);
  font-weight: 700;
  flex-shrink: 0;
}
.intent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 0 16px;
  flex-shrink: 0;
}
.chip {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 13px;
  cursor: pointer;
  background: var(--ring-panel);
  border: 1px solid var(--ring-line);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  text-align: left;
  line-height: 1.3;
}
.chip:hover,
.chip:focus-visible {
  border-color: rgba(210, 169, 78, 0.45);
  background: var(--ring-panel-2);
}
.chip:last-child {
  grid-column: span 2;
}

.quiet {
  display: none;
  margin: 12px 16px 0;
  background: var(--ring-panel);
  border: 1px solid var(--ring-gold-deep);
  border-radius: var(--ring-radius);
  padding: 18px 16px;
  text-align: center;
  flex-shrink: 0;
}
.quiet.open {
  display: block;
}
.quiet h2 {
  font-size: 1.2rem;
  margin: 0 0 4px;
}
.breath-orb {
  width: 110px;
  height: 110px;
  margin: 14px auto 8px;
  border-radius: 50%;
  background: radial-gradient(70% 70% at 50% 40%, #3a2f16, #1c180f);
  border: 2px solid var(--ring-gold-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--ring-gold-bright);
  transition: transform 3.8s ease-in-out;
}
.breath-cue {
  min-height: 3em;
  color: var(--ring-ink-dim);
  font-size: 0.98rem;
  margin: 6px auto 0;
  max-width: 32ch;
}
.quiet progress {
  width: 100%;
  height: 6px;
  appearance: none;
  margin-top: 12px;
}
.quiet progress::-webkit-progress-bar {
  background: #26221a;
  border-radius: 3px;
}
.quiet progress::-webkit-progress-value {
  background: var(--ring-gold);
  border-radius: 3px;
}
.quiet progress::-moz-progress-bar {
  background: var(--ring-gold);
}
.quiet .end-btn {
  margin-top: 12px;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--ring-line);
  color: var(--ring-ink-dim);
  font-family: inherit;
  font-size: 0.9rem;
}

.convo-label {
  margin: 14px 16px 0;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ring-muted);
  font-weight: 700;
  flex-shrink: 0;
}
.log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 16px 6px;
  min-height: 0;
}
.msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 0.95rem;
}
.msg .who {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 700;
}
.msg.agent {
  align-self: flex-start;
  background: var(--ring-panel-2);
  border: 1px solid var(--ring-line);
  border-bottom-left-radius: 5px;
}
.msg.agent .who {
  color: var(--ring-gold);
}
.msg.user {
  align-self: flex-end;
  background: #2b2413;
  border: 1px solid #453a1c;
  border-bottom-right-radius: 5px;
}
.msg.user .who {
  color: var(--ring-muted);
}
.msg p {
  margin: 0 0 8px;
}
.msg p:last-child {
  margin-bottom: 0;
}
.msg.crisis {
  background: var(--ring-danger-bg);
  border-color: var(--ring-danger-line);
  color: var(--ring-danger-ink);
  max-width: 100%;
}
.msg.crisis .who {
  color: #ffb4a6;
}
.msg a {
  color: var(--ring-gold-bright);
}

.card {
  align-self: stretch;
  max-width: 100%;
  border-radius: var(--ring-radius);
  padding: 14px;
  background: var(--ring-panel);
  border: 1px solid var(--ring-gold-deep);
}
.card h3 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.card p {
  margin: 0 0 8px;
  color: var(--ring-ink-dim);
  font-size: 0.93rem;
}
.card p:last-child {
  margin-bottom: 0;
}
.card .door {
  display: block;
  min-height: 48px;
  padding: 12px 14px;
  margin-top: 8px;
  border-radius: 10px;
  background: #241d0e;
  border: 1px solid var(--ring-gold-deep);
  color: var(--ring-gold-bright);
  text-decoration: none;
  font-weight: 600;
}
.card .door small {
  display: block;
  color: var(--ring-muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 16px 8px;
  flex-shrink: 0;
}
.actions button {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--ring-gold-deep);
  color: var(--ring-gold-bright);
  font-family: inherit;
  font-size: 0.9rem;
}
.actions button.plain {
  border-color: var(--ring-line);
  color: var(--ring-ink-dim);
}

.composer {
  flex-shrink: 0;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ring-line);
  background: #12100d;
}
.composer form {
  display: flex;
  gap: 8px;
}
.composer input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--ring-panel-2);
  border: 1px solid var(--ring-line);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
}
.composer input[type="text"]::placeholder {
  color: var(--ring-muted);
}
.composer input[type="text"]:focus {
  outline: 2px solid var(--ring-gold-deep);
  border-color: var(--ring-gold-deep);
}
.send-btn {
  flex: 0 0 auto;
  min-height: 48px;
  min-width: 72px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--ring-gold);
  color: #171106;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 16px;
}
.send-btn:active {
  background: var(--ring-gold-bright);
}

.about-proto {
  margin-top: 28px;
  background: var(--ring-panel);
  border: 1px solid var(--ring-line);
  border-radius: var(--ring-radius);
  padding: 16px;
}
.about-proto h2 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.about-proto h3 {
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ring-gold);
  margin: 16px 0 6px;
}
.about-proto p,
.about-proto li {
  color: var(--ring-ink-dim);
  font-size: 0.93rem;
}
.about-proto p {
  margin: 0 0 9px;
}
.about-proto ul {
  margin: 4px 0 8px;
  padding-left: 20px;
}
.about-proto li {
  margin-bottom: 5px;
}

body.ring-demo footer {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
body.ring-demo footer .hello-bof-flame {
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  opacity: 0.85;
}
body.ring-demo footer .hello-bof-flame:hover,
body.ring-demo footer .hello-bof-flame:focus-visible {
  opacity: 1;
}

@media (max-width: 450px) {
  body.ring-demo .ring-page {
    padding: 16px 16px 40px;
  }
  .ring-hero h1 {
    font-size: 1.85rem;
  }
  .phone-stage {
    margin-left: -16px;
    margin-right: -16px;
  }
  .phone {
    width: 100%;
    height: auto;
    min-height: 640px;
    border-radius: 0;
    box-shadow: none;
  }
  .notch {
    display: none;
  }
  .shell {
    overflow: visible;
  }
  .log {
    flex: none;
    max-height: none;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring-outer,
  .breath-orb,
  .ring-btn:active .ring-outer {
    transition: none;
  }
}
