/* =========================================================================
   Jane × Lo-Temp — Pete McCauley
   Heritage palette: deep frost-navy + warm Lo-Temp amber + cold steel blue
   Typography: Inter (heavy display + clean body), JetBrains Mono (eyebrows)
   ========================================================================= */

:root {
  /* Surfaces — frost-night palette */
  --bg-deep:        #0a0e16;   /* near-black with the faintest cold blue cast */
  --bg-lift:        #11161f;   /* card surface, lifted one notch */
  --bg-lift-2:      #161d28;   /* hover / focus surface */
  --hairline:       #232b38;   /* fine borders, low-contrast separators */
  --hairline-warm:  #3a3022;   /* warm-tinted hairline for amber accents */

  /* Type */
  --ink-primary:    #f4eedf;   /* warm off-white, sits easier than pure white */
  --ink-secondary:  #b8bcc4;   /* muted body */
  --ink-tertiary:   #6f7681;   /* eyebrows, footnotes */

  /* Brand accents — straight from the Lo-Temp thermometer */
  --accent-warm:    #f4b740;   /* HOT — Lo-Temp amber/gold */
  --accent-warm-2:  #d99a26;   /* deeper amber for hover */
  --accent-cool:    #6cb4e0;   /* COLD — Lo-Temp blue, slightly softer */
  --accent-cool-2:  #4d97c8;   /* deeper cool */

  /* Glow tokens — used very sparingly */
  --glow-warm:      rgba(244, 183, 64, 0.22);
  --glow-cool:      rgba(108, 180, 224, 0.18);

  /* Geometry */
  --max-content:    1080px;
  --radius-sm:      6px;
  --radius-md:      14px;
  --radius-lg:      24px;

  /* Motion */
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:       180ms;
  --dur-slow:       520ms;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--ink-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Atmosphere — soft warm/cool gradients that suggest hot/cold without distracting */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, var(--glow-warm) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 90% 110%, var(--glow-cool) 0%, transparent 55%);
  pointer-events: none;
}

/* =========================================================================
   TOPBAR — small, restrained co-brand
   ========================================================================= */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(10, 14, 22, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 44px;
  width: auto;
  /* Invert the logo from black-on-white to white-on-dark while preserving thermometer color */
  filter: invert(1) brightness(1) contrast(1.05);
  opacity: 0.92;
}

.co-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}

.co-brand-by {
  color: var(--ink-tertiary);
}

.co-brand-name {
  color: var(--accent-warm);
  font-weight: 500;
}

/* =========================================================================
   HERO — the main event
   ========================================================================= */

main {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 36px;
}

.hero {
  padding: 88px 0 64px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin: 0 0 24px;
}

.hero-title {
  font-size: clamp(60px, 9vw, 108px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  color: var(--ink-primary);
}

.hero-title .accent-warm {
  color: var(--accent-warm);
  /* very subtle warm glow that echoes the thermometer */
  text-shadow:
    0 0 28px rgba(244, 183, 64, 0.35),
    0 0 64px rgba(244, 183, 64, 0.12);
}

.hero-lede {
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.65;
  color: var(--ink-secondary);
  margin: 0 auto 56px;
  max-width: 640px;
  font-weight: 400;
}

.hero-lede .accent-cool {
  color: var(--accent-cool);
  font-weight: 500;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
}

.cta-hint {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink-secondary);
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.cta-note {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin: 14px 0 0;
}

/* "Talk with Jane" button — the primary CTA. Big, warm amber, calls
   the modal that hosts the ElevenLabs SDK conversation. */
.talk-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 460px;
  margin: 14px auto 0;
  padding: 26px 28px;
  border: 0;
  border-radius: 18px;
  background: var(--accent-warm);
  color: #1a1207;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow:
    0 18px 36px -20px rgba(244, 183, 64, 0.7),
    0 2px 0 rgba(0, 0, 0, 0.18) inset;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.talk-button:hover {
  transform: translateY(-2px);
  background: #f7c25c;
  box-shadow:
    0 24px 44px -20px rgba(244, 183, 64, 0.85),
    0 2px 0 rgba(0, 0, 0, 0.18) inset;
}

.talk-button:active {
  transform: translateY(0);
  background: var(--accent-warm-2);
}

.talk-button:focus-visible {
  outline: 3px solid var(--accent-cool);
  outline-offset: 4px;
}

.talk-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(26, 18, 7, 0.12);
  border: 1.5px solid rgba(26, 18, 7, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #1a1207;
}

.talk-icon svg { width: 28px; height: 28px; }

/* A slow, calm "ready" breath on the mic — same idea as Brad's */
.talk-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(26, 18, 7, 0.5);
  animation: talk-breathe 3.8s ease-out infinite;
  pointer-events: none;
}

@keyframes talk-breathe {
  0%   { transform: scale(1);    opacity: 0.6; }
  70%  { transform: scale(1.28); opacity: 0;   }
  100% { transform: scale(1.28); opacity: 0;   }
}

.talk-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.talk-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #1a1207;
}

.talk-sub {
  font-size: 15px;
  line-height: 1.35;
  color: rgba(26, 18, 7, 0.72);
  font-weight: 500;
}

.talk-arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  color: rgba(26, 18, 7, 0.55);
  transition: transform var(--dur-fast) var(--ease-out);
}

.talk-arrow svg { width: 26px; height: 26px; }

.talk-button:hover .talk-arrow { transform: translateX(5px); }

/* =========================================================================
   THREADS — gentle topic suggestions, not a feature pitch
   ========================================================================= */

.threads {
  padding: 64px 0 72px;
  border-top: 1px solid var(--hairline);
  margin-top: 32px;
}

.section-title {
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--ink-primary);
  text-align: center;
}

.section-lede {
  text-align: center;
  color: var(--ink-secondary);
  font-size: 16px;
  max-width: 540px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.thread-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.thread-card {
  background: var(--bg-lift);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 28px 26px 26px;
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.thread-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-warm) 0%, var(--accent-cool) 100%);
  opacity: 0.4;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.thread-card:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-warm);
  background: var(--bg-lift-2);
}

.thread-card:hover::before {
  opacity: 0.85;
}

.thread-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.thread-icon svg {
  width: 24px;
  height: 24px;
}

.thread-icon.warm {
  background: rgba(244, 183, 64, 0.10);
  color: var(--accent-warm);
  border: 1px solid rgba(244, 183, 64, 0.22);
}

.thread-icon.cool {
  background: rgba(108, 180, 224, 0.10);
  color: var(--accent-cool);
  border: 1px solid rgba(108, 180, 224, 0.22);
}

.thread-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  margin: 0 0 10px;
  line-height: 1.35;
}

.thread-body {
  font-size: 14.5px;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin: 0;
}

/* =========================================================================
   REASSURE — a single line that holds the whole conversation's posture
   ========================================================================= */

.reassure {
  padding: 84px 0;
  text-align: center;
}

.reassure-content {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.reassure-line {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 500;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-primary);
  margin: 0;
  letter-spacing: -0.005em;
}

.quote-mark {
  color: var(--accent-warm);
  font-family: 'Georgia', serif;
  font-size: 1.4em;
  vertical-align: -0.1em;
  font-style: normal;
  opacity: 0.7;
}

/* =========================================================================
   FOOTER — quiet credit
   ========================================================================= */

.footer {
  border-top: 1px solid var(--hairline);
  padding: 36px;
  margin-top: 24px;
}

.footer-row {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-credit,
.footer-meta {
  margin: 0;
  font-size: 13px;
  color: var(--ink-tertiary);
  line-height: 1.5;
}

.footer-credit strong {
  color: var(--accent-warm);
  font-weight: 600;
}

.footer-sep {
  color: var(--hairline);
  margin: 0 6px;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

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

  .brand-logo {
    height: 36px;
  }

  main {
    padding: 0 22px;
  }

  .hero {
    padding: 56px 0 40px;
  }

  .hero-lede {
    margin-bottom: 40px;
  }

  .threads {
    padding: 48px 0 56px;
  }

  .reassure {
    padding: 56px 0;
  }

  .footer-row {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .talk-icon::after {
    animation: none;
    opacity: 0.4;
  }

  .thread-card,
  .hero-title .accent-warm,
  .talk-button,
  .talk-arrow {
    transition: none;
  }
}

/* =========================================================================
   VOICE MODAL — Lo-Temp dark heritage theme adaptation of Brad's pattern
   ========================================================================= */

body.is-locked { overflow: hidden; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 14, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: scrim-fade 0.24s ease;
}

.scrim[hidden] { display: none; }

.dialog {
  width: 100%;
  max-width: 540px;
  max-height: 92svh;
  background: var(--bg-lift);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.8),
    0 0 60px -20px rgba(244, 183, 64, 0.15);
  animation: dialog-rise 0.34s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.dialog:focus { outline: none; }

.dialog-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--bg-lift-2) 0%, var(--bg-lift) 100%);
}

.jane-mark {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-warm);
  color: #1a1207;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(244, 183, 64, 0.35);
}

.jane-mark svg { width: 26px; height: 26px; }

.dialog-name {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink-primary);
  letter-spacing: -0.005em;
}

.dialog-status {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.3;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
}

.dialog-body {
  flex: 1;
  min-height: 240px;
  overflow-y: auto;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-deep);
}

.dialog-empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
  color: var(--ink-secondary);
  padding: 20px 0;
}

.dialog-empty p {
  margin: 0;
  font-size: 16px;
  max-width: 320px;
  line-height: 1.5;
}

.dialog-empty[hidden] { display: none; }

.pulse {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle, var(--glow-warm) 0%, transparent 65%);
}

.pulse::before,
.pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-warm);
  opacity: 0;
  animation: ripple 2.8s ease-out infinite;
}

.pulse::after { animation-delay: 1.4s; }

.pulse[data-state="speaking"] {
  background: radial-gradient(circle, var(--glow-cool) 0%, transparent 65%);
}

.pulse[data-state="speaking"]::before,
.pulse[data-state="speaking"]::after {
  border-color: var(--accent-cool);
}

/* Transcript bubbles */
.msg {
  max-width: 86%;
  padding: 13px 17px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg-label {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.7;
}

.msg-jane {
  align-self: flex-start;
  background: var(--bg-lift);
  border: 1px solid var(--hairline);
  color: var(--ink-primary);
}

.msg-jane .msg-label { color: var(--accent-warm); }

.msg-you {
  align-self: flex-end;
  background: var(--accent-warm);
  color: #1a1207;
  border: 1px solid var(--accent-warm-2);
}

.msg-you .msg-label {
  color: rgba(26, 18, 7, 0.75);
  opacity: 1;
}

.dialog-error {
  margin: auto;
  text-align: center;
  color: var(--ink-primary);
  background: rgba(244, 183, 64, 0.08);
  border: 1px solid rgba(244, 183, 64, 0.35);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.55;
}

.dialog-error[hidden] { display: none; }

.dialog-foot {
  border-top: 1px solid var(--hairline);
  padding: 16px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-lift);
}

.type-row {
  display: flex;
  gap: 10px;
}

.field {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink-primary);
  background: var(--bg-deep);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 12px 14px;
}

.field::placeholder {
  color: var(--ink-tertiary);
}

.field:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 1px;
  border-color: var(--accent-warm);
}

.field:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.send-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-deep);
  color: var(--accent-warm);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease;
}

.send-btn svg { width: 20px; height: 20px; }

.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.send-btn:not(:disabled):hover {
  background: var(--bg-lift-2);
  border-color: var(--accent-warm);
}

.done-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  color: #1a1207;
  background: var(--accent-warm);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, transform var(--dur-fast) ease;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.done-btn svg { width: 18px; height: 18px; }

.done-btn:hover { background: #f7c25c; }
.done-btn:active { transform: scale(0.99); }

.send-btn:focus-visible,
.done-btn:focus-visible {
  outline: 3px solid var(--accent-cool);
  outline-offset: 2px;
}

@keyframes ripple {
  0%   { transform: scale(0.55); opacity: 0.85; }
  100% { transform: scale(1.5);  opacity: 0;    }
}

@keyframes scrim-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes dialog-rise {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .dialog-head { padding: 18px 20px; }
  .dialog-body { padding: 20px; }
  .dialog-foot { padding: 14px 20px 18px; }
  .talk-button { padding: 22px 22px; gap: 16px; }
  .talk-title { font-size: 23px; }
  .talk-icon { width: 50px; height: 50px; }
  .talk-icon svg { width: 24px; height: 24px; }
  .talk-arrow { display: none; }
}
