/* ==========================================================================
   nourdge AI — marketing site
   Light/clinical aesthetic matching the product app
   ========================================================================== */

:root {
  --bg: #fafaf9;
  --bg-tint: #f5f5f4;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --surface-3: #eeedea;
  --border: #e7e5e1;
  --border-strong: #d6d3cd;
  --text: #18181b;
  --text-2: #3f3f46;
  --text-3: #71717a;
  --text-4: #a1a1aa;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-soft: #eef2ff;
  --accent-border: #c7d2fe;
  --success: #16a34a;
  --success-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --ink: #0b0b0e;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-md: 0 6px 20px rgba(24, 24, 27, 0.06), 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-lg: 0 16px 40px rgba(24, 24, 27, 0.08), 0 2px 8px rgba(24, 24, 27, 0.04);

  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px; line-height: 1.55; color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-feature-settings: "zero"; }

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

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

/* Layout ------------------------------------------------------------------ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 80px 0; }
.section.tight { padding: 56px 0; }
.section.hero { padding: 56px 0 64px; }

/* Typography -------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--accent); }

h1, .h1 {
  font-size: clamp(34px, 5.2vw, 60px);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.05;
  color: var(--text);
}
h2, .h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
}
h3, .h3 {
  font-size: clamp(19px, 2vw, 22px);
  font-weight: 600; letter-spacing: -0.015em; line-height: 1.3;
}
h4 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.lead {
  font-size: clamp(16px, 1.7vw, 19px);
  color: var(--text-3); line-height: 1.55; max-width: 640px; text-wrap: pretty;
}
.subhead {
  font-size: 14px; color: var(--text-3); line-height: 1.55; text-wrap: pretty;
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 7px;
  font-size: 13.5px; font-weight: 500; line-height: 1;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: background 100ms, border-color 100ms, transform 100ms;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.lg { padding: 12px 18px; font-size: 14.5px; border-radius: 8px; }

/* Nav --------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 250, 249, 0.8);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 28px;
  height: 56px; max-width: var(--container); margin: 0 auto;
  padding: 0 var(--gutter);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 5px;
  display: inline-block; flex-shrink: 0; object-fit: contain;
}
.brand .muted { color: var(--text-3); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-links a {
  padding: 6px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text-2);
  transition: background 100ms, color 100ms;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); font-weight: 500; }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.menu-btn {
  display: none; width: 36px; height: 36px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  flex-shrink: 0;
}
.nav-actions .btn { flex-shrink: 0; }
.nav-mobile-only { display: none; }

/* Footer ------------------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 40px;
  background: var(--surface);
  margin-top: 80px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px; margin-bottom: 48px;
}
.footer-col h5 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 500; color: var(--text-3); margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: 13.5px; color: var(--text-2); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-3);
}

/* Cards ------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.card.tight { padding: 18px; }
.card-hover { transition: border-color 120ms, transform 120ms, box-shadow 120ms; }
.card-hover:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* Badges ------------------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2);
}
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.badge.success { background: var(--success-soft); color: var(--success); border-color: #bbf7d0; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.badge .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

/* Chips ------------------------------------------------------------------- */
.chip {
  display: inline-flex; padding: 4px 10px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}

/* Hero canvas ------------------------------------------------------------- */
.hero-bg {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  background-image:
    radial-gradient(600px 300px at 15% 0%, rgba(79, 70, 229, 0.08), transparent 70%),
    radial-gradient(600px 300px at 85% 100%, rgba(79, 70, 229, 0.04), transparent 70%);
}
.grid-bg {
  position: absolute; inset: 0; opacity: 0.5;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
}

/* Utility ----------------------------------------------------------------- */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent); }
.center { text-align: center; }
.hr { height: 1px; background: var(--border); border: 0; margin: 16px 0; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1024px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 40px;
  }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .section { padding: 56px 0; }
}
@media (max-width: 820px) {
  .nav-inner { gap: 12px; position: relative; }
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links.open {
    display: flex; position: absolute; top: 56px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter); background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 40;
  }
  .nav-links.open a { padding: 10px 12px; }
  .nav-links.open .nav-mobile-only { display: block; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }
}
@media (max-width: 480px) {
  .nav-actions .btn.ghost { display: none; }
  .nav-actions { gap: 6px; }
}
@media (max-width: 680px) {
  .footer-grid { gap: 24px 24px; margin-bottom: 36px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .section.hero { padding: 40px 0 48px; }
  .logo-strip { gap: 24px; }
  .logo-strip .logo { font-size: 14px; }
  .logo-strip .logo.mono { font-size: 12px; }
}
@media (max-width: 480px) {
  h1, .h1 { font-size: 30px; }
  h2, .h2 { font-size: 24px; }
  h3, .h3 { font-size: 18px; }
  .lead { font-size: 15px; }
  .btn.lg { padding: 11px 16px; font-size: 14px; }
  .card { padding: 18px; }
  .section { padding: 48px 0; }
  .footer { padding: 40px 0 32px; margin-top: 48px; }
}

/* Animations -------------------------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes flow { 0% { stroke-dashoffset: 60; } 100% { stroke-dashoffset: 0; } }
.fade-up { animation: fadeUp 500ms ease-out both; }
.fade-up.d1 { animation-delay: 80ms; }
.fade-up.d2 { animation-delay: 160ms; }
.fade-up.d3 { animation-delay: 240ms; }

/* Logo strip -------------------------------------------------------------- */
.logo-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 48px; opacity: 0.7;
}
.logo-strip .logo {
  font-family: "Inter", sans-serif; font-weight: 600;
  font-size: 16px; color: var(--text-3); letter-spacing: -0.02em;
}
.logo-strip .logo.serif { font-family: Georgia, serif; font-style: italic; }
.logo-strip .logo.mono { font-family: "JetBrains Mono", monospace; font-size: 13.5px; font-weight: 500; }

/* Feature tiles ----------------------------------------------------------- */
.feature-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}

/* Code -------------------------------------------------------------------- */
pre.code {
  background: var(--ink); color: #e7e5e1;
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px; line-height: 1.7;
  overflow-x: auto; white-space: pre;
}
@media (max-width: 680px) {
  pre.code { white-space: pre-wrap; word-break: break-word; }
}
pre.code .tk { color: #c7d2fe; }
pre.code .str { color: #86efac; }
pre.code .com { color: #a1a1aa; font-style: italic; }
pre.code .num { color: #fde68a; }

/* Tables ------------------------------------------------------------------ */
.tbl-scroll-wrap { position: relative; }
.tbl-scroll-wrap::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 24px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
  pointer-events: none; border-top-right-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg);
}
.tbl-scroll-hint {
  display: none; font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0 0 8px;
}
.tbl-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 680px) {
  .tbl-scroll-hint { display: block; }
}
table.tbl {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  min-width: 520px;
}
@media (max-width: 480px) {
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 10px 12px; }
}
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; }
table.tbl th {
  font-size: 11px; font-weight: 500; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
table.tbl tbody tr { border-bottom: 1px solid var(--border); }
table.tbl tbody tr:last-child { border-bottom: none; }
