/* ============================================================================
   DevMemory — public site design system (landing + docs)
   Bold gradient modern · indigo→cyan · dark · vanilla, no build, no CDN.
   ========================================================================== */

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
  /* canvas */
  --bg:        #07080e;
  --bg-1:      #0b0d17;
  --bg-2:      #10132200;
  --surface:   rgba(255,255,255,0.035);
  --surface-2: rgba(255,255,255,0.06);
  --border:    rgba(255,255,255,0.09);
  --border-2:  rgba(255,255,255,0.14);

  /* text */
  --text:      #eceeffe6;
  --text-mut:  #a2a7c2;
  --text-dim:  #6b7196;

  /* brand — indigo → blue → cyan */
  --indigo:    #6366f1;
  --indigo-2:  #818cf8;
  --blue:      #3b82f6;
  --cyan:      #22d3ee;
  --accent:    #6366f1;
  --accent-soft: rgba(99,102,241,0.14);

  --grad:      linear-gradient(115deg, #818cf8 0%, #6366f1 34%, #3b82f6 66%, #22d3ee 100%);
  --grad-dim:  linear-gradient(115deg, #6366f1, #22d3ee);

  /* type */
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;

  /* geometry */
  --r-sm: 8px;  --r: 14px;  --r-lg: 20px;  --r-xl: 28px;
  --maxw: 1160px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 0 1px var(--border), 0 24px 70px -30px rgba(99,102,241,0.5);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient gradient field painted behind everything */
.bg-field {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% -5%, rgba(99,102,241,0.28), transparent 60%),
    radial-gradient(48% 42% at 12% 8%, rgba(34,211,238,0.16), transparent 60%),
    radial-gradient(55% 48% at 50% 108%, rgba(59,130,246,0.16), transparent 60%),
    var(--bg);
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.4;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(80% 60% at 50% 0%, #000 30%, transparent 78%);
}

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

/* ── Typography helpers ───────────────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.03em; font-weight: 650; }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--indigo-2);
}
.lead { color: var(--text-mut); font-size: clamp(16px, 2.2vw, 19px); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .18s ease, box-shadow .25s ease, background .2s ease, border-color .2s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  color: #0a0b16; background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 10px 34px -10px rgba(99,102,241,0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 44px -10px rgba(99,102,241,0.85); }
.btn-ghost { color: var(--text); background: var(--surface); border: 1px solid var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); transform: translateY(-2px); }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(7,8,14,0.6); border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(7,8,14,0.82); }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 680; font-size: 17px; letter-spacing: -0.02em; }
.brand .logo { width: 30px; height: 30px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: 8px; }
.nav-links a { color: var(--text-mut); font-size: 14.5px; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); }
.nav-toggle:hover { background: var(--surface); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: clamp(64px, 12vw, 132px) 0 clamp(48px, 8vw, 92px); text-align: center; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 26px;
  padding: 7px 15px 7px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-mut);
}
.hero .badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.hero h1 { font-size: clamp(38px, 7vw, 76px); font-weight: 680; margin-bottom: 22px; }
.hero .lead { max-width: 620px; margin: 0 auto 34px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 20px; font-size: 13px; color: var(--text-dim); }

/* floating glow orbs */
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; z-index: -1; pointer-events: none; }
.orb.a { width: 380px; height: 380px; background: var(--indigo); top: -40px; left: -80px; animation: float1 14s ease-in-out infinite; }
.orb.b { width: 320px; height: 320px; background: var(--cyan); top: 40px; right: -60px; animation: float2 16s ease-in-out infinite; }
@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(40px,30px)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-30px,40px)} }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

/* ── Terminal showcase ────────────────────────────────────────────────────── */
.terminal {
  max-width: 720px; margin: 46px auto 0; text-align: left;
  border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(180deg, rgba(18,21,38,0.9), rgba(10,12,22,0.94));
  border: 1px solid var(--border-2); box-shadow: var(--shadow-glow);
}
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.terminal-bar .tdot { width: 11px; height: 11px; border-radius: 50%; background: #34364a; }
.terminal-bar .tdot:nth-child(1){ background:#ff5f57 } .terminal-bar .tdot:nth-child(2){ background:#febc2e } .terminal-bar .tdot:nth-child(3){ background:#28c840 }
.terminal-bar .tname { margin-left: 10px; font: 12.5px/1 var(--mono); color: var(--text-dim); }
.terminal-body { padding: 20px 22px; font: 14px/1.85 var(--mono); overflow-x: auto; }
.terminal-body .line { white-space: pre; }
.terminal-body .p { color: var(--cyan); }        /* prompt */
.terminal-body .c { color: var(--text); }         /* command */
.terminal-body .o { color: var(--text-dim); }     /* output */
.terminal-body .g { color: #4ade80; }             /* success */
.terminal-body .m { color: var(--indigo-2); }     /* highlight */

/* ── Sections ─────────────────────────────────────────────────────────────── */
section { position: relative; padding: clamp(56px, 9vw, 104px) 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(38px, 6vw, 62px); }
.section-head h2 { font-size: clamp(28px, 4.4vw, 44px); margin: 14px 0 16px; }

/* logos strip */
.logos { display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: center; align-items: center; opacity: .9; }
.logos .logo-chip { display: flex; align-items: center; gap: 9px; color: var(--text-mut); font-size: 14px; font-weight: 500; }
.logos .logo-chip img { width: 24px; height: 24px; border-radius: 6px; }

/* feature grid */
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  position: relative; padding: 26px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; transition: opacity .25s;
}
.card:hover { transform: translateY(-4px); background: var(--surface-2); }
.card:hover::before { opacity: .8; }
.card .ic {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--indigo-2); margin-bottom: 16px;
}
.card .ic svg { width: 22px; height: 22px; }
.card h3 { font-size: 18px; margin-bottom: 8px; font-weight: 620; }
.card p { color: var(--text-mut); font-size: 14.5px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; padding: 26px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.step .num {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 16px;
  font: 700 16px var(--mono); color: #0a0b16; background: var(--grad);
}
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { color: var(--text-mut); font-size: 14px; }
.step code, .card code, .prose code, .cta code { font: 0.88em var(--mono); color: var(--cyan); background: rgba(34,211,238,0.09); padding: 2px 6px; border-radius: 6px; }

/* CTA band */
.cta-band {
  position: relative; text-align: center; border-radius: var(--r-xl); overflow: hidden;
  padding: clamp(44px, 7vw, 76px) 28px; border: 1px solid var(--border-2);
  background: radial-gradient(80% 130% at 50% 0%, rgba(99,102,241,0.28), transparent 62%), var(--bg-1);
}
.cta-band h2 { font-size: clamp(26px, 4vw, 40px); margin-bottom: 14px; }
.cta-band p { color: var(--text-mut); max-width: 520px; margin: 0 auto 28px; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 46px 0; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.footer .brand { font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a { color: var(--text-dim); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer .copy { color: var(--text-dim); font-size: 13px; width: 100%; }

/* ── Copy button (shared) ─────────────────────────────────────────────────── */
.copy-inline { display: inline-flex; align-items: center; gap: 8px; }
.copy-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  color: var(--text-dim); border: 1px solid var(--border); transition: all .15s;
}
.copy-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-2); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn.done { color: #4ade80; border-color: rgba(74,222,128,0.4); }

/* ── Scroll reveal ────────────────────────────────────────────────────────── */
/* Only hide-then-reveal when JS is present (html.js); otherwise content is
   always visible, so a JS load failure never leaves the page blank. */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } }

/* ============================================================================
   DOCS
   ========================================================================== */
.docs-shell { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 48px; align-items: start;
  max-width: var(--maxw); margin-inline: auto; padding: 40px 24px 96px; }
.docs-side { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; }
.docs-side .grp { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); margin: 20px 0 8px; }
.docs-side a {
  display: block; padding: 7px 12px; border-radius: 8px; font-size: 14px; color: var(--text-mut);
  border-left: 2px solid transparent; transition: all .15s;
}
.docs-side a:hover { color: var(--text); background: var(--surface); }
.docs-side a.active { color: var(--indigo-2); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 550; }

.prose { max-width: 780px; }
.prose h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 14px; }
.prose > p.lead { margin-bottom: 8px; }
.prose h2 { font-size: 26px; margin: 52px 0 14px; padding-top: 14px; scroll-margin-top: 90px; }
.prose h3 { font-size: 18.5px; margin: 30px 0 10px; scroll-margin-top: 90px; }
.prose p { color: var(--text-mut); margin-bottom: 14px; }
.prose ul, .prose ol { color: var(--text-mut); margin: 0 0 16px 22px; }
.prose li { margin-bottom: 7px; }
.prose li::marker { color: var(--indigo-2); }
.prose a.link { color: var(--indigo-2); border-bottom: 1px solid rgba(129,140,248,0.35); }
.prose a.link:hover { border-bottom-color: var(--indigo-2); }
.prose strong { color: var(--text); font-weight: 620; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* code blocks */
.code {
  position: relative; margin: 18px 0; border-radius: var(--r);
  background: rgba(10,12,22,0.85); border: 1px solid var(--border);
}
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; font: 13.5px/1.75 var(--mono); color: #cdd2ea; }
.code .copy-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.04); }
.code pre .tok-c { color: var(--text-dim); }     /* comment */
.code pre .tok-k { color: var(--indigo-2); }      /* keyword/cmd */
.code pre .tok-s { color: var(--cyan); }          /* string/flag */

/* callout */
.note {
  display: flex; gap: 13px; padding: 15px 17px; border-radius: var(--r); margin: 18px 0;
  background: var(--accent-soft); border: 1px solid rgba(99,102,241,0.28);
}
.note svg { width: 18px; height: 18px; flex: none; color: var(--indigo-2); margin-top: 2px; }
.note p { color: var(--text); margin: 0; font-size: 14.5px; }

/* table */
.table-wrap { overflow-x: auto; margin: 18px 0; border-radius: var(--r); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text); font-weight: 600; background: var(--surface); }
td { color: var(--text-mut); }
tr:last-child td { border-bottom: none; }
td .ok { color: #4ade80; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 940px) {
  .grid.cols-3, .steps { grid-template-columns: 1fr 1fr; }
  .docs-shell { grid-template-columns: 1fr; gap: 0; }
  .docs-side {
    position: static; max-height: none; overflow: visible; margin-bottom: 8px;
    display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border: 1px solid var(--border);
    border-radius: var(--r); background: var(--surface);
  }
  .docs-side .grp { width: 100%; margin: 6px 0 2px; }
  .docs-side a { border-left: none; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: rgba(7,8,14,0.97); border-bottom: 1px solid var(--border); padding: 16px 24px 20px; gap: 4px;
    backdrop-filter: blur(14px);
  }
  .nav-links.open a { padding: 10px 0; font-size: 16px; }
  .nav-toggle { display: grid; place-items: center; }
  .grid.cols-3, .grid.cols-2, .steps { grid-template-columns: 1fr; }
}
