/* ==========================================================================
   Base, layout primitives & shared components
   ========================================================================== */

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Overflow guard that does not break position: sticky */
@supports (overflow: clip) {
  body { overflow-x: clip; }
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

a { color: var(--accent); text-decoration: none; transition: color var(--dur); }
a:hover { color: var(--accent-hover); }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.skip-link:focus { top: 16px; color: var(--bg); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Ambient page wash (fixed, behind everything) */
.page-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -5%, rgba(60, 198, 210, .10), transparent 60%),
    radial-gradient(800px 500px at 95% 10%, rgba(74, 143, 224, .10), transparent 60%);
}

main, .site-footer { position: relative; z-index: 1; }

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-top: var(--section-space); }
.section--last { padding-bottom: var(--section-space); }

/* Section head: heading left, supporting copy right */
.section-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 24px 64px;
  align-items: end;
}
.section-head--center {
  display: block;
  max-width: 900px;
  margin-inline: auto;
  text-align: center;
}
.section-head--narrow { display: block; max-width: 820px; }

/* ---------- Typography ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.h2 {
  margin-top: 20px;
  font-size: var(--fs-h2);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 600;
  text-wrap: balance;
}
.h2--xl {
  font-size: var(--fs-h2-xl);
  line-height: .96;
  letter-spacing: -0.05em;
}

.h3 {
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.serif--grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: .06em;
}
.serif--accent { color: var(--accent); }

.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-3);
  max-width: 480px;
  text-wrap: pretty;
}
.section-head--center .lead { max-width: 680px; margin: 24px auto 0; }

.mono { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 14px 24px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color var(--dur), border-color var(--dur), color var(--dur), filter var(--dur), transform var(--dur);
}
.btn .arrow { transition: transform var(--dur) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

.btn--primary { background: var(--grad); color: var(--bg); }
.btn--primary:hover { color: var(--bg); filter: brightness(1.08); }

.btn--light { background: var(--text); color: var(--bg); }
.btn--light:hover { background: #fff; color: var(--bg); }

.btn--ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .02);
}
.btn--ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }

.btn--sm { min-height: 44px; padding: 11px 18px; font-size: 14px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Chips & tags ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.tag--mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .04em;
}
.tag--accent {
  color: var(--accent-ink);
  border-color: var(--accent-line);
  background: var(--accent-wash);
}

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.dot--sq { border-radius: 2px; }
.dot--sm { width: 6px; height: 6px; }

/* ---------- Cards ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}
.card--hover { transition: border-color var(--dur), background-color var(--dur); }
.card--hover:hover { border-color: rgba(60, 198, 210, .4); background: var(--surface-2); }

.card-bar {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--accent);
}

/* Window chrome used by product-UI panels */
.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.window-dots { display: flex; align-items: center; gap: 8px; min-width: 0; }
.window-dots > span:not(.window-path) {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.window-path {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-sample {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--text-4);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}

/* ---------- Reveal on scroll ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s var(--ease-out);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.8); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
