/* ====================================================================
   ElizaChatBot — Design System
   Palette: Paper White / Ink Navy / Sky Blue / Pale Sky / Warm Gold
   Display: Fraunces (warm serif) · Body: Inter · Utility: IBM Plex Mono
   Signature element: the breathing happiness ring (.ring)
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&family=Noto+Naskh+Arabic:wght@500;700&family=Cairo:wght@400;600;700&display=swap');

:root{
  /* ---- color tokens ---- */
  --paper:        #FBFAF7;
  --paper-dim:     #F2EFE7;
  --ink:          #1B2A41;
  --ink-soft:     #43586F;
  --sky:          #5B8DBE;
  --sky-deep:     #3E6E9E;
  --pale-sky:     #DCEAF5;
  --gold:         #C9A227;
  --gold-soft:    #F3E8C8;
  --line:         rgba(27,42,65,0.12);
  --shadow:       0 12px 32px rgba(27,42,65,0.08);

  --bg:           var(--paper);
  --bg-elevated:  #FFFFFF;
  --text:         var(--ink);
  --text-soft:    var(--ink-soft);
  --accent:       var(--sky-deep);
  --accent-soft:  var(--pale-sky);
  --highlight:    var(--gold);
  --highlight-soft: var(--gold-soft);
  --border:       var(--line);

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

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --container: 1140px;
}

[data-theme="dark"]{
  --bg:           #11202F;
  --bg-elevated:  #16273A;
  --text:         #F3F1EA;
  --text-soft:    #AFC2D4;
  --accent:       #8FC1F0;
  --accent-soft:  #1F3A52;
  --highlight:    #E0BB52;
  --highlight-soft: #2C2616;
  --border:       rgba(243,241,234,0.12);
  --shadow:       0 12px 32px rgba(0,0,0,0.35);
}

*{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.6;
  -webkit-font-smoothing:antialiased;
  transition:background .3s ease, color .3s ease;
}
html[dir="rtl"] body{ font-family:'Cairo','Inter',sans-serif; }

h1,h2,h3,.display{
  font-family:var(--font-display);
  font-weight:600;
  letter-spacing:-0.01em;
  margin:0 0 .5em;
  color:var(--text);
}
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .display{
  font-family:'Cairo','Noto Naskh Arabic',serif;
  font-weight:700;
}
h1{font-size:clamp(2.1rem,4.5vw,3.4rem); line-height:1.08;}
h2{font-size:clamp(1.6rem,3vw,2.3rem); line-height:1.15;}
h3{font-size:1.25rem;}
p{margin:0 0 1em; color:var(--text-soft);}
a{color:var(--accent-deep,var(--accent)); text-decoration:none;}
.eyebrow{
  font-family:var(--font-mono);
  font-size:.72rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--accent);
}
html[dir="rtl"] .eyebrow{ letter-spacing:0; }

img{max-width:100%; display:block;}
button{font-family:inherit;}

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

.container{
  max-width:var(--container);
  margin:0 auto;
  padding:0 24px;
}
.section{ padding:88px 0; }
.section--tight{ padding:56px 0; }
.section--alt{ background:var(--bg-elevated); }

/* ---------- nav ---------- */
.nav{
  position:sticky; top:0; z-index:50;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.nav__inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 24px; max-width:var(--container); margin:0 auto;
}
.nav__brand{
  display:flex; align-items:center; gap:.55em;
  font-family:var(--font-display); font-weight:600; font-size:1.25rem;
  color:var(--text);
}
.nav__brand .ring{ width:28px; height:28px; }
.nav__links{ display:flex; align-items:center; gap:28px; list-style:none; margin:0; padding:0; }
.nav__links a{ color:var(--text-soft); font-size:.95rem; font-weight:500; }
.nav__links a:hover, .nav__links a.is-active{ color:var(--accent); }
.nav__controls{ display:flex; align-items:center; gap:10px; }
.nav__toggle-row{ display:flex; align-items:center; gap:8px; }
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:50%;
  border:1px solid var(--border); background:var(--bg-elevated);
  color:var(--text); cursor:pointer; font-size:1rem;
}
.icon-btn:hover{ border-color:var(--accent); }
select.lang-select{
  border:1px solid var(--border); background:var(--bg-elevated);
  color:var(--text); border-radius:999px; padding:8px 14px;
  font-size:.85rem; cursor:pointer;
}
.nav__burger{ display:none; }

@media (max-width:860px){
  .nav__links{ display:none; }
  .nav__burger{ display:inline-flex; }
}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:.5em;
  padding:13px 26px; border-radius:999px;
  font-weight:600; font-size:.95rem;
  border:1px solid transparent; cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease;
}
.btn:hover{ transform:translateY(-1px); }
.btn-primary{ background:var(--accent); color:#fff; box-shadow:0 8px 22px rgba(62,110,158,0.28); }
.btn-primary:hover{ box-shadow:0 12px 26px rgba(62,110,158,0.36); }
.btn-gold{ background:var(--highlight); color:#1B2A41; box-shadow:0 8px 22px rgba(201,162,39,0.28); }
.btn-ghost{ background:transparent; border-color:var(--border); color:var(--text); }
.btn-ghost:hover{ border-color:var(--accent); color:var(--accent); }
.btn-block{ width:100%; justify-content:center; }

/* ---------- hero ---------- */
.hero{ padding:72px 0 40px; overflow:hidden; }
.hero__grid{
  display:grid; grid-template-columns:1.1fr .9fr; gap:48px; align-items:center;
}
@media (max-width:900px){ .hero__grid{ grid-template-columns:1fr; } }
.hero__eyebrow{ margin-bottom:18px; }
.hero__lead{ font-size:1.1rem; max-width:46ch; }
.hero__cta{ display:flex; gap:14px; margin-top:28px; flex-wrap:wrap; }
.hero__stats{ display:flex; gap:28px; margin-top:36px; flex-wrap:wrap; }
.hero__stat b{ display:block; font-family:var(--font-display); font-size:1.4rem; color:var(--text); }
.hero__stat span{ font-size:.82rem; color:var(--text-soft); }

/* ---------- signature ring ---------- */
.ring-card{
  background:var(--bg-elevated); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:32px;
  box-shadow:var(--shadow);
  display:flex; flex-direction:column; align-items:center; gap:18px;
}
.ring-wrap{ position:relative; width:220px; height:220px; }
.ring-wrap svg{ width:100%; height:100%; transform:rotate(-90deg); }
.ring-track{ fill:none; stroke:var(--accent-soft); stroke-width:14; }
.ring-fill{
  fill:none; stroke:var(--highlight); stroke-width:14; stroke-linecap:round;
  transition:stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1);
  animation:breathe 4.5s ease-in-out infinite;
  transform-origin:50% 50%;
}
@keyframes breathe{ 0%,100%{ filter:drop-shadow(0 0 0 rgba(201,162,39,0)); } 50%{ filter:drop-shadow(0 0 10px rgba(201,162,39,0.55)); } }
@media (prefers-reduced-motion:reduce){ .ring-fill{ animation:none; } }
.ring-center{
  position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; text-align:center;
}
.ring-center .score{ font-family:var(--font-display); font-size:2.6rem; color:var(--text); line-height:1; }
.ring-center .label{ font-family:var(--font-mono); font-size:.7rem; letter-spacing:.12em; text-transform:uppercase; color:var(--text-soft); margin-top:6px; }
.ring-card__note{ text-align:center; color:var(--text-soft); font-size:.92rem; max-width:30ch; }
.ring{ display:inline-block; }
.ring--small{ width:20px; height:20px; }

/* ---------- feature / content cards ---------- */
.grid{ display:grid; gap:24px; }
.grid--3{ grid-template-columns:repeat(3,1fr); }
.grid--2{ grid-template-columns:repeat(2,1fr); }
.grid--4{ grid-template-columns:repeat(4,1fr); }
@media (max-width:900px){ .grid--3,.grid--4{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){ .grid--2,.grid--3,.grid--4{ grid-template-columns:1fr; } }

.card{
  background:var(--bg-elevated); border:1px solid var(--border);
  border-radius:var(--radius-md); padding:28px;
}
.card .eyebrow{ display:block; margin-bottom:14px; }
.card h3{ margin-bottom:8px; }
.card p:last-child{ margin-bottom:0; }

.testimonial{ background:var(--accent-soft); border-radius:var(--radius-md); padding:28px; }
.testimonial p{ color:var(--text); font-style:italic; }
.testimonial cite{ display:block; margin-top:14px; font-size:.85rem; color:var(--text-soft); font-style:normal; }

/* ---------- inspiration widget ---------- */
.inspire{
  background:linear-gradient(135deg,var(--accent-soft),var(--highlight-soft));
  border-radius:var(--radius-lg); padding:36px; text-align:center;
}
.inspire blockquote{ font-family:var(--font-display); font-size:1.3rem; margin:0 0 12px; color:var(--text); }
.inspire .src{ font-size:.85rem; color:var(--text-soft); }

/* ---------- chat ---------- */
.chat-shell{
  max-width:760px; margin:0 auto;
  background:var(--bg-elevated); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  display:flex; flex-direction:column; height:min(72vh,640px);
  overflow:hidden;
}
.chat-head{ padding:18px 22px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:12px; }
.chat-head .dot{ width:9px; height:9px; border-radius:50%; background:#5BBE7A; }
.chat-log{ flex:1; overflow-y:auto; padding:22px; display:flex; flex-direction:column; gap:14px; }
.msg{ max-width:80%; padding:13px 16px; border-radius:16px; font-size:.96rem; line-height:1.5; }
.msg-bot{ align-self:flex-start; background:var(--accent-soft); color:var(--text); border-bottom-left-radius:4px; }
.msg-user{ align-self:flex-end; background:var(--accent); color:#fff; border-bottom-right-radius:4px; }
html[dir="rtl"] .msg-bot{ border-bottom-left-radius:16px; border-bottom-right-radius:4px; }
html[dir="rtl"] .msg-user{ border-bottom-right-radius:16px; border-bottom-left-radius:4px; }
.msg-bot.typing{ display:flex; gap:5px; align-items:center; }
.msg-bot.typing span{ width:6px; height:6px; border-radius:50%; background:var(--text-soft); animation:blink 1.2s infinite; }
.msg-bot.typing span:nth-child(2){ animation-delay:.2s; }
.msg-bot.typing span:nth-child(3){ animation-delay:.4s; }
@keyframes blink{ 0%,80%,100%{opacity:.25;} 40%{opacity:1;} }
.chat-input{ display:flex; gap:10px; padding:16px; border-top:1px solid var(--border); background:var(--bg); }
.chat-input textarea{
  flex:1; resize:none; border:1px solid var(--border); border-radius:14px;
  padding:12px 14px; font-family:inherit; font-size:.95rem; background:var(--bg-elevated); color:var(--text);
  max-height:120px;
}
.chat-disclaimer{ font-size:.78rem; color:var(--text-soft); text-align:center; padding:10px 16px 0; }

/* ---------- forms ---------- */
.field{ margin-bottom:18px; }
.field label{ display:block; font-size:.88rem; font-weight:600; margin-bottom:6px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="range"],
.field select,
.field textarea{
  width:100%; padding:11px 14px; border-radius:var(--radius-sm);
  border:1px solid var(--border); background:var(--bg-elevated); color:var(--text);
  font-family:inherit; font-size:.95rem;
}
.field textarea{ resize:vertical; min-height:90px; }
.range-row{ display:flex; align-items:center; gap:14px; }
.range-row output{ font-family:var(--font-mono); font-size:.85rem; color:var(--accent); min-width:34px; text-align:center; }

/* ---------- pills / tags ---------- */
.pill{
  display:inline-flex; align-items:center; padding:5px 14px; border-radius:999px;
  background:var(--accent-soft); color:var(--accent); font-size:.8rem; font-weight:600;
}
.pill-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.pill-row button{
  border:1px solid var(--border); background:var(--bg-elevated); color:var(--text-soft);
  padding:6px 16px; border-radius:999px; cursor:pointer; font-size:.85rem;
}
.pill-row button.is-active{ background:var(--accent); color:#fff; border-color:var(--accent); }

/* ---------- journal / goals list ---------- */
.entry{
  background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-md);
  padding:18px 20px; margin-bottom:12px; display:flex; gap:14px; align-items:flex-start;
}
.entry__mood{ font-size:1.6rem; }
.entry__meta{ font-size:.78rem; color:var(--text-soft); font-family:var(--font-mono); }
.entry__del{ margin-inline-start:auto; border:none; background:none; color:var(--text-soft); cursor:pointer; font-size:.85rem; }
.entry__del:hover{ color:#C0463D; }

.goal{ background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-md); padding:20px; margin-bottom:14px; }
.goal__bar{ height:8px; border-radius:999px; background:var(--accent-soft); overflow:hidden; margin:10px 0; }
.goal__bar span{ display:block; height:100%; background:var(--highlight); }
.goal__milestones{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.goal__milestones li{ display:flex; gap:10px; align-items:center; font-size:.92rem; color:var(--text-soft); }
.goal__milestones input{ accent-color:var(--accent); }

/* ---------- footer ---------- */
.footer{ background:var(--ink); color:#E9EEF3; padding:56px 0 28px; }
[data-theme="dark"] .footer{ background:#0B1521; }
.footer a{ color:#C9D6E3; }
.footer__grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:32px; margin-bottom:36px; }
@media (max-width:780px){ .footer__grid{ grid-template-columns:1fr 1fr; } }
.footer__brand{ font-family:var(--font-display); font-size:1.2rem; margin-bottom:10px; }
.footer h4{ font-size:.85rem; text-transform:uppercase; letter-spacing:.08em; color:#9FB3C6; margin-bottom:14px; font-family:var(--font-mono); }
.footer ul{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:9px; font-size:.92rem; }
.footer__bottom{ border-top:1px solid rgba(255,255,255,.12); padding-top:22px; font-size:.82rem; color:#9FB3C6; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }

/* ---------- utility ---------- */
.text-center{ text-align:center; }
.mt-0{ margin-top:0; }
.muted{ color:var(--text-soft); }
.section-head{ max-width:640px; margin:0 auto 48px; text-align:center; }
.badge-row{ display:flex; justify-content:center; gap:10px; margin-top:18px; flex-wrap:wrap; }
.skip-link{ position:absolute; left:-999px; }
.skip-link:focus{ left:12px; top:12px; background:var(--bg); padding:8px 14px; border-radius:8px; z-index:100; }

[data-i18n], [data-i18n-ph]{ }
.hidden{ display:none !important; }

/* page hero (secondary pages) */
.page-hero{ padding:60px 0 36px; text-align:center; }
.page-hero p{ max-width:56ch; margin-inline:auto; }
