/* OpenRoyleAl kingdom — public ORAL demo */
:root {
  --bg: #070708;
  --ink: #f4f1ea;
  --muted: #9a958c;
  --gold: #c9a227;
  --line: #222226;
  --panel: #101012;
  --danger: #c94a4a;
  --sans: "Outfit", system-ui, sans-serif;
  --page-x: max(22px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px), 7vw);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

.atmosphere {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(201, 162, 39, 0.14), transparent 55%),
    radial-gradient(700px 420px at 100% 80%, rgba(244, 241, 234, 0.04), transparent 50%),
    var(--bg);
  z-index: 0;
  animation: atmosphere-drift 18s ease-in-out infinite alternate;
}

@keyframes atmosphere-drift {
  from { filter: saturate(1); transform: scale(1); }
  to { filter: saturate(1.08); transform: scale(1.03); }
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.al-mark {
  font-weight: 700;
  color: var(--gold);
}

.top,
.stage,
.foot {
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--page-x);
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 8, 0.86);
  backdrop-filter: blur(8px);
}

.brand {
  color: var(--ink);
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 500;
  text-decoration: none;
  line-height: 1;
}
.brand:hover { text-decoration: none; }
.brand .al-mark { font-size: 1.12em; }

.top-link {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.top-link:hover { color: var(--gold); text-decoration: none; }

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(48px, 10vh, 96px) var(--page-x) 48px;
  max-width: 44rem;
  margin: 0 auto;
  width: 100%;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0;
  animation: rise 0.7s ease forwards 0.05s;
}

.hero-title {
  font-weight: 500;
  font-size: clamp(56px, 14vw, 96px);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 12px;
  opacity: 0;
  animation: rise 0.8s ease forwards 0.12s;
}

.lede {
  color: var(--muted);
  font-size: clamp(17px, 2.6vw, 20px);
  max-width: 22rem;
  margin-bottom: 28px;
  opacity: 0;
  animation: rise 0.8s ease forwards 0.22s;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KITT-style gold Al orb — click / Space starts the call */
.kitt {
  --kitt-size: clamp(148px, 34vw, 220px);
  --level: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  width: var(--kitt-size);
  height: var(--kitt-size);
  margin: 8px 0 12px;
  opacity: 0;
  animation: rise 0.85s ease forwards 0.28s;
  transition: transform 0.18s ease;
}
.kitt:hover .kitt-disc {
  transform: scale(1.03);
  box-shadow:
    0 0 0 2px rgba(201, 162, 39, 0.75),
    0 0 0 12px rgba(201, 162, 39, 0.1),
    0 0 56px rgba(201, 162, 39, 0.32),
    inset 0 0 40px rgba(0, 0, 0, 0.55);
}
.kitt:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 8px;
  border-radius: 50%;
}
.kitt:disabled {
  cursor: wait;
  opacity: 0.7;
}
.kitt.busy .kitt-disc {
  box-shadow:
    0 0 0 2px rgba(201, 162, 39, 0.45),
    0 0 0 10px rgba(201, 162, 39, 0.08),
    0 0 40px rgba(201, 162, 39, 0.2),
    inset 0 0 40px rgba(0, 0, 0, 0.65);
}

.kitt-disc {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, #1a160c 0%, #0c0b09 55%, #050505 100%);
  box-shadow:
    0 0 0 2px rgba(201, 162, 39, 0.55),
    0 0 0 10px rgba(201, 162, 39, 0.06),
    0 0 48px rgba(201, 162, 39, 0.18),
    inset 0 0 40px rgba(0, 0, 0, 0.65);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.kitt-level {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.35);
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.kitt.live .kitt-level {
  opacity: calc(0.2 + var(--level, 0) * 1.3);
  transform: scale(calc(1 + var(--level, 0) * 0.28));
}

.kitt-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-weight: 700;
  font-size: calc(var(--kitt-size) * 0.34);
  letter-spacing: -0.04em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(201, 162, 39, 0.45);
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

.kitt-scanner {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 35%;
  z-index: 1;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201, 162, 39, 0.05) 25%,
    rgba(255, 214, 90, 0.95) 50%,
    rgba(201, 162, 39, 0.05) 75%,
    transparent 100%
  );
  filter: blur(1px);
  opacity: 0.22;
  transform: translateX(0);
  animation: kitt-idle 4.5s ease-in-out infinite;
}

/* Listening: slower, dimmer sweep */
.kitt.listening .kitt-scanner {
  opacity: 0.45;
  animation: kitt-scan 2.4s linear infinite;
}
.kitt.listening .kitt-disc {
  box-shadow:
    0 0 0 2px rgba(201, 162, 39, 0.7),
    0 0 0 12px rgba(201, 162, 39, 0.08),
    0 0 56px rgba(201, 162, 39, 0.28),
    inset 0 0 40px rgba(0, 0, 0, 0.55);
}

/* Speaking back: KITT scan — fast gold bar racing across */
.kitt.speaking .kitt-scanner {
  opacity: 1;
  width: 42%;
  left: -42%;
  animation: kitt-scan 0.85s linear infinite;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201, 162, 39, 0.15) 18%,
    #ffe08a 48%,
    #c9a227 52%,
    rgba(201, 162, 39, 0.15) 82%,
    transparent 100%
  );
  box-shadow: 0 0 28px rgba(255, 214, 90, 0.85);
}
.kitt.speaking .kitt-disc {
  transform: scale(1.03);
  box-shadow:
    0 0 0 2px #e6c25a,
    0 0 0 14px rgba(201, 162, 39, 0.14),
    0 0 72px rgba(201, 162, 39, 0.55),
    inset 0 0 36px rgba(201, 162, 39, 0.12);
}
.kitt.speaking .kitt-mark {
  color: #ffe7a0;
  text-shadow: 0 0 22px rgba(255, 214, 90, 0.9);
  animation: kitt-pulse 0.85s ease-in-out infinite;
}

@keyframes kitt-idle {
  0%, 100% { transform: translateX(30%); opacity: 0.12; }
  50% { transform: translateX(160%); opacity: 0.28; }
}

@keyframes kitt-scan {
  0% { transform: translateX(0); }
  100% { transform: translateX(340%); }
}

@keyframes kitt-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .kitt-scanner,
  .kitt.speaking .kitt-mark,
  .atmosphere {
    animation: none !important;
  }
  .kitt.speaking .kitt-scanner {
    opacity: 0.85;
    left: 32%;
    width: 36%;
    transform: none;
  }
}

.status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 1.4em;
  max-width: 28rem;
}

.record-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 28rem;
}


.usage-meter,
.usage-card {
  margin-top: 12px;
  max-width: 28rem;
  width: 100%;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.85rem;
}
.usage-meter[hidden],
.usage-card[hidden] { display: none; }
.usage-card {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  gap: 0.7rem 1rem;
}
.usage-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  line-height: 1;
  color: var(--muted);
}
.usage-item svg,
.usage-item .usage-emoji {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--gold);
  fill: currentColor;
  stroke: currentColor;
}
.usage-item .usage-emoji { font-size: 12px; line-height: 14px; text-align: center; }
.usage-item .n { color: var(--ink); font-weight: 500; }
.usage-item.total .n { color: var(--gold); }
.usage-dir { display: inline-flex; align-items: center; gap: 0.15rem; }
.usage-dir svg { width: 10px; height: 10px; flex-basis: 10px; }

.transcript {
  margin-top: 36px;
  width: 100%;
  max-width: 32rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 4rem;
}

.transcript .call { display: flex; flex-direction: column; gap: 12px; user-select: text; }
.transcript .call + .call { border-top: 1px solid var(--line); padding-top: 12px; }

.line {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  animation: rise 0.35s ease;
}
.line:first-child { border-top: 0; }
.line .who {
  display: block;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.line .text {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.45;
}
.line.you .who { color: var(--muted); }

.foot {
  padding: 20px var(--page-x) 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.foot.foot-home {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  min-height: 88px;
  padding: 24px var(--page-x) 20px;
  white-space: normal;
  text-align: initial;
}
.foot-center {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.foot-byline {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.foot-mark {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0;
  color: var(--ink);
  text-decoration: none;
}
.foot-mark:hover { text-decoration: none; color: var(--ink); }
.foot-mark .word {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.foot-mark .al-mark {
  font-size: 1.05rem;
  font-weight: 700;
}
.foot-terms,
.foot-privacy {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  align-self: end;
  padding-bottom: 2px;
}
.foot-terms { grid-column: 1; justify-self: start; }
.foot-privacy { grid-column: 3; justify-self: end; }
.foot-terms:hover,
.foot-privacy:hover { color: var(--gold); text-decoration: none; }
.foot-gh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.55rem;
  color: var(--muted);
}
.foot-gh:hover { color: var(--ink); text-decoration: none; }

@media (max-width: 520px) {
  .stage { padding-top: 40px; }
  .hero-title { font-size: clamp(48px, 18vw, 72px); }
}
