/* ==========================================================================
   Soumyadeep's Universe — stylesheet
   1. Tokens & base
   2. Layout shell (canvas, main, nav)
   3. Planet labels & selection bar
   4. Intro splash
   5. World panel (shared)
   6. World panel (per planet: engineer / writer / artist / thinker / explorer)
   7. Reduced motion
   ========================================================================== */

/* ==========================================================================
   1. Tokens & base
   ========================================================================== */

:root {
  color-scheme: dark;

  /* palette */
  --bg:   #0f0d2e;
  --ink:  #f1eefc;
  --soft: #aaa4e6;
  --sun:  #ffc233;

  /* one accent per world */
  --eng: #3ed1c9;
  --wri: #ffb347;
  --art: #ff6b9e;
  --thi: #a48bff;
  --exp: #7fd47f;
  --bok: #ff7a59;
  --cin: #5bc0ff;

  /* typography */
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body:    Newsreader, Georgia, serif;
  --font-mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* The `hidden` attribute must always win.
   The browser's built-in rule is `[hidden] { display: none }` — specificity
   0-1-0. An id selector like `#gate { display: grid }` is 1-0-0, so it beats
   it, and the element stays on screen even though JS set `.hidden = true`.
   That is how the login card ended up covering the whole booted admin.
   One line, applied once, makes `hidden` reliable everywhere. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(ellipse at 50% 35%, #2a2072, var(--bg) 65%);
  color: var(--ink);
  font: 19px/1.6 var(--font-body);
}

h1, h2, button, .k { font-family: var(--font-display); }


/* ==========================================================================
   2. Layout shell
   ========================================================================== */

/* WebGL canvas sits behind everything */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  touch-action: none;
  cursor: grab;
}
#gl:active { cursor: grabbing; }

/* Overlay content. Pointer events are off so drags reach the canvas,
   and switched back on only for the interactive bits. */
main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
main > * { pointer-events: none; }
nav, nav button { pointer-events: auto; }

.sp { flex: 1; } /* spacer pushing the nav to the bottom */

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 6px 16px 56px;
}

nav button {
  border: 2px solid var(--c);
  border-radius: 99px;
  padding: 9px 17px;
  background: #0006;
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
nav button:hover,
nav button:focus-visible { background: var(--c); color: #111; outline: none; }
nav button:hover { transform: translateY(-3px); }


/* ==========================================================================
   3. Planet labels & selection bar
   ========================================================================== */

#labels {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.lb {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 11px;
  border: 1.5px solid var(--c);
  border-radius: 99px;
  background: #0b0826cc;
  color: #fff;
  font: 500 0.8rem var(--font-display);
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
}
.lb:hover,
.lb:focus-visible { background: var(--c); color: #111; outline: none; }

/* the sun's own label */
.lb.sl {
  border-color: #ffc233;
  background: #ffc233;
  color: #3a2200;
  font-weight: 800;
  cursor: default;
  pointer-events: none;
}

/* "Chat with Soumyadeep" — top-right on the home view only. Deliberately not
   near the bottom: the nav wraps to a second row and the selection bar already
   claims the space above it. */
#chat {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  z-index: 4;
  padding: 9px 16px;
  border: 1px solid #ffffff2e;
  border-radius: 999px;
  background: #ffffff0f;
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
#chat:hover,
#chat:focus-visible {
  background: var(--sun);
  border-color: var(--sun);
  color: #2a1a00;
  transform: translateY(-1px);
}
#chat[hidden] { display: none; }

@media (max-width: 480px) {
  #chat { font-size: 13px; padding: 8px 13px; right: 12px; }
}

#selbar {
  position: fixed;
  left: 50%;
  /* Sit clear of the nav whatever height it is. --navh is measured in
     universe.js, because the nav wraps to a second row once there are
     enough planets (and back to one when some are switched off). The
     118px fallback is the single-row height, used before the first
     measurement and if JS never runs. */
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--navh, 118px) + 14px);
  transform: translateX(-50%);
  z-index: 3;
  display: none;
  gap: 10px;
  align-items: center;
  padding: 8px 10px 8px 18px;
  border: 1px solid #fff4;
  border-radius: 99px;
  background: #0b0826ee;
  color: #fff;
  font: 500 0.92rem var(--font-display);
  white-space: nowrap;
}
#selbar.on { display: flex; }

#selbar button {
  border: 0;
  border-radius: 99px;
  padding: 6px 14px;
  background: #ffc233;
  color: #2a1a00;
  font: inherit;
  cursor: pointer;
}
#selbar button + button { background: #fff2; color: #fff; }


/* ==========================================================================
   4. Intro splash
   Covers the scene for 3s on every load, then fades out. JS adds .out.
   ========================================================================== */

#intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 45%, #2a2072f2, #0f0d2efa 70%);
  transition: opacity 0.7s ease, visibility 0.7s;
  cursor: pointer;
}
#intro.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#intro-title {
  margin: 0;
  max-width: 16em;
  font-size: clamp(1.7rem, 5.6vw, 3.6rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* whole words stay together when the line wraps */
.wd { display: inline-block; }

/* each character of the splash title, staggered by --d */
.ch {
  display: inline-block;
  animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: var(--d);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(0.6em) rotate(8deg); }
}


/* ==========================================================================
   5. World panel (shared)
   ========================================================================== */

#world {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px 60px;
  animation: land 0.5s ease-out;
  /* You have just zoomed into a bright planet, and it sits directly behind
     this text. A scrim keeps the starfield visible but stops the planet
     bleeding through the cards. */
  background: radial-gradient(ellipse at 50% 22%, #0c0a24e8, #04030cf7 72%);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
#world[hidden] { display: none; }

@keyframes land {
  from { opacity: 0; transform: scale(1.12); }
}

#back {
  position: sticky;
  top: 0;
  border: 0;
  border-radius: 99px;
  padding: 9px 16px;
  background: #000a;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
}
#back:focus-visible,
.sw:focus-visible,
.q:focus-visible { outline: 3px solid #fff; }

.wc { max-width: 780px; margin: 18px auto 0; }

/* kicker above each world title */
.k { font-weight: 800; font-size: 0.95rem; }

.wc h2 {
  margin: 4px 0 14px;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.05;
}


/* ==========================================================================
   6. World panel — per planet
   ========================================================================== */

/* --- The Engineer -------------------------------------------------------- */
.w-engineer { background: #07191c; color: #c9fffb; }
.w-engineer .k { color: var(--eng); }

.term {
  border: 1px solid #1d5b58;
  border-radius: 12px;
  background: #031012;
  overflow: hidden;
}

.tb {
  display: flex;
  gap: 7px;
  padding: 9px 12px;
  background: #0d2a2c;
}
.tb i { width: 11px; height: 11px; border-radius: 50%; background: #1d5b58; }

.term pre {
  margin: 0;
  padding: 18px;
  min-height: 360px;
  font: 15px/1.7 var(--font-mono);
  white-space: pre-wrap;
}
.term pre b { color: var(--eng); }

.cur::after { content: "▌"; animation: bl 1s steps(2) infinite; }
@keyframes bl { 50% { opacity: 0; } }

/* --- The Writer ---------------------------------------------------------- */
.w-writer { background: #2b2118; color: #2a2118; }
.w-writer .k { color: #8a4b00; }

.paper {
  padding: clamp(24px, 5vw, 52px);
  border-radius: 6px;
  background: #f4ead6;
  background-image: repeating-linear-gradient(transparent 0 31px, #d9c9a6 31px 32px);
  box-shadow: 0 20px 60px #0008;
}
.paper h2 {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
}
.paper p {
  margin: 0;
  min-height: 230px;
  font-size: 1.2rem;
  line-height: 32px;
}
.works-h {
  margin: 26px 0 10px;
  padding-top: 18px;
  border-top: 1px solid #d9c9a6;
  font: 800 0.78rem var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a6a3a;
}

.works { margin: 0; padding: 0; list-style: none; }
.works li { border-top: 1px solid #d9c9a6; }
.works li:last-child { border-bottom: 1px solid #d9c9a6; }

.works a, .works .w-plain {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 14px;
  padding: 13px 4px;
  color: inherit;
  text-decoration: none;
}
.works a:hover { background: #e8dcc2; }
.works a:focus-visible { outline: 2px solid #8a4b00; outline-offset: -2px; }

.w-kind {
  font: 800 0.68rem var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a07a3c;
}
.w-title {
  font: 400 1.18rem var(--font-body);
  font-style: italic;
}
.w-go { color: #a07a3c; font-size: 0.95rem; }
.works a:hover .w-go { color: #8a4b00; }
.w-note {
  grid-column: 2 / -1;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #6b5230;
}
.w-empty { margin: 18px 0 0; font-style: italic; color: #6b5230; }

/* --- The Artist ---------------------------------------------------------- */
.w-artist { background: linear-gradient(160deg, #2b0a22, #12062b); }
.w-artist .k { color: var(--art); }

#cv {
  display: block;
  width: 100%;
  height: min(56vh, 420px);
  border: 1px solid #ff6b9e55;
  border-radius: 14px;
  background: #0a0418;
  touch-action: none;
  cursor: crosshair;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.sw {
  width: 34px;
  height: 34px;
  border: 2px solid #fff6;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
  transition: transform 0.15s;
}
.sw:hover { transform: scale(1.25); }

.tools button.cl {
  margin-left: auto;
  border: 1px solid #fff4;
  border-radius: 99px;
  padding: 6px 14px;
  background: #fff1;
  color: #fff;
  cursor: pointer;
}

/* --- The Thinker --------------------------------------------------------- */
.w-thinker { background: radial-gradient(circle at 50% 30%, #2a1f6b, #0b0828); }
.w-thinker .k { color: var(--thi); }

.qs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 18px 0;
}

.q {
  border: 1px solid var(--thi);
  border-radius: 99px;
  padding: 10px 20px;
  background: #a48bff1f;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  animation: fl 5s ease-in-out infinite;
}
.q:nth-child(2n) { animation-delay: -1.7s; }
.q:nth-child(3n) { animation-delay: -3.1s; }
.q:hover { background: var(--thi); color: #111; }

@keyframes fl { 50% { transform: translateY(-9px); } }

#ans {
  min-height: 5em;
  padding: 10px;
  font-size: 1.5rem;
  font-style: italic;
  text-align: center;
}

/* --- The Explorer -------------------------------------------------------- */
.w-explorer { background: linear-gradient(180deg, #0d2a1c, #0a1a2b); }
.w-explorer .k { color: var(--exp); }

.exp-intro {
  margin: 0 0 18px;
  color: #cfe9d6;
  font-style: italic;
}

/* ---- legend ---- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 16px;
  font: 500 0.85rem var(--font-display);
  color: #d7ece0;
}
.lg-item { display: inline-flex; align-items: center; gap: 7px; }
.lg-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  box-shadow: 0 0 10px currentColor;
}
.lg-item b { color: #fff; }

/* ---- map + panel ---- */
.exp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 700px) {
  .exp-grid { grid-template-columns: 1fr; }
}

.map-wrap {
  padding: 10px;
  border: 1px solid #ffffff14;
  border-radius: 16px;
  background: #06161fcc;
}

.india {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  overflow: visible;
}

/* every state */
.mp-st {
  fill: #2c3f57;
  stroke: #0a1a2b;
  stroke-width: 1.2;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.25s, filter 0.25s;
}
.mp-st:hover { fill: #41597a; }
.mp-st:focus-visible { outline: none; stroke: #fff; stroke-width: 2.5; }

.mp-visited  { fill: #7fd47f; }
.mp-visited:hover { fill: #9ae59a; }
.mp-planning { fill: #ffb347; }
.mp-planning:hover { fill: #ffc672; }

.mp-st.is-sel {
  stroke: #fff;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 10px #ffffffaa);
}

/* marker on states that have places listed */
.mp-dot {
  fill: #06161f;
  stroke: #ffffffcc;
  stroke-width: 1.5;
  pointer-events: none;
}

/* ---- side panel ---- */
.state-panel {
  padding: 18px 20px;
  border: 1px solid #ffffff14;
  border-radius: 16px;
  background: #06161fcc;
  min-height: 220px;
}

.sp-h {
  margin: 0 0 10px;
  font: 800 0.8rem var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #93b5a4;
}
.sp-h span { color: #fff; }
.sp-h + .sp-chips { margin-bottom: 20px; }

.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-chip {
  border: 1px solid #ffffff2b;
  border-radius: 99px;
  padding: 5px 12px;
  background: #ffffff0f;
  color: #eafff2;
  font: 500 0.85rem var(--font-display);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.sp-chip.is-visited:hover  { background: #7fd47f33; border-color: var(--exp); }
.sp-chip.is-planning:hover { background: #ffb34733; border-color: var(--wri); }

.sp-back {
  border: 0;
  border-radius: 99px;
  padding: 5px 12px;
  margin-bottom: 12px;
  background: #ffffff14;
  color: #cfe9d6;
  font: 500 0.82rem var(--font-display);
  cursor: pointer;
}
.sp-back:hover { background: #ffffff26; }

.sp-title {
  margin: 0 0 8px;
  font: 800 1.5rem/1.1 var(--font-display);
  color: #fff;
}

.sp-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 99px;
  background: var(--c);
  color: #0a1a14;
  font: 800 0.75rem var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sp-note {
  margin: 14px 0 0;
  color: #cfe9d6;
  font-style: italic;
  line-height: 1.5;
}

.sp-places { margin: 16px 0 0; padding: 0; list-style: none; }
.sp-places li {
  padding: 10px 0;
  border-top: 1px solid #ffffff14;
}
.sp-places b {
  display: block;
  font: 800 1rem var(--font-display);
  color: var(--exp);
}
.sp-places span {
  display: block;
  margin-top: 2px;
  font-size: 0.92rem;
  color: #b9d4c4;
}

.sp-empty, .sp-hint {
  margin: 10px 0 0;
  color: #8fab9d;
  font-size: 0.92rem;
  font-style: italic;
}
.sp-hint { margin-top: 18px; }

}


/* --- The Book Lover / The Cine Lover ------------------------------------- */
.w-books  { background: linear-gradient(170deg, #2b1308, #160a1e); }
.w-books .k { color: var(--bok); }
.w-cinema { background: linear-gradient(170deg, #061a2b, #0b0a24); }
.w-cinema .k { color: var(--cin); }

.w-books  .pick-body h3 { color: var(--bok); }
.w-cinema .pick-body h3 { color: var(--cin); }

.shelf-intro {
  margin: 0 0 22px;
  color: #d8cfc4;
  font-style: italic;
}

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px;
}

.pick {
  display: flex;
  flex-direction: column;
  border: 1px solid #ffffff1a;
  border-radius: 14px;
  background: #15132b;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s;
}
.pick:hover { transform: translateY(-4px); border-color: #ffffff33; }

.cover {
  aspect-ratio: 2 / 3;
  background: #0b0a1c;
  overflow: hidden;
}
.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover.is-empty {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(135deg, #ffffff0a 0 12px, #ffffff14 12px 24px),
    #0b0a1c;
}
.cover.is-empty span {
  font: 800 2rem var(--font-display);
  color: #ffffff3d;
  letter-spacing: 0.05em;
}

.pick-body { padding: 14px 15px 16px; }
.pick-body h3 {
  margin: 0;
  font: 800 1.05rem/1.25 var(--font-display);
}
.pick-meta {
  margin: 3px 0 0;
  font-size: 0.86rem;
  color: #ffffff8a;
}
/* "Reading now" / "Watching now" — quiet, in the planet's own accent colour
   so it belongs to the shelf rather than shouting over the cover. */
.pick-flag {
  margin: 6px 0 0;
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sun);
  opacity: 0.92;
}
/* each shelf tints it with its own planet accent, like the headings above */
.w-books  .pick-flag { color: var(--bok); }
.w-cinema .pick-flag { color: var(--cin); }

.rating { margin: 9px 0 0; display: flex; align-items: center; gap: 8px; }
.pick-note {
  margin: 9px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #e9e4f5c7;
}

/* star rating: grey row with a gold row clipped over it, so halves work */
.stars {
  position: relative;
  display: inline-block;
  font-size: 0.95rem;
  letter-spacing: 2px;
  color: #ffffff2e;
  line-height: 1;
}
.stars::before { content: "★★★★★"; }
.stars i {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #ffc233;
}
.stars i::before { content: "★★★★★"; }
.rate-n {
  font: 800 0.8rem var(--font-display);
  color: #ffffff8a;
}


/* ==========================================================================
   7. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .ch,
  .q { animation: none; }
  .mp-st { transition: none; }
}

/* ============================================================== ask box ===
   The Thinker planet's "ask me anything" field. Lives below the curated
   questions, so the planet still works with the AI switched off or offline.
   ========================================================================= */

.ask {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #ffffff1f;
}

.ask-lead {
  margin: 0 0 12px;
  color: #cfd3ff;
  font-size: 15px;
  opacity: .9;
}

.ask-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.ask-input {
  flex: 1 1 auto;
  min-width: 0;                 /* lets the field shrink inside the flex row */
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #ffffff26;
  background: #0f0d26;
  color: #f2f3ff;
  font: inherit;
  font-size: 15px;
}
.ask-input::placeholder { color: #8e92bb; }
.ask-input:focus {
  outline: none;
  border-color: var(--thi);
  box-shadow: 0 0 0 3px #a48bff33;
}
.ask-input:disabled { opacity: .55; }

.ask-send {
  flex: 0 0 auto;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid #a48bff66;
  background: #a48bff1f;
  color: #e7e3ff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.ask-send:hover:not(:disabled) { background: #a48bff33; }
.ask-send:active:not(:disabled) { transform: translateY(1px); }
.ask-send:disabled { opacity: .5; cursor: progress; }

/* A link out to one of Soumyadeep's other sites, at the foot of a world.
   Reads as a card rather than a button, because the one-line explanation
   matters as much as the destination. */
.out-link {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 4px;
  padding: 14px 18px;
  border: 1px solid #ffffff1f;
  border-radius: 14px;
  background: #ffffff08;
  color: inherit;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.out-link:hover,
.out-link:focus-visible {
  background: #ffffff12;
  border-color: currentColor;
  transform: translateY(-1px);
}
.out-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.out-label { font-weight: 600; letter-spacing: .01em; }
.out-note {
  font-size: .88rem;
  line-height: 1.4;
  color: #ffffff9e;
}
.out-go { margin-left: auto; font-size: 1.1rem; opacity: .75; }

/* The Writer's panel is cream paper with near-black ink, so the white-on-dark
   treatment above vanishes into it — the note was invisible and the card had
   no visible edge. Everything flips to dark-on-light inside .paper. */
.paper .out-link {
  border-color: #00000026;
  background: #0000000a;
}
.paper .out-link:hover,
.paper .out-link:focus-visible {
  background: #00000014;
  border-color: currentColor;
}
.paper .out-note { color: #2a2118c4; }
.paper .out-go   { opacity: .6; }

/* tinted per planet, like the headings */
.w-engineer .out-link:hover { color: var(--eng); }
.w-writer   .out-link:hover { color: #8a4b00; }   /* matches .w-writer .k */
.w-books    .out-link:hover { color: var(--bok); }
.w-explorer .out-link:hover { color: var(--exp); }
.w-cinema   .out-link:hover { color: var(--cin); }
.w-artist   .out-link:hover { color: var(--art); }
.w-thinker  .out-link:hover { color: var(--thi); }

.ask-out:not(:empty) {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #15132b;
  border: 1px solid #ffffff14;
}
.ask-out.is-warn:not(:empty) {
  background: #241a2e;
  border-color: #ffb34733;
}

.ask-q-echo {
  margin: 0 0 8px;
  color: #9ea2cc;
  font-size: 13px;
  font-style: italic;
}

.ask-a {
  margin: 0;
  color: #f0f1ff;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;        /* keeps the model's own paragraph breaks */
}

.ask-note { margin: 0 0 6px; color: #d7d9f5; font-size: 14px; line-height: 1.55; }
.ask-note:last-child { margin-bottom: 0; }
.ask-mail { color: var(--thi); }

/* Three dots that breathe while the model is thinking. */
.ask-thinking {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #9ea2cc;
  font-size: 14px;
}
.ask-thinking i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--thi);
  animation: askdot 1.2s ease-in-out infinite;
}
.ask-thinking i:nth-child(2) { animation-delay: .15s; }
.ask-thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes askdot {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .ask-thinking i { animation: none; opacity: .7; }
}

@media (max-width: 560px) {
  .ask-form { flex-wrap: wrap; }
  .ask-send { width: 100%; }
}

/* Visually hidden, still read by screen readers. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
