:root {
  --ink: #092d3d;
  --ink-soft: #365966;
  --paper: #f5f0e4;
  --paper-deep: #e8dfca;
  --saffron: #f5a524;
  --coral: #ed6a5a;
  --mint: #b8dbc8;
  --white: #fffdf7;
  --shadow: 0 28px 80px rgba(5, 41, 55, 0.2);
  color-scheme: light;
  font-family: "Avenir Next", "Gill Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#app {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: max(20px, env(safe-area-inset-top)) clamp(20px, 5vw, 72px) max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 20% 8%, rgba(245, 165, 36, 0.25), transparent 25rem),
    linear-gradient(135deg, rgba(255, 253, 247, 0.85), rgba(232, 223, 202, 0.72));
}

#app::before {
  position: absolute;
  z-index: -3;
  inset: 0;
  background-image: radial-gradient(rgba(9, 45, 61, 0.12) 0.8px, transparent 0.8px);
  background-size: 18px 18px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.ambient {
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.7;
}

.ambient-one {
  width: 26rem;
  height: 26rem;
  top: 45%;
  left: -15rem;
  background: var(--mint);
}

.ambient-two {
  width: 22rem;
  height: 22rem;
  right: -12rem;
  bottom: -8rem;
  background: rgba(237, 106, 90, 0.22);
}

.masthead,
footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-family: "Kohinoor Gurmukhi", "Noto Sans Gurmukhi", serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border-radius: 50% 50% 50% 10%;
  background: var(--ink);
  color: var(--paper);
}

.masthead-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.lab-link {
  border-bottom: 1px solid rgba(9, 45, 61, 0.35);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.lab-link:hover,
.lab-link:focus-visible {
  border-color: currentColor;
}

.quick-exit,
.end-button {
  border: 1px solid var(--ink-soft);
  border-radius: 999px;
  padding: 9px 15px;
  background: rgba(255, 253, 247, 0.75);
  color: var(--ink);
  cursor: pointer;
}

.pilot-banner,
.human-fallback {
  width: min(760px, 100%);
  margin: 24px auto 0;
  border: 1px solid var(--ink-soft);
  border-radius: 18px;
  padding: 18px 20px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 12px 34px rgba(9, 45, 61, 0.1);
}

.pilot-banner p,
.human-fallback p {
  margin: 7px 0 0;
  line-height: 1.5;
}

.pilot-banner span[lang] {
  display: block;
  margin-top: 5px;
}

.pilot-help-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--ink);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.pilot-help-link span[lang] {
  display: inline;
}

.voice-stage {
  display: grid;
  min-height: min(620px, 68vh);
  place-items: center;
  align-content: center;
  text-align: center;
}

.eyebrow,
.resource-kicker {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  max-width: 14ch;
  margin: 0;
  font-family: "Kohinoor Gurmukhi", "Noto Sans Gurmukhi", Georgia, serif;
  font-size: clamp(2.4rem, 8vw, 5.8rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.status-english {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.3rem);
}

.orb-wrap {
  position: relative;
  display: grid;
  width: clamp(180px, 36vw, 260px);
  height: clamp(180px, 36vw, 260px);
  margin: 38px 0 22px;
  place-items: center;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(9, 45, 61, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one {
  inset: -10px;
}

.orbit-two {
  inset: -28px;
  border-style: dashed;
  animation: rotate 22s linear infinite;
}

.voice-orb,
.active-orb {
  position: absolute;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 50%;
}

.voice-orb {
  z-index: 2;
  border: 0;
  background: var(--ink);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  color: var(--white);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.voice-orb:hover,
.voice-orb:focus-visible {
  transform: scale(1.035);
  box-shadow: 0 34px 90px rgba(5, 41, 55, 0.28), 0 0 0 7px rgba(245, 165, 36, 0.24);
  outline: none;
}

.voice-orb:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(0.35);
}

.voice-orb:disabled:hover {
  transform: none;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.voice-orb svg {
  width: 58px;
  fill: var(--saffron);
}

.voice-orb span {
  position: absolute;
  bottom: 42px;
  font-family: "Kohinoor Gurmukhi", "Noto Sans Gurmukhi", serif;
  font-size: 1.05rem;
}

.active-orb {
  grid-auto-flow: column;
  gap: 7px;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 240ms ease, transform 240ms ease;
}

.active-orb span {
  width: 7px;
  height: 52px;
  border-radius: 99px;
  background: var(--saffron);
  animation: wave 1.1s ease-in-out infinite;
}

.active-orb span:nth-child(2),
.active-orb span:nth-child(4) {
  animation-delay: -0.3s;
}

.active-orb span:nth-child(3) {
  animation-delay: -0.6s;
}

#app:not([data-mode="idle"]):not([data-mode="error"]) .voice-orb {
  opacity: 0;
  pointer-events: none;
}

#app:not([data-mode="idle"]):not([data-mode="error"]) .active-orb {
  opacity: 1;
  transform: scale(1);
}

#app[data-mode="thinking"] .active-orb {
  background: var(--coral);
}

#app[data-mode="thinking"] .active-orb span {
  background: var(--white);
}

#app[data-mode="error"] .active-orb {
  background: #8f2d2d;
}

.permission-note {
  max-width: 36rem;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.privacy-before-start {
  max-width: 48rem;
  margin-top: 16px;
  border-top: 1px solid var(--ink-soft);
  padding-top: 14px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.privacy-before-start p {
  margin: 4px 0;
}

.privacy-before-start a {
  color: var(--ink);
  font-weight: 750;
}

.conversation {
  width: min(760px, 100%);
  min-height: 3.4rem;
  margin: 18px auto 22px;
  padding: 0 16px;
  text-align: center;
}

.transcript {
  margin: 5px 0;
  line-height: 1.45;
}

.user-transcript {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.assistant-transcript {
  font-family: "Kohinoor Gurmukhi", "Noto Sans Gurmukhi", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.resource-card {
  position: relative;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 18px;
  width: min(760px, 100%);
  margin: 0 auto 28px;
  padding: 22px 24px 22px 0;
  overflow: hidden;
  border: 1px solid rgba(9, 45, 61, 0.14);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 18px 50px rgba(9, 45, 61, 0.12);
  animation: rise 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.resource-card[hidden] {
  display: none;
}

.resource-accent {
  align-self: stretch;
  border-radius: 0 9px 9px 0;
  background: var(--saffron);
}

.resource-card h2,
.resource-card p {
  margin: 0;
}

.resource-card h2 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.4rem;
}

.resource-card #resource-provider {
  margin-top: 5px;
  color: var(--ink-soft);
}

.resource-phone {
  align-self: center;
  color: #8f2d2d;
  font-size: 1.12rem;
  font-weight: 800;
}

.resource-open {
  grid-column: 2 / -1;
  justify-self: start;
  color: var(--ink);
  font-weight: 800;
}

.error-message,
.human-fallback,
footer {
  width: min(760px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.error-message {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8ded8;
  color: #66271f;
}

.human-fallback h2 {
  margin: 0;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.35rem;
}

.human-fallback ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 1.2rem;
}

.human-fallback a {
  color: var(--ink);
  font-weight: 700;
}

footer {
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid rgba(9, 45, 61, 0.16);
  color: var(--ink-soft);
  font-size: 0.75rem;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@media (max-width: 640px) {
  #app {
    padding-right: 18px;
    padding-left: 18px;
  }

  .voice-stage {
    min-height: 620px;
  }

  .resource-card {
    grid-template-columns: 7px 1fr;
  }

  .resource-phone {
    grid-column: 2;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
