/*!
 * YourCVy — site.css
 * The design system shared by every page. Page-specific styles live in their own file
 * (home.css, app.css); they build on the tokens and components defined here.
 *
 * Contents
 *   0.  Metric-matched fallback fonts
 *   1.  Tokens
 *   2.  Reset
 *   3.  Base and typography
 *   4.  Dark surfaces (token remapping)
 *   5.  Layout primitives
 *   6.  Prose (article typography, tables)
 *   7.  Components
 *   8.  Article layout
 *   9.  Templates, pricing, comparison
 *   10. Forms
 *   11. Site header
 *   12. Site footer
 *   13. Utilities, skip link, focus
 *   14. Motion and reveal-on-scroll
 *   15. Rendered CV documents (.cv-doc isolation)
 *   16. Print
 *
 * Contrast (WCAG 2.2, computed with _dev/contrast-check.js; 4.5:1 text, 3:1 non-text):
 *   ink on paper 17.02 · ink on cream 15.79 · slate on paper 6.63 · slate on cream 6.16
 *   muted on paper 5.89 · muted on cream 5.47 · gold-text on paper 6.03 · on cream 5.59 · on white 6.84
 *   paper on ink 17.02 · paper-muted on ink 9.02 · on ink-2 8.35 · gold on ink 8.45 · on ink-2 7.54
 *   ink on gold (primary button) 8.45 · ink on gold-hover 10.01 · ai on paper 6.26 · ai on ai-tint 5.52
 *   gold-text on gold-tint (badge) 5.36 (5.02 over cream) · gold on gold-tint over ink-2 5.59 · warn on warn-bg 6.49
 *   danger on paper 5.80 / cream 5.38 / white 6.57 · success-text on paper 5.73 / cream 5.32 / white 6.51
 *   on dark: fg-danger #ff8a80 8.46 ink / 7.55 ink-2 · fg-success #6ee7a8 12.56 / 11.20 · ai-light on ai-bg 5.05+
 *   pale panels (always light tokens): slate on paper-warm 7.10 · on AI callout 6.78 · on warn-bg 6.60 · on cta-inline 6.92
 *   field-border on white 3.76 / on paper 3.32 (non-text) · focus ring gold-text on paper 6.03 / gold on ink 8.45
 *   focus ring inside template cards: gold-text on the preview mat 5.01–5.86 (non-text)
 *   logo "CVy" gold-deep on paper 3.42 (large text; logotypes are exempt anyway)
 *   (--success #1f7a4d is 4.35 on cream: icons and fills only, never text.)
 */

/* ==========================================================================
   0. Metric-matched fallback fonts
   Local system fonts tuned to the metrics of the web fonts, so text does not
   jump when Playfair Display / DM Sans finish loading (font-display: swap).
   ========================================================================== */

@font-face {
  font-family: 'Playfair Fallback';
  src: local('Times New Roman');
  size-adjust: 106%;
  ascent-override: 101%;
  descent-override: 23%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'DM Sans Fallback';
  src: local('Arial');
  size-adjust: 103%;
  ascent-override: 96%;
  descent-override: 30%;
  line-gap-override: 0%;
}

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
  /* Brand palette (SPEC §6) */
  --ink: #0e0e0e;
  --ink-2: #1b1b1b;
  --paper: #f5f0e8;
  --cream: #ede8dc;
  --white: #fff;
  --gold: #c9a84c;            /* fills, rules and text on dark only */
  --gold-light: #e8d49a;
  --gold-text: #735616;       /* gold text on paper / cream / white (AA) */
  --ai: #6d28d9;
  --ai-light: #a78bfa;
  --ai-tint: rgba(109, 40, 217, .08);
  --slate: #4a5568;
  --muted: #5c5c5c;
  --line: rgba(14, 14, 14, .12);
  --line-strong: rgba(14, 14, 14, .24);
  --paper-muted: rgba(245, 240, 232, .72);   /* secondary text on ink */
  --success: #1f7a4d;         /* fills and icons; use --success-text for text */
  --danger: #b42318;

  /* Palette extensions */
  --success-text: #1a6b43;    /* success text on paper / cream / white (AA) */
  --gold-deep: #9e7d26;       /* logo "CVy" on light surfaces */
  --gold-hover: #d6b862;      /* primary button hover */
  --field-border: #8a8374;    /* form control borders (3:1 non-text contrast) */
  --line-on-dark: rgba(245, 240, 232, .16);
  --warn: #8f3d0a;
  --warn-bg: #fbeee2;
  --warn-rule: #d9732e;
  --paper-warm: #fbf8f2;      /* a whisper lighter than paper, for quiet panels */

  /* Type */
  --f-display: 'Playfair Display', 'Playfair Fallback', Georgia, serif;
  --f-body: 'DM Sans', 'DM Sans Fallback', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --f-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

  /* Shape and depth */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(14, 14, 14, .06), 0 4px 16px rgba(14, 14, 14, .06);
  --shadow-2: 0 12px 40px rgba(14, 14, 14, .14);
  --shadow-paper: 0 1px 2px rgba(14, 14, 14, .08), 0 12px 32px -8px rgba(14, 14, 14, .24);

  /* Layout */
  --container: 1200px;
  --container-narrow: 800px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 64px;
  --measure: 72ch;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Motion */
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --dur-1: .15s;
  --dur-2: .25s;
  --dur-3: .6s;

  /* Icons used as CSS masks (colour comes from background-color) */
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --icon-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
  --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e0e0e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* Contextual role tokens (--fg, --fg-muted, --rule, --focus-ring …) are set in
     section 4, once for light surfaces and once for dark ones. */

  color-scheme: light;
}

@media (min-width: 60em) {
  :root { --header-h: 72px; }
}

/* ==========================================================================
   2. Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keep anchored and focused content clear of the sticky header (WCAG 2.4.11). */
  scroll-padding-top: calc(var(--header-h) + 16px);
  scroll-padding-bottom: 24px;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  display: block;
}

/* Element rules below end in :where(:not(.cv-doc *)) — zero extra specificity — so
   they never reach a rendered CV (see section 15). */
:is(img, picture, video, canvas):where(:not(.cv-doc *)) {
  display: block;
  max-width: 100%;
}

:is(img, video):where(:not(.cv-doc *)) {
  height: auto;
}

svg:where(:not(.cv-doc *)) {
  flex-shrink: 0;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

/* Lists with a class are UI lists: no bullets or indent. Add role="list" in markup
   where list semantics matter (Safari drops them when list-style is none). */
:where(ul, ol)[class]:where(:not(.cv-doc *)) {
  list-style: none;
  padding: 0;
}

table:where(:not(.cv-doc *)) {
  border-collapse: collapse;
  border-spacing: 0;
}

[hidden]:not([hidden="until-found"]) {
  display: none !important;
}

/* ==========================================================================
   3. Base and typography
   ========================================================================== */

body {
  background: var(--paper);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

@media (min-width: 48em) {
  body { font-size: 1.0625rem; }   /* 17px on tablets and up */
}

:is(h1, h2, h3, h4, h5, h6):where(:not(.cv-doc *)) {
  color: inherit;
  font-weight: 700;
  text-wrap: balance;
}

h1:where(:not(.cv-doc *)),
.h1 {
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -.02em;
  font-variant-numeric: lining-nums;   /* Playfair defaults to old-style figures: keep "€5" and "18" on the baseline */
}

h2:where(:not(.cv-doc *)),
.h2 {
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.015em;
  font-variant-numeric: lining-nums;
}

h3:where(:not(.cv-doc *)),
.h3 {
  font-family: var(--f-body);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.005em;
}

h4:where(:not(.cv-doc *)),
.h4 {
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Hero-sized headline, for a page's single H1 when it needs more presence. */
.display {
  font-family: var(--f-display);
  font-size: clamp(2.6rem, 6.6vw, 5.25rem);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -.03em;
  font-variant-numeric: lining-nums;
}

/* Italic gold accent inside headlines: "Your CV, <span class="accent">redesigned</span>". */
.accent {
  font-style: italic;
  color: var(--fg-accent);
}

p:where(:not(.cv-doc *)) {
  text-wrap: pretty;
}

:is(strong, b):where(:not(.cv-doc *)) {
  font-weight: 700;
}

small:where(:not(.cv-doc *)),
.small {
  font-size: .875rem;
}

a:where(:not(.cv-doc *)) {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: var(--rule-strong);
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: color var(--dur-1) var(--ease-out), text-decoration-color var(--dur-1) var(--ease-out);
}

a:where(:not(.cv-doc *)):hover {
  text-decoration-color: currentColor;
}

hr:where(:not(.cv-doc *)) {
  border: 0;
  border-top: 1px solid var(--rule);
}

abbr[title]:where(:not(.cv-doc *)) {
  text-decoration: underline dotted;
  cursor: help;
}

::selection {
  background: var(--gold-light);
  color: var(--ink);
}

/* ==========================================================================
   4. Surfaces: light and dark token scopes
   Components read these role tokens, never raw palette colours, so text, rules,
   links, buttons, badges and the focus ring follow the surface they sit on.
   - Dark contexts (.section--ink, .cta-band, .site-footer, .on-dark) remap them.
   - Components that keep their own pale background (callouts, examples, the
     inline CTA, quiet cards, template previews) reset them to the light values,
     so they stay readable even when placed inside a dark section.
   Use .on-dark / .on-light for any custom element with its own background.
   ========================================================================== */

:root,
.on-light,
.callout,
.example,
.cta-inline,
.card--quiet,
.template-card__media {
  --fg: var(--ink);
  --fg-muted: var(--slate);
  --fg-accent: var(--gold-text);
  --fg-inverse: var(--paper);         /* text on a var(--fg) fill (active chip, checkbox tick) */
  --fg-success: var(--success-text);
  --fg-danger: var(--danger);
  --rule: var(--line);
  --rule-strong: var(--line-strong);
  --focus-ring: var(--gold-text);
  --surface: var(--white);
  --surface-alt: var(--cream);
  --logo-accent: var(--gold-deep);
  --gold-tint: rgba(201, 168, 76, .18);
  --hover-wash: rgba(14, 14, 14, .04);
  --btn-dark-bg: var(--ink);
  --btn-dark-fg: var(--paper);
  --btn-dark-hover: #2a2a2a;
  --ai-fg: var(--ai);
  --ai-bg: var(--ai-tint);
}

:where(.on-light, .callout, .example, .cta-inline, .card--quiet, .template-card__media) {
  color: var(--fg);
}

.on-light {
  background-color: var(--paper);
}

.section--ink,
.cta-band,
.site-footer,
.on-dark {
  --fg: var(--paper);
  --fg-muted: var(--paper-muted);
  --fg-accent: var(--gold);
  --fg-inverse: var(--ink);
  --fg-success: #6ee7a8;
  --fg-danger: #ff8a80;
  --rule: var(--line-on-dark);
  --rule-strong: rgba(245, 240, 232, .34);
  --focus-ring: var(--gold);
  --surface: var(--ink-2);
  --surface-alt: #242424;
  --logo-accent: var(--gold);
  --gold-tint: rgba(201, 168, 76, .16);
  --hover-wash: rgba(245, 240, 232, .07);
  --btn-dark-bg: var(--paper);        /* the dark button flips to paper so it never disappears (UX-09) */
  --btn-dark-fg: var(--ink);
  --btn-dark-hover: var(--white);
  --ai-fg: var(--ai-light);
  --ai-bg: rgba(167, 139, 250, .14);
  background-color: var(--ink);
  color: var(--fg);
}

/* ==========================================================================
   5. Layout primitives
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

.container--wide {
  max-width: 1440px;
}

.section {
  padding-block: clamp(56px, 8vw, 112px);
}

.section--tight {
  padding-block: clamp(40px, 5vw, 72px);
}

.section--flush-top {
  padding-top: 0;
}

.section--cream {
  background: var(--cream);
}

.section--white {
  background: var(--white);
}

.section--rule {
  border-top: 1px solid var(--rule);
}

/* Section introduction: eyebrow, H2 and lede. */
.section-head {
  max-width: 760px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head > * + * {
  margin-top: 16px;
}

.section-head > .eyebrow + * {
  margin-top: 12px;
}

.section-head > :is(h1, h2, .display) + .lede {
  margin-top: 20px;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .lede {
  margin-inline: auto;
}

/* Heading on the left, a link or button on the right (wraps on small screens). */
.section-head--split {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
}

.section-head--split > * + * {
  margin-top: 0;
}

/* Grids: one column on phones, more as space allows. */
.grid,
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: var(--grid-gap, clamp(16px, 2.4vw, 32px));
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 45em) {
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Fluid grid: as many columns of at least --grid-min as fit. */
.grid-auto {
  display: grid;
  gap: var(--grid-gap, clamp(16px, 2.4vw, 32px));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 260px)), 1fr));
}

/* Text beside media; stacks on small screens. */
.split {
  display: grid;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

@media (min-width: 56em) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--reverse > :first-child { order: 2; }
}

/* Vertical rhythm: spaces direct children evenly. */
.stack > * + * { margin-top: 1rem; }
.stack--xs > * + * { margin-top: .5rem; }
.stack--sm > * + * { margin-top: .75rem; }
.stack--lg > * + * { margin-top: 1.5rem; }
.stack--xl > * + * { margin-top: 2.5rem; }

/* Horizontal group that wraps (buttons, chips, meta). */
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, 12px);
}

.cluster--center {
  justify-content: center;
}

.measure {
  max-width: var(--measure);
}

/* ==========================================================================
   6. Prose — long-form article typography
   Selectors use :where() so components nested in an article (callouts, buttons,
   FAQ, CTA boxes) keep their own styles. Unclassed lists, links and tables only.
   ========================================================================== */

.prose {
  max-width: var(--measure);
  font-size: 1.0625rem;
  line-height: 1.7;
}

@media (min-width: 48em) {
  .prose { font-size: 1.125rem; }
}

/* Flow spacing, also inside sections/articles used to group content. */
.prose > * + *,
.prose :where(section, article, div:not([class])) > * + * {
  margin-top: 1.15em;
}

.prose :where(h2) {
  margin-top: 2.2em;
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
}

.prose :where(h3) {
  margin-top: 1.9em;
  font-size: 1.25rem;
}

.prose :where(h4) {
  margin-top: 1.6em;
  font-size: 1.0625rem;
}

.prose :where(h2, h3, h4) + * {
  margin-top: .6em;
}

.prose > :first-child,
.prose :where(section, article):first-child > :first-child {
  margin-top: 0;
}

.prose :where(a:not([class])) {
  color: var(--fg);
  font-weight: 500;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1.5px;
  overflow-wrap: anywhere;
}

.prose :where(a:not([class]):hover) {
  color: var(--fg-accent);
  text-decoration-color: currentColor;
}

.prose :where(ul:not([class]), ol:not([class])) {
  padding-left: 1.35em;
}

.prose :where(ul:not([class]), ol:not([class])) > li + li {
  margin-top: .45em;
}

.prose :where(li) > :where(ul, ol) {
  margin-top: .45em;
}

.prose :where(ul:not([class])) > li::marker {
  color: var(--fg-accent);
}

.prose :where(ol:not([class])) > li::marker {
  color: var(--fg-accent);
  font-weight: 700;
}

.prose :where(strong) {
  color: var(--fg);
}

.prose :where(blockquote) {
  padding: .2em 0 .2em 1.25em;
  border-left: 3px solid var(--gold);
  font-family: var(--f-display);
  font-size: 1.2em;
  font-style: italic;
  line-height: 1.5;
}

.prose :where(blockquote) > * + * {
  margin-top: .6em;
}

.prose :where(blockquote) :where(cite, footer) {
  display: block;
  font-family: var(--f-body);
  font-size: .8em;
  font-style: normal;
  color: var(--fg-muted);
}

.prose :where(code, kbd, samp) {
  font-family: var(--f-mono);
  font-size: .86em;
  padding: .12em .38em;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--surface-alt);
}

.prose :where(pre) {
  overflow-x: auto;
  padding: 1em 1.25em;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: .875rem;
  line-height: 1.6;
}

.prose :where(pre code) {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.prose :where(figure) > :where(img, picture, svg) {
  width: 100%;
}

.prose :where(img) {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}

.prose :where(figcaption),
figcaption {
  margin-top: .65em;
  font-size: .875rem;
  line-height: 1.5;
  color: var(--fg-muted);
}

.prose :where(hr) {
  margin-block: 2.5em;
}

/* Tables: wrap them in .table-wrap so they scroll sideways on phones:
   <div class="table-wrap" role="region" aria-label="…" tabindex="0"><table>…</table></div> */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.table-wrap > table {
  width: 100%;
}

.table-wrap :where(th, td) {
  min-width: 7.5rem;
}

.table-wrap :where(th, td):first-child {
  min-width: 9rem;
}

:where(.prose, .table-wrap) :where(table) {
  width: 100%;
  font-size: .9375rem;
  line-height: 1.5;
}

.prose :where(table:not([class])) {
  border: 1px solid var(--rule);
}

.table-wrap :where(table) {
  border: 0;
}

:where(.prose, .table-wrap) :where(caption) {
  padding: .85rem 1rem .25rem;
  text-align: left;
  font-size: .875rem;
  font-weight: 600;
  color: var(--fg-muted);
}

:where(.prose, .table-wrap) :where(th, td) {
  padding: .75rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

:where(.prose, .table-wrap) :where(thead th) {
  background: var(--surface-alt);
  font-size: .875rem;
  font-weight: 700;
  vertical-align: bottom;
}

:where(.prose, .table-wrap) :where(tbody th) {
  font-weight: 600;
}

:where(.prose, .table-wrap) :where(tbody tr:last-child) > * {
  border-bottom: 0;
}

/* ==========================================================================
   7. Components
   ========================================================================== */

/* ---- Buttons -------------------------------------------------------------
   .btn + .btn--primary | --dark | --ghost | --link, sizes --sm | --lg, --block.
   One primary action per view. Icons: inline SVG, aria-hidden="true". */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 46px;
  padding: .7em 1.4em;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--f-body);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out);
}

.btn svg {
  width: 1.15em;
  height: 1.15em;
}

/* A trailing icon (e.g. an arrow) nudges forward on hover. */
.btn > svg:last-child:not(:first-child) {
  transition: transform var(--dur-2) var(--ease-out);
}

.btn:hover > svg:last-child:not(:first-child) {
  transform: translateX(2px);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  --btn-bg: var(--gold);
  --btn-fg: var(--ink);
  --btn-border: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 2px rgba(14, 14, 14, .1);
}

.btn--primary:hover {
  --btn-bg: var(--gold-hover);
  --btn-border: var(--gold-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 10px 24px -10px rgba(158, 125, 38, .75);
}

/* Ink on light surfaces, paper on dark ones (tokens in section 4). */
.btn--dark {
  --btn-bg: var(--btn-dark-bg);
  --btn-fg: var(--btn-dark-fg);
  --btn-border: var(--btn-dark-bg);
}

.btn--dark:hover {
  --btn-bg: var(--btn-dark-hover);
  --btn-border: var(--btn-dark-hover);
}

.btn--ghost {
  --btn-border: var(--rule-strong);
}

.btn--ghost:hover {
  --btn-border: var(--fg);
  --btn-bg: var(--hover-wash);
}

.btn--link {
  min-height: 24px;
  padding: .2em 0;
  border: 0;
  border-radius: 0;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--gold);
  text-underline-offset: .28em;
}

.btn--link:hover {
  --btn-fg: var(--fg-accent);
  text-decoration-color: currentColor;
}

.btn--link:active {
  transform: none;
}

.btn--sm {
  min-height: 38px;
  padding: .5em 1.05em;
  font-size: .875rem;
}

.btn--lg {
  min-height: 54px;
  padding: .85em 1.85em;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

/* Square icon-only button; give it an aria-label or .sr-only text. */
.btn--icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ---- Chips ---------------------------------------------------------------
   Static labels or filter toggles: <button class="chip" aria-pressed="true">. */

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  min-height: 36px;
  padding: .4em 1em;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--fg);
  font-family: var(--f-body);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.chip svg {
  width: 1em;
  height: 1em;
}

:is(button, a).chip {
  cursor: pointer;
}

:is(button, a).chip:hover {
  border-color: var(--fg);
}

.chip[aria-pressed="true"],
.chip[aria-checked="true"],
.chip[aria-selected="true"],
.chip[aria-current]:not([aria-current="false"]),
.chip.is-active {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--fg-inverse);
}

.chip-group,
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- Badges ------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .25em .7em;
  border-radius: var(--radius-pill);
  background: var(--gold-tint);
  color: var(--fg-accent);
  font-family: var(--f-body);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge svg {
  width: 1.1em;
  height: 1.1em;
}

/* Solid, high-emphasis badge: ink on light surfaces, paper on dark ones. */
.badge--ink {
  background: var(--fg);
  color: var(--fg-inverse);
}

.badge--ai {
  background: var(--ai-bg);
  color: var(--ai-fg);
}

.badge--outline {
  background: transparent;
  color: var(--fg-muted);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}

.badge--success {
  background: var(--white);
  color: var(--success-text);
  box-shadow: inset 0 0 0 1px rgba(31, 122, 77, .35);
}

/* ---- Eyebrow and lede ---------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .65em;
  color: var(--fg-accent);
  font-family: var(--f-body);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 1.5rem;
  height: 1px;
  background: currentColor;
}

.eyebrow--plain::before {
  display: none;
}

/* Centred headings get a rule on both sides. */
:is(.section-head--center, .text-center) .eyebrow::after {
  content: "";
  flex: none;
  width: 1.5rem;
  height: 1px;
  background: currentColor;
}

.lede {
  max-width: 62ch;
  color: var(--fg-muted);
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  line-height: 1.6;
}

.muted {
  color: var(--fg-muted);
}

/* ---- Cards --------------------------------------------------------------- */

.card {
  position: relative;
  padding: clamp(20px, 2.6vw, 32px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.card > * + * {
  margin-top: .75rem;
}

.card > :is(h2, h3, h4) + p {
  margin-top: .5rem;
}

.card :is(h2, h3) {
  font-family: var(--f-body);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
}

/* Plain paragraphs only: zero-specificity :where() so classed elements inside a
   card (.eyebrow, .field-error, .badge, .hint …) keep their own colours. */
.card :where(p:not([class])) {
  color: var(--fg-muted);
}

.card--flat {
  background: transparent;
  box-shadow: none;
}

.card--quiet {
  background: var(--paper-warm);
  box-shadow: none;
}

/* Whole-card link: put .card__link on the card's main link (usually in the heading). */
.card__link {
  color: inherit;
  text-decoration: none;
}

.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius) - 1px);   /* the card's inner (padding-box) radius */
}

.card__link:focus-visible {
  outline: none;
}

.card__link:focus-visible::after {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.card:has(.card__link) {
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}

.card:has(.card__link):hover {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-2);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gold-tint);
  color: var(--fg-accent);
}

.card__icon svg {
  width: 22px;
  height: 22px;
}

.card__icon--ai {
  background: var(--ai-bg);
  color: var(--ai-fg);
}

/* ---- Check list ----------------------------------------------------------
   Plain <li> items; the tick is drawn by CSS and never read aloud.
   Add class "is-no" to an item for a muted cross (state it in the text too). */

.check-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: .65rem;
}

.check-list > li {
  position: relative;
  min-height: 1.4rem;
  padding-left: 2rem;
}

.check-list > li::before,
.check-list > li::after {
  content: "";
  position: absolute;
  left: 0;
  top: calc(.8em - .65rem);
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
}

.check-list > li::before {
  background: var(--gold-tint);
}

.check-list > li::after {
  background: var(--fg-accent);
  -webkit-mask: var(--icon-check) center / .78rem no-repeat;
  mask: var(--icon-check) center / .78rem no-repeat;
}

.check-list > li.is-no {
  color: var(--fg-muted);
}

.check-list > li.is-no::before {
  background: var(--rule);
}

.check-list > li.is-no::after {
  background: var(--fg-muted);
  -webkit-mask-image: var(--icon-x);
  mask-image: var(--icon-x);
  -webkit-mask-size: .7rem;
  mask-size: .7rem;
}

/* If markup carries its own decorative tick, the CSS tick replaces it. */
.check-list > li > span[aria-hidden="true"]:first-child {
  display: none;
}

/* ---- Steps ----------------------------------------------------------------
   <ol class="steps"><li><h3>…</h3><p>…</p></li></ol> — numbered circles joined
   by a hairline; vertical on phones, horizontal from tablet landscape. */

.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 28px;
}

.steps > li {
  position: relative;
  counter-increment: step;
  min-height: 2.75rem;
  padding-left: 4rem;
}

.steps > li::before {
  content: counter(step);
  content: counter(step) / "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--fg-accent);
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 3.25rem;
  bottom: -20px;
  left: 1.375rem;
  width: 1px;
  background: var(--rule-strong);
}

.steps :is(h2, h3) {
  padding-top: .45rem;
  font-family: var(--f-body);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
}

.steps p {
  margin-top: .4rem;
}

.steps :where(p:not([class])) {
  color: var(--fg-muted);
}

@media (min-width: 56em) {
  .steps {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .steps > li {
    padding-left: 0;
    padding-top: 4.25rem;
  }

  .steps > li:not(:last-child)::after {
    top: 1.375rem;
    right: -28px;
    bottom: auto;
    left: 3.75rem;
    width: auto;
    height: 1px;
  }

  .steps :is(h2, h3) {
    padding-top: 0;
  }
}

/* ---- FAQ accordion ---------------------------------------------------------
   <div class="faq"><details class="faq-item"><summary>Q</summary><div class="faq-a">A</div></details></div> */

.faq {
  max-width: 820px;
  border-top: 1px solid var(--rule);
}

.section-head--center + .faq,
.faq--center {
  margin-inline: auto;
}

.faq-item {
  border-bottom: 1px solid var(--rule);
}

.faq-item > summary {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-radius: 4px;
  color: var(--fg);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  list-style: none;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease-out);
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

/* Plus that turns into a minus. */
.faq-item > summary::after {
  content: "";
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: -.1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 10px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 10px no-repeat;
  transition: transform var(--dur-2) var(--ease-out), background-size var(--dur-2) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}

.faq-item > summary:hover {
  color: var(--fg-accent);
}

.faq-item > summary:hover::after {
  border-color: currentColor;
}

.faq-item[open] > summary::after {
  transform: rotate(180deg);
  background-size: 10px 1.5px, 1.5px 0;
}

.faq-item > summary:focus-visible {
  outline-offset: 4px;
}

.faq-a {
  padding: 0 3.25rem 1.5rem 0;
  color: var(--fg-muted);
}

.faq-a > * + * {
  margin-top: .75em;
}

.faq-a :where(ul, ol):not([class]) {
  padding-left: 1.25em;
}

/* Smooth open/close where the browser can animate details content. Not under
   reduced motion: the global reset in section 14 cannot reach ::details-content. */
@media (prefers-reduced-motion: no-preference) {
  @supports selector(::details-content) {
    .faq-item {
      interpolate-size: allow-keywords;
    }

    .faq-item::details-content {
      block-size: 0;
      overflow: clip;
      transition: block-size var(--dur-2) var(--ease-out), content-visibility var(--dur-2) allow-discrete;
    }

    .faq-item[open]::details-content {
      block-size: auto;
    }
  }
}

/* ---- Callouts --------------------------------------------------------------
   Callouts, examples and the inline CTA are pale panels: they reset the role
   tokens to the light values (section 4), so they also work in dark sections. */

.callout {
  padding: 1.1rem 1.25rem 1.15rem 1.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper-warm);
  box-shadow: inset 3px 0 0 var(--gold);
  font-size: .96em;
}

.callout > * + * {
  margin-top: .5em;
}

.callout__title {
  display: flex;
  align-items: center;
  gap: .5em;
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.callout__title svg {
  width: 1.15em;
  height: 1.15em;
  color: var(--fg-accent);
}

.callout--warn {
  border-color: rgba(217, 115, 46, .35);
  background: var(--warn-bg);
  box-shadow: inset 3px 0 0 var(--warn-rule);
}

.callout--warn .callout__title,
.callout--warn .callout__title svg {
  color: var(--warn);
}

.callout--ai {
  border-color: rgba(109, 40, 217, .22);
  background: #f6f1fd;
  box-shadow: inset 3px 0 0 var(--ai);
}

.callout--ai .callout__title svg {
  color: var(--ai);
}

/* ---- Example (illustrative CV lines in guides) ---------------------------- */

.example {
  position: relative;
  padding: 1.1rem 1.25rem;
  border: 1px dashed var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: .96em;
}

.example > * + * {
  margin-top: .5em;
}

.example__label {
  display: block;
  color: var(--fg-accent);
  font-family: var(--f-body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---- Table of contents ---------------------------------------------------- */

.toc {
  font-size: .9375rem;
  line-height: 1.45;
}

.toc__title,
.toc > :is(h2, p):first-child {
  margin-bottom: .75rem;
  color: var(--fg-muted);
  font-family: var(--f-body);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.toc :is(ol, ul) {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.toc :is(ol, ul) :is(ol, ul) {
  border-left: 0;
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: .4rem 0 .4rem 1rem;
  border-left: 2px solid transparent;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}

.toc :is(ol, ul) :is(ol, ul) a {
  padding-left: 1.85rem;
  font-size: .875rem;
}

.toc a:hover {
  border-left-color: var(--rule-strong);
  color: var(--fg);
}

.toc a[aria-current]:not([aria-current="false"]) {
  border-left-color: var(--gold);
  color: var(--fg);
  font-weight: 600;
}

.toc a:focus-visible {
  outline-offset: -1px;
}

/* ---- Breadcrumbs --------------------------------------------------------- */

.breadcrumbs {
  color: var(--fg-muted);
  font-size: .875rem;
  line-height: 1.45;
}

.breadcrumbs :is(ol, ul) {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem .55rem;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.breadcrumbs li + li::before {
  content: "/";
  content: "/" / "";
  color: var(--fg-muted);
  opacity: .55;
}

.breadcrumbs a {
  display: inline-block;
  padding-block: .2rem;
  color: var(--fg-muted);
  text-decoration-color: transparent;
}

.breadcrumbs a:hover {
  color: var(--fg);
  text-decoration-color: currentColor;
}

.breadcrumbs [aria-current="page"] {
  color: var(--fg);
  font-weight: 500;
}

/* ---- CTA band (dark panel with heading and buttons) ----------------------- */

.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 28px;
  align-items: center;
  padding: clamp(36px, 6vw, 80px) clamp(24px, 6vw, 80px);
  border-radius: var(--radius-lg);
}

/* Soft, static light: gold top right, a hint of violet bottom left. */
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(201, 168, 76, .22), transparent 62%),
    radial-gradient(45% 90% at 0% 100%, rgba(109, 40, 217, .16), transparent 66%);
  pointer-events: none;
}

.cta-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(245, 240, 232, .08);
  pointer-events: none;
}

.cta-band > * {
  min-width: 0;
}

.cta-band :is(h2, .h2) {
  max-width: 22ch;
}

.cta-band p {
  max-width: 56ch;
}

.cta-band :where(p:not([class])) {
  color: var(--fg-muted);
}

.cta-band :is(h2, .h2) + p {
  margin-top: 14px;
}

.cta-band .eyebrow + :is(h2, .h2) {
  margin-top: 14px;
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (min-width: 56em) {
  .cta-band {
    grid-template-columns: minmax(0, 1.5fr) auto;
    gap: 48px;
  }

  .cta-band__actions {
    justify-content: flex-end;
  }
}

/* Full-bleed variant: use as a section of its own. */
.cta-band--flush {
  border-radius: 0;
}

/* ---- CTA inline (contextual call to action inside an article) ------------- */

.cta-inline {
  position: relative;
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 30px) clamp(20px, 3vw, 32px);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--white) 0%, #fbf5e7 100%) var(--white);   /* solid fallback colour for audits and forced colours */
  box-shadow: var(--shadow-1);
}

.cta-inline::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold);
}

.cta-inline :is(h2, h3, .cta-inline__title) {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
  font-variant-numeric: lining-nums;
}

.cta-inline p {
  margin-top: .35rem;
}

.cta-inline :where(p:not([class])) {
  color: var(--fg-muted);
  font-size: .9375rem;
  line-height: 1.55;
}

.cta-inline__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (min-width: 40em) {
  .cta-inline {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
  }
}

/* ---- Related cards ---------------------------------------------------------
   <aside class="related" aria-labelledby="related-h"><h2 id="related-h">…</h2>
   <ul class="related__list"><li><a class="related-card" href="…">…</a></li></ul></aside> */

.related {
  padding-block: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--rule);
}

.related > :is(h2, .h2) {
  margin-bottom: clamp(20px, 3vw, 32px);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.related__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.related-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  height: 100%;
  padding: 22px 56px 22px 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}

.related-card::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 22px;
  width: 20px;
  height: 20px;
  background: var(--fg-accent);
  -webkit-mask: var(--icon-arrow) center / contain no-repeat;
  mask: var(--icon-arrow) center / contain no-repeat;
  transition: transform var(--dur-2) var(--ease-out);
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-1);
}

.related-card:hover::after {
  transform: translateX(3px);
}

.related-card__kicker {
  color: var(--fg-accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.related-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
}

.related-card__desc {
  color: var(--fg-muted);
  font-size: .9375rem;
  line-height: 1.5;
}

/* ==========================================================================
   8. Article layout
   ========================================================================== */

.article-header {
  padding-block: clamp(28px, 5vw, 64px) clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
}

.article-header .breadcrumbs {
  margin-bottom: clamp(24px, 4vw, 40px);
}

.article-header :is(h1, .h1) {
  max-width: 22ch;
}

.article-header .eyebrow + :is(h1, .h1) {
  margin-top: 14px;
}

.article-header .lede {
  margin-top: 18px;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .6rem;
  margin-top: 24px;
  color: var(--fg-muted);
  font-size: .875rem;
  line-height: 1.5;
}

.byline img,
.byline svg {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.byline strong {
  color: var(--fg);
  font-weight: 600;
}

/* <span class="byline__sep" aria-hidden="true">·</span> between items; dropped on
   phones, where the items wrap onto their own lines. */
.byline__sep {
  opacity: .7;
}

@media (max-width: 29.99em) {
  .byline__sep { display: none; }
}

/* <div class="container article-layout">
     <aside class="article-aside"><nav class="toc" aria-label="On this page">…</nav></aside>
     <div class="article-body prose">…</div>
   </div>
   Phones: TOC box first, then the article. Desktop: sticky TOC on the left. */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  padding-block: clamp(32px, 5vw, 64px) clamp(48px, 6vw, 88px);
}

.article-aside > * + * {
  margin-top: 24px;
}

.article-aside .toc {
  padding: 18px 20px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-body {
  min-width: 0;
}

@media (min-width: 64em) {
  .article-layout:has(> .article-aside),
  .article-layout--toc {
    grid-template-columns: 15rem minmax(0, 1fr);
  }

  .article-aside {
    position: sticky;
    top: calc(var(--header-h) + 32px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 56px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .article-aside .toc {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }
}

@media (min-width: 75em) {
  .article-layout:has(> .article-aside),
  .article-layout--toc {
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 80px;
  }
}

/* ==========================================================================
   9. Templates, pricing, comparison
   ========================================================================== */

/* ---- Template cards --------------------------------------------------------
   <article class="template-card">
     <div class="template-card__media"><img src="/assets/img/templates/sm/x.webp" width="240" height="339" alt="…" loading="lazy"></div>
     <div class="template-card__body">
       <h3 class="template-card__name"><a href="…">Name</a></h3>
       <p class="template-card__meta">Single column · Safest for job portals</p>
       <div class="template-card__actions"><a class="btn btn--dark btn--sm" href="…">Use layout</a></div>
     </div>
   </article>
   The name link stretches over the whole card; actions stay clickable above it.
   Keep action labels short ("Use layout"): on 320 px phones a card is ~140 px wide. */

.template-grid {
  display: grid;
  gap: clamp(12px, 2vw, 28px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 48em) {
  .template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 72em) {
  .template-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.template-grid > li {
  display: flex;   /* when the grid is a <ul>, cards still fill the cell */
}

.template-grid > li > .template-card {
  flex: 1;
}

.template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}

.template-card:hover {
  transform: translateY(-3px);
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-2);
}

/* A cream mat with the CV sheet floating on it. */
.template-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  padding: 8% 12%;
  overflow: hidden;
  /* A desk-like mat that reads on both paper and cream sections. */
  background: linear-gradient(180deg, #f2ede4 0%, #e3dccd 100%);
}

.template-card__media > :is(img, picture, .template-card__ph) {
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 905;
  border-radius: 3px;
  background: var(--white);
  box-shadow: var(--shadow-paper);
  transition: transform var(--dur-3) var(--ease-out);
}

.template-card__media > picture > img {
  width: 100%;
  height: 100%;
}

.template-card:hover .template-card__media > * {
  transform: translateY(-4px) scale(1.015);
}

.template-card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-card__badges .badge {
  box-shadow: 0 1px 2px rgba(14, 14, 14, .08);
}

/* Light badges sit on a white chip so they stay legible over any preview. */
.template-card__badges .badge:not(.badge--ink) {
  background-color: rgba(255, 255, 255, .94);
}

.template-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--rule);
}

.template-card__name {
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.template-card__name a {
  color: inherit;
  text-decoration: none;
}

.template-card__name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius) - 1px);   /* the card's inner (padding-box) radius */
}

.template-card__name a:focus-visible {
  outline: none;
}

/* Focus rings the whole card, just outside its edge like every other ring, so it
   contrasts with the section behind it (a ring on the stretched ::after would be
   cut off by the card's overflow: hidden). */
.template-card:has(.template-card__name a:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Browsers without :has(): draw the ring just inside the clipped edge instead. */
@supports not selector(:has(*)) {
  .template-card__name a:focus-visible::after {
    outline: 3px solid var(--focus-ring);
    outline-offset: -3px;
  }
}

.template-card__meta {
  color: var(--fg-muted);
  font-size: .8125rem;
  line-height: 1.45;
}

.template-card__actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  container-type: inline-size;   /* lets the buttons adapt to the card, not the viewport */
}

.template-card__actions .btn {
  flex: 1 1 auto;
}

/* Very narrow cards (two columns on phones up to ~360 px): a compact action that
   keeps "Use this layout" on one line down to 320 px and, if a longer label still
   wraps, reads as a neat two-line button instead of a tall pill. */
@container (max-width: 135px) {
  .template-card__actions .btn {
    min-height: 36px;
    padding: .45em .6em;
    border-radius: var(--radius-sm);
    font-size: .8125rem;
    line-height: 1.15;
  }
}

@media (max-width: 29.99em) {
  .template-card__body {
    padding: 12px;
  }

  .template-card__name {
    font-size: .9375rem;
  }
}

/* ---- Price card ------------------------------------------------------------ */

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.price-card--featured {
  border-color: var(--fg);
  box-shadow: var(--shadow-2);
}

.price-card--featured::before {
  content: "";
  position: absolute;
  top: -1px;
  left: clamp(24px, 4vw, 40px);
  width: 56px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--gold);
}

.price-card__head > * + * {
  margin-top: 8px;
}

.price-card__name {
  font-family: var(--f-body);
  font-size: 1.125rem;
  font-weight: 700;
}

.price-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .6rem;
}

.price-card__amount {
  font-family: var(--f-display);
  font-variant-numeric: lining-nums;
  font-size: clamp(3rem, 6vw, 4.25rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
}

.price-card__unit {
  color: var(--fg-muted);
  font-weight: 500;
}

.price-card__note {
  color: var(--fg-muted);
  font-size: .875rem;
  line-height: 1.5;
}

.price-card .check-list {
  padding-block: 20px 4px;
  border-top: 1px solid var(--rule);
}

/* ---- Comparison table ------------------------------------------------------
   <div class="table-wrap" …><table class="compare">…</table></div>
   Mark our column's cells with .is-highlight; use .mark-yes / .mark-no with
   visible or .sr-only text ("Yes" / "No"). */

.compare {
  width: 100%;
  font-size: .9375rem;
  line-height: 1.45;
}

.compare :is(th, td) {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--rule);
  text-align: center;
  vertical-align: middle;
}

.compare :is(th, td):first-child {
  min-width: 11rem;
  text-align: left;
}

.compare thead th {
  border-bottom-color: var(--rule-strong);
  background: transparent;
  font-size: .875rem;
  font-weight: 700;
  vertical-align: bottom;
}

.compare tbody th {
  font-weight: 500;
}

.compare tbody tr:last-child > * {
  border-bottom: 0;
}

.compare .is-highlight {
  background: rgba(201, 168, 76, .1);
}

.compare thead .is-highlight {
  color: var(--fg-accent);
}

.mark-yes,
.mark-no {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  vertical-align: middle;
}

.mark-yes::before,
.mark-no::before {
  content: "";
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
  background: var(--fg-success);
}

.mark-no::before {
  -webkit-mask-image: var(--icon-x);
  mask-image: var(--icon-x);
  background: var(--fg-muted);
  transform: scale(.85);
}

/* ==========================================================================
   10. Forms (scoped to .form so the app's own controls are unaffected)
   <form class="form"><div class="field"><label for="x">Label</label>
   <input id="x" …><p class="hint" id="x-hint">…</p></div></form>
   ========================================================================== */

.form {
  display: grid;
  gap: 1.25rem;
}

.form .field,
.field {
  display: grid;
  gap: .4rem;
  min-width: 0;
}

.form-row {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 40em) {
  .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.form label,
.form legend,
.field__label {
  color: var(--fg);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.form fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: .6rem;
}

.form legend {
  margin-bottom: .25rem;
  padding: 0;
}

.form .optional {
  color: var(--fg-muted);
  font-weight: 400;
}

.hint {
  color: var(--fg-muted);
  font-size: .8125rem;
  line-height: 1.5;
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: .4em;
  color: var(--fg-danger);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.45;
}

.form :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"]), select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: .7rem .9rem;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  color: var(--ink);
  font-size: 1rem;            /* never below 16px: avoids iOS zoom on focus */
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(14, 14, 14, .04);
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}

.form textarea {
  min-height: 8.5rem;
  line-height: 1.55;
}

.form select {
  appearance: none;
  padding-right: 2.75rem;
  background-image: var(--icon-chevron);
  background-position: right .85rem center;
  background-repeat: no-repeat;
  background-size: 18px;
  cursor: pointer;
}

.form ::placeholder {
  color: var(--muted);
  opacity: 1;
}

.form :is(input, select, textarea):hover:not(:disabled, :focus) {
  border-color: #5f594d;
}

.form :is(input, select, textarea):focus-visible {
  border-color: var(--ink);
  outline-offset: 1px;
}

.form :is(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.form :is(input, select, textarea):disabled {
  border-color: var(--line-strong);
  background-color: var(--cream);
  color: var(--muted);
  cursor: not-allowed;
}

/* Checkboxes and radios: a 20px control inside a ≥24px row. */
.choice {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  min-height: 24px;
  color: var(--fg);
  font-weight: 400 !important;
  line-height: 1.5;
  cursor: pointer;
}

.form :is(input[type="checkbox"], input[type="radio"]) {
  appearance: none;
  flex: none;
  display: inline-grid;
  place-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin: .13em 0 0;
  border: 1.5px solid var(--field-border);
  border-radius: 5px;
  background: var(--white);
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}

.form input[type="radio"] {
  border-radius: 50%;
}

.form input[type="checkbox"]::before {
  content: "";
  width: .8rem;
  height: .8rem;
  background: var(--fg-inverse);
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
  transform: scale(0);
  transition: transform var(--dur-1) var(--ease-out);
}

.form input[type="radio"]::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--fg-inverse);
  transform: scale(0);
  transition: transform var(--dur-1) var(--ease-out);
}

/* Ink box with a paper tick on light surfaces, the inverse on dark ones. */
.form :is(input[type="checkbox"], input[type="radio"]):checked {
  border-color: var(--fg);
  background: var(--fg);
}

.form :is(input[type="checkbox"], input[type="radio"]):checked::before {
  transform: scale(1);
}

.form :is(input[type="checkbox"], input[type="radio"]):hover:not(:checked, :disabled) {
  border-color: var(--ink);
}

.form :is(input[type="checkbox"], input[type="radio"]):disabled {
  opacity: .5;
  cursor: not-allowed;
}

.form :is(input[type="checkbox"], input[type="radio"]):focus-visible {
  outline-offset: 2px;
}

/* ==========================================================================
   11. Site header
   <header class="site-header"><div class="container site-header__inner">
     logo · <nav id="site-nav" class="site-nav"> · CTA · <button class="nav-toggle">
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 240, 232, .96);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background: rgba(245, 240, 232, .86);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 20px);
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  flex: none;
  margin-right: auto;
  padding-block: 6px;
  color: var(--fg);
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  text-decoration: none;
  border-radius: 4px;
}

.logo span {
  padding-left: .03em;
  color: var(--logo-accent);
  font-style: italic;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(2px, .6vw, 8px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 .75rem;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.site-nav a:hover {
  background: rgba(14, 14, 14, .055);
  color: var(--ink);
}

/* Current page: heavier weight plus a gold underline (not colour alone). */
.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

.site-nav a[aria-current="page"]::after,
.site-nav a.is-section-current::after {
  content: "";
  position: absolute;
  right: .75rem;
  bottom: 5px;
  left: .75rem;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

.site-nav a.is-section-current::after {
  opacity: .55;
}

.site-header__cta {
  flex: none;
  min-height: 42px;
  padding: .55em 1.15em;
  font-size: .875rem;
  white-space: nowrap;
}

.nav-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  padding: 0;
  border: 1px solid transparent;   /* invisible normally; drawn as an outline in forced-colours mode */
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  transition: background-color var(--dur-1) var(--ease-out);
}

.nav-toggle:hover {
  background: rgba(14, 14, 14, .06);
}

/* Three bars that morph into a cross. */
.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nav-toggle__icon {
  position: relative;
  transition: background-color var(--dur-1) var(--ease-out);
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  transition: transform var(--dur-2) var(--ease-out);
}

.nav-toggle__icon::before { top: -6px; }
.nav-toggle__icon::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* Phones and tablets: the nav becomes a panel under the header. */
@media (max-width: 59.99em) {
  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding: 4px var(--gutter) 20px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 28px 40px -28px rgba(14, 14, 14, .35);
  }

  .site-header.is-nav-open .site-nav {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav__list > li + li {
    border-top: 1px solid var(--line);
  }

  /* Text stays on the gutter line; the negative margin gives the focus ring room. */
  .site-nav a {
    display: flex;
    min-height: 54px;
    margin-inline: -12px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 1.0625rem;
  }

  .site-nav a:hover {
    background: transparent;
    color: var(--gold-text);
  }

  .site-nav a[aria-current="page"]::after,
  .site-nav a.is-section-current::after {
    top: 50%;
    right: 12px;
    bottom: auto;
    left: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translateY(-50%);
  }

  .site-nav a:focus-visible {
    outline-offset: -3px;
  }
}

/* Gentle entrance where supported (no-op elsewhere and under reduced motion).
   The transition lives on the open state only, so closing, and crossing the
   breakpoint, are instant. */
@media (max-width: 59.99em) and (prefers-reduced-motion: no-preference) {
  .site-header.is-nav-open .site-nav {
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
  }

  @starting-style {
    .site-header.is-nav-open .site-nav {
      opacity: 0;
      transform: translateY(-8px);
    }
  }
}

@media (max-width: 22.49em) {
  .logo { font-size: 1.3rem; }

  .site-header__cta {
    padding-inline: .9em;
    font-size: .8125rem;
  }
}

/* No JavaScript: the menu button could never open the panel, so phones and tablets
   get the links as a wrapping row under the logo instead (not sticky, so two rows
   don't eat a small screen). Browsers without the scripting media feature keep
   the default behaviour. */
@media (max-width: 59.99em) and (scripting: none) {
  .site-header {
    position: relative;
  }

  .site-header__inner {
    flex-wrap: wrap;
    row-gap: 4px;
    padding-top: 10px;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    order: 3;
    display: block;
    flex-basis: 100%;
    max-height: none;
    overflow: visible;
    padding: 0 0 8px;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .site-nav__list {
    flex-direction: row;
    flex-wrap: wrap;
    margin-inline: -10px;
  }

  .site-nav__list > li + li {
    border-top: 0;
  }

  .site-nav a {
    min-height: 40px;
    margin-inline: 0;
    padding: 0 10px;
    font-size: .9375rem;
  }

  .site-nav a[aria-current="page"]::after,
  .site-nav a.is-section-current::after {
    top: auto;
    right: 10px;
    bottom: 5px;
    left: 10px;
    width: auto;
    height: 2px;
    border-radius: 2px;
    transform: none;
  }
}

@media (min-width: 60em) {
  .nav-toggle { display: none; }
  .site-nav { margin-right: 4px; }
}

/* ==========================================================================
   12. Site footer
   ========================================================================== */

.site-footer {
  padding-block: clamp(56px, 7vw, 88px) 32px;
  font-size: .9375rem;
}

.site-footer__grid {
  display: grid;
  gap: 40px 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-footer__brand {
  grid-column: 1 / -1;
  max-width: 36ch;
}

.site-footer .logo {
  font-size: 1.75rem;
}

.site-footer__brand p {
  margin-top: 16px;
  color: var(--fg-muted);
  line-height: 1.65;
}

.footer-h {
  margin-bottom: 12px;
  color: var(--gold);
  font-family: var(--f-body);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.site-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.site-footer__col a {
  display: inline-block;
  padding-block: 5px;
  color: var(--fg-muted);
  line-height: 1.4;
  text-decoration: none;
}

.site-footer__col a:hover {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

.site-footer__col a[aria-current="page"] {
  color: var(--paper);
  font-weight: 600;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  color: var(--fg-muted);
  font-size: .8125rem;
  line-height: 1.55;
}

.site-footer__bottom p:first-child {
  color: var(--paper);
}

.site-footer__bottom a {
  color: var(--paper);
  text-decoration-color: var(--gold);
}

@media (min-width: 48em) {
  .site-footer__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 64em) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr));
    gap: 40px 32px;
  }

  .site-footer__brand {
    grid-column: auto;
    padding-right: 24px;
  }

  .site-footer__bottom p:first-child {
    flex-basis: 100%;
  }
}

/* ==========================================================================
   13. Utilities, skip link, focus
   ========================================================================== */

.sr-only,
.sr-only-focusable:not(:focus, :focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: .75rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(calc(-100% - 20px));   /* appears instantly on focus */
}

.skip-link:focus {
  transform: none;
  box-shadow: var(--shadow-2);
}

.skip-link:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Shown by the home page when JavaScript is off (see SEO-10). */
.noscript-msg {
  padding: 12px var(--gutter);
  background: var(--ink);
  color: var(--paper);
  font-size: .9375rem;
  text-align: center;
}

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* Focus: one clear ring everywhere — gold-text on light, gold on dark (via --focus-ring). */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Programmatic focus targets set by site.js after an in-page jump. */
[data-scroll-focus]:focus {
  outline: none;
}

/* Forced colours (Windows high contrast): the mode replaces background colours and
   drops gradients, so anything drawn with background-color + mask (ticks, crosses,
   arrows, the menu bars) or with gradients (the FAQ plus/minus) would vanish.
   Redraw those in system colours, and give selected chips a real fill. */
@media (forced-colors: active) {
  .nav-toggle__icon,
  .nav-toggle__icon::before,
  .nav-toggle__icon::after {
    forced-color-adjust: none;
    background-color: ButtonText;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__icon {
    background-color: transparent;
  }

  .check-list > li::after,
  .check-list > li.is-no::after,
  .mark-yes::before,
  .mark-no::before,
  .related-card::after,
  .form input[type="checkbox"]::before,
  .form input[type="radio"]::before,
  .site-nav a[aria-current="page"]::after,
  .site-nav a.is-section-current::after {
    forced-color-adjust: none;
    background-color: CanvasText;
  }

  .faq-item > summary::after {
    forced-color-adjust: none;
    background-image:
      linear-gradient(CanvasText, CanvasText),
      linear-gradient(CanvasText, CanvasText);
  }

  .chip[aria-pressed="true"],
  .chip[aria-checked="true"],
  .chip[aria-selected="true"],
  .chip[aria-current]:not([aria-current="false"]),
  .chip.is-active {
    forced-color-adjust: none;
    border-color: Highlight;
    background-color: Highlight;
    color: HighlightText;
  }

  /* The custom chevron is a dark image; the native arrow follows the theme. */
  .form select {
    appearance: auto;
    background-image: none;
  }
}

/* ==========================================================================
   14. Motion and reveal-on-scroll
   Content is visible by default. site.js adds html.js-reveal only when
   IntersectionObserver exists; elements already on screen get .is-visible at
   once, the others get .is-visible.is-revealing as they scroll in.
   Optional stagger: style="--reveal-delay: 120ms".
   The entrance is a CSS animation of opacity and the individual `translate`
   property, so it never touches a component's own `transition` or `transform`:
   .reveal is safe on .card, .template-card, .related-card, .btn and the like
   (their hover lift and transitions keep working).
   No `scroll-behavior: smooth` on html: browsers would also animate arriving on
   /#faq from another page; site.js smooth-scrolls same-page links instead.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  html.js-reveal .reveal:not(.is-visible) {
    opacity: 0;
    translate: 0 18px;
  }

  html.js-reveal .reveal.is-revealing {
    animation: yc-reveal var(--dur-3) var(--ease-out) var(--reveal-delay, 0s) both;
  }
}

@keyframes yc-reveal {
  from {
    opacity: 0;
    translate: 0 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  .template-card:hover,
  .card:has(.card__link):hover,
  .related-card:hover,
  .btn:active {
    transform: none;
  }

  .template-card:hover .template-card__media > * {
    transform: none;
  }
}

/* ==========================================================================
   15. Rendered CV documents (.cv-doc, produced by CV.render in cv-core.js)
   A CV must look the same in the on-page preview as in the PDF export, which is
   rendered in an iframe with no site CSS (browser defaults plus
   *{box-sizing:border-box;margin:0;padding:0}). The base element rules above skip
   .cv-doc descendants; here the root drops what it would inherit from <body>.
   Templates set their own fonts and sizes inline or with
   .cv-doc[data-cvid="…"] selectors, which always win over these.
   ========================================================================== */

.cv-doc,
.cv-doc *,
.cv-doc *::before,
.cv-doc *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.cv-doc {
  color: #000;
  font: initial;
  font-optical-sizing: auto;
  letter-spacing: normal;
  word-spacing: normal;
  text-align: start;
  text-indent: 0;
  text-transform: none;
  text-shadow: none;
  white-space: normal;
  overflow-wrap: normal;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: auto;
}

/* ==========================================================================
   16. Print — articles print as clean, ink-friendly documents
   ========================================================================== */

@media print {
  @page {
    margin: 16mm 15mm;
  }

  :root,
  .on-light,
  .callout,
  .example,
  .cta-inline,
  .card--quiet,
  .template-card__media,
  .section--ink,
  .cta-band,
  .site-footer,
  .on-dark {
    --fg: #000;
    --fg-muted: #333;
    --fg-accent: #000;
    --fg-inverse: #fff;
    --fg-success: #000;
    --fg-danger: #000;
    --rule: #bbb;
    --rule-strong: #888;
    --surface: #fff;
    --surface-alt: #f2f2f2;
    --logo-accent: #000;
  }

  body {
    display: block;
    background: #fff !important;
    color: #000;
    font-size: 11pt;
    line-height: 1.5;
  }

  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .skip-link,
  .site-nav,
  .nav-toggle,
  .site-header__cta,
  .site-footer__grid,
  .breadcrumbs,
  .article-aside,
  .toc,
  .cta-band,
  .cta-inline,
  .related,
  .btn,
  .filter-chips,
  #coachLauncher,
  #appRoot,
  #resumeBanner {
    display: none !important;
  }

  .site-header {
    position: static;
    padding-bottom: 6pt;
    border-bottom: 1px solid #000;
    background: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .site-header__inner {
    min-height: 0;
  }

  .container {
    max-width: none;
    padding-inline: 0;
  }

  .section,
  .section--ink,
  .section--cream,
  .site-footer {
    padding-block: 0;
    background: none !important;
    color: #000;
  }

  .article-header {
    padding-block: 14pt 10pt;
  }

  .article-layout {
    display: block;
    padding-block: 12pt 0;
  }

  .prose {
    max-width: none;
    font-size: 11pt;
    line-height: 1.55;
  }

  .prose :where(a:not([class])) {
    color: #000;
    text-decoration: underline;
  }

  .prose :where(a[href^="http"]:not([class]))::after {
    content: " (" attr(href) ")";
    color: #444;
    font-size: .85em;
    font-weight: 400;
    word-break: break-all;
  }

  .prose :where(a[href^="/"]:not([class]))::after {
    content: " (yourcvy.com" attr(href) ")";
    color: #444;
    font-size: .85em;
    font-weight: 400;
    word-break: break-all;
  }

  h1, h2, h3, h4 {
    break-after: avoid;
    page-break-after: avoid;
  }

  table, figure, blockquote, pre, img, .callout, .example, .faq-item, .card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  p, li {
    orphans: 3;
    widows: 3;
  }

  .table-wrap {
    overflow: visible;
    border-color: #bbb;
  }

  /* Backgrounds are usually not printed: keep badges legible as outlined labels. */
  .badge {
    border: 1px solid #888;
    background: none !important;
    color: #000 !important;
  }

  /* site.js opens every FAQ answer for printing; keep the open state un-animated. */
  .faq-item::details-content {
    block-size: auto;
    transition: none;
  }

  .site-footer {
    margin-top: 18pt;
    border-top: 1px solid #000;
  }

  .site-footer__bottom {
    margin-top: 0;
    padding-top: 6pt;
    border: 0;
    color: #333;
    font-size: 8.5pt;
  }

  .site-footer__bottom p:first-child,
  .site-footer__bottom a {
    color: #000;
  }

  html.js-reveal .reveal,
  .reveal {
    opacity: 1 !important;
    translate: none !important;
    animation: none !important;
  }
}
