/* ===========================================================
   ChatNest — Design tokens
   Palette: deep pine background, warm ochre + sage accents
   Type: Fraunces (display) / Inter (body) / IBM Plex Mono (labels)
   =========================================================== */

:root{
  --bg:        #101B16;
  --bg-panel:  #17251F;
  --bg-raised: #1E2F27;
  --line:      #2A3A32;
  --accent:    #D89B4A;   /* warm ochre */
  --accent-2:  #7FAE8E;   /* sage */
  --text:      #F1EDE4;
  --text-mute: #A9B8AF;
  --text-dim:  #6E8177;
  --danger:    #D9704F;

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 14px;
  --radius-sm: 8px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; text-decoration: none; }

img, svg{ max-width: 100%; display: block; }

::selection{ background: var(--accent); color: #101B16; }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ---------- Layout shell ---------- */
.wrap{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(16,27,22,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo{
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .dot{
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(127,174,142,0.15);
}
nav.main-nav{ display: flex; gap: 28px; }
nav.main-nav a{
  font-size: 14.5px;
  color: var(--text-mute);
  transition: color .15s ease;
}
nav.main-nav a:hover{ color: var(--text); }

.nav-toggle{ display: none; }

/* ---------- Hero ---------- */
.hero{
  padding: 76px 0 56px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero .wrap{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow{
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before{
  content:'';
  width: 16px; height: 1px; background: var(--accent-2);
}
h1.hero-title{
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.08;
  margin: 0 0 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1.hero-title em{
  font-style: italic;
  color: var(--accent);
}
.hero-sub{
  color: var(--text-mute);
  font-size: 17px;
  max-width: 46ch;
  margin: 0 0 30px;
}
.cta-row{ display: flex; gap: 14px; flex-wrap: wrap; }

.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 100px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{ background: var(--accent); color: #17130B; }
.btn-primary:hover{ background: #E4AB60; }
.btn-ghost{ background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover{ border-color: var(--accent-2); }

/* Sample conversation mock in hero */
.chat-mock{
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.chat-mock::before{
  content: 'live preview';
  position: absolute;
  top: -11px; left: 20px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent-2);
  color: #0F1C16;
  padding: 3px 9px;
  border-radius: 100px;
}
.bubble{
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(6px);
  animation: rise .5s ease forwards;
}
.bubble .who{
  display:block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.bubble.in{ background: var(--bg-raised); border-bottom-left-radius: 4px; }
.bubble.out{ background: rgba(216,155,74,0.14); border: 1px solid rgba(216,155,74,0.3); margin-left: auto; border-bottom-right-radius: 4px; }
.bubble:nth-child(1){ animation-delay: .1s; }
.bubble:nth-child(2){ animation-delay: .6s; }
.bubble:nth-child(3){ animation-delay: 1.1s; }
.bubble:nth-child(4){ animation-delay: 1.6s; }
@keyframes rise{ to{ opacity:1; transform: translateY(0);} }

.typing-row{
  display:flex; align-items:center; gap:6px;
  color: var(--text-dim); font-size: 12.5px; font-family: var(--font-mono);
  margin-top: 4px;
}
.typing-dots{ display:inline-flex; gap:3px; }
.typing-dots span{
  width:5px; height:5px; border-radius:50%; background: var(--text-dim);
  animation: blink 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2){ animation-delay: .2s; }
.typing-dots span:nth-child(3){ animation-delay: .4s; }
@keyframes blink{ 0%,80%,100%{ opacity:.25 } 40%{ opacity:1 } }

@media (prefers-reduced-motion: reduce){
  .bubble{ animation: none; opacity: 1; transform: none; }
  .typing-dots span{ animation: none; }
}

/* ---------- Rooms grid ---------- */
.section{ padding: 64px 0; }
.section-head{ margin-bottom: 36px; max-width: 60ch; }
.section-head .eyebrow{ margin-bottom: 12px; }
h2.section-title{
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  margin: 0 0 10px;
  font-weight: 600;
}
.section-head p{ color: var(--text-mute); margin: 0; }

.room-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.room-card{
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .15s ease, transform .15s ease;
}
.room-card:hover{ border-color: var(--accent-2); transform: translateY(-2px); }
.room-top{ display: flex; align-items: center; justify-content: space-between; }
.room-name{ font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.room-live{
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent-2);
}
.room-live .pulse{
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2);
  animation: pulse 1.8s infinite;
}
@keyframes pulse{ 0%{ box-shadow:0 0 0 0 rgba(127,174,142,.5);} 70%{ box-shadow:0 0 0 6px rgba(127,174,142,0);} 100%{box-shadow:0 0 0 0 rgba(127,174,142,0);} }
.room-desc{ color: var(--text-mute); font-size: 13.5px; margin: 0; flex-grow: 1; }
.room-preview{
  background: var(--bg-raised);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.room-enter{
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13.5px; font-weight: 600; color: var(--accent);
  margin-top: 4px;
}

/* ---------- Sponsored strip (transparent ad slot) ---------- */
.sponsor-strip{
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255,255,255,0.02);
}
.sponsor-strip .label{
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}
.sponsor-strip p{ margin: 0; color: var(--text-mute); font-size: 13.5px; flex-grow: 1; }
.sponsor-strip a.btn{ padding: 9px 16px; font-size: 13px; }

/* ---------- Footer ---------- */
footer.site-footer{
  border-top: 1px solid var(--line);
  padding: 40px 0 32px;
  margin-top: 40px;
}
footer .wrap{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links{ display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a{ font-size: 13.5px; color: var(--text-mute); }
.footer-links a:hover{ color: var(--accent-2); }
.footer-note{ font-size: 12.5px; color: var(--text-dim); }

/* ---------- Generic content page ---------- */
.page-head{ padding: 56px 0 20px; border-bottom: 1px solid var(--line); }
.page-head h1{
  font-family: var(--font-display);
  font-size: clamp(28px,4vw,40px);
  margin: 0 0 10px;
}
.page-head p{ color: var(--text-mute); max-width: 60ch; }
.content{ padding: 44px 0 60px; max-width: 74ch; }
.content h2{ font-family: var(--font-display); font-size: 21px; margin: 34px 0 12px; }
.content p{ color: var(--text-mute); margin: 0 0 14px; }
.content ul{ color: var(--text-mute); padding-left: 20px; }
.content li{ margin-bottom: 8px; }

/* ---------- Contact form ---------- */
.form-card{
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 520px;
}
.field{ margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label{ font-size: 13px; color: var(--text-mute); font-family: var(--font-mono); }
.field input, .field textarea{
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  resize: vertical;
}

/* ---------- Room / chat page ---------- */
.chat-shell{
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}
.chat-head{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.chat-head h1{ font-family: var(--font-display); font-size: 24px; margin: 0; }
.chat-head .room-tag{
  font-family: var(--font-mono); font-size: 12px; color: var(--accent-2);
  border: 1px solid var(--line); padding: 4px 10px; border-radius: 100px;
}
.chat-window{
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: 58vh;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.messages{
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.messages .bubble{ animation: none; opacity: 1; transform: none; max-width: 78%; }
.msg-form{
  display: flex; gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}
.msg-form input{
  flex: 1;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
}
.msg-form button{
  border-radius: 100px;
  padding: 0 22px;
  border: none;
  background: var(--accent);
  color: #17130B;
  font-weight: 700;
  cursor: pointer;
}
.system-note{
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--font-mono);
  margin-top: 14px;
}
.setup-banner{
  background: rgba(217,112,79,0.12);
  border: 1px solid rgba(217,112,79,0.4);
  color: #F3C9BA;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.setup-banner.show{ display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 880px){
  .hero .wrap{ grid-template-columns: 1fr; }
  .room-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px){
  nav.main-nav{ display: none; }
  .room-grid{ grid-template-columns: 1fr; }
  .sponsor-strip{ flex-direction: column; align-items: flex-start; }
}
