/* ------------------------------------------------------------------
   Curio — a warm, family-friendly explorer for the TV
   ------------------------------------------------------------------ */

:root {
  --bg: #070a10;
  --bg-2: #0b111d;
  --panel: rgba(17, 24, 40, 0.82);
  --panel-solid: #111828;
  --panel-2: rgba(25, 35, 56, 0.82);
  --text: #f5f1e7;
  --text-soft: #d9d4e3;
  --muted: #a4a0b5;
  --faint: #74738a;
  --line: rgba(238, 242, 255, 0.12);
  --line-strong: rgba(238, 242, 255, 0.24);
  --accent: #f6b94b;
  --accent-2: #65d6c1;
  --accent-ink: #1a1204;
  --accent-soft: rgba(246, 185, 75, 0.14);
  --accent-2-soft: rgba(101, 214, 193, 0.12);
  --danger: #ff8a8a;
  --danger-soft: rgba(255, 105, 105, 0.12);
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.48);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.3);
  --radius: 28px;
  --radius-sm: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
}

body.mode-kid {
  --accent: #f6b94b;
  --accent-2: #65d6c1;
  --accent-soft: rgba(246, 185, 75, 0.15);
  --accent-2-soft: rgba(101, 214, 193, 0.12);
}

body.mode-teen {
  --accent: #b9a2ff;
  --accent-2: #6ee7f2;
  --accent-soft: rgba(185, 162, 255, 0.15);
  --accent-2-soft: rgba(110, 231, 242, 0.12);
}

body.mode-adult {
  --accent: #9bdcb2;
  --accent-2: #e7c27a;
  --accent-soft: rgba(155, 220, 178, 0.14);
  --accent-2-soft: rgba(231, 194, 122, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  position: relative;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(1100px 760px at 10% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(1000px 760px at 105% 108%, var(--accent-2-soft), transparent 60%),
    linear-gradient(145deg, #070a10 0%, #0b111d 48%, #060910 100%);
  font-family: var(--sans);
  font-size: clamp(16px, 1.15vw, 21px);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

a {
  color: var(--accent);
}

::selection {
  color: var(--accent-ink);
  background: var(--accent);
}

:focus {
  outline: none;
}

button:focus,
input:focus,
a:focus,
[tabindex="0"]:focus {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 4px solid var(--accent);
  outline-offset: 5px;
}

/* Atmosphere --------------------------------------------------------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.75;
  animation: auroraDrift 18s ease-in-out infinite alternate;
}

.aurora-a {
  top: -18%;
  left: 8%;
  width: 44vw;
  height: 44vw;
  background: var(--accent-soft);
}

.aurora-b {
  top: 34%;
  right: -14%;
  width: 40vw;
  height: 40vw;
  background: var(--accent-2-soft);
  animation-delay: -6s;
}

.aurora-c {
  bottom: -22%;
  left: 34%;
  width: 38vw;
  height: 38vw;
  background: rgba(134, 116, 255, 0.08);
  animation-delay: -11s;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* App shell ---------------------------------------------------------- */

.app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex: 0 0 auto;
  min-height: 88px;
  padding: 0 clamp(22px, 3.2vw, 58px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 10, 16, 0.7), rgba(7, 10, 16, 0.24));
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 8px 10px 8px 0;
  border: 0;
  background: none;
  text-align: left;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 72%, transparent);
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 24%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 55%),
    rgba(255, 255, 255, 0.025);
  box-shadow:
    inset 0 0 22px var(--accent-soft),
    0 0 28px color-mix(in srgb, var(--accent) 10%, transparent);
}

.brand-letter {
  font-family: var(--serif);
  font-size: 30px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

.brand-mark i {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1;
}

.brand-name {
  font-family: var(--serif);
  font-size: clamp(24px, 1.8vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-tag {
  margin-top: 7px;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-center {
  display: flex;
  justify-content: center;
  flex: 1 1 auto;
}

.age-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 10, 16, 0.5);
}

.age-switch button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.age-switch button:hover {
  color: var(--text);
}

.age-switch button[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 24%, transparent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.lang-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.lang-btn {
  gap: 8px;
  min-width: 80px;
  padding: 0 16px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.lang-globe {
  color: var(--accent);
  font-size: 16px;
}

.icon-btn {
  width: 48px;
  padding: 0;
  border-radius: 50%;
}

.icon-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.lang-btn:hover,
.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

/* Stage -------------------------------------------------------------- */

.stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(24px, 3.6vh, 52px) clamp(22px, 3.2vw, 58px);
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  scrollbar-width: thin;
}

.stage::-webkit-scrollbar {
  width: 8px;
}

.stage::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

/* Ask panel ---------------------------------------------------------- */

.ask-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(1180px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(18px, 3vh, 38px) 0 12px;
  text-align: center;
}

.ask-orbit {
  position: absolute;
  top: -6%;
  left: 50%;
  width: min(760px, 75vw);
  aspect-ratio: 1;
  pointer-events: none;
  transform: translateX(-50%);
  opacity: 0.5;
}

.orbit-ring {
  position: absolute;
  inset: 18%;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 50%;
  animation: slowSpin 46s linear infinite;
}

.orbit-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 22px var(--accent);
}

.orbit-dot-a {
  top: 18%;
  left: 22%;
  animation: floatY 7s ease-in-out infinite;
}

.orbit-dot-b {
  right: 18%;
  bottom: 26%;
  width: 5px;
  height: 5px;
  background: var(--accent-2);
  box-shadow: 0 0 18px var(--accent-2);
  animation: floatY 9s ease-in-out -3s infinite;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.ask-eyebrow {
  position: relative;
  z-index: 1;
  justify-content: center;
  margin-bottom: clamp(18px, 2.4vh, 30px);
  color: var(--accent);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

.ask-panel h1 {
  position: relative;
  z-index: 1;
  max-width: 1050px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5.5vw, 92px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.96;
  text-wrap: balance;
}

.lede {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: clamp(18px, 2.4vh, 28px) 0 clamp(26px, 3.6vh, 40px);
  color: var(--muted);
  font-size: clamp(17px, 1.35vw, 23px);
  line-height: 1.5;
  text-wrap: balance;
}

.ask-form {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(980px, 100%);
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    rgba(13, 19, 32, 0.9);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.ask-form:focus-within {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow:
    var(--shadow),
    0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent),
    0 0 55px var(--accent-soft);
}

.ask-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 62px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(19px, 1.55vw, 27px);
  letter-spacing: -0.01em;
}

.ask-form input::placeholder,
.chat-form input::placeholder {
  color: var(--faint);
}

.ask-form input:focus,
.chat-form input:focus {
  outline: none;
}

.round-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.round-btn svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.round-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.mic-btn.listening {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  animation: micPulse 1.4s ease-in-out infinite;
}

.ask-btn,
.primary-btn,
.send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 20%, transparent);
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
}

.ask-btn {
  min-width: 178px;
  height: 62px;
  border-radius: 17px;
  font-size: clamp(16px, 1.1vw, 19px);
}

.ask-btn:hover,
.primary-btn:hover,
.send-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 26%, transparent);
}

.ask-arrow,
.send-btn > span:last-child {
  font-size: 1.15em;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26, 18, 4, 0.25);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ask-btn.busy .spinner {
  display: inline-block;
}

.ask-btn.busy .ask-arrow {
  display: none;
}

.thinking {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.thinking-orbit {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.suggestions-head {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(980px, 100%);
  margin: clamp(28px, 4vh, 44px) 0 14px;
  text-align: left;
}

.suggestions-rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(980px, 100%);
  text-align: left;
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 68px;
  padding: 12px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.028);
  color: var(--text-soft);
  text-align: left;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.suggestion:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, transparent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.suggestion-emoji {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 20px;
}

.suggestion-text {
  font-size: clamp(14px, 1.02vw, 17px);
  line-height: 1.3;
}

.calendar-strip-wrap {
  width: min(980px, 100%);
  margin-top: clamp(30px, 4.4vh, 50px);
  text-align: left;
}

.calendar-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.text-btn {
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.text-btn:hover {
  color: var(--accent);
}

.calendar-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.calendar-strip .event-card {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.calendar-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 16px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  font-size: 14px;
}

.calendar-empty strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-soft);
  font-weight: 600;
}

.calendar-empty-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
}

/* Result ------------------------------------------------------------- */

.result {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding-bottom: 40px;
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  min-height: min(54vh, 560px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-media {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 55%),
    radial-gradient(circle at 78% 82%, var(--accent-2-soft), transparent 55%),
    linear-gradient(145deg, #182137, #0c1220);
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: imageIn 0.8s ease both;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(7, 10, 16, 0.05) 0%,
    rgba(7, 10, 16, 0.02) 48%,
    rgba(17, 24, 40, 0.86) 100%
  );
  pointer-events: none;
}

.hero-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.fallback-star {
  position: relative;
  z-index: 2;
  color: var(--accent);
  font-size: clamp(90px, 12vw, 190px);
  line-height: 1;
  text-shadow: 0 0 60px color-mix(in srgb, var(--accent) 45%, transparent);
  animation: breathe 5.5s ease-in-out infinite;
}

.fallback-ring {
  position: absolute;
  width: 54%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 50%;
}

.fallback-ring-b {
  width: 76%;
  border-color: color-mix(in srgb, var(--accent-2) 18%, transparent);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 3.6vw, 62px);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.calendar-badge {
  border-color: color-mix(in srgb, var(--accent-2) 40%, transparent);
  color: var(--accent-2);
  background: var(--accent-2-soft);
}

.hero-copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(36px, 4.1vw, 70px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}

.answer {
  max-height: 32vh;
  margin: clamp(18px, 2.2vh, 28px) 0 0;
  overflow-y: auto;
  padding-right: 8px;
  color: var(--text-soft);
  font-size: clamp(17px, 1.28vw, 23px);
  line-height: 1.52;
  white-space: pre-wrap;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  scrollbar-width: thin;
}

.answer::-webkit-scrollbar {
  width: 6px;
}

.answer::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.notice {
  margin-top: 16px;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.4;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: clamp(22px, 3vh, 34px);
}

.primary-btn {
  min-height: 52px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-weight: 600;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.ghost-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-1px);
}

.read-icon {
  color: var(--accent);
  font-size: 15px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.card {
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-head h3 {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.card-mark {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.facts-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts-list li {
  position: relative;
  padding-inline-start: 20px;
  color: var(--text-soft);
  font-size: clamp(14px, 1.02vw, 17px);
  line-height: 1.42;
}

.facts-list li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  inset-inline-start: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.facts-list li.empty-fact {
  color: var(--faint);
  font-style: italic;
}

.facts-list li.empty-fact::before {
  background: var(--faint);
  box-shadow: none;
}

.sources {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sources:empty {
  display: none;
}

.sources a {
  overflow: hidden;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sources a:hover {
  color: var(--accent);
}

.follow-list {
  display: grid;
  gap: 9px;
}

.follow-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: clamp(13px, 0.94vw, 16px);
  line-height: 1.3;
  text-align: start;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.follow-btn::after {
  content: "→";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 15px;
}

html[dir="rtl"] .follow-btn::after {
  content: "←";
}

.follow-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  background: var(--accent-soft);
  transform: translateX(2px);
}

html[dir="rtl"] .follow-btn:hover {
  transform: translateX(-2px);
}

.calendar-list {
  display: grid;
  gap: 10px;
}

.event-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.event-date {
  display: grid;
  place-items: center;
  width: 48px;
  flex: 0 0 auto;
  padding: 6px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1;
}

.event-day {
  color: var(--text);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.event-month {
  margin-top: 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.event-copy {
  min-width: 0;
  padding-top: 1px;
}

.event-title {
  overflow: hidden;
  color: var(--text-soft);
  font-size: clamp(13px, 0.92vw, 16px);
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-meta {
  margin-top: 4px;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-location {
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chat --------------------------------------------------------------- */

.chat {
  margin-top: 16px;
  padding: clamp(20px, 2.4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.chat-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.chat-head .eyebrow {
  color: var(--accent);
}

.chat-head h3 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(20px, 1.5vw, 27px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.chat-log {
  display: grid;
  gap: 10px;
  max-height: 320px;
  margin-bottom: 16px;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  scrollbar-width: thin;
}

.chat-log:empty {
  display: none;
}

.chat-bubble {
  max-width: min(82%, 900px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: clamp(14px, 1vw, 17px);
  line-height: 1.45;
  white-space: pre-wrap;
  animation: rise 0.3s ease both;
}

.chat-bubble.user {
  justify-self: end;
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  border-end-end-radius: 5px;
  background: var(--accent-soft);
  color: var(--text);
}

.chat-bubble.assistant {
  justify-self: start;
  border-end-start-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
}

.chat-bubble.typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
}

.chat-bubble.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing 1.2s ease-in-out infinite;
}

.chat-bubble.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-bubble.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 10, 16, 0.42);
  transition: border-color 0.2s ease;
}

.chat-form:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.chat-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(16px, 1.16vw, 20px);
}

.chat-form .round-btn {
  width: 46px;
  height: 46px;
}

.send-btn {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 13px;
}

/* Footer hints ------------------------------------------------------- */

.hints {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 22px 10px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hints > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

/* Modals ------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.74);
  backdrop-filter: blur(10px);
}

.sheet,
.token-card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(88dvh, 820px);
  overflow-y: auto;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(600px 300px at 20% -10%, var(--accent-soft), transparent 60%),
    #0f1626;
  box-shadow: var(--shadow);
  animation: sheetIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  scrollbar-width: thin;
}

.token-card {
  width: min(460px, 100%);
  text-align: center;
}

.token-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 38px;
  font-style: italic;
  font-weight: 600;
  box-shadow: 0 0 40px var(--accent-soft);
}

.token-card h2,
.sheet h2 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.token-card p:not(.eyebrow):not(.form-error),
.sheet-lede {
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.sheet-head .icon-btn {
  flex: 0 0 auto;
  font-size: 28px;
  line-height: 1;
}

.status-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.status-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
}

.status-dot.ok {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px var(--accent-2-soft);
}

.status-dot.warn {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.status-row strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.status-row span:not(.status-dot) {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 20px;
  text-align: start;
}

.field span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  height: 54px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(7, 10, 16, 0.42);
  color: var(--text);
  font-size: 17px;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.sheet-actions .primary-btn,
.sheet-actions .ghost-btn {
  min-height: 48px;
}

.fineprint {
  margin: 24px 0 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-error {
  margin: -8px 0 16px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  text-align: start;
}

/* On-screen keyboard ------------------------------------------------ */

.keyboard-wrap {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.keyboard-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.68);
  backdrop-filter: blur(8px);
}

.keyboard-sheet {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  max-height: 76dvh;
  margin-bottom: 18px;
  overflow-y: auto;
  padding: clamp(16px, 2vw, 26px);
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background:
    radial-gradient(700px 300px at 50% 0%, var(--accent-soft), transparent 64%),
    #0f1626;
  box-shadow: var(--shadow);
  animation: keyboardIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  scrollbar-width: thin;
}

.keyboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.keyboard-preview {
  flex: 1 1 auto;
  min-height: 42px;
  overflow: hidden;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 10, 16, 0.42);
  color: var(--text);
  font-size: 20px;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyboard-preview::after {
  content: "|";
  margin-inline-start: 2px;
  color: var(--accent);
  animation: caret 1s steps(1) infinite;
}

.keyboard-rows {
  display: grid;
  gap: 8px;
  direction: ltr;
}

.keyboard-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  height: clamp(46px, 6.2vh, 62px);
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: clamp(17px, 1.4vw, 22px);
  font-weight: 600;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.key:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transform: translateY(-1px);
}

.key.wide {
  flex: 2.1 1 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.key.ask {
  flex: 1.6 1 0;
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.key.ask:hover {
  background: var(--accent);
  filter: brightness(1.06);
}

/* Toast -------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 200;
  max-width: min(560px, calc(100% - 32px));
  padding: 14px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 54%, transparent);
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow);
  transform: translate(-50%, 0);
  animation: toastIn 0.3s ease both;
}

.toast.error {
  border-color: color-mix(in srgb, var(--danger) 54%, transparent);
  background: #3a151b;
  color: var(--danger);
}

/* Misc --------------------------------------------------------------- */

.noscript {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

/* RTL ---------------------------------------------------------------- */

html[dir="rtl"] body {
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
}

html[dir="rtl"] .brand,
html[dir="rtl"] .brand-copy {
  text-align: right;
}

html[dir="rtl"] .suggestions,
html[dir="rtl"] .suggestion,
html[dir="rtl"] .calendar-strip-wrap,
html[dir="rtl"] .calendar-strip-head,
html[dir="rtl"] .event-copy,
html[dir="rtl"] .card {
  text-align: right;
}

html[dir="rtl"] .hero-scrim {
  background: linear-gradient(
    270deg,
    rgba(7, 10, 16, 0.05) 0%,
    rgba(7, 10, 16, 0.02) 48%,
    rgba(17, 24, 40, 0.86) 100%
  );
}

html[dir="rtl"] .suggestions-rule {
  background: linear-gradient(270deg, var(--line), transparent);
}

html[dir="rtl"] .source,
html[dir="rtl"] .sources a {
  text-align: right;
}

html[dir="rtl"] .keyboard-rows {
  direction: ltr;
}

/* Responsive --------------------------------------------------------- */

@media (max-width: 1120px) {
  .result-hero {
    grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-card {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .calendar-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding-block: 12px;
  }

  .topbar-center {
    order: 3;
    flex-basis: 100%;
  }

  .ask-panel h1 {
    font-size: clamp(40px, 8vw, 68px);
  }

  .suggestions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-strip {
    grid-template-columns: 1fr;
  }

  .result-hero {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 280px;
  }

  .hero-scrim {
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(17, 24, 40, 0.25) 52%,
      #111828 100%
    );
  }

  html[dir="rtl"] .hero-scrim {
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(17, 24, 40, 0.25) 52%,
      #111828 100%
    );
  }

  .answer {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .stage {
    padding: 22px 16px;
  }

  .topbar {
    padding-inline: 16px;
  }

  .brand-tag,
  .hints {
    display: none;
  }

  .age-switch button {
    padding: 0 12px;
    font-size: 9px;
  }

  .ask-form {
    flex-wrap: wrap;
    border-radius: 20px;
  }

  .ask-form input {
    flex-basis: calc(100% - 124px);
    height: 54px;
  }

  .ask-btn {
    width: 100%;
    min-width: 0;
    height: 54px;
    order: 10;
  }

  .suggestions {
    grid-template-columns: 1fr;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .calendar-card {
    grid-column: auto;
  }

  .calendar-list {
    grid-template-columns: 1fr;
  }

  .sheet-actions {
    display: grid;
  }

  .sheet-actions > * {
    width: 100%;
  }

  .chat-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-bubble {
    max-width: 92%;
  }
}

@media (max-height: 760px) and (min-width: 901px) {
  .topbar {
    min-height: 74px;
  }

  .stage {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .ask-panel {
    padding-top: 6px;
  }

  .ask-panel h1 {
    font-size: clamp(38px, 4.6vw, 72px);
  }

  .lede {
    margin-top: 14px;
    margin-bottom: 22px;
  }

  .suggestions-head {
    margin-top: 22px;
  }

  .calendar-strip-wrap {
    margin-top: 24px;
  }

  .hints {
    min-height: 34px;
  }
}

/* Motion -------------------------------------------------------------- */

@keyframes auroraDrift {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(3%, 2%, 0) scale(1.08);
  }
}

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

@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

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

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

@keyframes imageIn {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes typing {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

@keyframes micPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 36%, transparent);
  }
  50% {
    box-shadow: 0 0 0 9px transparent;
  }
}

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