/* ══════════════════════════════════════════════════════
   Researchmatic — Design System
   Dark mode, gradient accents, glassmorphism nav
   ══════════════════════════════════════════════════════ */

:root {
  --bg: #0A0A0A;
  --surface: #141414;
  --surface-raised: #1A1A1A;
  --border: #2A2A2A;
  --text: #F0F0F0;
  --text-muted: #888888;
  --accent-teal: #00D4AA;
  --accent-blue: #0088FF;
  --gradient: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
}

/* ── UTILITY ── */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── NAVIGATION ── */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 1.1rem;
}

.nav-logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent-teal);
  opacity: 1;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
  border-radius: 1px;
}

/* ── HERO ── */

.hero {
  padding: 10rem 0 6rem;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--sans);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.15;
  font-weight: 600;
  max-width: 780px;
  margin-bottom: 2rem;
}

.hero-sub {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.btn-gradient {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--gradient);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.3s, transform 0.2s;
}

.btn-gradient:hover {
  box-shadow: 0 0 24px rgba(0, 212, 170, 0.3);
  transform: translateY(-1px);
  opacity: 1;
}

/* ── SECTION COMMON ── */

section {
  padding: 5rem 0;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--sans);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.2;
  font-weight: 600;
  margin-bottom: 1.5rem;
  max-width: 700px;
}

.section-intro {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 3rem;
}

/* ── SERVICES ── */

#services {
  border-bottom: 1px solid var(--border);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.service-card {
  background: var(--surface);
  padding: 2.5rem;
  transition: background 0.25s;
  position: relative;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.service-card:hover {
  background: var(--surface-raised);
}

.service-card:hover::before {
  opacity: 1;
}

.service-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent-teal);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.service-card h3 {
  font-family: var(--sans);
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.service-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.service-tags span {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-teal);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
}

/* ── RESEARCH ── */

#research {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

#research .section-title {
  color: var(--text);
}

.research-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.research-item {
  border-left: 2px solid;
  border-image: var(--gradient) 1;
  padding-left: 1.5rem;
}

.research-item h3 {
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.research-item p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ── PUBLICATIONS & IP ── */

#publications {
  border-bottom: 1px solid var(--border);
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat .num {
  font-family: var(--sans);
  font-size: 2.8rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat .label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

.pub-block {
  padding: 1.5rem 0;
}

.pub-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 0.5rem;
}

.pub-block h3 {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.pub-block p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.scholar-link {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--accent-teal);
  border-bottom: 1px solid var(--accent-teal);
  padding-bottom: 2px;
}

.scholar-link:hover {
  opacity: 0.7;
}

/* ── TRAINING ── */

#training {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.training-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.training-text p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.training-highlights {
  list-style: none;
  margin-bottom: 2rem;
}

.training-highlights li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 0.6rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.training-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-teal);
}

.btn-outline {
  display: inline-block;
  padding: 0.75rem 1.8rem;
  border: 1px solid var(--accent-teal);
  color: var(--accent-teal);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn-outline:hover {
  background: var(--accent-teal);
  color: var(--bg);
  opacity: 1;
}

/* ── CONTACT ── */

#contact {
  padding: 5rem 0 6rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-text p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.contact-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--accent-teal);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-teal);
  padding-bottom: 2px;
  transition: opacity 0.2s;
}

.contact-link:hover {
  opacity: 0.7;
}

.contact-details {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-details dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 0.3rem;
  margin-top: 1.5rem;
}

.contact-details dt:first-child {
  margin-top: 0;
}

.contact-details dd {
  margin-left: 0;
  line-height: 1.6;
}

.contact-details a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s;
}

.contact-details a:hover {
  border-color: var(--accent-teal);
  opacity: 1;
}

/* ── FOOTER ── */

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--accent-teal);
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

.footer-reg {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

/* ── COOKIE BANNER ── */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  display: none;
}

.cookie-banner.visible {
  display: block;
}

.cookie-banner .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-banner p {
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 200px;
}

.cookie-banner a {
  color: var(--accent-teal);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.cookie-btn-accept {
  padding: 0.5rem 1.2rem;
  background: var(--gradient);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.cookie-btn-accept:hover {
  box-shadow: 0 0 16px rgba(0, 212, 170, 0.3);
}

.cookie-btn-manage {
  padding: 0.5rem 1.2rem;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.cookie-btn-manage:hover {
  border-color: var(--accent-teal);
  color: var(--text);
}

.cookie-btn-reject {
  padding: 0.5rem 1.2rem;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.cookie-btn-reject:hover {
  color: var(--text);
}

.cookie-manage-panel {
  display: none;
  width: 100%;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.cookie-manage-panel.visible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-manage-panel p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cookie-btn-essential {
  padding: 0.5rem 1.2rem;
  background: transparent;
  color: var(--accent-teal);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--accent-teal);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cookie-btn-essential:hover {
  background: var(--accent-teal);
  color: var(--bg);
}

/* ── ANIMATIONS ── */

@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

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

/* ── RESPONSIVE ── */

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    gap: 1rem;
  }

  .hero {
    padding: 8rem 0 4rem;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }

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

  .research-items {
    grid-template-columns: 1fr;
  }

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

  .stats-bar {
    justify-content: center;
    gap: 2rem;
  }

  .stat-divider {
    display: none;
  }

  .training-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  footer .container {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .cookie-banner .container {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .cookie-buttons {
    justify-content: center;
  }
}

/* ── LEGAL PAGES ── */

.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.legal-content h1 {
  font-family: var(--sans);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.legal-content .last-updated {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.legal-content h2 {
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.legal-content p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.legal-content ul {
  margin: 0.75rem 0 1rem 1.5rem;
  color: var(--text-muted);
}

.legal-content li {
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 0.4rem;
}

.legal-content a {
  color: var(--accent-teal);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.legal-content a:hover {
  border-bottom-color: var(--accent-teal);
  opacity: 1;
}

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.legal-content th,
.legal-content td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.legal-content th {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-teal);
  font-weight: 500;
}
