/* ==========================================================================
   ZellRayy API — Theme Tokens
   Two moods, one system: "Night Console" (dark) & "Paper Console" (cream)
   ========================================================================== */

:root{
  --radius: 10px;
  --radius-sm: 6px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- DARK (default) : black / charcoal / warm-cream accent ---------- */
:root,
[data-theme="dark"]{
  --bg: #0a0a0b;
  --bg-soft: #121213;
  --surface: #19191b;
  --surface-2: #222224;
  --border: #2b2b2e;
  --border-soft: #1f1f21;
  --text: #d9d4c7;
  --text-muted: #8b877c;
  --text-dim: #5c5952;
  --accent: #cdbd94;
  --accent-strong: #ded0aa;
  --accent-ink: #17150f;
  --success: #7fbf8f;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.25);
  --grain-opacity: .05;
  --code-bg: #101011;
  color-scheme: dark;
}

/* ---------- LIGHT : cream / beige / ink accent ---------- */
[data-theme="light"]{
  --bg: #f3ecdb;
  --bg-soft: #ece1c8;
  --surface: #faf6ec;
  --surface-2: #efe4cb;
  --border: #ddd0ac;
  --border-soft: #e7dbbd;
  --text: #211f1a;
  --text-muted: #756c5b;
  --text-dim: #a89d86;
  --accent: #1c1a16;
  --accent-strong: #000000;
  --accent-ink: #f6f0e2;
  --success: #3f7a52;
  --shadow: 0 8px 30px rgba(60,50,20,.10);
  --shadow-sm: 0 2px 10px rgba(60,50,20,.08);
  --grain-opacity: .035;
  --code-bg: #efe4cc;
  color-scheme: light;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

::-webkit-scrollbar{ width: 8px; height: 8px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: var(--border); border-radius: 8px; }

::selection{ background: var(--accent); color: var(--accent-ink); }

.font-display{ font-family: 'Space Grotesk', 'Inter', sans-serif; }
.font-mono{ font-family: 'JetBrains Mono', 'Ubuntu Mono', monospace; }

a{ color: inherit; }

/* subtle film-grain texture, present in both moods at different strength */
.grain{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- layout atoms ---------- */
.surface{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.surface-2{ background: var(--surface-2); }

.pill{
  border-radius: 999px;
  border: 1px solid var(--border);
}

.muted{ color: var(--text-muted); }
.dim{ color: var(--text-dim); }

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .8rem;
  padding: .7rem 1.3rem;
  border-radius: var(--radius-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease), background-color .2s var(--ease), opacity .2s var(--ease);
  white-space: nowrap;
}
.btn-primary{
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: var(--shadow); filter: brightness(1.04); }
.btn-ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover{ border-color: var(--text-muted); transform: translateY(-2px); }
.btn-disabled{
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: not-allowed;
  border: 1px solid var(--border);
}

.card-hover{ transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease); }
.card-hover:hover{ transform: translateY(-4px); border-color: var(--text-dim); box-shadow: var(--shadow); }

/* ---------- theme toggle: a little day/night dial ---------- */
.theme-dial{
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  flex-shrink: 0;
}
.theme-dial .knob{
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: left .3s var(--ease), background .3s var(--ease);
  color: var(--accent-ink);
}
[data-theme="light"] .theme-dial .knob{ left: 26px; }

/* ---------- terminal / console signature block ---------- */
.console{
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.console-bar{
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
}
.console-dot{ width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.console-body{
  padding: 1.1rem 1.2rem 1.4rem;
  font-size: .78rem;
  line-height: 1.65;
  min-height: 168px;
}
.console-line{ white-space: pre-wrap; word-break: break-all; }
.console-cursor{
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink{ 50%{ opacity: 0; } }

/* ---------- reveal-on-scroll ---------- */
.reveal{
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.visible{ opacity: 1; transform: translateY(0); }

/* ---------- step numerals ---------- */
.step-num{
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- FAQ ---------- */
.faq-item summary{
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker{ display: none; }
.faq-item .chev{ transition: transform .25s var(--ease); }
.faq-item[open] .chev{ transform: rotate(45deg); }

/* ---------- pricing ---------- */
.plan-card{ position: relative; }
.plan-soon{ opacity: .62; }
.soon-ribbon{
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  letter-spacing: .06em;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px dashed var(--text-dim);
  color: var(--text-muted);
}

/* ---------- notifications: bell + dropdown ---------- */
.notif-wrap{ position: relative; flex-shrink: 0; }
.notif-btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .85rem;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.notif-btn:hover{ color: var(--text); border-color: var(--text-dim); }
.notif-dot{
  position: absolute;
  top: 5px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  border: 1.5px solid var(--surface-2);
  display: none;
}
.notif-dot.active{ display: block; }
.notif-panel{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.notif-panel.open{ opacity: 1; transform: translateY(0); pointer-events: auto; }
.notif-panel-header{
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .85rem;
}
.notif-list{ max-height: 320px; overflow-y: auto; }
.notif-item{ display: flex; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border-soft); }
.notif-item:last-child{ border-bottom: none; }
.notif-icon{
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  flex-shrink: 0;
}
.notif-body{ min-width: 0; }
.notif-title{ font-size: .8rem; font-weight: 600; margin-bottom: 2px; }
.notif-msg{ font-size: .75rem; color: var(--text-muted); line-height: 1.5; }
.notif-date{ font-size: .68rem; color: var(--text-dim); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }
.notif-empty{ padding: 1.75rem 1rem; text-align: center; font-size: .78rem; color: var(--text-dim); }

/* ---------- top banner ---------- */
.banner{
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
}

/* ---------- mobile nav drawer ---------- */
.mnav-overlay{
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s var(--ease);
}
.mnav-overlay.open{ opacity: 1; visibility: visible; }

.mnav-panel{
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 84vw;
  max-width: 300px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s var(--ease);
}
.mnav-overlay.open .mnav-panel{ transform: translateX(0); }

.mnav-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mnav-brand{ font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1rem; }
.mnav-close{
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .2s var(--ease);
}
.mnav-close:hover{ color: var(--text); }

.mnav-body{ flex: 1; overflow-y: auto; padding: .9rem; }
.mnav-label{
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--text-dim);
  padding: .5rem .65rem .4rem;
}
.mnav-item{
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .7rem;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.mnav-item:hover{ background: var(--surface-2); color: var(--text); }
.mnav-item.active{ background: var(--accent); color: var(--accent-ink); }
.mnav-icon{
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.mnav-item.active .mnav-icon{ background: rgba(0,0,0,.12); color: var(--accent-ink); }

body.mnav-lock{ overflow: hidden; }

@media (min-width: 768px){
  .mnav-overlay{ display: none; }
}

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