/* ============================================================
   DNAcrypt-AI — Light, minimal, modern theme
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --bg-soft: #eef3f9;
  --fg: #0d1b2a;
  --fg-soft: #3b4a5a;
  --muted: #6b7a8c;
  --line: #e3e9f0;
  --line-strong: #cfd8e3;
  --brand: #0a6cf0;        /* primary blue */
  --brand-dark: #0852b8;
  --accent: #14b8a6;       /* teal */
  --accent-soft: #d8f4ef;
  --danger: #d6435a;
  --success: #18a957;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15,30,55,.06), 0 1px 1px rgba(15,30,55,.04);
  --shadow-md: 0 6px 24px -8px rgba(15,30,55,.18), 0 2px 6px rgba(15,30,55,.06);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-dark); }
h1,h2,h3,h4 { color: var(--fg); line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--fg-soft); }
.muted { color: var(--muted); font-size: .92em; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-alt { background: var(--bg-alt); }

/* --------------------- Header ------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.05rem; color: var(--fg); }
.brand-accent { color: var(--brand); }
.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav a { color: var(--fg-soft); font-size: .92rem; font-weight: 500; }
.site-nav a:hover, .site-nav a.active { color: var(--brand); }
.site-nav a.active { font-weight: 600; }
.nav-cta {
  background: var(--fg); color: #fff !important;
  padding: .5rem .9rem; border-radius: 999px; font-size: .85rem;
}
.nav-cta:hover { background: var(--brand); }
.nav-toggle { display: none; background: none; border: 0; flex-direction: column; gap: 4px; padding: 6px; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--fg); border-radius: 2px; }

@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 0;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); }
  .nav-cta { margin: .75rem 1.25rem; text-align: center; }
}

/* --------------------- Buttons ----------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .8rem 1.3rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}
.btn-primary { background: var(--fg); color: #fff; }
.btn-primary:hover { background: var(--brand); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: #fff; color: var(--fg); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--brand); padding: .6rem .2rem; }
.btn-ghost:hover { color: var(--brand-dark); gap: .65rem; }

/* --------------------- Hero -------------------------- */
.hero {
  padding: 5.5rem 0 3rem;
  background: radial-gradient(1100px 500px at 20% -10%, var(--bg-soft) 0%, transparent 60%),
              radial-gradient(900px 400px at 95% 10%, var(--accent-soft) 0%, transparent 55%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .8rem; font-size: .8rem; color: var(--fg-soft);
  margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero h1 .accent { background: linear-gradient(120deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lede { font-size: 1.15rem; color: var(--fg-soft); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-meta { margin-top: 2.25rem; display: flex; gap: 2.25rem; flex-wrap: wrap; }
.hero-meta div strong { display: block; font-size: 1.5rem; color: var(--fg); font-family: var(--font-mono); }
.hero-meta div span { font-size: .85rem; color: var(--muted); }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* --------------------- Entropy Diagram (hero visual) ---------------- */
.entropy-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-md);
}
.entropy-card h3 {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 600; margin-bottom: 1rem;
}
.entropy-card .total {
  font-family: var(--font-mono); font-size: 2.25rem; font-weight: 700;
  background: linear-gradient(120deg, var(--brand), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .25rem;
}
.entropy-card .total-label { font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; }
.entropy-row {
  display: grid; grid-template-columns: 28px 1fr auto;
  gap: .8rem; align-items: center; padding: .55rem 0;
  border-top: 1px dashed var(--line);
  font-size: .92rem;
}
.entropy-row .op { font-family: var(--font-mono); color: var(--brand); font-weight: 600; text-align: center; }
.entropy-row .label { color: var(--fg-soft); }
.entropy-row .label strong { color: var(--fg); }
.entropy-row .val { font-family: var(--font-mono); color: var(--fg); font-weight: 600; }
.entropy-result {
  margin-top: 1rem; padding: .9rem 1rem;
  background: linear-gradient(120deg, rgba(10,108,240,.07), rgba(20,184,166,.07));
  border-radius: var(--radius); border: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}
.entropy-result .lbl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.entropy-result .num { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--brand-dark); }

/* --------------------- Cards & Grids ----------------- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.75rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: .5rem; font-size: 1.1rem; }
.card p { margin-bottom: 1rem; font-size: .94rem; }
.card .card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-mono); font-weight: 700; margin-bottom: 1rem;
}

/* --------------------- Page header ------------------- */
.page-header { padding: 4rem 0 2rem; border-bottom: 1px solid var(--line); }
.page-header .eyebrow { color: var(--brand); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; margin-bottom: .75rem; display: block; }
.page-header p.lede { font-size: 1.1rem; max-width: 50rem; }

/* --------------------- Prose ------------------------- */
.prose { max-width: 48rem; }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; font-size: 1.15rem; }
.prose ul, .prose ol { padding-left: 1.25rem; color: var(--fg-soft); }
.prose li { margin-bottom: .4rem; }
.prose blockquote {
  border-left: 3px solid var(--brand);
  padding: .5rem 0 .5rem 1.25rem; margin: 1.5rem 0;
  color: var(--fg); font-style: italic; font-size: 1.05rem;
}
.prose code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--bg-alt); padding: .15rem .4rem; border-radius: 4px;
}

/* --------------------- Quote / Callout --------------- */
.callout {
  background: linear-gradient(120deg, var(--bg-soft), var(--accent-soft));
  border-radius: var(--radius-lg); padding: 2.5rem;
  border: 1px solid var(--line); text-align: center;
}
.callout h2 { font-size: 1.4rem; font-weight: 600; font-style: italic; color: var(--fg); margin-bottom: .5rem; }
.callout cite { color: var(--muted); font-style: normal; font-size: .9rem; }

/* --------------------- Forms ------------------------- */
.form { display: grid; gap: 1.1rem; max-width: 36rem; }
.form label { display: block; font-weight: 500; font-size: .9rem; color: var(--fg); margin-bottom: .35rem; }
.form input, .form textarea {
  width: 100%; padding: .8rem 1rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: inherit; color: var(--fg); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(10,108,240,.12);
}
.form textarea { min-height: 140px; resize: vertical; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form .row { grid-template-columns: 1fr; } }
.form .honeypot { position: absolute; left: -9999px; }
.alert { padding: 1rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: .94rem; }
.alert-success { background: #e7f8ee; border: 1px solid #b9e8c8; color: #0f6b3a; }
.alert-error { background: #fde8ec; border: 1px solid #f3b8c4; color: #9c2238; }

/* --------------------- Lists / Releases / Pubs ------- */
.entry {
  border-top: 1px solid var(--line); padding: 2rem 0;
  display: grid; grid-template-columns: 180px 1fr; gap: 2rem;
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry .tag {
  font-family: var(--font-mono); font-size: .85rem;
  color: var(--brand); font-weight: 600;
}
.entry .tag.deprecated { color: var(--muted); }
.entry h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.entry .actions { margin-top: 1rem; display: flex; gap: .75rem; flex-wrap: wrap; }
@media (max-width: 700px) { .entry { grid-template-columns: 1fr; gap: .75rem; } }

/* --------------------- Architecture image ------------ */
.figure {
  margin: 2rem 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.figure img { border-radius: var(--radius); }
.figure figcaption { color: var(--muted); font-size: .88rem; margin-top: .75rem; text-align: center; }

/* --------------------- Footer ------------------------ */
.site-footer {
  background: var(--bg-alt); border-top: 1px solid var(--line);
  padding: 3.5rem 0 1.5rem; margin-top: 4rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 2rem;
  padding-bottom: 2.5rem; border-bottom: 1px solid var(--line);
}
.footer-grid h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .5rem; }
.footer-grid a { color: var(--fg-soft); font-size: .92rem; }
.footer-grid a:hover { color: var(--brand); }
.footer-brand img { margin-bottom: .75rem; border-radius: 8px; }
.powered-by { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.powered-by img { height: 28px; width: auto; opacity: .7; transition: opacity .2s; }
.powered-by a:hover img { opacity: 1; }
.footer-bottom {
  padding-top: 1.25rem; font-size: .85rem; color: var(--muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
}
.footer-legal a { color: var(--muted); }
.footer-legal a:hover { color: var(--brand); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* --------------------- Misc -------------------------- */
.banner-img {
  width: 100%; border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.center { text-align: center; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
.kicker {
  text-transform: uppercase; letter-spacing: .1em; font-size: .8rem;
  color: var(--brand); font-weight: 600;
}
