/*
 * Home v3 · fold 4 · certification answer (#certification). Prefix .an-
 * Tokens only (base.css). Mobile-first; breakpoints 640 / 768 / 1024 / 1200.
 * De-congested 27 Nov 2026: the H2 and the direct answer sit large and calm; below them four text tabs with a sliding
 * indicator (How it works / Key facts / Levels and length / Common questions); on the right a compact ink card.
 * One screen on desktop is reached by showing less, never by shrinking: there are no height-based squeeze rules here,
 * so on a short screen the fold simply grows.
 * answer.js adds .an-tabs-on to the section; without it every panel is shown, stacked.
 */

/* ---------- Section + decorative dotted field (top right, fades out) ---------- */
.home-v3 .an-section::before {
    content: ''; position: absolute; top: 0; right: 0; width: min(560px, 70%); height: 420px; pointer-events: none;
    background-image: radial-gradient(var(--l200) 1.3px, transparent 1.7px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse at top right, rgba(31, 3, 45, 1), transparent 68%);
            mask-image: radial-gradient(ellipse at top right, rgba(31, 3, 45, 1), transparent 68%);
}

/* ---------- Grid ---------- */
.home-v3 .an-grid { display: grid; gap: 48px; }
.home-v3 .an-main { min-width: 0; }

/* ---------- Heading + the direct answer ---------- */
.home-v3 .an-h2 { max-width: 20ch; }
.home-v3 .an-answer { margin-top: 24px; max-width: 660px; padding-left: 20px; border-left: 3px solid var(--brand); }
.home-v3 .an-answer p { font-size: 18px; line-height: 1.6; color: var(--ink-2); }

/* Inline CTA: only when the tabs are off (no JS), where the stacked panels push the ink card far down the page */
.home-v3 .an-cta-m { margin-top: 28px; }
.home-v3 .an-cta-m-btn { width: 100%; }
.home-v3 .an-cta-m-note { margin-top: 12px; font-size: 15px; line-height: 1.55; color: var(--mute); }
.home-v3 .an-tabs-on .an-cta-m { display: none; }

/* ---------- Tabs: quiet text tabs on a hairline, with one sliding indicator (added by answer.js) ---------- */
.home-v3 .an-tabs { margin-top: 36px; min-width: 0; }
.home-v3 .an-tablist { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-v3 .an-tablist[hidden] { display: none; }
.home-v3 .an-tab {
    position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 52px; margin: 0; padding: 8px 12px;
    border: 0; border-radius: 12px 12px 0 0; background: none; box-shadow: none; color: var(--mute); cursor: pointer;
    font: inherit; font-size: 15px; font-weight: 600; line-height: 1.25; letter-spacing: 0; text-align: center; text-transform: none;
    -webkit-appearance: none; appearance: none;
}
.home-v3 .an-tab:hover { color: var(--ink); background: var(--l50); }
.home-v3 .an-tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--l300); transition: background-color var(--t-base) ease; }
.home-v3 .an-tab[aria-selected="true"] { color: var(--brand-deep); }
.home-v3 .an-tab[aria-selected="true"]::after { background: var(--brand); }
.home-v3 .an-tab-ink {
    position: absolute; left: 0; top: 0; width: 100px; height: 3px; border-radius: 3px; background: var(--brand); pointer-events: none;
    z-index: 1; transform-origin: 0 0; opacity: 0;
}
.home-v3 .an-tab-ink.is-on { opacity: 1; }

/* Panels. Without JS they are stacked, as separate blocks. */
.home-v3 .an-panel + .an-panel { margin-top: 48px; }
.home-v3 .an-tabs-on .an-panels { margin-top: 28px; }
.home-v3 .an-tabs-on .an-panel + .an-panel { margin-top: 0; }
.home-v3 .an-tabs-on .an-panel:not(.is-active) { display: none; }

/* ---------- Panel 1: how to get certified ---------- */
.home-v3 .an-how-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; margin-top: 16px; }
.home-v3 .an-h3 { font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; scroll-margin-top: 120px; }
.home-v3 .an-how-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 18px 0 14px;
    border: 1px solid var(--l300); border-radius: 999px; background: var(--white); color: var(--brand-deep); cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; letter-spacing: 0; text-transform: none;
    -webkit-appearance: none; appearance: none;
    transition: border-color var(--t-base) ease, background-color var(--t-base) ease, color var(--t-base) ease;
}
.home-v3 .an-how-toggle[hidden] { display: none; }
.home-v3 .an-how-toggle:hover { border-color: var(--brand); background: var(--l50); }
.home-v3 .an-how-toggle .v3-i { transition: transform 320ms var(--ease); }
.home-v3 .an-how-toggle[aria-expanded="true"] .v3-i { transform: rotate(45deg); }

.home-v3 .an-how-stage { display: grid; gap: 28px; }
.home-v3 .an-how-text { max-width: 640px; }
.home-v3 .an-how-text p { margin-top: 12px; font-size: 17px; line-height: 1.6; color: var(--ink-2); }

/* With JS: the steps show first; the button swaps them for the full written answer, in the same space */
.home-v3 .an-how-swap .an-how-stage { gap: 0; }
.home-v3 .an-how-swap .an-how-text, .home-v3 .an-how-swap .an-steps { grid-area: 1 / 1; min-width: 0; }
.home-v3 .an-how-swap .an-how-text { align-self: start; visibility: hidden; opacity: 0; }
.home-v3 .an-how-swap.is-full .an-how-text { visibility: inherit; opacity: 1; }
.home-v3 .an-how-swap.is-full .an-steps { visibility: hidden; opacity: 0; }

.home-v3 .an-steps { display: grid; gap: 28px; }
.home-v3 .an-step { position: relative; padding-top: 20px; border-top: 2px solid var(--l200); }
.home-v3 .an-step::before { content: ''; position: absolute; left: 0; right: 0; top: -2px; height: 2px; border-radius: 2px; background: var(--brand); transform-origin: 0 50%; }
.home-v3 .an-step-head { display: flex; align-items: center; gap: 12px; }
.home-v3 .an-step:has(.an-step-link) .an-step-head { padding-right: 36px; }
.home-v3 .an-step-num {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 999px;
    background: var(--l100); color: var(--brand-deep); font-size: 15px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
    transition: background-color var(--t-base) ease, color var(--t-base) ease, transform 240ms var(--ease);
}
.home-v3 .an-step-title { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--ink); transition: color var(--t-base) ease; }
.home-v3 .an-step-text { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--mute); }
/* Steps 1 and 2 are links to their folds: the whole step is the target, the visible mark is the arrow */
.home-v3 .an-step-link { color: var(--brand-deep); text-decoration: none; }
.home-v3 .an-step-link::after { content: ''; position: absolute; inset: 0; border-radius: 10px; }
.home-v3 .an-step-link > span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.home-v3 .an-step-link .v3-i { position: absolute; top: 27px; right: 2px; transition: transform 240ms var(--ease); }
.home-v3 .an-step-link:focus-visible { outline: none; }
.home-v3 .an-step-link:focus-visible::after { outline: 3px solid var(--brand); outline-offset: 6px; }

.home-v3 .an-guide { font-size: 16px; }
.home-v3 .an-guide .v3-i { flex: none; }

/* ---------- Panels 2 and 3: the fact table as a plain list of label/value pairs ---------- */
.home-v3 .an-facts, .home-v3 .an-facts caption, .home-v3 .an-facts tbody, .home-v3 .an-facts tr, .home-v3 .an-facts th, .home-v3 .an-facts td { display: block; }
.home-v3 .an-facts { width: 100%; border-collapse: collapse; border: 0; margin: 0; background: transparent; }
.home-v3 .an-facts caption { padding: 0 0 20px; text-align: left; font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
/* With the tabs on, the tab already names the table: keep the caption for screen readers only */
.home-v3 .an-tabs-on .an-facts caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.home-v3 .an-facts tr { padding: 12px 0; border: 0; border-top: 1px solid var(--l200); background: none; }
.home-v3 .an-facts tbody:first-of-type tr:first-child { padding-top: 0; border-top: 0; }
.home-v3 .an-facts tbody:last-of-type tr:last-child { padding-bottom: 0; }
.home-v3 .an-facts th {
    padding: 0; border: 0; background: none; text-align: left;
    font-size: 13px; font-weight: 600; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-deep);
}
.home-v3 .an-facts td { padding: 2px 0 0; border: 0; background: none; font-size: 16px; line-height: 1.6; color: var(--ink); }
.home-v3 .an-facts td strong { font-weight: 600; color: var(--ink); }
.home-v3 .an-td-lead { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.home-v3 .an-links { display: grid; margin-top: 4px; }
.home-v3 .an-links li { display: flex; align-items: center; gap: 0 12px; font-size: 16px; }
.home-v3 .an-course {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 0;
    font-weight: 600; line-height: 1.35; color: var(--brand-deep); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
    transition: color var(--t-fast) ease;
}
.home-v3 .an-course .v3-i { display: none; }              /* long course names wrap: the underline marks the link */
.home-v3 .an-course-plain { display: inline-block; padding: 9px 0; font-weight: 600; color: var(--ink); }
.home-v3 .an-tag { display: inline-block; padding: 3px 12px; border-radius: var(--r-chip); background: var(--l100); color: var(--brand-deep); font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.home-v3 .an-dur { display: grid; margin-top: 4px; }
.home-v3 .an-dur li { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 20px; padding: 9px 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.home-v3 .an-dur b { flex: none; font-weight: 700; color: var(--ink); white-space: nowrap; }

/* ---------- Panel 4: "Still deciding?" as three plain rows ---------- */
.home-v3 .an-ask { max-width: 640px; }
.home-v3 .an-ask-label { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--mute); }
.home-v3 .an-chips { display: grid; margin-top: 8px; }
.home-v3 .an-chips li + li { border-top: 1px solid var(--l200); }
.home-v3 .an-chip {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 12px 0;
    font-size: 18px; font-weight: 500; line-height: 1.35; color: var(--ink); text-decoration: none;
    transition: color var(--t-base) ease;
}
.home-v3 .an-chip .v3-i {
    box-sizing: border-box; flex: none; width: 36px; height: 36px; padding: 9px; border-radius: 999px; background: var(--l100); color: var(--brand-deep);
    transition: transform 240ms var(--ease), background-color var(--t-base) ease, color var(--t-base) ease;
}
.home-v3 .an-chip:hover { color: var(--brand-deep); text-decoration: none; }

/* ---------- Ink card: one heading, the PeopleCert line, two actions ---------- */
.home-v3 .an-aside { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 24px; padding: 28px 24px; border: 1px solid rgba(255, 255, 255, .12); }
.home-v3 .an-aside::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--brand-grad); opacity: .3;
    -webkit-mask-image: linear-gradient(135deg, rgba(31, 3, 45, 1), transparent 62%);
            mask-image: linear-gradient(135deg, rgba(31, 3, 45, 1), transparent 62%);
}
.home-v3 .an-aside-title { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; color: var(--on-dark); }
.home-v3 .an-seal { display: flex; align-items: center; gap: 14px; }
.home-v3 .an-seal-mark {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 999px;
    color: var(--amber); background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.home-v3 .an-seal-mark .v3-i { width: 24px; height: 24px; transition: transform 420ms var(--ease); }
.home-v3 .an-seal-text { display: grid; gap: 2px; }
.home-v3 .an-seal-text strong { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--on-dark); }
.home-v3 .an-seal-text span { font-size: 14px; line-height: 1.5; color: var(--on-dark-2); }
.home-v3 .an-aside-act { display: grid; gap: 12px; }
.home-v3 .an-aside-more[hidden] { display: none; }

/* Focus on the ink panel: amber ring on links, white ring on the amber button */
.home-v3 .an-aside a:focus-visible { outline: var(--focus-dark); outline-offset: 2px; }
.home-v3 .an-aside .v3-btn-primary:focus-visible { outline: 3px solid var(--on-dark); outline-offset: 2px; }
.home-v3 .an-aside .v3-btn-primary:active, .home-v3 .an-cta-m-btn:active { transform: scale(.98); }

/* ---------- Pointer feedback ---------- */
@media (pointer: fine) {
    .home-v3 .an-step:hover .an-step-num { background: var(--brand); color: var(--white); transform: scale(1.1); }
    .home-v3 .an-step:has(.an-step-link):hover .an-step-title { color: var(--brand-deep); }
    .home-v3 .an-step:hover .an-step-link .v3-i { transform: translateX(4px); }
    .home-v3 .an-course:hover { color: var(--brand); }
    .home-v3 .an-chip:hover .v3-i { background: var(--brand); color: var(--white); transform: translateX(4px); }
    .home-v3 .an-aside:hover .an-seal-mark .v3-i { transform: rotate(-10deg) scale(1.08); }
}

/* ---------- Motion (transform, opacity and colour only; everything rests fully visible) ---------- */
@keyframes anPanelFwd { from { opacity: 0; transform: translate3d(18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes anPanelBack { from { opacity: 0; transform: translate3d(-18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes anRise { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
@keyframes anBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: no-preference) {
    .home-v3 .an-tab-ink.is-ready { transition: transform 380ms var(--ease), opacity var(--t-base) ease; }
    /* The opened panel slides in from the side it lives on (answer.js sets data-dir) */
    .home-v3 .an-section.an-tabs-on .an-panels .an-panel.is-active { animation: anPanelFwd 360ms var(--ease) both; }
    .home-v3 .an-section.an-tabs-on .an-panels[data-dir="back"] .an-panel.is-active { animation-name: anPanelBack; }
    /* Its items follow one after another; the step rules draw across */
    .home-v3 .an-tabs-on .an-panel.is-active :is(.an-step, .an-facts tr, .an-chips li) { animation: anRise 420ms var(--ease) both; }
    .home-v3 .an-tabs-on .an-panel.is-active :is(.an-step, .an-facts tr, .an-chips li):nth-child(2) { animation-delay: 60ms; }
    .home-v3 .an-tabs-on .an-panel.is-active :is(.an-step, .an-facts tr, .an-chips li):nth-child(3) { animation-delay: 120ms; }
    .home-v3 .an-tabs-on .an-panel.is-active :is(.an-facts tr):nth-child(n+4) { animation-delay: 180ms; }
    .home-v3 .an-tabs-on .an-panel.is-active .an-step::before { animation: anBar 450ms var(--ease) 140ms both; }
    .home-v3 .an-tabs-on .an-panel.is-active .an-step:nth-child(2)::before { animation-delay: 260ms; }
    .home-v3 .an-tabs-on .an-panel.is-active .an-step:nth-child(3)::before { animation-delay: 380ms; }
    /* Steps <-> full answer cross-fade */
    .home-v3 .an-how-swap .an-how-text, .home-v3 .an-how-swap .an-steps { transition: opacity 300ms var(--ease), transform 300ms var(--ease), visibility 0s linear 300ms; }
    .home-v3 .an-how-swap .an-how-text { transform: translate3d(0, 10px, 0); }
    .home-v3 .an-how-swap.is-full .an-how-text { transform: none; transition-delay: 0s; }
    .home-v3 .an-how-swap:not(.is-full) .an-steps { transition-delay: 0s; }
    .home-v3 .an-how-swap.is-full .an-steps { transform: translate3d(0, -10px, 0); }
}

/* ---------- 640+ ---------- */
@media (min-width: 640px) {
    .home-v3 .an-cta-m { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
    .home-v3 .an-cta-m-btn { width: auto; }
    .home-v3 .an-cta-m-note { margin-top: 0; }
    .home-v3 .an-tabs-on .an-cta-m { display: none; }

    /* One row of tabs on one hairline */
    .home-v3 .an-tablist { display: flex; gap: 4px; }
    .home-v3 .an-tablist::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--l300); }
    .home-v3 .an-tab { min-height: 48px; padding: 8px 18px; font-size: 16px; white-space: nowrap; }

    /* Short facts in two columns of three; levels beside course length */
    .home-v3 .an-facts:not(.an-facts-levels), .home-v3 .an-facts-levels tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; align-items: start; }
    .home-v3 .an-facts caption { grid-column: 1 / -1; }
    .home-v3 .an-facts tr:first-child { padding-top: 0; border-top: 0; }
    .home-v3 .an-facts tr:last-child { padding-bottom: 0; }
    .home-v3 .an-facts-levels tbody { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: 40px; }
    .home-v3 .an-facts-levels tr { padding: 0; border-top: 0; }
}

/* ---------- 768+: steps in a row; the ink card in two columns until it moves to the side ---------- */
@media (min-width: 768px) {
    .home-v3 .an-answer p { font-size: 19px; }
    .home-v3 .an-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
    .home-v3 .an-aside { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; align-items: center; padding: 36px; }
    .home-v3 .an-aside-title, .home-v3 .an-seal { grid-column: 1; }
    .home-v3 .an-aside-act { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- 1024+: answer and tabs on the left, compact ink card on the right ---------- */
@media (min-width: 1024px) {
    .home-v3 .an-grid { grid-template-columns: minmax(0, 1fr) 288px; column-gap: 40px; row-gap: 0; align-items: center; }
    .home-v3 .an-steps { gap: 20px; }
    .home-v3 .an-cta-m { display: none; }
    .home-v3 .an-h2 { max-width: none; }
    .home-v3 .an-answer p { font-size: 20px; }

    /* Every panel shares one grid cell, so the fold keeps one height whichever tab is open */
    .home-v3 .an-tabs-on .an-panels { display: grid; }
    .home-v3 .an-tabs-on .an-panel { grid-area: 1 / 1; min-width: 0; }
    .home-v3 .an-tabs-on .an-panel:not(.is-active) { display: block; visibility: hidden; }

    .home-v3 .an-tabs { margin-top: 32px; }

    .home-v3 .an-aside { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 24px; }
    .home-v3 .an-aside-title, .home-v3 .an-seal, .home-v3 .an-aside-act { grid-column: auto; grid-row: auto; }
    .home-v3 .an-aside-act { margin-top: 4px; }
}

/* Without JS the left column is long: the card follows the reader down the page */
@media (min-width: 1024px) and (min-height: 720px) {
    .home-v3 .an-section:not(.an-tabs-on) .an-grid { align-items: start; }
    .home-v3 .an-section:not(.an-tabs-on) .an-aside { position: sticky; top: 96px; }
}

/* ---------- 1200+: wider ink card, more air between the columns ---------- */
@media (min-width: 1200px) {
    .home-v3 .an-grid { grid-template-columns: minmax(0, 1fr) 340px; column-gap: 72px; }
    .home-v3 .an-steps { gap: 28px; }
    .home-v3 .an-aside { padding: 36px 32px; }
}

/* ---------- Reduced motion / forced colours ---------- */
@media (prefers-reduced-motion: reduce) {
    .home-v3 .an-step-num, .home-v3 .an-how-toggle .v3-i, .home-v3 .an-chip .v3-i, .home-v3 .an-step-link .v3-i, .home-v3 .an-seal-mark .v3-i { transition: none; }
    .home-v3 .an-step:hover .an-step-num, .home-v3 .an-step:hover .an-step-link .v3-i, .home-v3 .an-chip:hover .v3-i, .home-v3 .an-aside:hover .an-seal-mark .v3-i { transform: none; }
    .home-v3 .an-section.an-tabs-on .an-panels .an-panel { animation: none; }
}
@media (forced-colors: active) {
    .home-v3 .an-answer { border-left-color: CanvasText; }
    .home-v3 .an-aside, .home-v3 .an-how-toggle { border: 1px solid CanvasText; }
    .home-v3 .an-step { border-top-color: CanvasText; }
    .home-v3 .an-step::before, .home-v3 .an-tab-ink { background: Highlight; }
    .home-v3 .an-tab { border-bottom: 1px solid CanvasText; }
    .home-v3 .an-tab[aria-selected="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
