/* Keep — Estudio Digital | shared styles */
:root {
  /* Plan palette */
  --ink: #0D0D12;
  --ink-2: #13131B;
  --ink-3: #1A1A26;
  --surface: #14141E;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --text: #EDEEF2;
  --text-dim: #9BA1B0;
  --text-faint: #646B7D;

  --brand-deep: #1A1A2E;
  --brand-electric: #0F3460;
  --accent: #00D4AA;
  --accent-warm: oklch(82% 0.14 70);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 18px;

  --font-display: 'Space Grotesk', 'Inter', -apple-system, system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --pad: clamp(20px, 4vw, 48px);
  --maxw: 1280px;
}

:root[data-theme="light"] {
  --ink: #FAFAFB;
  --ink-2: #F4F4F8;
  --ink-3: #ECEDF2;
  --surface: #FFFFFF;
  --line: rgba(13,13,18,0.08);
  --line-strong: rgba(13,13,18,0.18);
  --text: #14141C;
  --text-dim: #4A5162;
  --text-faint: #8892A0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

.mono { font-family: var(--font-mono); letter-spacing: 0.01em; }
.display { font-family: var(--font-display); letter-spacing: -0.02em; font-weight: 500; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(40px, 7vw, 96px); line-height: 1.02; }
h2 { font-size: clamp(28px, 3.6vw, 48px); line-height: 1.08; }
h3 { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.25; }
p { margin: 0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* Dot grid background utility */
.dotgrid {
  background-image: radial-gradient(circle, var(--line-strong) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--ink) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 32px; height: 32px; display: inline-flex;
  color: var(--text);
}
.logo-mark svg { display: block; }
.logo:hover .logo-mark { color: var(--accent); transition: color .2s; }
.logo-word { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.03em; }
.logo-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin-left: 2px; }

.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  padding: 8px 14px; border-radius: 8px; font-size: 14px; color: var(--text-dim);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--ink-3); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::before {
  content: '·'; color: var(--accent); margin-right: 6px; font-weight: bold;
}

.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); background: transparent;
  border-radius: 8px; color: var(--text-dim);
  transition: all .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }

.lang-toggle {
  display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 34px;
  font-family: var(--font-mono); font-size: 11px;
}
.lang-toggle button {
  background: transparent; border: 0; padding: 0 10px; color: var(--text-faint);
}
.lang-toggle button.on { background: var(--ink-3); color: var(--text); }

.nav-cta {
  font-size: 13px; padding: 8px 14px; border-radius: 8px;
  background: var(--text); color: var(--ink);
  transition: transform .12s;
}
.nav-cta:hover { transform: translateY(-1px); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 10px; border: 0;
  font-size: 14px; font-weight: 500; letter-spacing: -0.005em;
  transition: transform .12s ease, background .15s;
}
.btn-primary { background: var(--accent); color: #06120F; }
.btn-primary:hover { transform: translateY(-1px); background: #1EE4BB; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--ink-3); }

/* Tag / chip */
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
  background: var(--ink-2);
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,170,0.18); }

/* Section */
section { padding: clamp(60px, 9vw, 120px) 0; position: relative; }
.section-label {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 18px;
}
.section-label::before {
  content: ''; width: 28px; height: 1px; background: var(--accent);
}
.section-title { max-width: 820px; margin-bottom: 40px; }
.section-title p { color: var(--text-dim); font-size: 18px; margin-top: 16px; max-width: 620px; }

/* Card */
.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-strong); }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 60px 0 40px;
  color: var(--text-dim);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer h4 { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; font-weight: 500; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 50px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
}

/* Tweaks panel */
.tweaks {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  width: 280px; padding: 18px;
  background: var(--ink-2); border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.5);
  font-size: 13px;
  display: none;
}
.tweaks.open { display: block; }
.tweaks h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin: 0 0 12px; font-weight: 500; }
.tweak-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.tweak-row:first-of-type { border-top: 0; }
.tweak-row label { color: var(--text-dim); font-size: 12px; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-strong); cursor: pointer; }
.swatch.on { outline: 2px solid var(--text); outline-offset: 2px; }

.chatbot-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: #06120F;
  display: grid; place-items: center;
  border: 0;
  box-shadow: 0 12px 30px -8px rgba(0,212,170,0.55);
  transition: transform .2s;
}
.chatbot-btn:hover { transform: scale(1.05); }
.chatbot-btn.hide { display: none; }

.chatbot {
  position: fixed; right: 20px; bottom: 20px; z-index: 95;
  width: 360px; max-width: calc(100vw - 40px);
  height: 520px; max-height: calc(100vh - 80px);
  background: var(--ink-2); border: 1px solid var(--line-strong);
  border-radius: 16px;
  display: none; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}
.chatbot.open { display: flex; }
.chatbot-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  background: var(--ink-3);
}
.chatbot-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--brand-electric));
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; color: #06120F; font-weight: 600;
}
.chatbot-title { flex: 1; font-size: 14px; }
.chatbot-title small { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.chatbot-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.bubble.bot { background: var(--ink-3); color: var(--text); border-bottom-left-radius: 4px; align-self: flex-start; }
.bubble.user { background: var(--accent); color: #06120F; border-bottom-right-radius: 4px; align-self: flex-end; }
.bubble.typing { display: inline-flex; gap: 4px; }
.bubble.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: dot 1s infinite; }
.bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.chatbot-form { border-top: 1px solid var(--line); display: flex; padding: 10px; gap: 8px; }
.chatbot-form input {
  flex: 1; background: var(--ink); border: 1px solid var(--line); color: var(--text);
  padding: 10px 14px; border-radius: 10px; font: inherit; font-size: 13px;
}
.chatbot-form input:focus { outline: none; border-color: var(--accent); }
.chatbot-form button {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #06120F;
  border: 0; display: grid; place-items: center;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chip { padding: 6px 10px; border-radius: 999px; background: var(--ink-3); border: 1px solid var(--line); font-size: 11.5px; color: var(--text-dim); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--text); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tweaks { display: none !important; }
}

/* Fade in on load */
.reveal { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }
html.js-reveal .reveal { opacity: 0; transform: translateY(14px); }
html.js-reveal .reveal.in { opacity: 1; transform: none; }

/* Accent swap */
:root[data-accent="cyan"] { --accent: #00D4AA; }
:root[data-accent="violet"] { --accent: oklch(72% 0.19 295); }
:root[data-accent="amber"] { --accent: oklch(80% 0.16 70); }
:root[data-accent="pink"] { --accent: oklch(74% 0.18 12); }

/* Density */
:root[data-density="compact"] section { padding: clamp(40px, 6vw, 80px) 0; }
:root[data-density="roomy"] section { padding: clamp(80px, 12vw, 160px) 0; }
