/* ============================================================
   FLORIAN RUMIEL: PORTFOLIO
   World: a transit network. A Foundation line splits into
   Governance and Knowledge lines that meet at the platform
   interchange, then head toward the current focus.
   ============================================================ */

/* ---------- Fonts (self-hosted Archivo, variable 400–800) ---------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  /* Ground and ink */
  --white: #FFFFFF;
  --zone: #F4F5F6;          /* era bands */
  --rule: #E3E5E8;
  --ink: #1A1A1A;
  --ink-2: #3D4148;
  --muted: #6B7078;

  /* Lines: stroke colour, text/icon colour, roundel fill */
  --f: #E8791E;  --f-ink: #B35A0C;  --f-rd: #B4520A;   /* Foundation */
  --g: #0057B8;  --g-ink: #0057B8;  --g-rd: #0057B8;   /* Governance */
  --k: #00875A;  --k-ink: #007A52;  --k-rd: #007A52;   /* Knowledge */

  /* Layout */
  --content: 1296px;
  --pad: 72px;
  --bar-h: 60px;

  /* Motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 16px);
  scrollbar-color: #C9CDD2 transparent;
  scrollbar-width: thin;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  caret-color: var(--g);
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .22em;
}
::selection { background: #CFE0F5; color: var(--ink); }
:focus-visible { outline: 3px solid var(--g); outline-offset: 3px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C9CDD2; border-radius: 10px; border: 2px solid var(--white); }
::-webkit-scrollbar-track { background: transparent; }

/* Bilingual content: both languages live in the markup; the inactive one is hidden */
html[lang="en"] [data-l="fr"],
html[lang="fr"] [data-l="en"] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ic { width: 20px; height: 20px; flex: none; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Shared container */
.bar-inner, .hero, .map, .section, .footer {
  max-width: calc(var(--content) + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- Roundels: line identifiers ---------- */
.roundel {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  color: var(--white); font-size: 13px; font-weight: 800; line-height: 1;
}
.roundel.f { background: var(--f-rd); }
.roundel.g { background: var(--g-rd); }
.roundel.k { background: var(--k-rd); }
.roundel.sm { width: 19px; height: 19px; font-size: 10.5px; }

/* ---------- Top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.bar-inner { display: flex; align-items: center; gap: 32px; height: var(--bar-h); }
.bar-name { font-weight: 800; font-size: 16px; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.bar-nav { display: flex; gap: 26px; margin-left: auto; }
.bar-nav a { font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.bar-nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--g); text-underline-offset: 8px; }
.bar-actions { display: flex; align-items: center; gap: 12px; margin-left: 8px; }

.lang { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px; }
.lang button {
  font: inherit; font-size: 13px; font-weight: 800; letter-spacing: .02em;
  border: 0; background: transparent; color: var(--ink);
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.lang button:not([aria-pressed="true"]):hover { background: var(--zone); }

.btn-cv {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--ink); color: var(--white); text-decoration: none;
  font-size: 15px; font-weight: 700; padding: 10px 18px; border-radius: 999px;
  transition: background-color .2s var(--ease-out), transform .2s var(--ease-out);
}
.btn-cv:hover { background: #000; transform: translateY(-1px); }
.btn-cv small { font-size: 12px; font-weight: 600; opacity: .75; }
.btn-cv .ic { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 40px;
  padding-top: 28px; padding-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.75rem, 1.6rem + 3.2vw, 4.25rem);
  font-weight: 800; line-height: 1; letter-spacing: -.025em;
}
.positioning { margin-top: 14px; font-size: clamp(1.125rem, 1rem + .5vw, 1.4rem); line-height: 1.35; color: var(--ink-2); max-width: 40ch; }
.positioning strong { color: var(--ink); font-weight: 700; }

.legend { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: flex-end; max-width: 560px; padding-bottom: 6px; }
.legend li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.legend-hint { color: var(--muted); }
.hint-station { width: 14px; height: 14px; border: 3px solid var(--ink); border-radius: 50%; background: var(--white); }
.transfer-dots { display: inline-flex; gap: 4px; }
.transfer-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }

/* ---------- Network map (desktop, drawn by site.js) ---------- */
.map { position: relative; }
.network { position: relative; }
.network svg { width: 100%; height: auto; overflow: visible; font-family: "Archivo", system-ui, sans-serif; }
.network .seg, .network .st, .network .rd-on-line { transition: opacity .25s var(--ease-out); }
.network.tracing .seg:not(.on),
.network.tracing .st:not(.on),
.network.tracing .rd-on-line { opacity: .18; }
.network .st { cursor: pointer; outline: none; }
.network .st-ring { opacity: 0; transition: opacity .15s var(--ease-out); }
.network .st:focus-visible .st-ring { opacity: 1; }
.network .st:hover .st-dot,
.network .st[aria-expanded="true"] .st-dot { stroke-width: 5; }
.network .st-label { font-size: 14px; font-weight: 700; fill: var(--ink); }
.network .st-label.cap { font-size: 17px; font-weight: 800; }
.network .st-label.focus { font-size: 15px; font-weight: 800; }
.network .st-caption { font-size: 12px; font-weight: 600; fill: var(--muted); }
.network .era-year { font-size: 15px; font-weight: 800; fill: var(--ink); }
.network .era-name { font-size: 12px; font-weight: 500; fill: var(--muted); }

/* Station card (opened from a station) */
.card {
  position: absolute; z-index: 20; width: 380px;
  background: var(--white); border: 1px solid #D9DCE0; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(26, 26, 26, .14), 0 2px 6px rgba(26, 26, 26, .06);
  padding: 18px 20px 18px;
  animation: card-in .22s var(--ease-out);
}
.card::after {
  content: ""; position: absolute; left: var(--ax, 50%); width: 14px; height: 14px;
  background: var(--white); border: 1px solid #D9DCE0; transform: translateX(-50%) rotate(45deg);
}
.card.above::after { bottom: -8px; border-top: 0; border-left: 0; }
.card.below::after { top: -8px; border-bottom: 0; border-right: 0; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }
.card-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; padding-right: 30px; }
.card-head .ic { width: 24px; height: 24px; }
.card-head h3 { font-size: 17px; font-weight: 800; line-height: 1.35; }
.card-when { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.card-close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 50%; color: var(--ink-2); cursor: pointer;
}
.card-close:hover { background: var(--zone); color: var(--ink); }
.card .stop-body { padding: 0; font-size: 14.5px; line-height: 1.5; }
.card .stop-ctx { font-size: 13px; }

/* ---------- Strip map (mobile, and the map's content source) ---------- */
.strip { margin-top: 8px; }
.era { position: relative; padding-left: 66px; }
.era:nth-child(odd) .era-title { background: var(--zone); }
.era-title { position: relative; font-size: 14px; font-weight: 600; color: var(--muted); padding: 18px 0 6px 10px; margin-left: -10px; border-radius: 6px; }

/* Rails: track pieces drawn per row by site.js (layoutRails), so each line
   starts, branches and ends at its real stations.
   Track centres: Foundation 15px, Governance 31px, Knowledge 47px. */
.rail { position: absolute; top: 0; bottom: 0; left: -66px; width: 56px; pointer-events: none; }
.era-title > .rail { left: -56px; }
.rail i { position: absolute; width: 6px; border-radius: 3px; }
.rail .f { left: 12px; background: var(--f); }
.rail .g { left: 28px; background: var(--g); }
.rail .k { left: 44px; background: var(--k); }
.rail .x { left: 28px; background: radial-gradient(circle, var(--ink) 2.2px, transparent 2.8px) 0 2px / 6px 13px repeat-y; }
/* Pieces overlap their neighbours by 1px so the track reads as one continuous line */
.rail .through { top: -1px; bottom: -1px; border-radius: 0; }
.rail .end { top: -1px; height: calc(var(--dy) + 1px); border-radius: 0 0 3px 3px; }
.rail .start { top: var(--dy); bottom: -1px; border-radius: 3px 3px 0 0; }
.rail .elbow { top: calc(var(--dy) - 3px); height: 6px; left: 12px; }
.rail .elbow.g { width: 22px; }
.rail .elbow.k { width: 38px; }
.era-year { font-size: 16px; font-weight: 800; color: var(--ink); margin-right: 6px; }

.stop { position: relative; }
.stop summary {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; align-items: center;
  list-style: none; cursor: pointer; padding: 10px 0;
}
.stop summary::-webkit-details-marker { display: none; }
/* Station dot sitting on its own track */
.stop summary::before {
  content: ""; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  left: calc(var(--track-x) - 8px - 66px);
  background: var(--white); border: 3.5px solid var(--ink); border-radius: 50%;
}
.stop[data-line="f"] { --track-x: 15px; }
.stop[data-line="g"] { --track-x: 31px; }
.stop[data-line="k"] { --track-x: 47px; }
.stop[data-line="x"] { --track-x: 31px; }
.stop-cap summary::before { left: calc(23px - 66px); width: 32px; height: 20px; margin-top: -10px; border-width: 4px; border-radius: 12px; }
.stop-focus summary::before { border-style: dotted; }
/* Chevron */
.stop summary::after {
  content: ""; grid-column: 3; grid-row: 1 / span 2; width: 9px; height: 9px; margin-right: 6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s var(--ease-out);
}
.stop details[open] summary::after { transform: rotate(-135deg); }
.stop-ic { grid-row: 1 / span 2; width: 24px; height: 24px; }
.stop[data-line="f"] .stop-ic { color: var(--f-ink); }
.stop[data-line="g"] .stop-ic { color: var(--g-ink); }
.stop[data-line="k"] .stop-ic { color: var(--k-ink); }
.stop-name { grid-column: 2; grid-row: 1; font-size: 17px; font-weight: 700; line-height: 1.35; }
.stop-when { grid-column: 2; grid-row: 2; font-size: 13.5px; color: var(--muted); }
.stop-body { padding: 2px 0 18px 34px; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.stop-body > * + * { margin-top: 8px; }
.stop-ctx { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.conns li { position: relative; padding-left: 18px; margin-top: 6px; }
.conns li::before {
  content: ""; position: absolute; left: 1px; top: .55em; width: 8px; height: 8px;
  border: 2px solid var(--muted); border-radius: 50%;
}
.conns strong { color: var(--ink); font-weight: 700; }
.stop-logos { display: flex; gap: 12px; margin-top: 12px; }
.stop-logos img { width: 24px; height: 24px; }

/* ---------- Sections ---------- */
.section { padding-top: 112px; }
.section h2 {
  font-size: clamp(2rem, 1.4rem + 1.6vw, 2.75rem);
  font-weight: 800; line-height: 1.1; letter-spacing: -.02em;
  margin-bottom: 32px;
}

/* Profile: the map's caption, so it sits close under the map */
.section.profile { padding-top: 48px; }
.lead { font-size: clamp(1.25rem, 1rem + .8vw, 1.6rem); line-height: 1.45; max-width: 62ch; text-wrap: pretty; }
.profile-goal { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; font-size: 17px; font-weight: 600; color: var(--ink-2); max-width: 70ch; }
.profile-goal .ic { width: 24px; height: 24px; margin-top: 1px; color: var(--ink); }

/* Experience */
.role, .education {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 40px;
  padding: 32px 0; border-top: 1px solid var(--rule);
}
.role-when { font-size: 15px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 4px; }
.role-title { font-size: 22px; font-weight: 750; line-height: 1.35; }
h4.role-title { font-size: 19px; }
.role-sub { font-weight: 500; color: var(--muted); }
.role-lines { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: 3px; }
.role-org { font-size: 16px; color: var(--muted); margin: 4px 0 12px; }
.bullets { max-width: 75ch; }
.bullets li { position: relative; padding-left: 24px; margin-top: 8px; color: var(--ink-2); }
.bullets li::before {
  content: ""; position: absolute; left: 2px; top: .5em; width: 10px; height: 10px;
  border: 2.5px solid var(--ink); border-radius: 50%; background: var(--white);
}
/* Levio sub-roles hang off a branch line */
.subroles { position: relative; margin-top: 16px; padding-left: 28px; }
.subroles::before { content: ""; position: absolute; left: 7px; top: 14px; bottom: 14px; width: 2px; background: #D5D8DC; }
.subrole { position: relative; padding: 14px 0 18px; }
.subrole::before {
  content: ""; position: absolute; left: -27px; top: 22px; width: 14px; height: 14px;
  background: var(--white); border: 3px solid var(--muted); border-radius: 50%;
}
.subrole .role-when { padding-top: 0; font-size: 14px; }

.education { align-items: start; }
.edu-title { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.edu-title .ic { width: 26px; height: 26px; color: var(--f-ink); }
.edu-degree { font-size: 19px; font-weight: 700; }

/* Skills */
.skill-lines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.skill-line h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 750; padding-bottom: 12px; border-bottom: 3px solid currentColor; }
.skill-line.g h3 { color: var(--g-ink); }
.skill-line.k h3 { color: var(--k-ink); }
.skill-line.f h3 { color: var(--f-ink); }
.skill-line li { padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 16px; color: var(--ink-2); }
.languages { margin-top: 28px; font-size: 16px; color: var(--muted); }

/* Projects */
.project {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 20px; align-items: start;
  padding: 26px 0; border-top: 1px solid var(--rule);
}
.project:last-child { border-bottom: 1px solid var(--rule); }
.project-ic { width: 30px; height: 30px; margin-top: 2px; }
.project-ic.k { color: var(--k-ink); }
.project-ic.f { color: var(--f-ink); }
.project h3 { font-size: 20px; font-weight: 750; }
.project p { margin-top: 6px; color: var(--ink-2); max-width: 70ch; }
.project-links { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 10px; }
.project-links:empty { display: none; }
.project-links a { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.project-links .ic { width: 15px; height: 15px; color: var(--muted); }
.status { font-weight: 600; color: var(--k-ink); }
.status::before { content: "· "; color: var(--muted); }
.status.muted { color: var(--muted); }

/* Contact: the close */
.contact { padding-bottom: 104px; }
.contact-mail {
  display: inline-block;
  font-size: clamp(1.6rem, .9rem + 3vw, 3.25rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
  text-decoration-thickness: 3px; text-underline-offset: 10px; text-decoration-color: var(--g);
  overflow-wrap: anywhere;
  transition: color .2s var(--ease-out);
}
.contact-mail:hover { color: var(--g); }
.contact-links { display: flex; flex-wrap: wrap; gap: 14px 32px; margin-top: 32px; }
.contact-links a { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.contact-links img, .contact-links .ic { width: 20px; height: 20px; }

/* Footer */
.footer { border-top: 1px solid var(--rule); padding-top: 26px; padding-bottom: 40px; font-size: 14px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (min-width: 1024px) {
  .js-network .strip { display: none; }
}
@media (max-width: 1023px) {
  .network { display: none !important; }
  .legend-conn { display: none !important; } /* the strip map draws no transfer dots */
}
@media (max-width: 1240px) {
  :root { --pad: 40px; }
  .bar-nav { display: none; }
  .bar-actions { margin-left: auto; }
}
@media (max-width: 1023px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .legend { justify-content: flex-start; }
  .section { padding-top: 88px; }
}
@media (max-width: 760px) {
  .role, .education { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .edu-title { margin-bottom: 4px; }
  .skill-lines { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .project { grid-template-columns: 32px minmax(0, 1fr); }
}
@media (max-width: 600px) {
  :root { --pad: 20px; --bar-h: 56px; }
  .bar-name { display: none; }
  .bar-inner { gap: 12px; }
  .bar-actions { margin-left: auto; gap: 8px; }
  .btn-cv { padding: 9px 14px; font-size: 14px; }
  .hero { padding-top: 28px; }
  .legend-hint { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
