/* =========================================================
   Vrushyam Temp Chat — foundations
   Palette is built around one idea: paper-white surfaces with
   an iris accent, and a single ember tone reserved for time
   running out. Ember never appears decoratively.
   ========================================================= */

:root {
  --ink:        #16141F;
  --ink-2:      #211E30;
  --ink-3:      #322E45;
  --paper:      #FFFFFF;
  --mist:       #F5F5FA;
  --line:       #E5E4EF;
  --mute:       #6E6B84;

  --iris:       #5340E8;
  --iris-ink:   #3A28C4;
  --iris-soft:  #EDEBFF;

  --amber:      #B7791F;
  --ember:      #D9452A;

  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --shadow: 0 12px 32px -12px rgba(22, 20, 31, .28);
}

* { box-sizing: border-box; }

/* Several components below set display, which would otherwise beat the
   [hidden] attribute and leave invisible panels swallowing clicks. */
[hidden] { display: none !important; }

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

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up   { text-transform: uppercase; letter-spacing: .12em; }

:focus-visible {
  outline: 2px solid var(--iris);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Wordmark ---------- */
.wordmark { display: flex; align-items: center; gap: 10px; }

.wordmark-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--iris);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  flex: none;
}

.wordmark-text {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark-text em { font-style: normal; color: var(--mute); font-weight: 500; }
.gate-brand .wordmark-text em { color: rgba(255,255,255,.55); }

/* =========================================================
   Landing gate
   ========================================================= */
.gate { background: var(--ink); }

.gate-grid {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}

/* ---- Left: the thesis ---- */
.gate-brand {
  background: var(--ink);
  color: #fff;
  padding: 40px clamp(28px, 5vw, 72px) 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: relative;
  overflow: hidden;
}

/* A faint ruled field, like graph paper being timed on. */
.gate-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 100% 34px;
  pointer-events: none;
}
.gate-brand > * { position: relative; z-index: 1; }

.gate-thesis {
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.06;
  font-weight: 600;
  margin-top: auto;
}
.gate-thesis .ul {
  background: linear-gradient(transparent 62%, var(--iris) 62%, var(--iris) 88%, transparent 88%);
}

.gate-lede {
  max-width: 46ch;
  color: rgba(255,255,255,.68);
  font-size: 15.5px;
  line-height: 1.65;
}

/* ---- The signature: three clocks, all falling ---- */
.clocks {
  list-style: none;
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(255,255,255,.14);
  display: grid;
  gap: 14px;
}

.clock {
  display: grid;
  grid-template-columns: 8.5ch 1fr;
  align-items: baseline;
  gap: 16px;
}

.clock-time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  font-weight: 500;
  color: #fff;
}

.clock-label {
  color: rgba(255,255,255,.52);
  font-size: 13.5px;
  line-height: 1.4;
}

.gate-foot {
  color: rgba(255,255,255,.4);
  font-size: 12.5px;
}

/* ---- Right: the single action ---- */
.gate-panel {
  background: var(--paper);
  padding: 40px clamp(24px, 4vw, 56px);
  display: grid;
  align-content: center;
  justify-items: stretch;
}

.panel-card { max-width: 380px; width: 100%; margin: 0 auto; }

.panel-title { font-size: 27px; font-weight: 600; }
.panel-sub {
  color: var(--mute);
  font-size: 14.5px;
  line-height: 1.6;
  margin-top: 8px;
}

.notice {
  background: var(--iris-soft);
  color: var(--iris-ink);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 22px;
}

/* ---------- Fields ---------- */
.field { display: block; margin-top: 22px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 7px;
}
.field-label .opt { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .7; }

.field input,
.member-add input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  transition: border-color .15s ease, box-shadow .15s ease;
  font-size: 15px;
}
.field input:focus,
.member-add input:focus {
  outline: none;
  border-color: var(--iris);
  box-shadow: 0 0 0 3px var(--iris-soft);
}

.field-hint { color: var(--mute); font-size: 12.5px; margin-top: 8px; }

.form-error {
  color: var(--ember);
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--iris); color: #fff; }
.btn-primary:hover { background: var(--iris-ink); }

.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }

.btn-block { width: 100%; margin-top: 24px; }
.btn-sm { padding: 9px 12px; font-size: 13.5px; border-radius: var(--r-sm); }

/* ---------- Code slab ---------- */
.code-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--iris);
  margin-bottom: 6px;
}

.code-slab {
  width: 100%;
  margin-top: 22px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ink);
  border: none;
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: left;
}

.code-value {
  font-family: var(--mono);
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 700;
  letter-spacing: .18em;
  color: #fff;
}

.code-copy {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 5px 11px;
  flex: none;
}
.code-slab:hover .code-copy { color: #fff; border-color: rgba(255,255,255,.6); }

.code-warn {
  color: var(--mute);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 14px;
}

/* =========================================================
   Modals (shared by the chat screen)
   ========================================================= */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(22, 20, 31, .48);
  z-index: 40;
}

.modal {
  position: fixed;
  z-index: 50;
  inset: auto 0 0 0;
  display: grid;
  justify-items: center;
}

@media (min-width: 641px) {
  .modal { inset: 0; place-content: center; }
}

.modal-body {
  background: var(--paper);
  width: min(440px, 100vw);
  padding: 26px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow);
  max-height: 92vh;
  overflow-y: auto;
}
@media (min-width: 641px) {
  .modal-body { border-radius: var(--r-lg); }
}

.modal-body h3 { font-size: 21px; font-weight: 600; }
.modal-sub { color: var(--mute); font-size: 14px; line-height: 1.6; margin-top: 8px; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 26px;
}

.member-add {
  display: grid;
  grid-template-columns: 1fr 100px auto;
  gap: 8px;
  margin-top: 8px;
}

.member-chips {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.member-chips li {
  background: var(--iris-soft);
  color: var(--iris-ink);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.member-chips button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  padding: 0;
  line-height: 1;
  font-size: 15px;
}
.member-chips button:hover { opacity: 1; }

.share-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.share-key {
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 600;
}
.share-val { font-family: var(--display); font-size: 18px; font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 80;
  box-shadow: var(--shadow);
}

/* =========================================================
   Landing responsive
   ========================================================= */
@media (max-width: 860px) {
  .gate-grid { grid-template-columns: 1fr; }
  .gate-brand { padding: 28px 24px 32px; gap: 22px; }
  .gate-thesis { margin-top: 12px; font-size: 32px; }
  .clocks { padding-top: 16px; }
  .gate-panel { padding: 32px 24px 56px; }
  .gate-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
