:root {
  color-scheme: dark;
  --paper: #f4efe5;
  --muted: rgba(244, 239, 229, 0.62);
  --faint: rgba(244, 239, 229, 0.14);
  --gold: #d6ad69;
  --aqua: #8bded4;
  --void: #020303;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 50% 24%, rgba(214, 173, 105, 0.16), transparent 18rem),
    radial-gradient(circle at 48% 58%, rgba(139, 222, 212, 0.07), transparent 26rem),
    linear-gradient(180deg, #050606, var(--void) 48%, #000);
}

a {
  color: inherit;
}

.page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: clamp(24px, 5vw, 56px);
  overflow-x: hidden;
}

.artifact-experience {
  display: grid;
  width: min(100%, 760px);
  justify-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: rgba(139, 222, 212, 0.78);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.2rem, 13vw, 8.5rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.9;
  text-shadow:
    0 0 42px rgba(139, 222, 212, 0.14),
    0 0 96px rgba(214, 173, 105, 0.1);
}

.artifact {
  position: relative;
  width: clamp(190px, 42vw, 390px);
  aspect-ratio: 1;
  margin: clamp(34px, 7vw, 68px) 0 clamp(28px, 5vw, 48px);
  border-radius: 50%;
  filter:
    drop-shadow(0 32px 80px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 48px rgba(214, 173, 105, 0.14));
}

.artifact::before,
.artifact::after,
.artifact-ring,
.artifact-axis,
.artifact-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  content: "";
}

.artifact::before {
  background:
    radial-gradient(circle at 62% 35%, rgba(244, 239, 229, 0.9), transparent 0.45rem),
    radial-gradient(circle at 46% 42%, rgba(244, 239, 229, 0.42), transparent 3rem),
    radial-gradient(circle at 48% 52%, rgba(214, 173, 105, 0.34), transparent 9rem),
    radial-gradient(circle at 50% 50%, rgba(17, 14, 9, 0.92), #050403 72%, transparent 73%);
  border: 1px solid rgba(214, 173, 105, 0.28);
  box-shadow:
    inset 0 0 36px rgba(244, 239, 229, 0.08),
    inset 0 0 120px rgba(0, 0, 0, 0.86);
}

.artifact::after {
  inset: -12%;
  background:
    radial-gradient(circle, transparent 0 48%, rgba(0, 0, 0, 0.45) 70%, #000 84%, transparent 85%),
    conic-gradient(from 20deg, transparent, rgba(139, 222, 212, 0.11), transparent, rgba(214, 173, 105, 0.12), transparent);
  opacity: 0.72;
  animation: artifact-turn 48s linear infinite;
}

.artifact-ring {
  inset: 11%;
  border: 1px solid rgba(214, 173, 105, 0.22);
  box-shadow:
    0 0 48px rgba(214, 173, 105, 0.08),
    inset 0 0 42px rgba(139, 222, 212, 0.05);
}

.artifact-axis {
  top: 50%;
  left: -9%;
  right: -9%;
  width: auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 239, 229, 0.22), rgba(214, 173, 105, 0.68), transparent);
  transform-origin: center;
}

.artifact-axis-one {
  transform: rotate(38deg);
}

.artifact-axis-two {
  opacity: 0.42;
  transform: rotate(-24deg);
}

.artifact-core {
  inset: 46%;
  background: rgba(244, 239, 229, 0.78);
  box-shadow:
    0 0 18px rgba(244, 239, 229, 0.35),
    0 0 60px rgba(214, 173, 105, 0.28);
}

.lead,
.boundary {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.24rem);
  line-height: 1.6;
}

.boundary {
  max-width: 38rem;
  margin-top: 16px;
  color: rgba(244, 239, 229, 0.5);
  font-size: clamp(0.92rem, 1.6vw, 1.02rem);
}

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

[hidden] {
  display: none !important;
}

body:not(.chat-page) .chat-thread,
body:not(.chat-page) .ask-log,
body:not(.chat-page) .ask-select-bar {
  display: none !important;
}

.ask {
  width: min(100%, 28rem);
  margin-top: clamp(22px, 4vw, 36px);
}

.ask-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  background: rgba(3, 6, 7, 0.56);
  border: 1px solid var(--faint);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.ask-bar:focus-within {
  border-color: rgba(214, 173, 105, 0.55);
  box-shadow: 0 0 0 1px rgba(214, 173, 105, 0.28);
}

.ask-bar input,
.ask-bar textarea {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  color: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  background: transparent;
  border: 0;
  outline: 0;
}

.ask-bar textarea {
  max-height: 8rem;
  line-height: 1.35;
  resize: none;
  overflow-y: auto;
}

.chat-composer .ask-bar textarea {
  padding: 10px 0;
}

.ask-bar input::placeholder,
.ask-bar textarea::placeholder {
  color: rgba(244, 239, 229, 0.42);
}

.ask-send {
  min-height: 36px;
  padding: 8px 14px;
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  background: transparent;
  border: 1px solid rgba(214, 173, 105, 0.55);
  border-radius: 999px;
}

.ask-send:hover,
.ask-send:focus-visible {
  color: var(--paper);
  border-color: var(--gold);
  outline: 0;
}

.ask-send:disabled {
  color: rgba(214, 173, 105, 0.42);
  border-color: rgba(214, 173, 105, 0.22);
}

.chat-page {
  overflow: hidden;
}

body.chat-page .page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  min-height: 0;
  place-items: stretch;
  padding: 0;
}

body.chat-page .artifact-experience {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: min(100%, 40rem);
  margin: 0 auto;
  text-align: left;
}

body.chat-page .home-only {
  display: none;
}

body.chat-page .ask {
  width: 100%;
  margin-top: 0;
}

.chat-page .chat-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
}

.chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 16px 20px 8px;
}

.chat-home {
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.chat-home:hover,
.chat-home:focus-visible {
  color: var(--paper);
  outline: 0;
}

.chat-auth {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.chat-auth-session {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.chat-auth-name,
.chat-auth-memory {
  min-width: 0;
  overflow: hidden;
  color: rgba(244, 239, 229, 0.52);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.chat-auth-memory {
  color: rgba(214, 173, 105, 0.62);
}

.chat-auth-link {
  flex-shrink: 0;
  padding: 6px 12px;
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(214, 173, 105, 0.42);
  border-radius: 999px;
  cursor: pointer;
}

.chat-auth-link:hover,
.chat-auth-link:focus-visible {
  color: var(--paper);
  border-color: var(--gold);
  outline: 0;
}

.chat-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: min(100%, 40rem);
  margin: 0 auto;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 8px 20px 0;
  text-align: left;
}

.ask-log {
  display: grid;
  align-content: end;
  flex: 1;
  gap: 14px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(214, 173, 105, 0.28) transparent;
}

.ask-turn {
  margin: 0;
  max-width: 92%;
  font-size: 0.98rem;
  line-height: 1.55;
  border-radius: 10px;
  touch-action: pan-y;
}

body.chat-signed-in .ask-turn {
  -webkit-touch-callout: none;
}

body.ask-selecting .ask-turn {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

body.ask-selecting .ask-turn:hover {
  background: rgba(214, 173, 105, 0.05);
}

.ask-turn-selected {
  background: rgba(214, 173, 105, 0.1);
  box-shadow: inset 0 0 0 1px rgba(214, 173, 105, 0.46);
}

.ask-who {
  display: block;
  margin-bottom: 3px;
  color: rgba(139, 222, 212, 0.62);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ask-turn-user {
  justify-self: end;
  color: var(--muted);
  text-align: right;
}

.ask-turn-user .ask-who {
  color: rgba(214, 173, 105, 0.62);
}

.ask-turn-lightnido {
  justify-self: start;
  color: var(--paper);
  text-align: left;
}

.ask-status {
  flex-shrink: 0;
  margin: 10px 0 0;
  color: rgba(244, 239, 229, 0.5);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  line-height: 1.45;
}

.chat-composer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(2, 3, 3, 0.88) 22%);
}

.ask-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(2, 3, 3, 0.88) 22%);
}

.ask-select-count {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(214, 173, 105, 0.78);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ask-select-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.ask-select-cancel,
.ask-select-delete {
  min-height: 36px;
  padding: 8px 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
}

.ask-select-cancel {
  color: rgba(244, 239, 229, 0.7);
  border: 1px solid rgba(244, 239, 229, 0.2);
}

.ask-select-delete {
  color: var(--gold);
  border: 1px solid rgba(214, 173, 105, 0.5);
}

.ask-select-cancel:hover,
.ask-select-cancel:focus-visible {
  color: var(--paper);
  border-color: rgba(244, 239, 229, 0.42);
  outline: 0;
}

.ask-select-delete:hover,
.ask-select-delete:focus-visible {
  color: var(--paper);
  border-color: var(--gold);
  outline: 0;
}

.ask-select-delete:disabled {
  color: rgba(214, 173, 105, 0.42);
  border-color: rgba(214, 173, 105, 0.22);
  cursor: default;
}

body.ask-selecting .chat-composer {
  display: none;
}

.chat-composer .ask-bar {
  align-items: flex-end;
}

.sources {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(28px, 5vw, 46px);
  font-family: Arial, Helvetica, sans-serif;
}

.sources a {
  min-height: 36px;
  padding: 9px 13px;
  color: rgba(244, 239, 229, 0.66);
  background: rgba(3, 6, 7, 0.56);
  border: 1px solid var(--faint);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.sources a:hover,
.sources a:focus-visible {
  color: var(--paper);
  border-color: rgba(139, 222, 212, 0.58);
  outline: 0;
}

@keyframes artifact-turn {
  from {
    rotate: 0deg;
  }

  to {
    rotate: 360deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 22px 16px 30px;
  }

  .artifact {
    width: min(78vw, 300px);
  }

  .ask {
    width: 100%;
  }

  .ask-bar {
    padding: 5px 5px 5px 14px;
  }

  .chat-top {
    padding: 14px 16px 6px;
  }

  .chat-auth-name {
    display: none;
  }

  .chat-thread {
    padding: 6px 16px 0;
  }

  .chat-composer,
  .ask-select-bar {
    padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .sources {
    gap: 8px;
  }

  .sources a {
    min-height: 34px;
    padding: 8px 11px;
    font-size: 0.72rem;
  }
}

body.docs-site {
  overflow-y: auto;
}

body.docs-site .page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 0 6.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: min(100%, 40rem);
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 32px) 0;
}

.site-mark {
  color: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-mark:hover,
.site-mark:focus-visible {
  color: var(--paper);
  outline: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: flex-end;
}

.site-nav a {
  color: rgba(244, 239, 229, 0.58);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--paper);
  outline: 0;
}

.site-nav .site-nav-quiet {
  color: rgba(244, 239, 229, 0.36);
}

.docs-hero {
  display: grid;
  width: min(100%, 38rem);
  margin: 0 auto;
  padding: 40px clamp(20px, 5vw, 32px) 4px;
  justify-items: center;
  text-align: center;
}

body.docs-site h1.home-title {
  font-size: clamp(2.8rem, 11vw, 5.8rem);
}

body.docs-site .artifact {
  width: clamp(176px, 38vw, 292px);
  margin: clamp(28px, 6vw, 52px) 0 clamp(10px, 2vw, 18px);
}

.spindle {
  display: block;
  width: 1px;
  height: 44px;
  margin: 10px auto 28px;
  background: linear-gradient(180deg, transparent, rgba(214, 173, 105, 0.62), transparent);
}

.spindle-inline {
  height: 36px;
  margin: 18px 0 22px;
}

.home-sentence {
  max-width: 22rem;
  margin: 0;
  color: var(--paper);
  font-size: clamp(1.18rem, 2.6vw, 1.42rem);
  line-height: 1.4;
}

.home-invite {
  max-width: 28rem;
  margin-top: 18px;
  font-size: clamp(0.98rem, 1.7vw, 1.08rem);
}

.docs-main {
  width: min(100%, 36rem);
  margin: 0 auto;
  padding: 12px clamp(20px, 5vw, 32px) 0;
  text-align: left;
}

.docs-article h1 {
  font-size: clamp(2.2rem, 7vw, 3.3rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-shadow: none;
}

.docs-article h2,
.docs-main h2 {
  margin: 2.6rem 0 0.8rem;
  color: var(--paper);
  font-size: 1.16rem;
  font-weight: 400;
}

.docs-article p,
.docs-article li,
.docs-main p {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.8vw, 1.12rem);
  line-height: 1.75;
}

.docs-article .lead,
.docs-hero .lead {
  color: rgba(244, 239, 229, 0.58);
}

.docs-article a,
.docs-main a {
  color: rgba(244, 239, 229, 0.86);
}

.docs-main .sources a {
  color: rgba(244, 239, 229, 0.66);
}

.docs-article a:hover,
.docs-article a:focus-visible,
.docs-main a:hover,
.docs-main a:focus-visible {
  color: var(--paper);
  outline: 0;
}

.docs-article ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.docs-article li + li {
  margin-top: 0.45rem;
}

.docs-index {
  display: grid;
  gap: 0;
  margin: 2.6rem 0 0;
  padding: 0;
  list-style: none;
}

.docs-index li + li {
  border-top: 1px solid var(--faint);
}

.docs-index a {
  display: block;
  padding: 1.2rem 0;
  color: var(--paper);
  text-decoration: none;
  background: none;
  border: 0;
}

.docs-index a:hover,
.docs-index a:focus-visible {
  outline: 0;
}

.docs-index a:hover strong,
.docs-index a:focus-visible strong {
  color: var(--paper);
}

.docs-index strong {
  display: block;
  margin-bottom: 6px;
  color: rgba(244, 239, 229, 0.88);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-transform: none;
}

.docs-index span {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.docs-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 2.4rem;
}

.docs-links a {
  color: rgba(244, 239, 229, 0.7);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.docs-links a:hover,
.docs-links a:focus-visible {
  color: var(--paper);
  outline: 0;
}

.docs-main .sources {
  margin-top: clamp(36px, 6vw, 56px);
}

.ask-optional {
  margin-top: 2.4rem;
  padding-top: 1.3rem;
  color: rgba(244, 239, 229, 0.42);
  font-size: 0.92rem;
  line-height: 1.6;
  border-top: 1px solid var(--faint);
}

.ask-optional a {
  margin-left: 0.35rem;
  color: rgba(244, 239, 229, 0.7);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.ask-go {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 8px 14px;
  color: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  border: 1px solid var(--faint);
  border-radius: 999px;
}

.ask-go:hover,
.ask-go:focus-visible {
  border-color: rgba(244, 239, 229, 0.42);
  outline: 0;
}

.chat-experimental {
  flex-shrink: 0;
  margin: 0;
  color: rgba(244, 239, 229, 0.4);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  body.docs-site .page {
    padding: 0 0 4.2rem;
  }

  .site-header {
    padding: 20px 20px 0;
  }

  .docs-hero,
  .docs-main {
    padding-left: 20px;
    padding-right: 20px;
  }

  body.docs-site .artifact {
    width: min(64vw, 240px);
    width: min(64vw, 240px, 26svh);
  }

  /* First screen on phones: the hero fills the smallest viewport (Safari bars
     shown), so no index text starts under Safari's bottom bar on first load. */
  body.docs-site .docs-hero {
    min-height: 100vh;
    min-height: 100svh;
    align-content: center;
    box-sizing: border-box;
    /* Hero starts below the ~70px header, so its bottom edge sits past the
       viewport; reserve header + Safari's ~90px bottom bar + breathing room. */
    padding-bottom: calc(180px + env(safe-area-inset-bottom, 0px));
  }

  .home-sentence {
    max-width: 18rem;
  }
}

.chat-ai-note {
  margin: 8px 4px 0;
  color: rgba(244, 239, 229, 0.72);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.74rem;
  line-height: 1.4;
  text-align: center;
}

.chat-ai-note a {
  color: var(--gold);
}

body.docs-site .ai-label {
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(214, 173, 105, 0.35);
  border-radius: 6px;
}

/* Short phones (e.g. Safari with toolbars at 390x664): tighten the hero so
   the first screen still clears the bottom bar. */
@media (max-width: 520px) and (max-height: 720px) {
  body.docs-site .docs-hero {
    padding-top: 12px;
  }

  body.docs-site .artifact {
    margin: 14px 0 6px;
    width: min(64vw, 200px, 22svh);
  }

  body.docs-site .spindle {
    height: 20px;
  }
}
