
/*
* ============================================================
* RISHIVAN — PREMIUM FRONTEND STYLES
* public/style.css — VOLUME 4.2.0
* ============================================================
*
* Visual direction:
*
*  Ancient wisdom
*  Modern clarity
*  Quiet luxury
*  Mystical but not fantasy-heavy
*  Human, warm, sophisticated
*
* Council:
*
*  Agam = anchor
*  Rishi = specialist
*
* The Council should feel like a real conversation,
* NOT eight chatbots and NOT a generated report.
*/


/* ============================================================
  ROOT
  ============================================================ */

:root {
  --gold: #d4af37;
  --gold-light: #e5c866;
  --gold-soft: rgba(212, 175, 55, 0.16);

  --bg: #090b14;
  --bg-deep: #060811;
  --surface: rgba(20, 23, 38, 0.78);
  --surface-light: rgba(30, 33, 51, 0.72);

  --text: #f5f2e9;
  --text-soft: #c8c4ba;
  --text-muted: #8e8b84;

  --border: rgba(255, 255, 255, 0.09);
  --border-gold: rgba(212, 175, 55, 0.24);

  --shadow:
    0 18px 55px rgba(0, 0, 0, 0.35);

  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;

  --max-width: 620px;

  --font-serif:
    Georgia,
    "Times New Roman",
    serif;

  --font-sans:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}


/* ============================================================
  RESET
  ============================================================ */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;

  color: var(--text);

  font-family: var(--font-sans);

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(73, 62, 111, 0.28),
      transparent 42%
    ),
    linear-gradient(
      180deg,
      #101225 0%,
      #090b14 48%,
      #060811 100%
    );

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* ============================================================
  APP
  ============================================================ */

#app {
  min-height: 100vh;
  width: 100%;
}


/* ============================================================
  SCREENS
  ============================================================ */

.screen {
  display: none;

  width: 100%;
  min-height: 100vh;

  position: relative;

  overflow: hidden;
}

.screen.active {
  display: flex;
  flex-direction: column;
}


/* ============================================================
  GENERIC BUTTONS
  ============================================================ */

button {
  font-family: inherit;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button,
[data-go],
[data-question],
[data-mode] {
  -webkit-tap-highlight-color: transparent;
}


/* ============================================================
  WELCOME
  ============================================================ */

#welcome {
  align-items: center;
  justify-content: center;

  padding: 40px 24px;

  text-align: center;

  background:
    radial-gradient(
      circle at 50% 32%,
      rgba(102, 78, 153, 0.26),
      transparent 35%
    ),
    radial-gradient(
      circle at 15% 90%,
      rgba(212, 175, 55, 0.08),
      transparent 32%
    ),
    linear-gradient(
      160deg,
      #12152b,
      #080a13 72%
    );
}

#welcome::before {
  content: "";

  position: absolute;

  inset: 0;

  background:
    radial-gradient(
      circle at 15% 15%,
      rgba(255,255,255,0.06) 0 1px,
      transparent 1.5px
    );

  background-size: 90px 90px;

  opacity: 0.28;

  pointer-events: none;
}


/* ============================================================
  WELCOME CONTENT
  ============================================================ */

#welcome .content,
#welcome > div {
  position: relative;
  z-index: 1;
}

#welcome h1 {
  margin: 0;

  font-family: var(--font-serif);

  font-size: clamp(
    46px,
    13vw,
    78px
  );

  font-weight: 400;

  letter-spacing: 0.12em;

  color: var(--gold);

  text-shadow:
    0 0 35px rgba(212, 175, 55, 0.14);
}

#welcome p {
  color: var(--text-soft);

  line-height: 1.75;
}


/* ============================================================
  PRIMARY GOLD BUTTON
  ============================================================ */

.primary-button,
button.primary,
#enterBtn {
  appearance: none;

  border: 0;

  width: 100%;

  min-height: 56px;

  padding: 0 24px;

  border-radius: 999px;

  background:
    linear-gradient(
      135deg,
      #d8b943,
      #bd9825
    );

  color: #17130a;

  font-size: 15px;

  font-weight: 700;

  letter-spacing: 0.03em;

  box-shadow:
    0 12px 32px rgba(212, 175, 55, 0.18);

  cursor: pointer;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.primary-button:hover,
button.primary:hover,
#enterBtn:hover {
  transform: translateY(-1px);

  box-shadow:
    0 16px 38px rgba(212, 175, 55, 0.24);
}

.primary-button:active,
button.primary:active,
#enterBtn:active {
  transform: translateY(1px);
}


/* ============================================================
  DETAILS SCREEN
  ============================================================ */

#details {
  justify-content: center;

  padding:
    36px
    22px
    42px;

  background:
    radial-gradient(
      circle at 80% 10%,
      rgba(91, 70, 143, 0.22),
      transparent 35%
    ),
    linear-gradient(
      180deg,
      #101326,
      #080a12
    );
}

#details h1,
#details h2 {
  font-family: var(--font-serif);

  font-weight: 400;

  line-height: 1.15;
}

#details label {
  display: block;

  margin:
    16px
    0
    7px;

  color: var(--text-soft);

  font-size: 13px;

  letter-spacing: 0.02em;
}

#details input,
#details select,
#details textarea {
  width: 100%;

  min-height: 52px;

  padding:
    0
    16px;

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-sm);

  outline: none;

  background:
    rgba(12, 15, 28, 0.74);

  color: var(--text);

  font-family: inherit;

  font-size: 15px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

#details input:focus,
#details select:focus,
#details textarea:focus {
  border-color:
    rgba(212, 175, 55, 0.52);

  box-shadow:
    0 0 0 3px
    rgba(212, 175, 55, 0.08);
}

#details input::placeholder {
  color: #686873;
}


/* ============================================================
  FORM ERROR
  ============================================================ */

#formError {
  margin-top: 12px;

  color: #e8a7a7;

  font-size: 13px;

  line-height: 1.5;
}


/* ============================================================
  PREPARING SCREEN
  ============================================================ */

#preparing {
  align-items: center;
  justify-content: center;

  padding: 30px;

  text-align: center;

  background:
    radial-gradient(
      circle,
      rgba(89, 69, 143, 0.25),
      transparent 48%
    ),
    #080a13;
}

#preparing h1,
#preparing h2 {
  font-family: var(--font-serif);

  font-weight: 400;
}

#prepText {
  color: var(--text-soft);

  margin-top: 12px;

  line-height: 1.7;
}


/* ============================================================
  PREPARING ORBIT
  ============================================================ */

#preparing::before {
  content: "";

  width: 150px;
  height: 150px;

  margin-bottom: 34px;

  border:
    1px solid
    rgba(212, 175, 55, 0.30);

  border-radius: 50%;

  box-shadow:
    0 0 0 20px
      rgba(212, 175, 55, 0.025),
    0 0 0 42px
      rgba(212, 175, 55, 0.018);

  animation:
    rishivanOrbit
    4s
    linear
    infinite;
}

@keyframes rishivanOrbit {
  from {
    transform:
      rotate(0deg);
  }

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


/* ============================================================
  CHAT SCREEN
  ============================================================ */

#chat {
  min-height: 100vh;

  background:
    radial-gradient(
      circle at 50% -15%,
      rgba(89, 69, 143, 0.26),
      transparent 42%
    ),
    linear-gradient(
      180deg,
      #0d1020,
      #080a12 62%,
      #060811
    );
}


/* ============================================================
  CHAT HEADER
  ============================================================ */

#chat header,
.chat-header {
  position: sticky;

  top: 0;

  z-index: 20;

  display: flex;

  align-items: center;

  justify-content: space-between;

  min-height: 64px;

  padding:
    12px
    18px;

  border-bottom:
    1px solid
    rgba(255,255,255,0.055);

  background:
    rgba(8, 10, 18, 0.84);

  backdrop-filter:
    blur(18px);

  -webkit-backdrop-filter:
    blur(18px);
}

.chat-header h1,
#chat header h1 {
  margin: 0;

  font-family: var(--font-serif);

  font-size: 18px;

  font-weight: 400;

  letter-spacing: 0.13em;

  color: var(--gold);
}


/* ============================================================
  MODE INDICATOR
  ============================================================ */

#modeIndicator {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  min-height: 28px;

  padding:
    4px
    11px;

  border:
    1px solid
    var(--border);

  border-radius: 999px;

  color: var(--text-muted);

  background:
    rgba(255,255,255,0.035);

  font-size: 11px;

  letter-spacing: 0.05em;
}

#modeIndicator.council-active {
  border-color:
    var(--border-gold);

  color:
    var(--gold-light);

  background:
    rgba(212,175,55,0.07);
}


/* ============================================================
  CHAT CONTENT
  ============================================================ */

#messages {
  width: 100%;

  max-width:
    var(--max-width);

  margin:
    0
    auto;

  padding:
    24px
    18px
    120px;

  overflow-y: auto;

  overscroll-behavior:
    contain;

  scrollbar-width:
    thin;
}


/* ============================================================
  MESSAGE BASE
  ============================================================ */

.msg {
  width: fit-content;

  max-width: 88%;

  margin-bottom: 17px;

  padding:
    14px
    16px;

  border-radius:
    var(--radius-md);

  line-height: 1.65;

  font-size: 15px;

  animation:
    messageIn
    0.24s
    ease
    both;
}

@keyframes messageIn {
  from {
    opacity: 0;

    transform:
      translateY(7px);
  }

  to {
    opacity: 1;

    transform:
      translateY(0);
  }
}


/* ============================================================
  USER MESSAGE
  ============================================================ */

.msg.user {
  margin-left: auto;

  color: #17130a;

  background:
    linear-gradient(
      135deg,
      #d9bc58,
      #c19d2c
    );

  border-bottom-right-radius:
    6px;

  box-shadow:
    0 8px 24px
    rgba(0,0,0,0.20);
}

.msg.user .who {
  color:
    rgba(23,19,10,0.66);
}


/* ============================================================
  OLD AGAM MESSAGE COMPATIBILITY
  ============================================================ */

.msg.agam {
  margin-right: auto;

  color: var(--text);

  background:
    rgba(24, 27, 43, 0.78);

  border:
    1px solid
    rgba(255,255,255,0.07);

  border-bottom-left-radius:
    6px;
}


/* ============================================================
  MESSAGE SPEAKER LABEL
  ============================================================ */

.who {
  margin-bottom: 6px;

  font-size: 10px;

  font-weight: 700;

  letter-spacing: 0.13em;

  text-transform: uppercase;

  color:
    var(--gold);
}


/* ============================================================
  MESSAGE TEXT
  ============================================================ */

.message-text {
  color: inherit;

  word-wrap: break-word;

  overflow-wrap: anywhere;
}


/* ============================================================
  COUNCIL MESSAGES
  ============================================================ */

.council-message {
  position: relative;

  width: min(
    88%,
    520px
  );

  padding:
    15px
    17px;

  margin-bottom: 13px;
}


/* ============================================================
  AGAM — COUNCIL ANCHOR
  ============================================================ */

.council-message.council-agam {
  margin-left: 0;
  margin-right: auto;

  border:
    1px solid
    rgba(212,175,55,0.20);

  border-left:
    2px solid
    rgba(212,175,55,0.75);

  background:
    linear-gradient(
      135deg,
      rgba(37,34,48,0.92),
      rgba(22,25,40,0.86)
    );

  box-shadow:
    0 12px 32px
    rgba(0,0,0,0.18);
}

.council-message.council-agam
.council-speaker {
  color:
    var(--gold-light);
}


/* ============================================================
  RISHI SPECIALIST
  ============================================================ */

.council-message.council-rishi {
  margin-left: 18px;
  margin-right: auto;

  border:
    1px solid
    rgba(255,255,255,0.065);

  border-left:
    2px solid
    rgba(156,142,188,0.48);

  background:
    rgba(19,22,36,0.70);

  color:
    #ddd9d0;
}

.council-message.council-rishi
.council-speaker {
  color:
    #c4b9dc;
}


/* ============================================================
  COUNCIL SPEAKER
  ============================================================ */

.council-speaker {
  display: block;

  margin-bottom: 7px;

  font-size: 10px;

  font-weight: 700;

  letter-spacing: 0.15em;

  text-transform: uppercase;
}


/* ============================================================
  COUNCIL TEXT
  ============================================================ */

.council-text {
  font-size: 15px;

  line-height: 1.72;
}


/* ============================================================
  RESPONSE PURPOSE — SUBTLE DIFFERENCES
  ============================================================ */

.council-message[data-role="specialist"] {
  opacity: 0.98;
}

.council-message[data-role="anchor"] {
  opacity: 1;
}


/* ============================================================
  PARTICIPANTS
  ============================================================ */

#participants {
  width: min(
    calc(100% - 36px),
    var(--max-width)
  );

  margin:
    8px
    auto
    0;

  padding:
    7px
    0;

  display: flex;

  align-items: center;

  gap: 7px;

  flex-wrap: wrap;

  color:
    var(--text-muted);

  font-size: 10px;

  letter-spacing: 0.04em;
}

#participants.hidden {
  display: none;
}

.participant {
  padding:
    4px
    8px;

  border:
    1px solid
    rgba(255,255,255,0.07);

  border-radius:
    999px;

  background:
    rgba(255,255,255,0.025);
}


/* ============================================================
  AUDIT
  ============================================================ */

#audit {
  width: min(
    calc(100% - 36px),
    var(--max-width)
  );

  margin:
    8px
    auto
    12px;

  padding:
    7px
    11px;

  border:
    1px solid
    rgba(212,175,55,0.10);

  border-radius:
    10px;

  color:
    rgba(212,175,55,0.68);

  background:
    rgba(212,175,55,0.025);

  font-size: 10px;

  line-height: 1.5;
}

#audit.hidden {
  display: none;
}


/* ============================================================
  TYPING
  ============================================================ */

#typing {
  width: min(
    calc(100% - 36px),
    var(--max-width)
  );

  margin:
    0
    auto
    10px;

  padding:
    0
    4px;

  color:
    var(--text-muted);

  font-size: 12px;
}

#typing.hidden {
  display: none;
}

#typing::after {
  content: "...";

  display: inline-block;

  animation:
    typingDots
    1.2s
    steps(4, end)
    infinite;
}

@keyframes typingDots {
  0% {
    opacity: 0.2;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.2;
  }
}


/* ============================================================
  CHAT FORM
  ============================================================ */

#chatForm {
  position: fixed;

  z-index: 30;

  left: 0;
  right: 0;
  bottom: 0;

  display: flex;

  align-items: center;

  gap: 9px;

  width: 100%;

  max-width:
    var(--max-width);

  margin:
    0
    auto;

  padding:
    12px
    16px
    calc(12px + env(safe-area-inset-bottom));

  background:
    linear-gradient(
      180deg,
      rgba(6,8,17,0),
      rgba(6,8,17,0.94) 25%
    );

  backdrop-filter:
    blur(8px);

  -webkit-backdrop-filter:
    blur(8px);
}


/* ============================================================
  CHAT INPUT
  ============================================================ */

#question {
  flex: 1;

  min-width: 0;

  min-height: 50px;

  padding:
    0
    16px;

  border:
    1px solid
    rgba(255,255,255,0.09);

  border-radius:
    999px;

  outline: none;

  background:
    rgba(20,23,38,0.94);

  color:
    var(--text);

  font-family:
    var(--font-sans);

  font-size: 15px;

  box-shadow:
    0 10px 30px
    rgba(0,0,0,0.18);

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

#question:focus {
  border-color:
    rgba(212,175,55,0.42);

  box-shadow:
    0 0 0 3px
    rgba(212,175,55,0.06),
    0 10px 30px
    rgba(0,0,0,0.20);
}

#question::placeholder {
  color:
    #777582;
}


/* ============================================================
  CHAT SEND BUTTON
  ============================================================ */

#chatForm button[type="submit"] {
  flex:
    0 0 50px;

  width: 50px;
  height: 50px;

  border: 0;

  border-radius: 50%;

  background:
    linear-gradient(
      135deg,
      #d9bc58,
      #bd9826
    );

  color:
    #17130a;

  font-size: 19px;

  font-weight: 700;

  cursor: pointer;

  box-shadow:
    0 8px 24px
    rgba(212,175,55,0.16);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

#chatForm button[type="submit"]:hover {
  transform:
    translateY(-1px);

  box-shadow:
    0 12px 28px
    rgba(212,175,55,0.22);
}

#chatForm button[type="submit"]:active {
  transform:
    scale(0.96);
}


/* ============================================================
  LINKS / SECONDARY TEXT
  ============================================================ */

a {
  color:
    var(--gold-light);

  text-decoration:
    none;
}

.small,
.secondary,
.muted {
  color:
    var(--text-muted);

  font-size: 12px;

  line-height: 1.6;
}


/* ============================================================
  HIDDEN UTILITY
  ============================================================ */

.hidden {
  display: none !important;
}


/* ============================================================
  RESPONSIVE — TABLET
  ============================================================ */

@media (min-width: 700px) {
  :root {
    --max-width: 680px;
  }

  #messages {
    padding-left: 0;
    padding-right: 0;
  }

  .council-message {
    max-width: 580px;
  }

  .council-message.council-rishi {
    margin-left: 32px;
  }
}


/* ============================================================
  RESPONSIVE — SMALL PHONES
  ============================================================ */

@media (max-width: 380px) {
  #messages {
    padding-left: 12px;
    padding-right: 12px;
  }

  .msg {
    max-width: 91%;

    font-size: 14px;
  }

  .council-message {
    width: 91%;
  }

  .council-message.council-rishi {
    margin-left: 10px;
  }

  #chatForm {
    padding-left: 10px;
    padding-right: 10px;
  }
}


/* ============================================================
  ACCESSIBILITY
  ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:
      0.01ms !important;

    animation-iteration-count:
      1 !important;

    scroll-behavior:
      auto !important;

    transition-duration:
      0.01ms !important;
  }
}


/* ============================================================
  SAFARI / IOS
  ============================================================ */

input,
textarea,
button {
  -webkit-appearance: none;
}

input,
textarea {
  border-radius:
    var(--radius-sm);
}


/* ============================================================
  FINAL TOUCH
  ============================================================ */

::selection {
  background:
    rgba(212,175,55,0.24);

  color:
    var(--text);
}
