/* ============================================================
   BLACK FOSSILS — Design System
   style.css | v1.0
   ============================================================ */

/* ── 1. CSS Custom Properties (Design Tokens) ─────────────── */
:root {
  /* Colors */
  --clr-bg:         #0a0a0a;
  --clr-bg-2:       #111111;
  --clr-bg-3:       #1a1a1a;
  --clr-border:     #2a2a2a;
  --clr-text:       #f0f0f0;
  --clr-text-muted: #888888;
  --clr-accent:     #ffffff;
  --clr-accent-dim: #cccccc;

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

  --fs-xs:   0.75rem;   /* 12px */
  --fs-sm:   0.875rem;  /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-md:   1.125rem;  /* 18px */
  --fs-lg:   1.25rem;   /* 20px */
  --fs-xl:   1.5rem;    /* 24px */
  --fs-2xl:  2rem;      /* 32px */
  --fs-3xl:  2.5rem;    /* 40px */
  --fs-4xl:  3.5rem;    /* 56px */
  --fs-5xl:  4.5rem;    /* 72px */

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;

  --lh-tight:  1.2;
  --lh-snug:   1.4;
  --lh-normal: 1.6;
  --lh-loose:  1.8;

  /* Spacing */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --sp-32: 8rem;

  /* Layout */
  --container-max: 1100px;
  --container-pad: var(--sp-6);

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --border: 1px solid var(--clr-border);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.7);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;

  /* Z-index layers */
  --z-nav:     100;
  --z-overlay: 200;
  --z-modal:   300;
}

/* ── 2. CSS 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-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  appearance: none;
}

button {
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

/* ── 3. Typography Utilities ──────────────────────────────── */
.text-xs     { font-size: var(--fs-xs); }
.text-sm     { font-size: var(--fs-sm); }
.text-base   { font-size: var(--fs-base); }
.text-md     { font-size: var(--fs-md); }
.text-lg     { font-size: var(--fs-lg); }
.text-xl     { font-size: var(--fs-xl); }
.text-2xl    { font-size: var(--fs-2xl); }
.text-3xl    { font-size: var(--fs-3xl); }
.text-4xl    { font-size: var(--fs-4xl); }

.text-muted  { color: var(--clr-text-muted); }
.text-accent { color: var(--clr-accent); }
.text-center { text-align: center; }
.text-upper  { text-transform: uppercase; letter-spacing: 0.12em; }
.font-mono   { font-family: var(--font-mono); }
.font-medium { font-weight: var(--fw-medium); }
.font-bold   { font-weight: var(--fw-bold); }

/* ── 4. Layout ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--sp-24);
}

.section--lg {
  padding-block: var(--sp-32);
}

.section-label {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-4);
}

.section-title {
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-3xl));
  font-weight: var(--fw-bold);
  margin-bottom: var(--sp-4);
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--clr-text-muted);
  max-width: 560px;
  line-height: var(--lh-loose);
}

/* Grid helpers */
.grid { display: grid; }
.flex { display: flex; }

/* ── 5. Header / Navigation ───────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: 64px;
  display: flex;
  align-items: center;
  background-color: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--border);
  transition: border-color var(--dur-base) var(--ease),
              background-color var(--dur-base) var(--ease);
}

.site-header.scrolled {
  background-color: rgba(10, 10, 10, 0.98);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: var(--fw-bold);
  font-size: var(--fs-lg);
  letter-spacing: -0.03em;
  color: var(--clr-accent);
  flex-shrink: 0;
}

.nav__logo-icon {
  width: 28px;
  height: 28px;
  border: 2px solid var(--clr-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.nav__link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text-muted);
  transition: color var(--dur-fast) var(--ease);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--clr-accent);
  transition: width var(--dur-base) var(--ease);
}

.nav__link:hover,
.nav__link.active {
  color: var(--clr-accent);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.nav__cta {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  padding: var(--sp-2) var(--sp-5);
  border: var(--border);
  border-color: var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  transition: border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}

.nav__cta:hover {
  border-color: var(--clr-accent);
  color: var(--clr-bg);
  background: var(--clr-accent);
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  padding: var(--sp-1);
}

.nav__hamburger span {
  display: block;
  height: 1.5px;
  background: var(--clr-text);
  border-radius: var(--radius-full);
  transition: transform var(--dur-base) var(--ease),
              opacity var(--dur-base) var(--ease),
              width var(--dur-base) var(--ease);
  width: 100%;
}

.nav__hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav__hamburger.open span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav__hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile Menu */
.nav__mobile {
  position: fixed;
  inset: 64px 0 0 0;
  background: var(--clr-bg);
  z-index: calc(var(--z-nav) - 1);
  padding: var(--sp-8) var(--container-pad);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  border-top: var(--border);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease);
}

.nav__mobile.open {
  transform: translateX(0);
}

.nav__mobile-link {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-muted);
  transition: color var(--dur-fast) var(--ease);
  padding-block: var(--sp-2);
  border-bottom: var(--border);
}

.nav__mobile-link:hover,
.nav__mobile-link.active {
  color: var(--clr-accent);
}

/* ── 6. Footer ────────────────────────────────────────────── */
.site-footer {
  border-top: var(--border);
  padding-block: var(--sp-12);
  margin-top: var(--sp-16);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
}

.footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.footer__brand p {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  max-width: 280px;
  margin-top: var(--sp-3);
  line-height: var(--lh-loose);
}

.footer__links-group h4 {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-4);
}

.footer__links-group ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer__links-group a {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  transition: color var(--dur-fast) var(--ease);
}

.footer__links-group a:hover {
  color: var(--clr-accent);
}

.footer__bottom {
  padding-top: var(--sp-6);
  border-top: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.footer__copy {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
}

.footer__legal {
  display: flex;
  gap: var(--sp-6);
}

.footer__legal a {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  transition: color var(--dur-fast) var(--ease);
}

.footer__legal a:hover {
  color: var(--clr-accent);
}

/* ── 7. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--clr-accent);
  color: var(--clr-bg);
  border-color: var(--clr-accent);
}

.btn--primary:hover {
  background: var(--clr-accent-dim);
  border-color: var(--clr-accent-dim);
}

.btn--outline {
  background: transparent;
  color: var(--clr-text);
  border-color: var(--clr-border);
}

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

.btn--ghost {
  background: transparent;
  color: var(--clr-text-muted);
  border-color: transparent;
}

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

.btn--lg {
  font-size: var(--fs-base);
  padding: var(--sp-4) var(--sp-8);
}

.btn--sm {
  font-size: var(--fs-xs);
  padding: var(--sp-2) var(--sp-4);
}

/* ── 8. Cards ─────────────────────────────────────────────── */
.card {
  background: var(--clr-bg-2);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  transition: border-color var(--dur-base) var(--ease),
              background var(--dur-base) var(--ease),
              transform var(--dur-base) var(--ease);
}

.card:hover {
  border-color: #444;
  background: var(--clr-bg-3);
  transform: translateY(-2px);
}

.card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-5);
  font-size: var(--fs-lg);
}

.card__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-3);
}

.card__body {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  line-height: var(--lh-loose);
}

/* ── 9. Tags / Badges ─────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  padding: var(--sp-1) var(--sp-3);
  border: var(--border);
  border-radius: var(--radius-full);
  color: var(--clr-text-muted);
  letter-spacing: 0.04em;
}

/* ── 10. Divider / Separator ──────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--clr-border);
  margin-block: var(--sp-8);
}

/* ── 11. Form Elements ────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text-muted);
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--clr-bg-2);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--clr-text);
  transition: border-color var(--dur-fast) var(--ease);
  resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #555;
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--clr-text-muted);
  opacity: 0.6;
}

.form-textarea {
  min-height: 120px;
}

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

.mt-auto { margin-top: auto; }
.mb-4    { margin-bottom: var(--sp-4); }
.mb-6    { margin-bottom: var(--sp-6); }
.mb-8    { margin-bottom: var(--sp-8); }
.mb-12   { margin-bottom: var(--sp-12); }
.gap-2   { gap: var(--sp-2); }
.gap-4   { gap: var(--sp-4); }
.gap-6   { gap: var(--sp-6); }
.gap-8   { gap: var(--sp-8); }

/* ── 13. Animations ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fade-up {
  animation: fadeUp var(--dur-slow) var(--ease) both;
}

.animate-fade-in {
  animation: fadeIn var(--dur-slow) var(--ease) both;
}

.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }

/* Intersection Observer-based reveals */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 14. Responsive Breakpoints ───────────────────────────── */
@media (max-width: 768px) {
  :root {
    --container-pad: var(--sp-5);
  }

  .nav__links,
  .nav__cta {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .section {
    padding-block: var(--sp-16);
  }

  .section--lg {
    padding-block: var(--sp-20);
  }

  .footer__top {
    flex-direction: column;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 769px) {
  .nav__mobile {
    display: none !important;
  }
}

@media (max-width: 480px) {
  :root {
    --container-pad: var(--sp-4);
  }
}

/* ── 15. Focus Visible (Accessibility) ────────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
}
