/* BuildLoft: design tokens + dark theme (default) + layout. Vanilla CSS, no build step. */

:root {
  --bg: #0b0d12;
  --bg-raised: #12151d;
  --bg-card: #161a24;
  --border: #262c3a;
  --text: #e8eaf0;
  --text-muted: #a3a9b8;
  --accent: #b6ff3b;
  --accent-ink: #0b0d12;
  --link: #7cd4ff;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;

  --radius: 0.75rem;
  --container: 68rem;
  --nav-h: 4rem;

  color-scheme: dark;
}

/* ---------- Reset ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ---------- Utilities ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

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

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -3rem;
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  font-weight: 700;
}

.skip-link:focus {
  top: var(--space-2);
}

section[id] {
  scroll-margin-top: var(--nav-h);
}

/* ---------- Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 18, 0.92);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-h);
  gap: var(--space-2);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.nav-menu {
  display: none;
  flex-basis: 100%;
  flex-direction: column;
  gap: var(--space-1);
  padding-bottom: var(--space-3);
}

.nav-menu.is-open {
  display: flex;
}

.nav-menu a {
  display: block;
  padding: var(--space-2) 0;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.nav-menu a:hover {
  color: var(--accent);
}

/* Without JS the toggle cannot work, so keep the menu visible. */
.no-js .nav-menu {
  display: flex;
}

@media (min-width: 48rem) {
  .nav {
    flex-wrap: nowrap;
  }

  .nav-toggle {
    display: none;
  }

  .nav-menu,
  .nav-menu.is-open {
    display: flex;
    flex-basis: auto;
    flex-direction: row;
    gap: var(--space-4);
    padding-bottom: 0;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: var(--space-6);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(182, 255, 59, 0.12), transparent 60%),
    radial-gradient(ellipse at 90% 30%, rgba(124, 212, 255, 0.1), transparent 55%);
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: var(--space-3);
}

.hero h1 {
  font-size: clamp(2.75rem, 12vw, 6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.tagline {
  margin-top: var(--space-4);
  max-width: 40rem;
  font-size: clamp(1.1rem, 3.5vw, 1.4rem);
  color: var(--text-muted);
}

.hero-sub {
  margin-top: var(--space-3);
  max-width: 40rem;
  color: var(--text-muted);
}

.hero-sub code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
  overflow-wrap: anywhere;
}

/* Skip-link / in-page targets get programmatic focus (tabindex=-1); no ring on whole sections. */
[tabindex="-1"]:focus {
  outline: none;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

/* ---------- Sections ---------- */

.about,
.showcase {
  padding-block: var(--space-6);
  border-top: 1px solid var(--border);
}

h2 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.about p {
  max-width: 44rem;
  color: var(--text-muted);
}

.about p + p {
  margin-top: var(--space-3);
}

.section-lede {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

/* ---------- Showcase ---------- */

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-4);
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-open {
  border-style: dashed;
}

.card-title {
  font-size: 1.25rem;
}

.card-desc {
  color: var(--text-muted);
  flex-grow: 1;
}

.card-link {
  font-weight: 600;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: var(--space-5);
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-inner {
  display: grid;
  gap: var(--space-3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
