/* =====================================================================
   Whole-career additions: journey, domains, competencies, education,
   earlier work, and the organisation map in the hero.
   Loaded after enhance.css; relies on the tokens in app.css.
   ===================================================================== */

/* ---------- Domain colours (one hue per industry) ---------- */
:root { --d-banking: #0f766e; --d-legal-tech: #6d28d9; --d-telecom: #c2410c; --d-insurance: #0369a1; }
[data-domain="banking"], [data-domain="core-banking"] { --dc: var(--d-banking); }
[data-domain="legal-tech"] { --dc: var(--d-legal-tech); }
[data-domain="telecom"] { --dc: var(--d-telecom); }
[data-domain="insurance"] { --dc: var(--d-insurance); }

/* ---------- Career journey bar ---------- */
.journey { max-width: none; }
.track { display: flex; gap: .35rem; margin-bottom: 1rem; }
.track-seg { flex-basis: 0; min-width: 4.2rem; text-align: left; border: 1px solid var(--border); border-top: 4px solid var(--dc, var(--accent)); background: var(--surface); color: var(--text); border-radius: 10px; padding: .55rem .7rem; cursor: pointer; font: inherit; display: grid; gap: .1rem; transition: background .25s ease, transform .2s ease; }
.track-seg:hover { background: var(--surface-2); }
.track-seg.is-active { background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface); border-color: var(--dc, var(--accent)); transform: translateY(-2px); }
.track-name { font-weight: 650; font-size: .88rem; line-height: 1.2; }
.track-years { font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.journey .flow-step.is-active { border-color: var(--dc, var(--accent)); }
.journey .flow-step[data-domain] .flow-layer { color: var(--dc, var(--muted)); }
.flow-at { color: var(--muted); font-weight: 400; }
.journey .flow-body { padding-left: 1rem; }
.journey .flow-body p { margin: 0 0 .6rem; }
.journey .flow-body .period { margin-bottom: .4rem; }
.journey .flow-body strong { color: var(--text); }
@media (max-width: 640px) {
  .track { flex-wrap: wrap; }
  .track-seg { flex: 1 1 calc(50% - .35rem) !important; }
}
/* the bar duplicates the list, so without JavaScript hide the bar and keep the readable list */
html:not(.reveal-ready) .track { display: none; }

/* ---------- Domain cards ---------- */
.domains { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.domain-card { border-top: 3px solid var(--dc, var(--accent)); }
.domain-card .mono-label { color: var(--dc, var(--accent)); }

/* ---------- Competencies, groups, project meta ---------- */
.comp-summary { color: var(--muted); font-style: italic; }
.card .bullets { color: var(--muted); font-size: .95rem; padding-left: 1.1rem; }
.group-title { margin: 2rem 0 .9rem; font-family: var(--mono); font-size: .8rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: .8rem; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.project-meta { margin: 0 0 .4rem; text-transform: none; letter-spacing: .02em; }

/* ---------- Education ---------- */
.edu-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.edu h3 { margin: .4rem 0 .15rem; }
.edu .edu-inst { margin: 0 0 .5rem; color: var(--text); font-weight: 600; }
.edu .edu-address { margin: 0 0 .6rem; color: var(--muted); font-size: .92rem; padding-left: 1.3rem; position: relative; }
.edu .edu-address::before { content: ""; position: absolute; left: .15rem; top: .5rem; width: .55rem; height: .55rem; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); }
.edu .edu-score { margin: 0 0 .5rem; color: var(--accent); }
.edu .edu-note { margin: 0 0 .6rem; font-size: .92rem; }

/* ---------- Earlier work ---------- */
.repo-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.repo-mini li { display: grid; gap: .05rem; padding-bottom: .7rem; border-bottom: 1px solid var(--border); }
.repo-mini li:last-child { border-bottom: 0; padding-bottom: 0; }
.repo-mini span { color: var(--muted); font-size: .88rem; }

/* ---------- Testimonials (render only when data exists) ---------- */
.quote { margin: 0; }
.quote blockquote { margin: 0 0 1rem; font-family: var(--display); font-size: 1.05rem; }
.quote figcaption { display: grid; color: var(--muted); font-size: .88rem; }
.quote figcaption strong { color: var(--text); }

/* ---------- Hero: organisation map ---------- */
.hero-diagram { max-width: min(100%, 46rem); }
.d-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.d-ring2 { fill: none; stroke: var(--accent); stroke-opacity: .25; stroke-width: 1; stroke-dasharray: 2 7; }
.d-sat { fill: var(--accent); fill-opacity: .55; }
.d-orbit { animation: orbit 90s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.d-ping { fill: none; stroke: var(--accent); stroke-opacity: 0; stroke-width: 1.2; transform-origin: 280px 280px; animation: ping 4s ease-out infinite; }
@keyframes ping { 0% { transform: scale(1); stroke-opacity: .55; } 100% { transform: scale(2.9); stroke-opacity: 0; } }
.d-packet { fill: var(--accent-2); filter: drop-shadow(0 0 4px var(--accent-2)); }
.d-name { fill: var(--text); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.d-years { fill: var(--muted); font-family: var(--mono); font-size: 9.5px; }
.d-org .d-node { transition: stroke .3s ease, fill .3s ease; }
.d-org { animation-name: orgglow; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
@keyframes orgglow {
  0%, 22%, 100% { filter: none; }
  6%, 16% { filter: drop-shadow(0 0 9px var(--accent)); }
}
.d-org:hover .d-node { stroke: var(--accent); fill: var(--accent-soft); }
@media (max-width: 899px) { .hero-diagram { max-width: 26rem; } }

/* ---------- Mobile header: keep brand, search and theme on one row ---------- */
@media (max-width: 719px) {
  .brand-role { display: none; }
}

/* ---------- CV page details ---------- */
.cv-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.cv .meta { margin: 0; }
.cv p { margin: 0 0 .5rem; }
.cv .cv-client { color: var(--muted); font-size: .92rem; margin: 0 0 .25rem; }
.cv .cv-summary { margin: 0 0 .4rem; }
.cv .cv-stack { font-size: .9rem; color: var(--muted); }
.cv .cv-edu { margin-bottom: .8rem; }
.cv .period { font-family: var(--mono); font-size: .8rem; margin: 0; }
@media print {
  .cv { font-size: 10pt; line-height: 1.4; }
  .cv .cv-client, .cv .cv-stack { color: #333; }
  .cv h1 { font-size: 20pt; }
  .cv .bullets { margin-bottom: .4rem; }
  .cv-edu { break-inside: avoid; }
}

/* ---------- Project diagrams: one bespoke layout per project ---------- */
:root { --bad: #dc2626; --good: #16a34a; }
.case-head { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 960px) { .case-head { grid-template-columns: .9fr 1.1fr; } }
.project-diagram { width: 100%; max-width: min(100%, 46rem); height: auto; justify-self: center; }
.case-head-text .tags { margin-bottom: 0; }
.pd { overflow: visible; }

.pd .pd-t { font: 600 12.5px var(--font); fill: var(--text); }
.pd .pd-big { font-size: 15px; }
.pd .pd-sub { font: 500 10.5px var(--font); fill: var(--muted); }
.pd .pd-mono { font: 500 10px var(--mono); letter-spacing: .12em; fill: var(--muted); }
.pd .pd-warn-t { font: 600 10.5px var(--font); fill: var(--bad); }

.pd .pd-node rect, .pd .pd-node path, .pd .pd-node ellipse, .pd .pd-node polygon, .pd .pd-node circle { fill: var(--surface); stroke: var(--border); stroke-width: 1.4; }
.pd .pd-node.accent rect, .pd .pd-node.accent polygon, .pd .pd-node.accent path, .pd .pd-node.accent ellipse { stroke: var(--accent); fill: var(--accent-soft); }
.pd .pd-node.dashed rect { stroke-dasharray: 5 4; fill: transparent; }
.pd .pd-node.warnbox rect { stroke: var(--bad); stroke-opacity: .6; }
.pd .pd-db path, .pd .pd-db ellipse { stroke: var(--accent); }
.pd .pd-frame { fill: var(--accent-soft); fill-opacity: .35; stroke: var(--border); stroke-dasharray: 3 5; }
.pd .pd-card { fill: var(--surface); stroke: var(--border); stroke-width: 1.4; }
.pd .pd-rail { fill: var(--accent-soft); stroke: var(--accent); stroke-opacity: .5; }

.pd .pd-line { fill: none; stroke: var(--accent); stroke-opacity: .65; stroke-width: 1.6; }
.pd .pd-line.pd-dash { stroke-dasharray: 4 4; }
.pd .pd-line.warn { stroke: var(--bad); stroke-opacity: .8; stroke-dasharray: 5 4; }
.pd .pd-ah { fill: var(--accent); }
.pd .pd-aw { fill: var(--bad); }
.pd .d-packet { fill: var(--accent-2); filter: drop-shadow(0 0 3px var(--accent-2)); }
.pd .d-packet.warn { fill: var(--bad); filter: drop-shadow(0 0 3px var(--bad)); }
.pd .pd-docp { fill: var(--accent); stroke: var(--surface); stroke-width: 1; }

.pd .pd-badge circle { fill: var(--accent); }
.pd .pd-badge text { font: 700 10.5px var(--font); fill: var(--accent-contrast); }
.pd .pd-legend-dot { fill: var(--bad); }

/* clock, gear, waves, ticks */
.pd .pd-clock .pd-tickmark { stroke: var(--muted); stroke-width: 1.4; }
.pd .pd-hand { stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; animation: pd-spin 6s linear infinite; }
.pd .pd-clock .pd-hub-dot { fill: var(--accent); stroke: none; }
.pd .pd-gear path { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.6; animation: pd-spin 9s linear infinite; }
.pd .pd-gear circle { fill: var(--bg); stroke: var(--accent); stroke-width: 1.4; }
@keyframes pd-spin { to { transform: rotate(360deg); } }
.pd .pd-wave { fill: none; stroke: var(--accent); stroke-opacity: .75; stroke-width: 2; stroke-dasharray: 6 6; animation: pd-flow 1.2s linear infinite; }
.pd .pd-wave.rev { stroke: var(--accent-2); animation-direction: reverse; }
@keyframes pd-flow { to { stroke-dashoffset: -12; } }

/* checklist ticks (student remittance) */
.pd .pd-check { fill: var(--bg); stroke: var(--border); stroke-width: 1.4; }
.pd .pd-tick { fill: none; stroke: var(--good); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 26; stroke-dashoffset: 26; animation: pd-draw 9.5s ease-out infinite; }
@keyframes pd-draw { 0% { stroke-dashoffset: 26; opacity: 1; } 8% { stroke-dashoffset: 0; } 88% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.pd .pd-folder rect { stroke-width: 1.6; }

/* rejected request at the gate */
.pd .pd-x line { stroke: var(--bad); stroke-width: 2.6; stroke-linecap: round; opacity: 0; animation: pd-blink 7s ease-out infinite; }
@keyframes pd-blink { 0% { opacity: 0; } 4% { opacity: 1; } 32% { opacity: 1; } 40%, 100% { opacity: 0; } }

/* RPA track and bot */
.pd .pd-track { fill: none; stroke: var(--border); stroke-width: 16; stroke-linejoin: round; }
.pd .pd-track-mid { fill: none; stroke: var(--accent); stroke-opacity: .5; stroke-width: 1.4; stroke-dasharray: 3 7; }
.pd .pd-station { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.pd .pd-bot { fill: var(--accent); stroke: none; }
.pd .pd-eye { fill: var(--accent-contrast); stroke: none; }

/* test-driven ring */
.pd .pd-ring { fill: none; stroke: var(--border); stroke-width: 1.6; stroke-dasharray: 3 5; }
.pd .pd-dot { stroke: var(--surface); stroke-width: 2; }
.pd .pd-dot.red { fill: var(--bad); }
.pd .pd-dot.green { fill: var(--good); }
.pd .pd-dot.refactor { fill: var(--accent-2); }

/* ---------- Card thumbnails: the same diagram at card size ---------- */
.card-diagram { display: block; width: calc(100% + 2.5rem); margin: -1.25rem -1.25rem 1rem; border-bottom: 1px solid var(--border); background: radial-gradient(70% 90% at 50% 50%, var(--accent-soft), transparent 80%), var(--bg); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; padding: .5rem .75rem; }
.mini-diagram { display: block; width: 100%; height: auto; aspect-ratio: 560 / 350; }
.mini-diagram .pd-t { font-weight: 700; }

/* ---------- Reduced motion and print: static diagram, no packets ---------- */
@media (prefers-reduced-motion: reduce) {
  .d-orbit, .d-ping, .d-org { animation: none; }
  .d-packet, .d-ping { display: none; }
  .track-seg { transition: none; }
}
@media print { .hero-diagram { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .pd .pd-hand, .pd .pd-gear path, .pd .pd-wave, .pd .pd-x line { animation: none; }
  .pd .pd-x line { opacity: 1; }
  .pd .pd-tick { animation: none; stroke-dashoffset: 0; }
  .pd .d-packet, .pd .pd-docp, .pd .pd-botg { display: none; }
}
