/* Line drawings, hover states and scroll motion. Static styles apply everywhere;
   anything that starts hidden is scoped to .motion, which the head script sets only
   when the reader allows motion. */

/* Hero: a faint dot grid and a verification seal beside the heading. */
.home-hero { position: relative; isolation: isolate; }
.home-hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 34rem; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, #c9c9c9 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 78% 18%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 80% at 78% 18%, #000 10%, transparent 70%);
}
.home-hero > .frame { position: relative; }
.hero-art { position: absolute; top: -1.5rem; right: -.5rem; width: clamp(15rem, 30vw, 20rem); height: auto; overflow: visible; }
.hero-art * { fill: none; vector-effect: non-scaling-stroke; }
.art-corners { stroke: var(--ink); stroke-width: 1; }
.art-ring { stroke: #bdbdbd; stroke-width: 1; stroke-dasharray: 2 6; }
.art-orbit { transform-origin: 160px 160px; animation: art-spin 40s linear infinite; }
.hero-art .art-orbit-dot { fill: var(--accent); stroke: none; }
.art-ticks line { stroke: #b5b5b5; stroke-width: 1; }
.art-ticks line.major { stroke: var(--ink); }
.art-track { stroke: var(--panel); stroke-width: 7; }
.art-arc { stroke: var(--accent); stroke-width: 7; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--score)); }
.art-core { stroke: var(--ink); stroke-width: 1; }
.art-check { stroke: var(--accent); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }

/* Step drawings */
.step-art { display: block; width: 2.75rem; height: 2.75rem; margin-bottom: 1.125rem; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.step-art .step-ink { stroke: var(--accent); stroke-width: 2; }
.step-art .step-hand { stroke: var(--accent); stroke-width: 2; transform-origin: 24px 27px; }
.steps > li { position: relative; }
.steps > li::before { content: ""; position: absolute; top: -1px; left: 0; width: 2.5rem; height: 3px; background: var(--accent); }

/* Module score bars on the certificate specimen */
.spec-bar { display: block; height: 2px; margin-top: .4375rem; background: var(--line); }
.spec-bar b { display: block; height: 100%; width: calc(var(--score) * 1%); background: var(--accent); transform-origin: left; }

/* Closing panel seal */
.closing { position: relative; }
.closing-art { flex: none; width: 3.5rem; height: 3.5rem; fill: none; stroke: var(--ink); stroke-width: 1.5; }
.closing-art .art-ring { stroke-width: 1; }
.closing-art .art-check { stroke-width: 3; }

/* Hover and press feedback */
.button { transition: background-color .18s, border-color .18s, color .18s, transform .12s; }
.button:active { transform: translateY(1px); }
.role-tile, .price-card { position: relative; transition: border-color .2s, background-color .2s, transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s; }
.role-tile::after, .price-card::after {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.role-tile:hover, .price-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -18px rgb(0 0 0 / .45); }
.role-tile:hover::after, .price-card:hover::after { transform: scaleX(1); }
.spec-status::before { content: ""; display: inline-block; width: .375rem; height: .375rem; margin-right: .375rem; border-radius: 50%; background: currentColor; vertical-align: .05em; }
.status-grid [data-status="valid"] dt::before { border-radius: 50%; }

@media (max-width: 51.25rem) {
  .hero-art { display: none; }
  .home-hero::before { height: 22rem; }
}
@media (max-width: 36rem) {
  .closing-art { display: none; }
}

/* ---------- Motion (only with .motion) ---------- */
.motion [data-reveal], .motion .home-hero h1 {
  opacity: 0; transform: translateY(1.25rem);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.motion [data-reveal].is-visible, .motion .home-hero h1.is-visible { opacity: 1; transform: none; }
/* Hover transforms on revealed cards should respond immediately. */
.motion .role-tile.is-visible, .motion .price-card.is-visible { transition-delay: 0s; transition-duration: .2s, .2s, .25s, .25s; }
.motion .role-tile.is-visible:hover, .motion .price-card.is-visible:hover { transform: translateY(-3px); }

.motion .offset-rule { transform: scaleX(0); transform-origin: left; transition: transform 1.1s cubic-bezier(.6, 0, .2, 1); }
.motion .offset-rule.is-visible { transform: none; }

/* Hero seal draws itself in. */
.motion .hero-art .art-ticks line { opacity: 0; transition: opacity .4s; }
.motion .hero-art.is-visible .art-ticks line { opacity: 1; }
.motion .hero-art .art-arc { stroke-dashoffset: 100; transition: stroke-dashoffset 1.6s cubic-bezier(.3, 0, .2, 1) .5s; }
.motion .hero-art.is-visible .art-arc { stroke-dashoffset: calc(100 - var(--score)); }
.motion .hero-art .art-core, .motion .hero-art .art-corners { opacity: 0; transition: opacity .8s .2s; }
.motion .hero-art.is-visible .art-core, .motion .hero-art.is-visible .art-corners { opacity: 1; }
.motion .hero-art .art-check { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .7s cubic-bezier(.5, 0, .2, 1) 1.9s; }
.motion .hero-art.is-visible .art-check { stroke-dashoffset: 0; }
.motion .hero-art .art-orbit { opacity: 0; transition: opacity 1s .8s; }
.motion .hero-art.is-visible .art-orbit { opacity: 1; }

/* Specimen: module bars fill as the score counts up; the status dot pulses. */
.motion .specimen .spec-bar b { transform: scaleX(0); transition: transform 1.2s cubic-bezier(.3, 0, .2, 1); transition-delay: calc(.6s + var(--i, 0) * 120ms); }
.motion .specimen.is-visible .spec-bar b { transform: none; }
.motion .specimen.is-visible .spec-status::before { animation: pulse-dot 2.4s ease-out 1.8s infinite; }

/* Steps: the accent segment grows, then the drawing traces in. */
.motion .steps > li::before { width: 0; transition: width .6s cubic-bezier(.3, 0, .2, 1); transition-delay: calc(.2s + var(--i, 0) * 120ms); }
.motion .steps > li.is-visible::before { width: 2.5rem; }
.motion .step-art path, .motion .step-art circle { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s cubic-bezier(.5, 0, .2, 1); transition-delay: calc(.25s + var(--i, 0) * 150ms); }
.motion .step-art .step-ink { transition-delay: calc(.9s + var(--i, 0) * 150ms); }
.motion li.is-visible .step-art path, .motion li.is-visible .step-art circle { stroke-dashoffset: 0; }
.motion li.is-visible .step-art .step-hand { animation: hand-tick 6s steps(12) 1.6s infinite; }

/* Employer panel: statuses check in one at a time. */
.motion .status-grid > div { opacity: 0; transform: translateX(-.5rem); transition: opacity .5s, transform .5s; transition-delay: calc(.35s + var(--i, 0) * 140ms); }
.motion .status-panel.is-visible .status-grid > div { opacity: 1; transform: none; }
.motion .status-panel.is-visible [data-status="valid"] dt::before { animation: pulse-dot 2.4s ease-out 1.4s infinite; }

/* Closing seal */
.motion .closing-art circle:not(.art-ring), .motion .closing-art .art-check { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s cubic-bezier(.5, 0, .2, 1) .3s; }
.motion .closing-art .art-check { transition-delay: 1s; }
.motion .closing.is-visible .closing-art circle, .motion .closing.is-visible .closing-art .art-check { stroke-dashoffset: 0; }
.motion .closing-art .art-ring { transform-origin: 32px 32px; animation: art-spin 30s linear infinite; }

@keyframes art-spin { to { transform: rotate(360deg); } }
@keyframes hand-tick { to { transform: rotate(360deg); } }
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 .4rem transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .art-orbit, .closing-art .art-ring { animation: none; }
  .role-tile:hover, .price-card:hover { transform: none; }
}

/* ================= Inner pages ================= */

/* Page intro: dot grid on the right and a line drawing for the page's topic. */
.page-intro { position: relative; isolation: isolate; overflow: hidden; }
.page-intro::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, #cdcdcd 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 55% 95% at 88% 30%, #000 5%, transparent 70%);
  mask-image: radial-gradient(ellipse 55% 95% at 88% 30%, #000 5%, transparent 70%);
}
.page-intro > .frame { position: relative; }
.page-intro.has-art .lead { max-width: min(34rem, 56%); }
.intro-art { position: absolute; right: 0; top: 50%; translate: 0 -50%; width: clamp(13rem, 26vw, 17.5rem); height: auto; overflow: visible; }
.intro-art * { vector-effect: non-scaling-stroke; }
.intro-art path, .intro-art circle { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.intro-art .ia-corners { stroke: var(--ink); stroke-width: 1; }
.intro-art .ia-line { stroke: var(--ink); stroke-width: 1.25; }
.intro-art .ia-faint { stroke: #b8b8b8; stroke-width: 1.25; }
.intro-art .ia-accent { stroke: var(--accent); stroke-width: 1.5; }
.intro-art .ia-thick { stroke-width: 3; }
.intro-art .ia-track { stroke: #e2e2e2; stroke-width: 6; stroke-linecap: butt; }
.intro-art .ia-bar { stroke-width: 6; stroke-linecap: butt; }
.intro-art .ia-arc { stroke: var(--accent); stroke-width: 6; stroke-dasharray: 100; stroke-dashoffset: 14; }
.intro-art .ia-paper { fill: var(--paper); stroke: none; }
.intro-art .ia-ink { fill: var(--ink); stroke: none; }
.intro-art .ia-dot { fill: var(--accent); stroke: none; }
.intro-art .ia-ring { stroke: #c4c4c4; stroke-width: 1; stroke-dasharray: 2 6; }
.intro-art .ia-scan { stroke: var(--accent); stroke-width: 2; opacity: .8; }
.ia-loop-spin { transform-origin: 140px 110px; animation: art-spin 48s linear infinite; }
.intro-art[data-art="trust"] .ia-loop-spin { transform-origin: 140px 108px; }
.ia-loop-float { animation: ia-float 5s ease-in-out infinite; }
.ia-loop-swing { transform-origin: 34px 40px; animation: ia-swing 6s ease-in-out infinite; }
.ia-loop-pulse { transform-box: fill-box; transform-origin: center; animation: ia-pulse 2.4s ease-out infinite; }
.intro-art .ia-scan { animation: ia-scan 3.2s ease-in-out infinite alternate; }

/* Inner-page hover feedback, matching the homepage cards. */
.role-card, .plan-card, .info-card { position: relative; transition: border-color .2s, background-color .2s, transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s; }
.role-card::after, .plan-card::after, .info-card::after {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.role-card:hover, .plan-card:hover, .info-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -18px rgb(0 0 0 / .45); }
.role-card:hover::after, .plan-card:hover::after, .info-card:hover::after { transform: scaleX(1); }
.guide-row .tile-icon, .sample-row .tile-icon { transition: color .2s, border-color .2s, transform .25s; }
.guide-row:hover .tile-icon, .sample-row:hover .tile-icon { color: var(--accent); border-color: var(--accent); transform: rotate(-6deg); }
.process-list li { position: relative; }
.process-list li::after { content: ""; position: absolute; top: -1px; left: 0; width: 2.5rem; height: 3px; background: var(--accent); }

@media (max-width: 51.25rem) {
  .intro-art { display: none; }
  .page-intro.has-art .lead { max-width: 34rem; }
}

/* Inner-page reveals. Keep this list in step with innerReveal in motion.mjs. */
.motion :is(.page-intro .breadcrumbs, .page-intro .eyebrow, .page-intro h1, .page-intro .lead, .page-intro .button-row,
  .split-section > *, .section-heading, .plan-grid > *, .role-grid > *, .process-list > li, .prose-section, .guide-row,
  .sample-row, .narrow-grid > *, .faq-list > details, .band-table tbody tr, .short-list > li, .fact-strip, .module-grid > *) {
  opacity: 0; transform: translateY(1rem);
  transition: opacity .65s cubic-bezier(.2, .7, .2, 1), transform .65s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.motion :is(.page-intro .breadcrumbs, .page-intro .eyebrow, .page-intro h1, .page-intro .lead, .page-intro .button-row,
  .split-section > *, .section-heading, .plan-grid > *, .role-grid > *, .process-list > li, .prose-section, .guide-row,
  .sample-row, .narrow-grid > *, .faq-list > details, .band-table tbody tr, .short-list > li, .fact-strip, .module-grid > *).is-visible {
  opacity: 1; transform: none;
}
.motion :is(.role-card, .plan-card, .info-card).is-visible { transition-delay: 0s; transition-duration: .2s, .2s, .25s, .25s; }
.motion :is(.role-card, .plan-card, .info-card).is-visible:hover { transform: translateY(-3px); }

.motion .process-list li::after { width: 0; transition: width .6s cubic-bezier(.3, 0, .2, 1) calc(.2s + var(--i, 0) * 120ms); }
.motion .process-list li.is-visible::after { width: 2.5rem; }

/* Intro drawings trace in, then their loops run. */
.motion .intro-art [pathLength="1"] { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s cubic-bezier(.5, 0, .2, 1) .15s; }
.motion .intro-art .ia-accent[pathLength="1"] { transition-delay: .9s; }
.motion .intro-art.is-visible [pathLength="1"] { stroke-dashoffset: 0; }
.motion .intro-art :is(.ia-paper, .ia-ink, .ia-dot, .ia-ring, .ia-corners, .ia-scan) { opacity: 0; transition: opacity .8s .3s; }
.motion .intro-art.is-visible :is(.ia-paper, .ia-ink, .ia-dot, .ia-ring, .ia-corners) { opacity: 1; }
.motion .intro-art.is-visible .ia-scan { opacity: .8; transition-delay: 1.2s; }
.motion .intro-art .ia-ink { transition-delay: .6s; }
.motion .intro-art .ia-arc { stroke-dashoffset: 100; transition: stroke-dashoffset 1.4s cubic-bezier(.3, 0, .2, 1) 1s; }
.motion .intro-art.is-visible .ia-arc { stroke-dashoffset: 14; }

@keyframes ia-float { 50% { transform: translateY(-4px); } }
@keyframes ia-swing { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2.5deg); } }
@keyframes ia-pulse { 0% { opacity: 1; transform: scale(1); } 70% { opacity: .35; transform: scale(1.35); } 100% { opacity: 1; transform: scale(1); } }
@keyframes ia-scan { from { transform: translateY(0); } to { transform: translateY(136px); } }

@media (prefers-reduced-motion: reduce) {
  .ia-loop-spin, .ia-loop-float, .ia-loop-swing, .ia-loop-pulse, .intro-art .ia-scan { animation: none; }
  .role-card:hover, .plan-card:hover, .info-card:hover { transform: none; }
}
