/* ── Reset ─────────────────────────────────────────────── */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Accessibility ─────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: #000;
  color: #fff;
  font-size: 0.875rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ── Reduced motion ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ── Print ─────────────────────────────────────────────── */

@media print {
  body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .skip-link,
  .site-header,
  .thread-canvas-wrap {
    display: none !important;
  }

  .fade-in-section {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── Design Tokens ─────────────────────────────────────── */

:root {
  /* Backgrounds — blue-black undertone */
  --color-bg-primary: #0c0c12;
  --color-bg-secondary: #141420;
  --color-bg-elevated: #1a1a2e;

  /* Text — opacity-based hierarchy */
  --color-text-primary: rgba(255, 255, 255, 0.92);
  --color-text-secondary: rgba(255, 255, 255, 0.64);
  --color-text-muted: rgba(255, 255, 255, 0.36);

  /* Accent — teal, used sparingly (CTAs only) */
  --color-accent: #4ecdc4;
  --color-accent-hover: #3dbdb4;

  /* Borders — thin, low-opacity */
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.16);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Type scale */
  --text-hero: clamp(3rem, 2.39rem + 2.61vw, 4.0625rem);
  --text-h2: 2.25rem;
  --text-h3: 1.375rem;
  --text-body-lg: 1.125rem;
  --text-body: 1rem;
  --text-sm: 0.875rem;
  --text-label: 0.75rem;

  /* Line heights */
  --leading-heading: 1.15;
  --leading-body: 1.5;
  --leading-prose: 1.65;

  /* Letter spacing */
  --tracking-heading: -0.02em;

  /* Font weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Spacing — 8px grid */
  --space-1: 0.5rem;   /* 8px */
  --space-2: 1rem;     /* 16px */
  --space-3: 1.5rem;   /* 24px */
  --space-4: 2rem;     /* 32px */
  --space-5: 2.5rem;   /* 40px */
  --space-6: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */
  --space-10: 5rem;    /* 80px */

  /* Layout */
  --container-max: 72rem;       /* 1152px */
  --container-narrow: 45rem;    /* 720px */
  --container-padding: 2rem;    /* 32px */

  /* Border radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */

  /* Motion durations */
  --duration-fast: 100ms;
  --duration-normal: 200ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  /* Easing */
  --ease-default: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Shadows */
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(78, 205, 196, 0.12);

  /* Nav effects (for future sticky nav) */
  --nav-blur: blur(16px) saturate(180%);
  --nav-bg: rgba(12, 12, 18, 0.8);
}

/* ── Base Styles ───────────────────────────────────────── */

html {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-light);
  line-height: var(--leading-body);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
}

/* ── Typography ────────────────────────────────────────── */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--text-hero);
}

h2 {
  font-size: var(--text-h2);
}

@media (max-width: 767px) {
  h2 {
    font-size: 1.75rem;
  }
}

h3 {
  font-size: var(--text-h3);
}

p {
  margin: 0;
  line-height: var(--leading-prose);
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ── Layout ────────────────────────────────────────────── */

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

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--space-10);
}

@media (max-width: 767px) {
  .section {
    padding-block: var(--space-5);
  }
}

/* ── Product Card Grid ─────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-secondary);
  transition: transform var(--duration-normal) var(--ease-default),
              border-color var(--duration-normal) var(--ease-default);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-hover);
}

/* ── Animations ────────────────────────────────────────── */

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Scroll-fade ───────────────────────────────────────── */

.fade-in-section {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity var(--duration-slower) var(--ease-default),
              transform var(--duration-slower) var(--ease-default);
}

.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Thread Rule ───────────────────────────────────────── */

.thread-rule {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0 0 var(--space-6);
}

.thread-rule--footer {
  margin-bottom: var(--space-5);
}

/* ── Section Label ─────────────────────────────────────── */

.section-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

/* ── Navigation ────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav {
  background: var(--nav-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom: 1px solid var(--color-border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  gap: var(--space-4);
}

.nav__wordmark {
  text-decoration: none;
  font-size: 2rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-primary);
}

.nav__wordmark:visited {
  color: var(--color-text-primary);
}

.nav__symbol {
  display: block;
  flex-shrink: 0;
}

.wordmark__sen {
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
}

.wordmark__labs {
  font-weight: var(--weight-light);
  color: var(--color-text-secondary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav__links::-webkit-scrollbar {
  display: none;
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-default);
}

.nav__link:hover,
.nav__link[aria-current] {
  color: var(--color-text-primary);
}

/* ── Hero ──────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 40svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding-block: var(--space-12) var(--space-10);
}

.hero__canvas-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__canvas {
  width: 100%;
  height: 100%;
  opacity: 0.2;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 44rem;
  animation: fade-in-up var(--duration-slower) var(--ease-default) both;
}

.hero__logo {
  display: block;
  width: 72px;
  height: 72px;
}

.hero__kicker {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.hero__headline {
  font-size: var(--text-hero);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-text-primary);
}

.hero__subline {
  font-size: var(--text-body-lg);
  font-weight: var(--weight-light);
  color: var(--color-text-secondary);
  line-height: var(--leading-body);
}

.hero__anchors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
}

.hero__anchor {
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.125rem;
  transition: color var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default);
}

.hero__anchor:hover {
  color: var(--color-text-secondary);
  border-color: var(--color-border-hover);
}

/* ── About ─────────────────────────────────────────────── */

.about__body {
  font-size: var(--text-body-lg);
  font-weight: var(--weight-light);
  color: var(--color-text-secondary);
  line-height: var(--leading-prose);
  margin-bottom: var(--space-6);
}



/* ── Products ──────────────────────────────────────────── */

.products .section-label {
  margin-bottom: var(--space-6);
}

.product-card {
  position: relative;
}

.product-card .card {
  height: 100%;
}

.product-card__link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-5);
  text-decoration: none;
  height: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-secondary);
  transition: border-color var(--duration-normal) var(--ease-default),
              box-shadow var(--duration-normal) var(--ease-default),
              transform var(--duration-normal) var(--ease-default);
}

.product-card__link:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.product-card__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.product-card__body {
  flex: 1;
}

.product-card__name {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.product-card__description {
  font-size: var(--text-sm);
  font-weight: var(--weight-light);
  color: var(--color-text-secondary);
  line-height: var(--leading-prose);
  margin-bottom: var(--space-4);
}

.product-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.product-card__url {
  align-self: flex-end;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-default);
}

.product-card__link:hover .product-card__url {
  color: var(--color-accent);
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--color-text-muted);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.1875rem 0.5rem;
  white-space: nowrap;
}

/* ── Consulting ────────────────────────────────────────── */

.consulting__body {
  font-size: var(--text-body-lg);
  font-weight: var(--weight-light);
  color: var(--color-text-secondary);
  line-height: var(--leading-prose);
  margin-bottom: var(--space-6);
}

.consulting__cta {
  margin: 0;
}

.cta-link {
  display: inline-block;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: var(--weight-medium);
  font-size: var(--text-body-lg);
  border-bottom: 1px solid transparent;
  transition: color var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default);
  padding-bottom: 0.125rem;
}

.cta-link:hover {
  color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

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

/* ── Founder ───────────────────────────────────────────── */

.founder__bio {
  font-size: var(--text-body-lg);
  font-weight: var(--weight-light);
  color: var(--color-text-secondary);
  line-height: var(--leading-prose);
  margin-bottom: var(--space-5);
}

.founder__links {
  font-style: normal;
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.founder__link {
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.125rem;
  transition: color var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default);
}

.founder__link:hover {
  color: var(--color-text-secondary);
  border-color: var(--color-border-hover);
}

/* ── Footer ────────────────────────────────────────────── */

.site-footer {
  padding-block: var(--space-8);
  border-top: none;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.footer__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer__copy,
.footer__location {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: var(--weight-light);
}

.footer__links {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

.footer__link:hover {
  color: var(--color-text-secondary);
}

.footer__tagline {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--color-text-muted);
  opacity: 0.6;
  margin: 0;
}

/* ── Mobile adjustments ────────────────────────────────── */

@media (max-width: 767px) {
  .footer__inner {
    flex-direction: column;
    gap: var(--space-4);
  }

  .nav__links {
    gap: var(--space-3);
  }

  .hero__content {
    gap: var(--space-4);
  }
}
