/* ============================================================
   mayurkakade.dev — shared design system
   Dark theme only. No light mode (per spec principle 10).
   ============================================================ */

:root {
  --bg:          #0D0D0D;
  --surface:     #141414;
  --surface-2:   #1A1A1A;
  --border:      #1F1F1F;
  --border-2:    #2A2A2A;
  --text:        #F0F0F0;
  --text-2:      #A0A0A0;
  --text-3:      #505050;
  --accent:      #4AF0B4;
  --accent-dim:  #4AF0B414; /* green tint */
  --accent-border: #4AF0B44D;
  --orange:      #FF6B35;

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

  --maxw: 1120px;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

/* ---- typography ---- */
h1, h2, h3 { font-family: var(--mono); font-weight: 700; line-height: 1.1; margin: 0; }
.hero-type   { font-size: clamp(36px, 5vw, 64px); font-weight: 700; }
h2, .h2      { font-size: clamp(24px, 3vw, 40px); font-weight: 700; letter-spacing: -0.01em; }
h3, .h3      { font-size: 19px; font-weight: 600; }
.body-2 { color: var(--text-2); }
.mono   { font-family: var(--mono); }
.accent { color: var(--accent); }
.orange { color: var(--orange); }

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
}
code, .code { font-family: var(--mono); font-size: 13px; }

/* ---- layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-head { margin-bottom: 40px; }
.section-head .label { display: block; margin-bottom: 12px; }

/* ============================================================
   Navigation (shared across all pages)
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__brand { font-family: var(--mono); font-size: 13px; color: var(--text-2); letter-spacing: 0.02em; }
.nav__brand:hover { color: var(--text); }
.nav__links { display: flex; gap: 26px; align-items: center; }
.nav__links a {
  font-family: var(--mono); font-size: 13px; color: var(--text-2);
  position: relative; padding: 4px 0; transition: color 0.25s ease;
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent);
}
.nav__burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__burger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; transition: 0.3s; }

/* mobile full-screen menu */
.mobilemenu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.mobilemenu.is-open { opacity: 1; pointer-events: auto; }
.mobilemenu a { font-family: var(--mono); font-size: 22px; color: var(--text-2); }
.mobilemenu a:hover { color: var(--accent); }
.mobilemenu__close { position: absolute; top: 20px; right: 24px; background: none; border: 0; color: var(--text); font-size: 28px; cursor: pointer; }

@media (max-width: 680px) {
  .nav__links { display: none; }
  .nav__burger { display: block; }
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  display: flex; flex-direction: column;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s var(--ease-spring);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-spring);
}
.card:hover { border-color: var(--accent-border); background: var(--surface-2); transform: translateY(-3px); }
.card:hover::before { transform: scaleX(1); }
.card h3 { margin-bottom: 12px; }
.card p { color: var(--text-2); margin: 0 0 20px; flex: 1; }
.card__meta { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-bottom: 18px; }
.card__cta { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.card__cta::after { content: ""; }

.card--live { box-shadow: 0 0 0 1px transparent; }
.card--live:hover { box-shadow: 0 0 30px -6px var(--accent-dim), 0 0 0 1px var(--accent-border); }
.badge {
  display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent); background: var(--accent-dim);
  border: 1px solid var(--accent-border); border-radius: 999px; padding: 3px 10px; margin-bottom: 14px;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 6px; padding: 6px 12px;
}

/* ---- buttons ---- */
.btn {
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--bg);
  transition: transform 0.2s var(--ease-spring), opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn--ghost:hover { border-color: var(--accent-border); color: var(--accent); }
.btn--full { width: 100%; justify-content: center; }

/* ============================================================
   Motion: scroll reveal
   ============================================================ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Hero (landing)
   ============================================================ */
.hero { min-height: 100svh; display: flex; flex-direction: column; position: relative; }
.hero__center {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 30px; padding: 0 24px;
}
.hero__wave { width: min(60vw, 640px); height: 120px; opacity: 1; transition: opacity 0.6s ease; }
.hero__wave path {
  stroke: var(--accent); stroke-width: 2; fill: none; opacity: 0.3;
  stroke-dasharray: 12 10;
  animation: waveflow 3s linear infinite, wavepulse 3s ease-in-out infinite;
}
@keyframes waveflow { to { stroke-dashoffset: -220; } }
@keyframes wavepulse { 0%,100% { opacity: 0.22; } 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  .hero__wave path { animation: none; stroke-dasharray: none; }
}
.hero__title { min-height: 1.1em; }
.hero__title .caret { color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--text-3); font-size: 22px; opacity: 0; transition: opacity 0.6s ease;
  animation: bob 2s ease-in-out infinite;
}
.hero__cue.is-visible { opacity: 1; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }
.is-scrolled .hero__wave { opacity: 0; }

/* ---- case-study / writing teasers ---- */
.teaser { border-top: 1px solid var(--border); padding: 32px 0; display: block; transition: background 0.3s ease; }
.teaser:hover { background: var(--surface); }
.teaser:hover .teaser__cta { color: var(--accent); }
.teaser h3 { margin: 8px 0 10px; }
.teaser p { color: var(--text-2); margin: 0 0 14px; max-width: 60ch; }
.teaser__cta { font-family: var(--mono); font-size: 13px; color: var(--text-2); transition: color 0.25s ease; }

/* ---- contact ---- */
.contact { text-align: center; }
.contact h2 { margin-bottom: 28px; }
.contact ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.contact a, .contact li { font-family: var(--mono); font-size: 15px; color: var(--text-2); }
.contact a:hover { color: var(--accent); }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---- generic page hero ---- */
.pagehero { padding: 80px 0 20px; }
.pagehero h1 { font-size: clamp(30px, 4.5vw, 52px); margin: 14px 0 16px; }
.pagehero p { color: var(--text-2); max-width: 60ch; font-size: 17px; }

/* ---- TODO placeholder marker (internal, visible while blocked) ---- */
.todo {
  border: 1px dashed var(--border-2); border-radius: 8px; padding: 14px 16px;
  color: var(--text-3); font-family: var(--mono); font-size: 12px; margin: 18px 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, #ffffff05 10px, #ffffff05 20px);
}
.todo b { color: var(--orange); }

/* ---- copyable command ---- */
.cmd {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 14px 16px; font-family: var(--mono); font-size: 13px; color: var(--text);
}
.cmd button { background: none; border: 0; color: var(--text-3); cursor: pointer; font-family: var(--mono); font-size: 12px; }
.cmd button:hover { color: var(--accent); }

.linkrow { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

/* ============================================================
   Crystal AI two-panel demo
   ============================================================ */
.demo { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; background: var(--surface); }
.demo__panel { display: flex; flex-direction: column; min-height: 460px; }
.demo__panel--yaml { border-right: 1px solid var(--border-2); }
.demo__bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.demo__bar .label { color: var(--text-2); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.preset {
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  background: var(--bg); border: 1px solid var(--border-2); border-radius: 6px;
  padding: 5px 10px; cursor: pointer; transition: 0.2s;
}
.preset:hover { border-color: var(--accent-border); color: var(--text); }
.preset.is-active { color: var(--accent); border-color: var(--accent-border); background: var(--accent-dim); }

#yaml {
  flex: 1; width: 100%; resize: none; border: 0; outline: none;
  background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 13px;
  line-height: 1.6; padding: 16px; tab-size: 2;
}
.demo__foot { padding: 12px 16px; border-top: 1px solid var(--border); }

#chat { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; word-wrap: break-word;
}
.bubble--agent { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.bubble--user  { align-self: flex-end; background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--text); }
.bubble.is-thinking { color: var(--text-3); letter-spacing: 3px; }
.chatform { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
#chat-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; outline: none;
}
#chat-input:focus { border-color: var(--accent-border); }
.demo__status { font-family: var(--mono); font-size: 12px; color: var(--orange); min-height: 1em; margin-top: 10px; }

@media (max-width: 780px) {
  .demo { grid-template-columns: 1fr; }
  .demo__panel--yaml { border-right: 0; border-bottom: 1px solid var(--border-2); }
  .demo__panel { min-height: 360px; }
}

/* ============================================================
   CustomerPro live demo form
   ============================================================ */
.cpform { max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; padding: 28px; transition: border-color 0.3s ease; }
.cpform.is-error { border-color: var(--orange); }
.cpform label { display: block; font-family: var(--mono); font-size: 12px; color: var(--text-2); margin: 0 0 8px; }
.cpform textarea, .cpform input {
  width: 100%; background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 12px; font-size: 14px; outline: none; margin-bottom: 20px;
}
.cpform textarea { min-height: 96px; resize: vertical; font-family: var(--body); line-height: 1.5; }
.cpform textarea:focus, .cpform input:focus { border-color: var(--accent-border); }
.phone { display: flex; gap: 10px; }
.phone .cc { width: 84px; flex: none; text-align: center; font-family: var(--mono); }
.qr { margin-top: 24px; text-align: center; }
.qr__box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 200px; height: 200px; border: 1px dashed var(--border-2); border-radius: 10px;
  color: var(--text-3); font-family: var(--mono); font-size: 12px; padding: 12px;
}
.qr__box img { border-radius: 8px; }
.qr__caption { color: var(--text-2); font-size: 13px; margin-top: 12px; }
.qr[hidden] { display: none; }

/* WhatsApp-style agent chat (CustomerPro live preview) */
.wa-chat {
  height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  background: var(--bg); border: 1px solid var(--border-2); border-radius: 10px; padding: 14px;
}
#cp-chatwrap[hidden] { display: none; }
#cp-chatwrap.pop { animation: qrpop 0.35s var(--ease-spring); }
#cp-input { flex: 1; background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 12px; font-size: 14px; outline: none; }
#cp-input:focus { border-color: var(--accent-border); }
.qr.pop { animation: qrpop 0.4s var(--ease-spring); }
@keyframes qrpop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.spinner { width: 16px; height: 16px; border: 2px solid #0004; border-top-color: var(--bg); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Case-study pipelines
   ============================================================ */
.pipeline { overflow-x: auto; padding: 20px 0 8px; }
.pipeline__track { display: flex; align-items: stretch; gap: 0; min-width: 780px; }
.pnode {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; transition: border-color 0.3s ease, background 0.3s ease; position: relative;
}
.pnode:hover { border-color: var(--accent-border); background: var(--surface-2); }
.pnode h4 { font-family: var(--mono); font-size: 14px; margin: 0 0 8px; }
.pnode .pnode__sub { color: var(--text-2); font-size: 13px; margin: 0; }
.pnode__detail { color: var(--text-3); font-size: 12px; margin-top: 10px; max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.pnode:hover .pnode__detail { max-height: 200px; }
.parrow { display: flex; align-items: center; color: var(--text-3); padding: 0 6px; font-family: var(--mono); }
@media (max-width: 680px) { .parrow { display: none; } .pipeline__track { flex-direction: column; gap: 12px; min-width: 0; } .pipeline { overflow: visible; } }

/* video hero */
.videohero { width: 100%; border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-family: var(--mono); font-size: 13px; }
.videohero video { width: 100%; height: 100%; object-fit: cover; }
.bigcta { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 60px 24px; }
.bigcta h2 { margin-bottom: 24px; }
