/* ============================================================================
   Xtrable — Linear-inspired dark theme
   Near-black canvas, hairline borders, crisp Inter type, soft radial glow,
   and a vivid azure accent modernised from the brand blue (#107ac2 -> #2f8bff).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ----- Design tokens ----------------------------------------------------- */
:root {
  /* surfaces */
  --bg: #08090a;
  --bg-1: #0c0d0f;
  --bg-2: #111316;
  --bg-3: #16181c;
  --surface: rgba(255, 255, 255, 0.02);
  --surface-hover: rgba(255, 255, 255, 0.04);

  /* borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* text */
  --text: #f7f8f8;
  --text-2: #c4c9d4;
  --text-3: #9298a3;
  --text-muted: #6c727d;

  /* accent — modernised xtrable azure */
  --accent: #2f8bff;
  --accent-bright: #5fa8ff;
  --accent-deep: #1366d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 139, 255, 0.14);
  --accent-line: rgba(47, 139, 255, 0.35);

  /* glow */
  --glow-a: rgba(47, 139, 255, 0.30);
  --glow-b: rgba(19, 102, 214, 0.18);

  /* type */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;

  /* metrics */
  --max: 1100px;
  --max-wide: 1280px;
  --max-prose: 720px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --header-h: 64px;

  color-scheme: dark;
}

/* ----- Reset ------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--text);
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--text);
}

p {
  margin: 0 0 1rem;
  color: var(--text-2);
}

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

/* ----- Layout helpers ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 24px;
}
.container--wide { max-width: var(--max-wide); }
.container--prose { max-width: var(--max-prose); }

.section {
  padding-block: clamp(56px, 9vw, 120px);
}
.section--tight { padding-block: clamp(40px, 6vw, 72px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-3);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 1px var(--accent);
}

.section-head {
  max-width: 760px;
  margin-bottom: 48px;
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-title {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
}
.section-sub {
  font-size: 1.075rem;
  color: var(--text-3);
  margin-top: 14px;
}

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 24px -10px var(--accent);
}
.btn--primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: var(--accent-ink);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--surface-hover);
  border-color: var(--text-3);
  color: var(--text);
}

.btn--small { padding: 8px 14px; font-size: 0.875rem; }

/* ----- Top navigation (component: site-header) --------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(8, 9, 10, 0.72);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  width: 100%;
  max-width: var(--max-wide);
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-deep));
  box-shadow: 0 0 16px -2px var(--accent);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.site-nav a {
  color: var(--text-3);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}
.site-nav a:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.site-header__spacer { flex: 1; }
.site-header__actions { display: flex; align-items: center; gap: 10px; }

/* ----- Hero (component: hero) -------------------------------------------- */
.hero {
  position: relative;
  text-align: center;
  padding-block: clamp(72px, 12vw, 152px);
  overflow: hidden;
}
.hero__glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 720px;
  pointer-events: none;
  background:
    radial-gradient(60% 60% at 50% 0%, var(--glow-a) 0%, transparent 70%),
    radial-gradient(40% 50% at 70% 10%, var(--glow-b) 0%, transparent 70%);
  filter: blur(8px);
  z-index: 0;
}
.hero__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 60%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 60%);
  opacity: 0.5;
}
.hero > .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0 auto 22px;
  max-width: 16ch;
}
.hero__lead {
  font-size: clamp(1.075rem, 1.9vw, 1.3rem);
  color: var(--text-3);
  max-width: 60ch;
  margin: 0 auto 34px;
}
.hero__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.text-gradient {
  background: linear-gradient(180deg, #ffffff 30%, #a9c8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----- Feature grid / cards ----------------------------------------------
   Grids wrap as centered flex so an odd card (e.g. the 3rd of three at a
   2-up width) stays centered and the layout never goes lopsided.
   ------------------------------------------------------------------------- */
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}
.grid > * {
  flex: 1 1 280px;
}
/* 2-up: wider cards, two per row on desktop, one on mobile */
.grid--2 > * {
  flex-basis: 440px;
  max-width: 560px;
}
/* 3-up: three per row on desktop; centred orphan when wrapped */
.grid--3 > * {
  flex-basis: 300px;
  max-width: 372px;
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.card__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-bright);
  margin-bottom: 16px;
}
.card__icon svg { width: 20px; height: 20px; }
.card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}
.card p {
  font-size: 0.95rem;
  color: var(--text-3);
  margin: 0;
}

/* ----- CTA band (component: cta) ----------------------------------------- */
.cta {
  position: relative;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(47, 139, 255, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  padding: clamp(40px, 6vw, 72px) 24px;
  overflow: hidden;
}
.cta h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  max-width: 22ch;
  margin-inline: auto;
}
.cta p {
  color: var(--text-3);
  max-width: 52ch;
  margin: 14px auto 28px;
}
.cta__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ----- Prose (richtext page bodies) -------------------------------------- */
.prose {
  color: var(--text-2);
  font-size: 1.05rem;
}
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font-size: 1.6rem;
  margin: 2.2rem 0 0.8rem;
}
.prose h3 {
  font-size: 1.25rem;
  margin: 1.8rem 0 0.6rem;
}
.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.3rem; color: var(--text-2); }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }
.prose blockquote {
  margin: 1.6rem 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-size: 1.2rem;
  font-style: normal;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}
.prose pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow-x: auto;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
  font-size: 0.95rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th { color: var(--text); font-weight: 600; }
.prose img { border-radius: var(--radius); margin: 1.4rem 0; }

/* Page header for inner pages */
.page-head {
  padding-block: clamp(48px, 8vw, 88px) clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-head h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  letter-spacing: -0.03em;
}
.page-head__summary {
  font-size: 1.15rem;
  color: var(--text-3);
  max-width: 60ch;
  margin-top: 12px;
}

/* ----- Footer (component: site-footer) ----------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  padding-block: 56px 40px;
  margin-top: 40px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}
.site-footer__brand .brand { margin-bottom: 14px; }
.site-footer__tag { color: var(--text-muted); font-size: 0.9rem; max-width: 34ch; }
.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-3); font-size: 0.925rem; }
.footer-col a:hover { color: var(--text); }
.site-footer__bottom {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ----- Responsive -------------------------------------------------------- */
@media (max-width: 860px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .site-nav { display: none; }
}
@media (max-width: 560px) {
  .site-footer__grid { grid-template-columns: 1fr; }
  .container { padding-inline: 18px; }
}

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