/* ============================================================
   Biomorph Systems — style.css
   Global reset, design tokens, typography, layout utilities
   ============================================================ */

/* ------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   ------------------------------------------------------------ */
:root {
  /* Brand colours */
  --color-purple:      #581C87;
  --color-purple-dark: #3B0764;
  --color-purple-mid:  #7C3AED;
  --color-cyan:        #22D3EE;
  --color-cyan-dark:   #06B6D4;
  --color-white:       #FFFFFF;
  --color-black:       #000000;
  --color-gray-light:  #F3F4F6;
  --color-gray-mid:    #E5E7EB;
  --color-gray-text:   #6B7280;
  --color-dark-surface:#0A0A0A;

  /* Typography */
  --font-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  --font-size-xs:   0.75rem;   /* 12px */
  --font-size-sm:   0.875rem;  /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg:   1.125rem;  /* 18px */
  --font-size-xl:   1.25rem;   /* 20px */
  --font-size-2xl:  1.5rem;    /* 24px */
  --font-size-3xl:  1.875rem;  /* 30px */
  --font-size-4xl:  2.25rem;   /* 36px */
  --font-size-5xl:  3rem;      /* 48px */
  --font-size-6xl:  3.75rem;   /* 60px */

  --font-weight-normal:  400;
  --font-weight-medium:  500;
  --font-weight-semibold:600;
  --font-weight-bold:    700;

  --line-height-tight:  1.2;
  --line-height-snug:   1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed:1.625;

  /* Spacing scale (multiples of 4px) */
  --space-1:  0.25rem;   /* 4px */
  --space-2:  0.5rem;    /* 8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */

  /* Layout */
  --max-width:       1200px;
  --max-width-prose: 680px;
  --nav-height:      72px;

  /* Borders & radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full:9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;
}

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

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

body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-black);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

/* ------------------------------------------------------------
   Layout Utilities
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--space-8);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--space-12);
  }
}

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

/* Section padding */
.section {
  padding-block: var(--space-16);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-24);
  }
}

/* Theme variants */
.section--dark {
  background-color: var(--color-black);
  color: var(--color-white);
}

.section--light {
  background-color: var(--color-white);
  color: var(--color-black);
}

.section--gray {
  background-color: var(--color-gray-light);
  color: var(--color-black);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-8);
}

.grid--2 {
  grid-template-columns: 1fr;
}

.grid--3 {
  grid-template-columns: 1fr;
}

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

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

/* Flex utilities */
.flex { display: flex; }
.flex--center { align-items: center; justify-content: center; }
.flex--between { align-items: center; justify-content: space-between; }
.flex--col { flex-direction: column; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ------------------------------------------------------------
   Typography helpers
   ------------------------------------------------------------ */
.heading-xl {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.heading-lg {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.heading-md {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
}

.heading-sm {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
}

@media (min-width: 768px) {
  .heading-xl {
    font-size: var(--font-size-5xl);
  }
  .heading-lg {
    font-size: var(--font-size-4xl);
  }
}

@media (min-width: 1024px) {
  .heading-xl {
    font-size: var(--font-size-6xl);
  }
}

.body-lg {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
}

.body-base {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
}

.body-sm {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.text-muted       { color: var(--color-gray-text); }
.text-muted--dark { color: rgba(255,255,255,0.65); }

/* Accent colours */
.accent-cyan   { color: var(--color-cyan); }
.accent-purple { color: var(--color-purple); }

/* ------------------------------------------------------------
   Animations
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .fade-in-up {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeInUp 0.6s ease forwards;
  }

  .fade-in-up--delay-1 { animation-delay: 150ms; }
  .fade-in-up--delay-2 { animation-delay: 300ms; }
  .fade-in-up--delay-3 { animation-delay: 450ms; }

  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in-up {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* Scroll-triggered reveal — disabled, content always visible */
.reveal {
  opacity: 1;
  transform: none;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js-loaded .reveal {
  opacity: 1;
  transform: none;
}

.js-loaded .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.no-js .reveal {
  opacity: 1;
  transform: none;
}
