/* ================================================================
   docs.css — Documentation / Article page styles
   Noto Serif reading typography + Anthropic-blog-inspired layout
   Colors faithfully sourced from the Gravity Word document palette
   ================================================================ */

/* ── Noto Serif import ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Document color tokens (from .docx XML) ── */
:root {
  --doc-title:        #0F2740;
  --doc-subtitle:     #25314D;
  --doc-heading:      #132B4B;
  --doc-body:         #35445F;
  --doc-body-sec:     #344054;
  --doc-meta:         #667085;
  --doc-accent:       #2557D6;
  --doc-bullet:       #2454F4;
  --doc-callout-bg:   #EEF4FF;
  --doc-callout-border: #D0DFFF;
  --doc-phase-hd-bg:  #132B4B;
  --doc-phase-hd-text:#FFFFFF;
  --doc-phase-bd-bg:  #F2F5FA;
  --doc-ai-bg:        #F3F5F7;
  --doc-page-bg:      #FFFFFF;
  --doc-divider:      #E4E7EC;
}

/* ── Article layout ── */
.doc-page {
  background: var(--doc-page-bg);
  min-height: 100vh;
}

.doc-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 140px 24px 64px;
  font-family: 'Noto Serif', Georgia, serif;
  color: var(--doc-body);
  line-height: 1.8;
  font-size: 1.05rem;
}

/* ── Article header ── */
.doc-header {
  margin-bottom: 48px;
  border-bottom: 1px solid var(--doc-divider);
  padding-bottom: 32px;
}

.doc-badge {
  display: inline-block;
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--doc-accent);
  background: var(--doc-callout-bg);
  border: 1px solid var(--doc-callout-border);
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 24px;
}

.doc-title {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 700;
  color: var(--doc-title);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.doc-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: var(--doc-subtitle);
  line-height: 1.4;
  margin: 0 0 20px;
}

.doc-lead {
  font-size: 1.08rem;
  color: var(--doc-body-sec);
  line-height: 1.85;
  margin: 0 0 16px;
}

.doc-meta {
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  font-size: 0.82rem;
  color: var(--doc-meta);
  margin: 0;
  letter-spacing: 0.02em;
}

/* ── Share buttons ── */
.doc-share {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.doc-share-label {
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  font-size: 0.78rem;
  color: var(--doc-meta);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 4px;
}

.doc-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--doc-divider);
  border-radius: 8px;
  background: transparent;
  color: var(--doc-meta);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.doc-share-btn:hover {
  border-color: var(--doc-accent);
  color: var(--doc-accent);
  background: rgba(37, 87, 214, 0.04);
}

.doc-share-btn svg {
  width: 16px;
  height: 16px;
}

.doc-share-btn .tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--doc-heading);
  color: #fff;
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateX(-50%) translateY(4px);
  margin-bottom: 6px;
}

.doc-share-btn .tooltip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Section headings ── */
.doc-section {
  margin: 48px 0 0;
}

.doc-section-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--doc-heading);
  line-height: 1.3;
  margin: 0 0 16px;
}

.doc-section-subheading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--doc-subtitle);
  line-height: 1.4;
  margin: 0 0 12px;
}

.doc-section p {
  margin: 0 0 18px;
  color: var(--doc-body);
}

/* ── Principles callout box ── */
.doc-callout {
  background: var(--doc-callout-bg);
  border: 1px solid var(--doc-callout-border);
  border-radius: 10px;
  padding: 28px 32px;
  margin: 32px 0;
}

.doc-callout-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--doc-title);
  margin: 0 0 16px;
}

.doc-callout-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-callout-list li {
  position: relative;
  padding: 6px 0 6px 20px;
  font-size: 0.98rem;
  color: var(--doc-body-sec);
  line-height: 1.75;
}

.doc-callout-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--doc-accent);
}

.doc-callout-list li strong {
  color: #101828;
}

/* ── Animated three-phase workflow ── */
.doc-workflow {
  position: relative;
  margin: 28px 0 40px;
  padding: 40px 24px 32px;
  background: linear-gradient(180deg, #F7FAFF 0%, #F2F5FA 100%);
  border: 1px solid var(--doc-callout-border);
  border-radius: 10px;
  overflow: hidden;
}

.doc-workflow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  position: relative;
  z-index: 1;
}

.doc-workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 0 4px;
  position: relative;
}

.doc-workflow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 27px;
  left: calc(50% + 28px);
  width: calc(100% - 42px);
  height: 1px;
  background: linear-gradient(90deg,
    rgba(37, 87, 214, 0.08) 0%,
    rgba(37, 87, 214, 0.32) 18%,
    rgba(37, 87, 214, 0.32) 82%,
    rgba(37, 87, 214, 0.08) 100%);
  pointer-events: none;
}

.doc-workflow-step:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 26px;
  left: calc(50% + 28px);
  width: 46px;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, rgba(37, 87, 214, 0.95) 50%, transparent 100%);
  filter: blur(0.3px);
  animation: doc-workflow-particle 3.2s linear infinite;
  pointer-events: none;
}

.doc-workflow-step:nth-child(1)::before {
  animation-delay: 0s;
}

.doc-workflow-step:nth-child(2)::before {
  animation-delay: 1.6s;
}

@keyframes doc-workflow-particle {
  0%   { transform: translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translateX(calc(100% + 14px)); opacity: 0; }
}

.doc-workflow-marker {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--doc-page-bg);
  border: 1px solid var(--doc-callout-border);
  display: grid;
  place-items: center;
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--doc-accent);
  box-shadow: 0 8px 22px rgba(37, 87, 214, 0.08);
  z-index: 1;
}

.doc-workflow-marker::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(37, 87, 214, 0.22);
  animation: doc-workflow-pulse 4s ease-out infinite;
}

.doc-workflow-step:nth-child(1) .doc-workflow-marker::before { animation-delay: 0s; }
.doc-workflow-step:nth-child(2) .doc-workflow-marker::before { animation-delay: 1s; }
.doc-workflow-step:nth-child(3) .doc-workflow-marker::before { animation-delay: 2s; }

@keyframes doc-workflow-pulse {
  0%   { transform: scale(1);    opacity: 0.55; }
  70%  { transform: scale(1.35); opacity: 0;    }
  100% { transform: scale(1.35); opacity: 0;    }
}

.doc-workflow-phase {
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--doc-title);
}

.doc-workflow-body {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--doc-body-sec);
  max-width: 165px;
  margin: 0;
}

@media (max-width: 720px) {
  .doc-workflow {
    padding: 28px 20px 24px;
  }

  .doc-workflow-steps {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .doc-workflow-step {
    display: grid;
    grid-template-columns: 56px 1fr;
    grid-template-areas:
      "marker phase"
      "marker body";
    column-gap: 20px;
    row-gap: 4px;
    text-align: left;
    align-items: center;
    padding: 0;
  }

  .doc-workflow-step:not(:last-child)::after {
    top: 56px;
    left: 27px;
    width: 1px;
    height: calc(100% - 34px);
    background: linear-gradient(180deg,
      rgba(37, 87, 214, 0.08) 0%,
      rgba(37, 87, 214, 0.32) 12%,
      rgba(37, 87, 214, 0.32) 88%,
      rgba(37, 87, 214, 0.08) 100%);
  }

  .doc-workflow-step:not(:last-child)::before {
    top: 56px;
    left: 26px;
    width: 3px;
    height: 38px;
    background: linear-gradient(180deg, transparent 0%, rgba(37, 87, 214, 0.95) 50%, transparent 100%);
    animation-name: doc-workflow-particle-v;
  }

  @keyframes doc-workflow-particle-v {
    0%   { transform: translateY(0); opacity: 0; }
    10%  { opacity: 1; }
    82%  { opacity: 1; }
    100% { transform: translateY(calc(100% + 22px)); opacity: 0; }
  }

  .doc-workflow-step .doc-workflow-marker {
    grid-area: marker;
    align-self: center;
  }

  .doc-workflow-step .doc-workflow-phase {
    grid-area: phase;
    align-self: end;
  }

  .doc-workflow-step .doc-workflow-body {
    grid-area: body;
    align-self: start;
    max-width: none;
  }
}

/* ── AI callout block (grey) ── */
.doc-highlight {
  background: var(--doc-ai-bg);
  border-radius: 10px;
  padding: 28px 32px;
  margin: 32px 0;
  border: 1px solid var(--doc-divider);
}

.doc-highlight-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--doc-title);
  margin: 0 0 12px;
}

.doc-highlight p {
  margin: 0 0 14px;
  color: var(--doc-body-sec);
  font-size: 0.98rem;
}

.doc-highlight p:last-child {
  margin-bottom: 0;
}

/* ── Bullet lists ── */
.doc-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
}

.doc-list li {
  position: relative;
  padding: 6px 0 6px 22px;
  color: var(--doc-body);
  line-height: 1.75;
}

.doc-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--doc-bullet);
}

/* ── Mid-page CTA banner (inspired by Product Overview PDF footer) ── */
.doc-cta-banner {
  margin: 64px -24px 0;
  padding: 48px 32px;
  background: var(--doc-phase-hd-bg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.doc-cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(37, 87, 214, 0.15), transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(36, 84, 244, 0.1), transparent 50%);
  pointer-events: none;
}

.doc-cta-banner-brand {
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 16px;
  position: relative;
}

.doc-cta-banner h3 {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 8px;
  line-height: 1.3;
  position: relative;
}

.doc-cta-banner p {
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 28px;
  line-height: 1.6;
  position: relative;
}

.doc-cta-banner-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.doc-cta-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #FFFFFF;
  color: var(--doc-heading);
}

.doc-cta-btn-primary:hover {
  background: #F0F4FF;
  transform: translateY(-1px);
}

.doc-cta-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: #FFFFFF;
}

.doc-cta-btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

/* ── Bottom share row ── */
.doc-footer-share {
  margin: 48px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--doc-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.doc-footer-share-text {
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  font-size: 0.88rem;
  color: var(--doc-meta);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .doc-article {
    padding: 120px 20px 48px;
    font-size: 1rem;
  }

  .doc-title {
    font-size: 1.8rem;
  }

  .doc-callout,
  .doc-highlight {
    padding: 20px 22px;
  }

  .doc-cta-banner {
    padding: 36px 24px;
  }
}

@media (max-width: 480px) {
  .doc-article {
    padding: 110px 16px 36px;
  }

  .doc-cta-banner {
    margin: 48px -16px 0;
    padding: 32px 20px;
  }

  .doc-share {
    flex-wrap: wrap;
  }
}
