/* ==========================================================================
   CV page (cv/index.html)
   Loaded after css/galaxy-system.css. Uses its tokens and devices only.
   Markup for .cv-content and [data-cv-contact] comes from css/cv/cv-renderer.js.
   Order: page header, sections, summary, expertise, accomplishments,
   timeline, background, motion, responsive, forced colours, print.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page header: CV extras inside the shared .page-hero
   -------------------------------------------------------------------------- */
.cv-title-dot { color: var(--hot); text-shadow: 0 0 30px rgba(255, 42, 70, .45); }

.cv-role {
  margin-top: clamp(14px, 2vh, 22px);
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(1.25rem, 1.1rem + .7vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -.005em;
  color: var(--bone);
}
.cv-role-sep {
  margin-inline: .35em;
  font-family: var(--f-mono);
  font-size: .8em;
  color: var(--hot);
}

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(24px, 3.6vh, 40px);
}
html:not(.js) .print-btn { display: none; }

/* contact HUD in the band's meta row */
.cv-contact { row-gap: 6px; }
.cv-contact:empty { display: none; }
.cv-contact .hud-row { align-items: center; }
.cv-contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--bone-dim);
  text-decoration: underline;
  text-decoration-color: rgba(255, 42, 70, .5);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
  transition: color var(--dur-1) linear, text-decoration-color var(--dur-1) linear;
}
@media (hover: hover) {
  .cv-contact a:hover { color: var(--bone); text-decoration-color: var(--hot); }
}

/* --------------------------------------------------------------------------
   2. Sections: sticky mono head on the left, content on the right
   -------------------------------------------------------------------------- */
.cv-page { padding-block: var(--s8) var(--section-y-tight); }

.cv-sec {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--s6);
  padding-top: var(--s6);
}
.cv-sec + .cv-sec { margin-top: var(--s9); }

/* laser rule: hairline with a hot segment that scales in with the head */
.cv-sec::before,
.cv-sec::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 1px;
}
.cv-sec::before { right: 0; background: var(--ink-3); }
.cv-sec::after {
  width: clamp(80px, 12vw, 180px);
  background: var(--hot);
  box-shadow: 0 0 10px var(--hot);
  transform-origin: left;
  transition: transform 1.1s .2s var(--ease-out);
}

.cv-sec-head {
  grid-column: 1 / span 3;
  align-self: start;
  position: sticky;
  top: calc(var(--header-real, var(--header-h)) + 32px);
}
.cv-h2 {
  margin-top: var(--s4);
  font-family: var(--f-display);
  font-weight: 300;
  font-size: var(--t-h2-small);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--bone);
  max-width: 14ch;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.cv-sec-body { grid-column: 4 / -1; min-width: 0; }

/* --------------------------------------------------------------------------
   3. Summary
   -------------------------------------------------------------------------- */
.cv-statement {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.5rem);
  line-height: 1.24;
  letter-spacing: -.01em;
  color: var(--bone);
  max-width: 32ch;
  text-wrap: pretty;
}
.cv-statement strong { font-weight: 300; color: var(--hot); font-style: italic; }
.cv-summary-p {
  margin-top: var(--s6);
  max-width: 62ch;
  font-size: var(--t-lede);
  line-height: 1.7;
  color: var(--bone-dim);
}

/* --------------------------------------------------------------------------
   4. Expertise: constellation glyphs that join up as the block arrives
   -------------------------------------------------------------------------- */
.cv-skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--s6) var(--col-gap);
}
.cv-skill {
  position: relative;
  padding-top: var(--s5);
  border-top: 1px solid var(--ink-3);
}
.cv-skill::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 1px;
  background: var(--hot);
  box-shadow: 0 0 10px var(--hot);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s var(--ease-out);
}
.cv-skill .glyph circle { fill: var(--bone-dim); }
.cv-skill .glyph polygon {
  stroke-dashoffset: 0;
  fill: rgba(200, 16, 46, .12);
  transition-delay: calc(350ms + var(--i, 0) * 140ms);
}
@media (hover: hover) {
  .cv-skill:hover::after { transform: scaleX(1); }
  .cv-skill:hover .glyph circle { fill: var(--hot); }
}
.cv-skill-title {
  margin-top: var(--s5);
  font-family: var(--f-display);
  font-weight: 300;
  font-size: var(--t-h3);
  line-height: 1.25;
  color: var(--bone);
  text-wrap: balance;
}
.cv-skill-desc {
  margin-top: var(--s3);
  font-size: var(--t-small);
  line-height: 1.6;
  color: var(--bone-dim);
}

/* --------------------------------------------------------------------------
   5. Accomplishments: numbered rows in a lock-on panel
   -------------------------------------------------------------------------- */
.cv-wins {
  position: relative;
  padding: clamp(24px, 4vw, 56px);
  background:
    radial-gradient(ellipse 60% 90% at 0% 100%, rgba(200, 16, 46, .12), transparent 70%),
    linear-gradient(180deg, rgba(255, 42, 70, .03), rgba(10, 10, 9, .6)),
    var(--ink-2);
  border: 1px solid var(--ink-3);
}
.cv-wins .lock { inset: -1px; }
.cv-wins .lock i { width: 26px; height: 26px; }
.cv-win {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: baseline;
  padding-block: 18px;
  border-top: 1px solid var(--ink-3);
}
.cv-win:first-child { border-top: 0; padding-top: 0; }
.cv-win:last-child { padding-bottom: 0; }
.cv-win-num {
  font: 400 .875rem/1 var(--f-mono);
  letter-spacing: .04em;
  color: var(--hot);
}
.cv-win-text {
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--bone);
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   6. Timeline: roles as nodes on a vertical laser line
   -------------------------------------------------------------------------- */
.timeline {
  --date-w: 10rem;
  --rail: 3.25rem;
  --node: 15px;
  --node-top: 1px;
  --line-x: calc(var(--date-w) + var(--rail) / 2);
  position: relative;
}
/* dim base rail so the structure reads before the laser draws */
.timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--line-x) - .5px);
  width: 1px;
  background: var(--ink-4);
}

.role {
  position: relative;
  display: grid;
  grid-template-columns: var(--date-w) var(--rail) minmax(0, 1fr);
  padding-bottom: clamp(40px, 5vw, 72px);
}
.role:last-child { padding-bottom: 0; }

/* laser segment from this node down to the next */
.role::before {
  content: '';
  position: absolute;
  left: calc(var(--line-x) - 1px);
  top: calc(var(--node-top) + var(--node) - 2px);
  bottom: calc(-1 * var(--node-top) - 2px);
  width: 2px;
  background: var(--hot);
  box-shadow: 0 0 6px var(--hot), 0 0 16px rgba(200, 16, 46, .6);
  transform-origin: top;
  transition: transform 1.2s .35s var(--ease-in-out);
}
.role:last-child::before {
  bottom: 0;
  background: linear-gradient(var(--hot), rgba(255, 42, 70, 0));
  box-shadow: none;
}

.role-dates {
  grid-column: 1;
  grid-row: 1;
  padding-right: var(--s4);
  text-align: right;
  letter-spacing: .06em;
  color: var(--hot);
}

.role-dates .nw { white-space: nowrap; }

.role-node {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  position: relative;
  z-index: 1;
  width: var(--node);
  height: var(--node);
  margin-top: var(--node-top);
  border-radius: 50%;
  background: var(--ink);
  border: 1.5px solid var(--hot);
  box-shadow: 0 0 0 4px var(--ink), 0 0 14px var(--glow);
  transition: transform .6s .3s var(--ease-out), opacity .6s .3s var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.role-node::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--hot);
}
/* current roles get the "on air" ring */
.role.is-current .role-node::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--hot);
  opacity: 0;
}
@media (hover: hover) {
  .role:hover .role-node { box-shadow: 0 0 0 4px var(--ink), 0 0 22px var(--hot); }
}

.role-body {
  grid-column: 3;
  grid-row: 1 / span 2;
  min-width: 0;
}
.role-company {
  color: var(--bone);
  letter-spacing: .12em;
}
.role-title {
  margin-top: 10px;
  font-family: var(--f-display);
  font-weight: 300;
  font-size: var(--t-h3);
  line-height: 1.25;
  color: var(--bone);
  max-width: 38ch;
  text-wrap: balance;
  transition: color var(--dur-2);
}
@media (hover: hover) {
  .role:hover .role-title { color: #fffaf3; }
}
.role-description p {
  margin-top: var(--s4);
  max-width: var(--measure);
  font-size: var(--t-body);
  line-height: 1.65;
  color: var(--bone-dim);
}
.role-impact-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: var(--s5);
  color: var(--mute);
}
.role-impact-head::before {
  content: '';
  width: 20px; height: 1px;
  background: var(--hot);
}
.role-impacts { margin-top: var(--s2); max-width: var(--measure); }
.role-impacts li {
  position: relative;
  padding-left: 1.5rem;
  margin-top: 10px;
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--bone-dim);
}
.role-impacts li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: .62em;
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1px solid var(--hot);
}
.role-impacts strong { color: var(--bone); font-weight: 500; }

/* --------------------------------------------------------------------------
   7. Background: education, memberships, citizenships, interests
   -------------------------------------------------------------------------- */
.cv-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: var(--s7) var(--col-gap);
}
.cv-block-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink-4);
  color: var(--bone-dim);
}
.degree { padding-top: 18px; }
.degree-inst {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: var(--t-h3);
  line-height: 1.25;
  color: var(--bone);
}
.degree-qual { margin-top: 6px; color: var(--bone); }
.degree-dates { margin-top: 8px; color: var(--hot); letter-spacing: .06em; }
.degree-desc { margin-top: var(--s3); font-size: var(--t-small); color: var(--bone-dim); }
.cv-list li {
  padding-block: 12px 13px;
  border-bottom: 1px solid var(--ink-3);
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--bone-dim);
}
.cv-list strong { color: var(--bone); }

.cv-noscript {
  padding: var(--s6) 0;
  color: var(--bone-dim);
}
.cv-noscript a { color: var(--bone); text-decoration: underline; text-decoration-color: var(--hot); text-underline-offset: 4px; }

/* --------------------------------------------------------------------------
   8. Motion (final states above; these only hide under html.js with motion)
   -------------------------------------------------------------------------- */
@keyframes cv-failsafe-y { to { transform: scaleY(1); } }

@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-paused) .role.is-current .role-node::before { animation: pulse-ring 2.4s var(--ease-out) infinite; }

  .js .cv-sec:has(> .cv-sec-head[data-reveal]:not(.is-in))::after { transform: scaleX(0); }
  .js .role[data-reveal]:not(.is-in)::before { transform: scaleY(0); }
  .js .role[data-reveal]:not(.is-in) .role-node { opacity: .25; transform: scale(.4); }
  .js .cv-skills[data-reveal]:not(.is-in) .glyph polygon { stroke-dashoffset: 1; fill: rgba(200, 16, 46, 0); }
}

/* failsafes: only when site.js never ran */
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.reveal-armed) .cv-sec:has(> .cv-sec-head[data-reveal]:not(.is-in))::after { animation: failsafe-scale 0s 3.5s forwards; }
  html.js:not(.reveal-armed) .role[data-reveal]:not(.is-in)::before { animation: cv-failsafe-y 0s 3.5s forwards; }
  html.js:not(.reveal-armed) .role[data-reveal]:not(.is-in) .role-node { animation: failsafe-reveal 0s 3.5s forwards; }
  html.js:not(.reveal-armed) .cv-skills[data-reveal]:not(.is-in) .glyph polygon { animation: failsafe-line 0s 3.5s forwards; }
}

/* pause control: final states */
html.motion-paused .cv-sec::after { transform: none !important; }
html.motion-paused .role::before { transform: none !important; }
html.motion-paused .role .role-node { opacity: 1 !important; transform: none !important; }
html.motion-paused .cv-skills .glyph polygon { stroke-dashoffset: 0 !important; }

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
  .cv-sec-head { grid-column: 1 / span 4; }
  .cv-sec-body { grid-column: 5 / -1; }
  .timeline { --date-w: 0px; --rail: 2.25rem; }
  .role { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .role-dates { grid-column: 2; grid-row: 1; text-align: left; padding-right: 0; }
  .role-node { grid-column: 1; }
  .role-body { grid-column: 2; grid-row: 2; margin-top: 8px; }
}

@media (max-width: 959px) {
  .cv-sec { grid-template-columns: minmax(0, 1fr); row-gap: var(--s6); }
  .cv-sec-head { grid-column: 1; position: static; }
  .cv-sec-body { grid-column: 1; }
  .cv-h2 { max-width: 20ch; }
}

@media (max-width: 719px) {
  /* each link row is already 44px tall, so the rows need no extra gap */
  .cv-contact { flex-direction: column; gap: 0; }
  .cv-contact .hud-row { flex-wrap: wrap; column-gap: 14px; }
  .cv-contact dt { min-width: 5.5em; }
  .cv-win { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .cv-skill { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 16px; align-items: center; }
  .cv-skill-title { margin-top: 0; }
  .cv-skill-desc { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .cv-actions .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   10. Forced colours
   -------------------------------------------------------------------------- */
@media (forced-colors: active) {
  .cv-sec::before, .timeline::before, .role::before { background: CanvasText; }
  .role-node, .role-node::after { forced-color-adjust: none; background: Highlight; border-color: CanvasText; }
  .cv-wins { border-color: CanvasText; }
}

/* --------------------------------------------------------------------------
   11. Print: a clean, light, single-column CV
   -------------------------------------------------------------------------- */
@page { size: A4; margin: 14mm 15mm 16mm; }

@media print {
  html, body { background: #fff !important; color: #111 !important; }
  body { font-size: 9.5pt; line-height: 1.45; }
  .label { color: #444; }
  a { color: inherit; }

  .site-header, .site-footer, .skip-link, .hero-galaxy, .motion-toggle,
  .cv-actions, .page-lead, .page-hero-eyebrow, .cv-noscript,
  .page-hero::after, .page-hero-copy::before, .page-hero-meta::before,
  .page-hero-meta > span[aria-hidden], .page-hero-meta .hero-controls,
  .lock, .glyph, .eyebrow-num, .eyebrow-sep { display: none !important; }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }
  [data-reveal], .role-node { opacity: 1 !important; transform: none !important; }
  .cv-sec::after, .role::before { transform: none !important; }

  /* header block */
  .page-hero { display: block; min-height: 0; padding: 0; background: none; overflow: visible; }
  .page-hero-body, .page-hero-meta, .cv-page { padding: 0 !important; max-width: none; }
  .page-hero-body { display: block; }
  .page-hero-body::after { display: none; }
  .page-title { margin: 0; animation: none !important; clip-path: none !important; font-size: 26pt; font-weight: 300; line-height: 1.05; letter-spacing: -.02em; color: #111; }
  .cv-title-dot { color: #a80d26; }
  .cv-role { margin-top: 3pt; font-size: 12.5pt; color: #222; }
  .cv-role-sep { color: #a80d26; }
  .page-hero-meta { display: block !important; margin-top: 8pt; padding-bottom: 10pt !important; border-bottom: 1.5pt solid #111; }
  .cv-contact { display: flex; flex-direction: row; flex-wrap: wrap; gap: 2pt 16pt; }
  .cv-contact .hud-row { gap: 5pt; font-size: 8pt; }
  .cv-contact dt { color: #a80d26; min-width: 0; }
  .cv-contact dd, .cv-contact a { color: #111; text-decoration: none; min-height: 0; }

  /* sections stack: heading above content */
  .cv-sec { display: block; padding-top: 7pt; margin-top: 14pt !important; }
  .cv-sec::before { background: #bbb; }
  .cv-sec::after { width: 36pt; height: 1.5pt; background: #a80d26; }
  .cv-sec-head { position: static; margin-bottom: 7pt; break-after: avoid; page-break-after: avoid; }
  .cv-sec-head .eyebrow { display: none; }
  .cv-h2 { margin: 0; max-width: none; font-size: 13pt; font-weight: 400; color: #111; }

  .cv-statement { max-width: none; font-size: 11.5pt; line-height: 1.4; color: #111; }
  .cv-statement strong { color: #a80d26; }
  .cv-summary-p { max-width: none; margin-top: 5pt; font-size: 9.5pt; color: #222; }

  .cv-skills { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6pt 18pt; }
  .cv-skill { padding-top: 5pt; border-top: .75pt solid #ccc; break-inside: avoid; }
  .cv-skill::after { display: none; }
  .cv-skill-title { margin: 0; font-size: 10.5pt; font-weight: 400; color: #111; }
  .cv-skill-desc { margin-top: 2pt; font-size: 9pt; color: #333; }

  .cv-wins { padding: 0; background: none; border: 0; }
  .cv-win { grid-template-columns: 22pt minmax(0, 1fr); padding-block: 3pt; border: 0; break-inside: avoid; }
  .cv-win:first-child { padding-top: 0; }
  .cv-win-num { font-size: 8pt; color: #a80d26; }
  .cv-win-text { max-width: none; font-size: 9.5pt; line-height: 1.45; color: #111; }

  .timeline { --date-w: 78pt; --rail: 18pt; --node: 7pt; --node-top: 2pt; }
  .timeline::before { background: #ccc; }
  /* roles may run across pages; only their header block and single bullets hold together */
  .role { grid-template-columns: var(--date-w) var(--rail) minmax(0, 1fr); padding-bottom: 10pt; break-inside: auto; page-break-inside: auto; }
  .role-company, .role-title { break-after: avoid; page-break-after: avoid; }
  .role-description p, .role-impacts li { break-inside: avoid; page-break-inside: avoid; orphans: 2; widows: 2; }
  .role:last-child { padding-bottom: 0; }
  .role::before { width: 1pt; left: calc(var(--line-x) - .5pt); background: #a80d26; opacity: .5; }
  .role:last-child::before { display: none; }
  .role-dates { grid-column: 1; grid-row: 1; text-align: right; padding-right: 6pt; font-size: 7.5pt; color: #a80d26; }
  .role-node { grid-column: 2; background: #fff; border: 1pt solid #a80d26; }
  .role-node::after { inset: 1.5pt; background: #a80d26; }
  .role.is-current .role-node::before { display: none; }
  .role-body { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
  .role-company { font-size: 8pt; color: #111; font-weight: 500; }
  .role-title { margin-top: 1pt; max-width: none; font-size: 11pt; font-weight: 400; color: #111; }
  .role-description p { max-width: none; margin-top: 3pt; font-size: 9.5pt; line-height: 1.45; color: #222; }
  .role-impact-head { display: none; }
  .role-impacts { max-width: none; margin-top: 3pt; }
  .role-impacts li { margin-top: 2pt; padding-left: 11pt; font-size: 9.5pt; line-height: 1.42; color: #222; }
  .role-impacts li::before { top: .55em; left: 1pt; width: 4pt; height: 4pt; border-color: #a80d26; }
  .role-impacts strong { color: #111; }

  .cv-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10pt 18pt; }
  .cv-block { break-inside: avoid; }
  .cv-block-head { padding-bottom: 3pt; border-bottom: .75pt solid #999; font-size: 7.5pt; color: #333; }
  .degree { padding-top: 4pt; }
  .degree-inst { font-size: 10.5pt; color: #111; }
  .degree-qual { margin-top: 1pt; font-size: 9.5pt; color: #222; }
  .degree-dates { margin-top: 1pt; font-size: 7.5pt; color: #a80d26; }
  .degree-desc { margin-top: 2pt; font-size: 9pt; color: #333; }
  .cv-list li { padding-block: 2.5pt; border-bottom: 0; font-size: 9pt; color: #222; }
  .cv-list strong { color: #111; }

}
