/* ============================================================
   CogniHuman — Global Styles
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
}

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

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

ul, ol { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.625rem); }
h4 { font-size: 1.125rem; font-family: var(--font-body); font-weight: 500; }
h5 { font-size: 0.9375rem; font-family: var(--font-body); font-weight: 500; }

p { max-width: var(--max-w-text); }

strong { font-weight: 500; }
em { font-style: italic; }

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

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

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

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

.section__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.section__heading {
  margin-bottom: var(--sp-6);
}

.section__lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 600px;
  margin-bottom: var(--sp-12);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(253, 250, 245, 0.88);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color var(--dur-mid) ease, background var(--dur-mid) ease;
}

.nav.scrolled {
  border-color: var(--border-mid);
  background: rgba(253, 250, 245, 0.96);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.nav__logo-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--ch-ink-800);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Logo placeholder — replace this div's content with actual logo */
.nav__logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav__logo-placeholder {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 4px;
  position: relative;
}

.nav__logo-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

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

.nav__link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color var(--dur-fast) ease;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent-warm);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-out);
}

.nav__link:hover { color: var(--text-primary); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link.active { color: var(--text-primary); }
.nav__link.active::after { transform: scaleX(1); background: var(--ch-ink-500); }

.nav__cta {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4375rem 1.125rem;
  background: var(--ch-ink-900);
  color: var(--ch-paper-100);
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.nav__cta:hover {
  background: var(--ch-ink-700);
  transform: translateY(-1px);
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--dur-mid) ease, opacity var(--dur-fast) ease;
}

/* --- Footer --- */
.footer {
  background: var(--ch-ink-900);
  color: var(--ch-paper-200);
  padding-block: var(--sp-16) var(--sp-12);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--sp-12);
  padding-bottom: var(--sp-12);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: var(--sp-8);
}

.footer__brand .nav__logo-mark {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.footer__brand .nav__logo-name { color: var(--ch-paper-100); }

.footer__tagline {
  font-size: 0.875rem;
  color: rgba(237,229,212,0.55);
  margin-top: var(--sp-4);
  font-weight: 300;
  max-width: 240px;
  line-height: 1.6;
}

.footer__col-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(237,229,212,0.4);
  margin-bottom: var(--sp-4);
}

.footer__col ul { display: flex; flex-direction: column; gap: var(--sp-2); }

.footer__col a {
  font-size: 0.875rem;
  color: rgba(237,229,212,0.65);
  transition: color var(--dur-fast) ease;
}
.footer__col a:hover { color: var(--ch-paper-100); }

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: rgba(237,229,212,0.35);
}

.footer__legal a {
  color: rgba(237,229,212,0.5);
  transition: color var(--dur-fast) ease;
}
.footer__legal a:hover { color: var(--ch-paper-200); }

.footer__status {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--dur-mid) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  padding: 0.6875rem 1.5rem;
  background: var(--ch-ink-900);
  color: var(--ch-paper-100);
}
.btn-primary:hover {
  background: var(--ch-ink-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  padding: 0.6875rem 1.5rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
}
.btn-secondary:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-ghost {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.btn-ghost:hover { color: var(--text-primary); }

.btn svg { width: 16px; height: 16px; }

/* --- Cards --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--dur-mid) ease, box-shadow var(--dur-mid) ease, transform var(--dur-mid) var(--ease-out);
}

.card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* --- Tag / Pill --- */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  border: 1px solid transparent;
}

.tag--ink {
  background: var(--ch-ink-100);
  color: var(--ch-ink-600);
  border-color: var(--ch-ink-200);
}

.tag--terra {
  background: var(--ch-terra-100);
  color: var(--ch-terra-600);
  border-color: var(--ch-terra-200);
}

.tag--muted {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin-block: var(--sp-12);
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 100ms; }
.reveal--delay-2 { transition-delay: 200ms; }
.reveal--delay-3 { transition-delay: 300ms; }
.reveal--delay-4 { transition-delay: 400ms; }

/* --- Responsive nav --- */
@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }

  .nav__mobile-menu {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: var(--bg-primary);
    padding: var(--sp-8) var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-6);
    transform: translateX(100%);
    transition: transform var(--dur-mid) var(--ease-out);
    z-index: 99;
    border-top: 1px solid var(--border-subtle);
  }

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

  .nav__mobile-menu .nav__link {
    font-size: 1.25rem;
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--text-primary);
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--sp-4);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}
