/* ==========================================================================
   Home page
   --------------------------------------------------------------------------
   1. Hero annotation ("Think Gartner. For the CDN industry.")
   The hero card itself is shared by all pages → main.css
   The map section under the hero: /assets/css/tools/performance-map.css
   ========================================================================== */

/* 1. Hero annotation
   --------------------------------------------------------------------------
   One timed sequence, CSS only (no JS), every step fills "both" so the page
   rests in its final state:
     0.15s  words rise in, one by one
     1.30s  "Think Gartner." steps back (fades to a light tone)
     2.00s  promise line fades in
     2.60s  "CDN" gets circled in red
     2.90s  the matching promise is highlighted
     3.10s  "Real data" tag pops in next to the circle
   ========================================================================== */
/* Tall hero card on desktop; logo + headline + promise sit centred in it */
.hero--annotated {
  display: flex;
  flex-direction: column;
  justify-content: center; /* logo + text centred together as one group */
  min-height: 1040px;
}

/* Less air between the logo and the headline */
.hero--annotated .site-header {
  padding-bottom: 0;
}

.hero__content--annotated {
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-top: clamp(32px, 4vw, 48px);
  text-align: center;
}

.annotated-title {
  max-width: none;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(44px, 8.6vw, 152px); /* 8.6vw keeps "For the CDN industry." on one line */
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.annotated-title__word {
  display: inline-block;
  animation: annotate-rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms + 150ms);
}

/* "Think Gartner." sits on its own line and steps back once the words are in */
.annotated-title__think {
  display: block;
  animation: annotate-step-back 1.4s ease 1.3s both;
}

/* The red circle around "CDN", drawn as a pen stroke */
.annotate-mark {
  position: relative;
  margin-inline: 0.1em; /* breathing room so the circle doesn't touch "the" / "industry" */
}

.annotate-mark__circle {
  position: absolute;
  top: -12%;
  left: -16%;
  width: 132%;
  height: 124%;
  overflow: visible;
  pointer-events: none;
}

.annotate-mark__circle path {
  fill: none;
  stroke: var(--color-brand);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 100; /* path has pathLength="100" */
  stroke-dashoffset: 100;
  animation: annotate-draw 1.3s cubic-bezier(0.6, 0.05, 0.25, 1) 2.6s forwards;
}

.annotate-mark__tag {
  position: absolute;
  top: -0.28em;
  left: -1.6em;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--color-brand);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(11px, 1vw, 15px);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  animation: annotate-tag 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 3.1s both;
}

/* The page's H1, under the tagline: plain words for what the page offers */
.annotated-heading {
  margin: clamp(32px, 3.6vw, 52px) auto 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
  animation: annotate-fade 1s ease 1.8s both;
}

.annotated-lead {
  flex: none;
  max-width: 48ch;
  margin: clamp(14px, 1.4vw, 20px) auto 0;
  padding-bottom: 0;
  font-size: clamp(17px, 1.75vw, 25px);
  line-height: 1.5;
  text-wrap: pretty;
  animation: annotate-fade 1s ease 2s both;
}

/* The promise that matches "CDN": a red marker stroke sweeps under it */
.annotate-highlight {
  background: linear-gradient(rgba(210, 9, 45, 0.12), rgba(210, 9, 45, 0.12)) no-repeat 0 88% / 0% 38%;
  color: inherit;
  animation: annotate-highlight 1.1s cubic-bezier(0.6, 0.05, 0.25, 1) 2.9s forwards;
}

@keyframes annotate-rise {
  from {
    opacity: 0;
    transform: translateY(0.35em);
    filter: blur(8px);
  }
}

@keyframes annotate-step-back {
  to {
    color: rgba(42, 10, 16, 0.32);
  }
}

@keyframes annotate-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes annotate-tag {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes annotate-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes annotate-highlight {
  to {
    background-size: 100% 38%;
    color: var(--color-ink);
  }
}

/* Tablets & phones: a fixed 1040px card would be mostly empty — fit the content instead */
@media (max-width: 1024px) {
  .hero--annotated {
    min-height: 0;
  }
}

/* Phones: the title shrinks but the tag doesn't — move it under the circle so it covers nothing */
@media (max-width: 600px) {
  .annotate-mark__tag {
    top: 104%; /* under the circle: above it would touch "Gartner.", on it covers "CDN" */
    left: 18%;
    padding: 4px 7px;
    font-size: 11px;
  }
}

/* Reduced motion: skip straight to the final, annotated state */
@media (prefers-reduced-motion: reduce) {
  .hero__content--annotated *,
  .hero__content--annotated {
    animation-delay: 0s !important;
  }
}
