/* Shared styles for service and case-study pages (homepage keeps its own inline CSS) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-latin.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url(../fonts/jetbrains-mono-latin.woff2) format('woff2'); }

:root {
  --bg: #0a0e1a; --bg-alt: #0f1424; --surface: #141a2e; --surface-2: #1b2340; --border: #26304f;
  --text: #e6e9f2; --text-muted: #9aa3bd; --accent: #7c83ff; --accent-2: #22d3ee;
  --gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35); --radius: 14px; --maxw: 1120px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
:root[data-theme="light"] {
  --bg: #f7f8fc; --bg-alt: #eef1f8; --surface: #ffffff; --surface-2: #f1f3fa; --border: #dde2ef;
  --text: #141a2e; --text-muted: #525b75; --accent: #4f46e5; --accent-2: #0891b2;
  --shadow: 0 10px 30px rgba(20, 26, 46, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }
.grad { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: var(--mono); font-weight: 500; font-size: 1.05rem; }
.logo span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-muted); font-size: .92rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .nav-links { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .nav-links.open { max-height: 420px; }
  .nav-links li a { display: block; padding: 14px 16px; border-top: 1px solid var(--border); }
}

/* Buttons, chips, cards */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; cursor: pointer; font-family: inherit; transition: transform .2s, border-color .2s; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn:hover { transform: translateY(-2px); }
.btn-ghost:hover { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li { font-family: var(--mono); font-size: .74rem; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
a.card { display: block; transition: transform .25s, border-color .25s, box-shadow .25s; }
a.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: var(--shadow); }

/* Page hero */
.page-hero { position: relative; padding: 56px 0 48px; overflow: hidden; border-bottom: 1px solid var(--border); }
.page-hero::before { content: ""; position: absolute; z-index: -1; width: 640px; height: 640px; top: -320px; right: -200px; border-radius: 50%; background: radial-gradient(closest-side, var(--accent), transparent); opacity: .35; pointer-events: none; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 22px; padding: 0; font-size: .85rem; color: var(--text-muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a:hover { color: var(--text); }
.eyebrow { font-family: var(--mono); font-size: .85rem; color: var(--accent-2); letter-spacing: .05em; }
.page-hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.12; letter-spacing: -0.025em; margin: 10px 0 16px; max-width: 22ch; }
.page-hero .lead { font-size: clamp(1.02rem, 1.7vw, 1.15rem); color: var(--text-muted); max-width: 64ch; margin: 0 0 28px; }
.page-hero .lead strong { color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 36px; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.fact b { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
.fact span { font-weight: 600; font-size: .95rem; }

/* Body sections */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; margin: 6px 0 20px; }
.prose { max-width: 75ch; color: var(--text-muted); font-size: 1.04rem; }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--text); }
.prose ul { padding-left: 20px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
@media (max-width: 440px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.card p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.card .tag { font-family: var(--mono); font-size: .72rem; color: var(--accent-2); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 6px; }
.card .more { display: inline-block; margin-top: 12px; color: var(--accent-2); font-weight: 600; font-size: .9rem; }
.card .chips { margin-top: 14px; }

/* Process steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: "0" counter(step); font-family: var(--mono); color: var(--accent-2); font-size: .85rem; display: block; margin-bottom: 6px; }
.steps h3 { margin: 0 0 6px; font-size: 1.02rem; }
.steps p { margin: 0; color: var(--text-muted); font-size: .93rem; }

/* FAQ */
.faq { max-width: 80ch; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-2); font-family: var(--mono); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--text-muted); }

/* Case study results */
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 8px 0 0; }
.result { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent-2); border-radius: 12px; padding: 16px 18px; color: var(--text-muted); font-size: .95rem; }
.result strong { display: block; color: var(--text); font-size: 1.02rem; margin-bottom: 4px; }

/* Inline code */
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--text); }

/* Product page: screenshots, install steps, sources table */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.shots figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.shots img { display: block; width: 100%; height: auto; background: #fff; }
.shots figcaption { padding: 12px 16px; color: var(--text-muted); font-size: .9rem; }
@media (max-width: 440px) { .shots { grid-template-columns: 1fr; } }
.install { counter-reset: inst; list-style: none; padding: 0; margin: 24px 0 0; max-width: 80ch; }
.install li { counter-increment: inst; position: relative; padding: 0 0 26px 56px; }
.install li::before { content: counter(inst); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--gradient); color: #fff; font-weight: 700; }
.install li::after { content: ""; position: absolute; left: 17px; top: 42px; bottom: 6px; width: 2px; background: var(--border); }
.install li:last-child::after { display: none; }
.install h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.install p { margin: 0; color: var(--text-muted); }
.note { max-width: 80ch; margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent-2); border-radius: 12px; padding: 16px 18px; color: var(--text-muted); font-size: .95rem; }
.note strong { color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.src-table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
.src-table th, .src-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.src-table th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.src-table td { color: var(--text-muted); }
.src-table td:first-child { color: var(--text); font-weight: 600; }
.src-table tr:last-child td { border-bottom: 0; }

/* CTA band */
.cta-band { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 36px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gradient); }
.cta-band h2 { margin: 0 0 6px; font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.cta-band p { margin: 0; color: var(--text-muted); max-width: 60ch; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 36px 0 28px; color: var(--text-muted); font-size: .9rem; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; margin-bottom: 28px; }
.foot-grid h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin: 0 0 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 6px; }
.foot-grid a:hover { color: var(--text); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 20px; }
.partner a { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 10px; background: #0a0e1a; border: 1px solid var(--border); }
.partner img { height: 32px; width: auto; display: block; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Product Hunt button */
.ph-btn svg { width: 20px; height: 20px; }
.ph-btn:hover { border-color: #ff6154; }
