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

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.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;
}
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; }
[id] { scroll-margin-top: 90px; }

/* Two-tone ring reads on both light and dark sections */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #D90429;
  border-radius: 4px;
}
h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.2; color: #2B2D42; }

.section-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #555C68;
  margin-bottom: 0.8rem;
}

/* ---- SKIP LINK ---- */
.skip-link {
  position: absolute;
  top: -60px;
  left: 1rem;
  z-index: 10001;
  background: #2B2D42;
  color: #EDF2F4;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; outline: 2px solid #D90429; outline-offset: -2px; }

/* ---- 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: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 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: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #EDF2F4;
  letter-spacing: -0.02em;
  transition: color 0.4s;
  display: flex;
  align-items: center;
  padding: 8px 4px;
  margin: -8px -4px;
}
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-links a:not(.nav-cta) {
  padding: 0.7rem 0;
  margin: -0.7rem 0;
}
nav.scrolled .nav-links a { color: #555C68; }
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: #DA122E; }
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  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: #DA122E; }
.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.7);
  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.4); }
.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;
  padding: 0.7rem 0;
  margin-bottom: -0.7rem;
  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;
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 80%);
}
.doc-hero .section-label { color: #8D99AE; }
.doc-hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  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: rgba(237,242,244,0.6);
  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: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  color: #2B2D42;
}
.paradigm-block p {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.92rem;
  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: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.62rem;
  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;
}
/* ---- 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.25);
  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-tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555C68;
  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: #555C68;
  line-height: 1.5;
}

/* ---- FOOTER ---- */
footer {
  padding: 2.5rem 2rem;
  background: #2B2D42;
  color: rgba(237,242,244,0.6);
  border-top: 1px solid rgba(141,153,174,0.08);
}
footer a {
  color: rgba(237,242,244,0.6);
}
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: 'Plus Jakarta Sans', 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.6) !important;
  text-decoration: none;
  transition: color 0.3s;
  line-height: 1.6;
  padding: 0.5rem 0;
  margin: -0.15rem 0;
}
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: 'Plus Jakarta Sans', sans-serif;
  font-weight: 400;
  font-size: 0.82rem;
  color: rgba(237,242,244,0.6);
}
.footer-tagline {
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(237,242,244,0.6);
}
.footer-icons { display: flex; gap: 0.8rem; }
footer .footer-icons a {
  width: 44px; height: 44px;
  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.6) !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: 17px; height: 17px; }

/* ---- ANIMATIONS ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.visible { transition: none !important; }
}

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

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

/* Tablet portrait */
@media (max-width: 900px) {
  .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; }
}

/* 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;
    justify-content: safe center;
    align-items: center;
    gap: 2rem;
    z-index: 9999;
    overflow-y: auto;
    padding: 2rem 0;
  }
  .nav-links.open a {
    color: #EDF2F4 !important;
    font-size: 1.1rem;
    display: inline-block;
    padding: 0.75rem 1.2rem;
    margin: -0.75rem -1.2rem;
  }
  .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 h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .doc-hero-sub { font-size: 0.92rem; margin-bottom: 1.5rem; }
  .doc-hero-tag { 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-epistemology-intro { font-size: 0.85rem; }
  .doc-protocol-intro { font-size: 0.85rem; margin-bottom: 2rem; }

  .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 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; }
  .footer-nav { grid-template-columns: 1fr; gap: 1.2rem; }
}
