/* ============================================
   CODHZ Design System — Shared Styles v2
   ============================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: #2B2D42;
  background: #EDF2F4;
  line-height: 1.7;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; line-height: 1.2; color: #2B2D42; }

.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8D99AE;
  margin-bottom: 0.8rem;
}

/* ---- NAV ---- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s ease;
  background: transparent;
}
nav.scrolled {
  background: rgba(237,242,244,0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(43,45,66,0.06);
}
nav.dark-nav { background: transparent; }
nav.dark-nav.scrolled {
  background: rgba(43,45,66,0.95);
  backdrop-filter: blur(16px);
}
.nav-logo-img { height: 28px; width: auto; }
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #EDF2F4;
  letter-spacing: -0.02em;
  transition: color 0.4s;
  display: flex;
  align-items: center;
}
nav.scrolled .nav-logo { color: #2B2D42; }
nav.dark-nav .nav-logo { color: #EDF2F4; }
nav.dark-nav.scrolled .nav-logo { color: #EDF2F4; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(237,242,244,0.6);
  transition: color 0.3s;
}
nav.scrolled .nav-links a { color: #8D99AE; }
nav.dark-nav .nav-links a { color: rgba(237,242,244,0.6); }
nav.dark-nav.scrolled .nav-links a { color: rgba(237,242,244,0.6); }
.nav-links a:hover { color: #EDF2F4; }
nav.scrolled .nav-links a:hover { color: #2B2D42; }
nav.dark-nav.scrolled .nav-links a:hover { color: #EDF2F4; }
.nav-cta {
  background: #D90429;
  color: #EDF2F4 !important;
  padding: 0.45rem 1.2rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  transition: background 0.3s;
}
.nav-cta:hover { background: #EF233C; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; z-index: 1001; }
.hamburger span { width: 22px; height: 1.5px; background: #EDF2F4; transition: all 0.3s; }
nav.scrolled .hamburger span { background: #2B2D42; }
nav.dark-nav .hamburger span { background: #EDF2F4; }
nav.dark-nav.scrolled .hamburger span { background: #EDF2F4; }

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #D90429;
  color: #EDF2F4;
  padding: 0.75rem 1.8rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.3s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: #EF233C; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #8D99AE;
  padding: 0.75rem 1.8rem;
  font-weight: 500;
  font-size: 0.88rem;
  border: 1px solid rgba(141,153,174,0.25);
  border-radius: 20px;
  transition: all 0.3s;
}
.btn-ghost:hover { border-color: #8D99AE; color: #2B2D42; }
.btn-ghost-light { color: rgba(237,242,244,0.6); border-color: rgba(237,242,244,0.2); }
.btn-ghost-light:hover { color: #EDF2F4; border-color: rgba(237,242,244,0.5); }
.inline-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: #D90429;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.25s ease;
}
.inline-link:hover { gap: 0.5rem; letter-spacing: 0.01em; }

/* ---- AGENT DOC HERO ---- */
.doc-hero {
  min-height: 55vh;
  background: #2B2D42;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}
.doc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(237,242,244,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237,242,244,0.015) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 80%);
}
.doc-hero-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 10rem 2rem 4rem;
  position: relative;
  z-index: 2;
  width: 100%;
}
.doc-hero .section-label { color: #8D99AE; }
.doc-hero-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #EDF2F4;
  background: rgba(217,4,41,0.8);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1.2rem;
}
.doc-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: #EDF2F4;
  font-weight: 700;
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
}
.doc-hero-sub {
  font-size: 1.05rem;
  color: #8D99AE;
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Hero actions (Framework / App buttons) */
.doc-hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(141,153,174,0.12);
}

/* ---- AGENT DOC CAPABILITIES ---- */
.doc-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}
.doc-cap {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  background: rgba(237,242,244,0.08);
  color: #EDF2F4;
  border-radius: 20px;
  letter-spacing: 0.01em;
  border: 1px solid rgba(141,153,174,0.15);
}

/* ---- SECTIONS ---- */
.section { padding: 5rem 2rem; }
.section-inner { max-width: 1100px; margin: 0 auto; }

/* ---- FRAMEWORK DEFINITION ---- */
.doc-definition { background: #fff; }
.doc-definition h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 1.2rem;
}
.doc-definition p {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.85;
  margin-bottom: 1rem;
}

/* ---- EPISTEMOLOGICAL ARCHITECTURE (paragraphs, no cards) ---- */
.doc-epistemology { background: #EDF2F4; }
.doc-epistemology h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 1rem;
}
.doc-epistemology-intro {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.85;
  margin-bottom: 2.5rem;
}
.paradigm-block {
  margin-bottom: 2rem;
  padding: 1.5rem 1.8rem;
  background: #fff;
  border: 1px solid rgba(141,153,174,0.15);
  border-radius: 12px;
}
.paradigm-block h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  color: #2B2D42;
}
.paradigm-block p {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.88rem;
  color: #555;
  line-height: 1.85;
}
.paradigm-block:last-child { margin-bottom: 0; }
.paradigm-block-header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.paradigm-block-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: #D90429;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- REASONING PROTOCOL (STEPS) — darker gray bg, blue header ---- */
.doc-protocol { background: #D6DBE0; color: #2B2D42; }
.doc-protocol .section-label { color: #8D99AE; }
.doc-protocol h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: #2B2D42;
  margin-bottom: 1rem;
}
.doc-protocol-intro {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.85;
  margin-bottom: 3rem;
}
.step-timeline { position: relative; }
.step-timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(43,45,66,0.12);
}
.step-item {
  position: relative;
  padding-left: 56px;
  margin-bottom: 2.5rem;
}
.step-item:last-child { margin-bottom: 0; }
.step-number {
  position: absolute;
  left: 0;
  top: 0;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: #2B2D42;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #EDF2F4;
  z-index: 2;
}
.step-paradigm {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8D99AE;
  margin-bottom: 0.35rem;
}
.step-item h3 {
  font-size: 1.05rem;
  color: #2B2D42;
  margin-bottom: 0.6rem;
}
.step-item p {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.8;
  margin-bottom: 0.8rem;
}
.step-output {
  font-size: 0.78rem;
  color: #666;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.5);
  border-left: 2px solid #2B2D42;
  border-radius: 4px 12px 12px 4px;
  line-height: 1.6;
}
.step-output strong { color: #2B2D42; }

/* ---- RESEARCH PAGE ---- */
.research-block {
  margin-bottom: 1.5rem;
}
.research-block p {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.85;
}
.research-example {
  margin: 2rem 0;
  padding: 1.8rem 2rem;
  background: rgba(255,255,255,0.5);
  border-left: 3px solid #2B2D42;
  border-radius: 4px 14px 14px 4px;
}
.research-example-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8D99AE;
  margin-bottom: 0.8rem;
}
.research-example p {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.85;
  margin-bottom: 0.8rem;
}
.research-example p:last-child { margin-bottom: 0; }
.research-example-coda {
  font-weight: 500;
  color: #2B2D42 !important;
  font-style: italic;
}
.research-agenda {
  margin-top: 2.5rem;
}
.research-agenda-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8D99AE;
  margin-bottom: 1.2rem;
}
.research-agenda-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.research-agenda-item {
  padding: 1.5rem;
  border: 1px solid rgba(141,153,174,0.15);
  border-radius: 12px;
  background: #fff;
}
.research-agenda-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: #D90429;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}
.research-agenda-item h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.research-agenda-item p {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.7;
}
.research-closing {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem !important;
  font-weight: 600;
  color: #2B2D42 !important;
}

/* ---- AGENT NAV (bottom) ---- */
.doc-agent-nav { background: #EDF2F4; }
.doc-agent-nav-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.doc-agent-nav-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(141,153,174,0.12);
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}
.doc-agent-nav-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 3px;
  background: rgba(217,4,41,0.7);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.doc-agent-nav-card:hover {
  border-color: rgba(141,153,174,0.3);
  box-shadow: 0 8px 30px rgba(43,45,66,0.06);
  transform: translateY(-2px);
}
.doc-agent-nav-card:hover::after { transform: scaleX(1); }
.doc-agent-nav-card.current {
  border-color: #D90429;
  background: rgba(217,4,41,0.03);
}
.doc-agent-nav-tag {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8D99AE;
  margin-bottom: 0.4rem;
}
.doc-agent-nav-card h3 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.doc-agent-nav-card p {
  font-size: 0.72rem;
  color: #8D99AE;
  line-height: 1.5;
}

/* ---- FOOTER ---- */
footer {
  padding: 2.5rem 2rem;
  background: #2B2D42;
  color: rgba(237,242,244,0.35);
  border-top: 1px solid rgba(141,153,174,0.08);
}
footer a {
  color: rgba(237,242,244,0.35);
}
footer a:hover {
  color: #EDF2F4;
}
.footer-inner {
  max-width: 960px;
  margin: 0 auto;
}
.footer-nav {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.footer-col-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  color: rgba(237,242,244,0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
footer .footer-col a {
  font-size: 0.78rem;
  color: rgba(237,242,244,0.35) !important;
  text-decoration: none;
  transition: color 0.3s;
  line-height: 1.6;
}
footer .footer-col a:hover {
  color: #EDF2F4 !important;
}
.footer-bottom {
  border-top: 1px solid rgba(141,153,174,0.08);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-top {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  font-size: 0.82rem;
  color: rgba(237,242,244,0.4);
}
.footer-tagline {
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(237,242,244,0.25);
}
.footer-icons { display: flex; gap: 0.8rem; }
footer .footer-icons a {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(141,153,174,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(237,242,244,0.35) !important;
  transition: all 0.3s;
}
footer .footer-icons a:hover { border-color: #8D99AE; color: #EDF2F4 !important; box-shadow: 0 2px 8px rgba(141,153,174,0.2); }
.footer-icons a svg { width: 13px; height: 13px; }

/* ---- ANIMATIONS ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---- RESPONSIVE ---- */

/* Tablet landscape */
@media (max-width: 1024px) {
  .section { padding: 4rem 1.5rem; }
  .section-inner { max-width: 100%; }
  .doc-hero-content { padding: 8rem 1.5rem 3.5rem; }
  .doc-agent-nav-inner { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .research-agenda-grid { grid-template-columns: 1fr; }
  .doc-agent-nav-inner { grid-template-columns: 1fr; }
  .doc-hero-actions { flex-direction: column; }
  .doc-hero-actions .btn-primary,
  .doc-hero-actions .btn-ghost,
  .doc-hero-actions .btn-ghost-light { width: 100%; text-align: center; justify-content: center; }
  .footer-nav { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 0.4rem; text-align: center; }
  .step-item { padding-left: 48px; }
}

/* Mobile — hamburger nav */
@media (max-width: 900px) {
  nav {
    padding: 0.8rem 1.5rem;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
  }
  nav.scrolled {
    background: rgba(43,45,66,0.95);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  nav.dark-nav.scrolled {
    background: rgba(43,45,66,0.95);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .nav-links { display: none !important; }
  .nav-links.open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(43,45,66,0.98);
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 9999;
  }
  .nav-links.open a { color: #EDF2F4 !important; font-size: 1.1rem; }
  .nav-links.open .nav-cta { background: #D90429; padding: 0.6rem 1.5rem; border-radius: 20px; }
  .hamburger { display: flex; z-index: 10000; position: relative; }

  .doc-hero { min-height: 45vh; }
  .doc-hero-content { padding: 6.5rem 1.2rem 3rem; }
  .doc-hero h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .doc-hero-sub { font-size: 0.92rem; margin-bottom: 1.5rem; }
  .doc-hero-tag { font-size: 0.6rem; padding: 0.3rem 0.75rem; }
  .doc-caps { gap: 0.3rem; margin-bottom: 1.5rem; }
  .doc-cap { font-size: 0.62rem; padding: 0.3rem 0.7rem; }

  .section { padding: 3rem 1.2rem; }
  .doc-definition h2,
  .doc-epistemology h2,
  .doc-protocol h2 { font-size: 1.4rem; }
  .doc-definition p,
  .doc-epistemology-intro,
  .paradigm-block p { font-size: 0.85rem; }
  .doc-protocol-intro { font-size: 0.85rem; margin-bottom: 2rem; }

  .step-item { padding-left: 44px; margin-bottom: 2rem; }
  .step-number { width: 32px; height: 32px; font-size: 0.7rem; }
  .step-timeline::before { left: 15px; }
  .step-item h3 { font-size: 0.95rem; }
  .step-item p { font-size: 0.8rem; }
  .step-output { font-size: 0.74rem; padding: 0.7rem 0.85rem; }

  .doc-agent-nav-card { padding: 1.2rem; }
  .doc-agent-nav-card h3 { font-size: 0.85rem; }
  .doc-agent-nav-card p { font-size: 0.68rem; }

  .footer-inner { padding: 0; }
  .footer-top { font-size: 0.75rem; }
  .footer-tagline { font-size: 0.65rem; }
}

/* Small phones */
@media (max-width: 420px) {
  .doc-hero-content { padding: 6rem 1rem 2.5rem; }
  .doc-hero h1 { font-size: 1.5rem; }
  .doc-hero-sub { font-size: 0.85rem; }
  .section { padding: 2.5rem 1rem; }
  .paradigm-block-header { flex-direction: column; gap: 0.3rem; }
  .step-item { padding-left: 40px; }
  .step-number { width: 28px; height: 28px; font-size: 0.65rem; }
  .step-timeline::before { left: 13px; }
  .footer-nav { grid-template-columns: 1fr; gap: 1.2rem; }
}
