/* ═══════════════════════════════════════════
   FONTS — Space Mono (self-hosted)
   Latin + latin-ext subsets with the same unicode-range as Google Fonts:
   the browser only downloads the files it actually needs.
═══════════════════════════════════════════ */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/space-mono-400-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: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/space-mono-400-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/space-mono-700-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: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/space-mono-700-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/space-mono-400italic-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: 'Space Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/space-mono-400italic-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ═══════════════════════════════════════════
   SCROLL PROGRESS BAR
═══════════════════════════════════════════ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 300;
  transition: width .1s linear;
  border-radius: 0 2px 2px 0;
}

/* ═══════════════════════════════════════════
   LANG TOGGLE
═══════════════════════════════════════════ */
/* Shared styles between theme-toggle and lang-toggle */
.header-btn {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  height: 28px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-size: 11px;
  transition: box-shadow .15s;
}

.header-btn:hover {
  box-shadow: var(--shadow-lg);
}

.theme-toggle {
  justify-content: center;
  color: var(--muted);
  transition: box-shadow .15s, color .15s;
}

.theme-toggle svg {
  width: 13px;
  height: 13px;
}

.theme-toggle:hover {
  color: var(--text);
}

.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }

[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}


.lang-toggle {
  gap: 6px;
  font-family: inherit;
  letter-spacing: 1px;
}

.lang-toggle [data-lang] {
  color: var(--muted);
  transition: color .15s;
}

.lang-toggle [data-lang].active {
  color: var(--text);
  font-weight: 700;
}

.lang-sep {
  color: var(--border);
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Theme ────────────────────────────────────────────────────────────────
   Every value is declared ONCE with light-dark(); which half applies is driven
   by `color-scheme` — the OS preference by default, forced by the [data-theme]
   attribute the theme toggle writes on <html>. That also keeps native UI
   (scrollbars, form controls, the canvas before CSS paints) in step with the
   theme, which <meta name="color-scheme"> alone can't do for the override. */
:root {
  color-scheme: light dark;

  --bg:          light-dark(#f0e6dc, #332c24);
  --bg-alt:      light-dark(#ede0d4, #3a3229);
  --card:        light-dark(#faf5f0, #41382e);
  --card-hover:  light-dark(#ffffff, #493e35);
  --border:      light-dark(rgba(0,0,0,.08), rgba(255,255,255,.08));
  --text:        light-dark(#1c1712, #f0e6dc);
  --muted:       light-dark(#6b5f55, #b3a89e);   /* ≥ 4.5:1 on bg and card (WCAG AA) */
  --accent:      light-dark(#b85c38, #c96840);   /* decorative only (lines, dots, backgrounds) */
  --accent-text: light-dark(#9d4a28, #e29565);   /* accent-colored text — ≥ 4.5:1 on bg/card */
  --accent-btn:  light-dark(#b85c38, #a34e2e);   /* button background with white text — ≥ 4.5:1 */
  --accent-dark: light-dark(#a34e2e, #8f4426);
  --accent-soft: light-dark(rgba(184,92,56,.12), rgba(201,104,64,.15));
  /* Contract badge text colors — lightened in dark mode for contrast */
  --badge-green:  light-dark(#3d7a52, #82c79a);
  --badge-blue:   light-dark(#3260a0, #8fb6e8);
  --badge-ochre:  light-dark(#8f6428, #d4a35e);
  --badge-purple: light-dark(#5b50a0, #ada3e0);
  --tag-bg:     light-dark(rgba(0,0,0,.06), rgba(255,255,255,.06));
  --tag-border: light-dark(rgba(0,0,0,.1),  rgba(255,255,255,.1));
  --tag-text:   light-dark(#4a3f38, #c5b8ae);
  --shadow:     0 2px 12px light-dark(rgba(0,0,0,.06), rgba(0,0,0,.30));
  --shadow-lg:  0 8px 32px light-dark(rgba(0,0,0,.10), rgba(0,0,0,.50));

  --radius:    14px;
  --radius-sm: 8px;
  --font:      'Space Mono', 'Courier New', monospace;
  --max-w:     860px;

  /* Colourise filter applied to monochrome skill icons. A filter chain isn't a
     colour, so light-dark() can't express it — hence the real overrides below,
     the only theme value still declared twice. */
  --icon-filter: invert(26%) sepia(9%) saturate(600%) hue-rotate(340deg) brightness(88%) contrast(92%);
}

/* Manual override from the theme toggle — flips every light-dark() at once */
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"]  { color-scheme: dark; }

[data-theme="dark"] {
  --icon-filter: invert(85%) sepia(10%) saturate(300%) hue-rotate(340deg) brightness(100%) contrast(90%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --icon-filter: invert(85%) sepia(10%) saturate(300%) hue-rotate(340deg) brightness(100%) contrast(90%);
  }
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Skip link — visible only on keyboard focus (WCAG 2.4.1 bypass blocks) */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10001; /* above terminal overlay (10000) and cookie banner (9999) */
  padding: 8px 14px;
  background: var(--accent-btn);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform .2s ease;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Skip-link target: focus lands on <main> but we don't ring the whole region */
main[tabindex="-1"]:focus { outline: none; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(circle, var(--accent-soft) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
header, main, footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */

/* Hero entrance animation */
[data-anim] {
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeUp 0.45s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 60ms);
}

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-anim] {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

header {
  padding-top: 56px;
  padding-bottom: 8px;
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--card);
  box-shadow: var(--shadow-lg);
  display: block;
}

.avatar-fallback {
  display: none;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

/* Status dot — <button> for keyboard/screen-reader access */
.avatar-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 26px;
  height: 26px;
  padding: 0;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 50%;
  border: 3px solid var(--bg);
  cursor: default;
  z-index: 2;
}

.avatar-status:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Colors per status */
.avatar-status[data-status="available"]   { background: #3db85a; }
.avatar-status[data-status="open"]        { background: #f0a030; }
.avatar-status[data-status="unavailable"] { background: #a0a0a0; }

/* Icon: available → checkmark */
.avatar-status[data-status="available"]::after {
  content: '';
  position: absolute;
  top: 43%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 5px;
  height: 9px;
  border-right: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
}

/* Icon: open → hollow circle */
.avatar-status[data-status="open"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2.5px solid #fff;
}

/* Icon: unavailable → dash */
.avatar-status[data-status="unavailable"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 11px;
  border-bottom: 2.5px solid #fff;
}

.avatar-status__tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  white-space: nowrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px 6px 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.avatar-status:hover .avatar-status__tooltip,
.avatar-status:focus-visible .avatar-status__tooltip,
.avatar-status__tooltip.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

@media (hover: none) {
  .avatar-status { cursor: pointer; }
}

/* Show only the label matching current status */
.avatar-status__label { display: none; }
.avatar-status[data-status="available"]   .avatar-status__label[data-for="available"]   { display: inline; }
.avatar-status[data-status="open"]        .avatar-status__label[data-for="open"]        { display: inline; }
.avatar-status[data-status="unavailable"] .avatar-status__label[data-for="unavailable"] { display: inline; }

.avatar-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar-status[data-status="available"]   .avatar-status__dot { background: #3db85a; }
.avatar-status[data-status="open"]        .avatar-status__dot { background: #f0a030; }
.avatar-status[data-status="unavailable"] .avatar-status__dot { background: #a0a0a0; }

header h1 {
  font-size: clamp(20px, 4.5vw, 26px);
  font-weight: 700;
  letter-spacing: -.5px;
  margin-top: 4px;
}

.hero-subtitle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-role {
  color: var(--accent-text);
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.hero-loc {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}


/* Social icons */
.socials {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}

.socials a svg {
  width: 18px;
  height: 18px;
}

.socials a:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ═══════════════════════════════════════════
   HERO ACTIONS
═══════════════════════════════════════════ */
.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  text-decoration: none;
  transition: background .15s, color .15s, box-shadow .15s, transform .15s;
  white-space: nowrap;
}

.btn-split {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}

.btn-split:has(:hover) {
  box-shadow: var(--shadow-lg);
}

.btn-split__part {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--muted);
  white-space: nowrap;
  transition: background .15s, color .15s, transform .15s;
}

.btn-split__part:hover {
  background: var(--card);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-split__div {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}


.btn--accent {
  background: var(--accent-btn);
  border: 1px solid transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(184,92,56,.25);
}

.btn--accent:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(184,92,56,.35);
}

/* ═══════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════ */
.section {
  scroll-margin-top: 52px;
  margin-top: 52px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: clamp(9.5px, 2.2vw, 11px);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════════
   ABOUT
═══════════════════════════════════════════ */
.about-stats {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
}

.about-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 8px;
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* ── Diagonal pattern — only its opacity is toggled on hover. The scroll
   animation runs continuously (it's invisible at opacity 0), so the pattern
   keeps moving while it fades out on mouse-leave instead of freezing mid-fade.
   Two offset layers of the same tile, so each stat declares its glyph once in
   --stat-glyph and this rule stacks it twice. */
.about-stat::before {
  content: '';
  position: absolute;
  inset: -40%;
  background-image: var(--stat-glyph), var(--stat-glyph);
  background-repeat: repeat;
  background-size: 90px 90px;
  background-position: 0 0, 45px 45px;
  transform: rotate(-20deg);
  opacity: 0;
  transition: opacity .5s ease;
  animation: stat-scroll 4s linear infinite;
  pointer-events: none;
}

.about-stat:hover::before {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .about-stat::before {
    animation: none;
  }
}

@keyframes stat-scroll {
  from { background-position: 0 0,       45px 45px; }
  to   { background-position: 90px 90px, 135px 135px; }
}

/* hourglass — experience */
.about-stat[data-stat="exp"] {
  --stat-glyph: url("data:image/svg+xml,\
%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 90' fill='none'\
 stroke='%23c96840' stroke-opacity='0.22' stroke-width='1.4'\
 stroke-linecap='round' stroke-linejoin='round'%3E\
%3Cg transform='translate(19,19)'%3E\
%3Cpath d='M15,15 L37,15 C37,21 29,25 26,26 C23,27 15,31 15,37 L37,37 C37,31 29,27 26,26 C23,25 15,21 15,15 Z'/%3E\
%3Cline x1='13' y1='15' x2='39' y2='15'/%3E\
%3Cline x1='13' y1='37' x2='39' y2='37'/%3E\
%3C/g%3E%3C/svg%3E");
}

/* briefcase — industry sectors */
.about-stat[data-stat="sectors"] {
  --stat-glyph: url("data:image/svg+xml,\
%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 90' fill='none'\
 stroke='%23c96840' stroke-opacity='0.22' stroke-width='1.4'\
 stroke-linecap='round' stroke-linejoin='round'%3E\
%3Cg transform='translate(19,19)'%3E\
%3Crect x='13' y='22' width='26' height='18' rx='2'/%3E\
%3Cpath d='M20,22 L20,18 Q20,15 23,15 L29,15 Q32,15 32,18 L32,22'/%3E\
%3Cline x1='13' y1='30' x2='39' y2='30'/%3E\
%3Crect x='24' y='28' width='5' height='4' rx='1'/%3E\
%3C/g%3E%3C/svg%3E");
}

/* pipe — pipelines */
.about-stat[data-stat="pipelines"] {
  --stat-glyph: url("data:image/svg+xml,\
%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 90' fill='none'\
 stroke='%23c96840' stroke-opacity='0.22' stroke-width='1.4'\
 stroke-linecap='round' stroke-linejoin='round'%3E\
%3Cg transform='translate(19,19)'%3E\
%3Cline x1='13' y1='21' x2='39' y2='21'/%3E\
%3Cline x1='13' y1='31' x2='39' y2='31'/%3E\
%3Crect x='7' y='16' width='6' height='20'/%3E\
%3Crect x='39' y='16' width='6' height='20'/%3E\
%3C/g%3E%3C/svg%3E");
}

.about-stat:last-child {
  border-right: none;
}

.about-stat__num {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  position: relative;
  transition: transform .3s ease;
}

.about-stat:hover .about-stat__num {
  transform: scale(1.08);
}

.about-stat__label {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.3px;
  margin-top: 1px;
  position: relative;
}

.about-body {
  position: relative;
  max-height: 90px;
  overflow: hidden;
  transition: max-height .4s ease;
}
.about-body.expanded {
  max-height: 2000px;
}
.about-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--card));
  pointer-events: none;
  transition: opacity .3s;
}
.about-body.expanded .about-fade {
  opacity: 0;
}
.about-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-text);
  opacity: 0.8;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: opacity .15s;
}
.about-toggle:hover {
  opacity: 1;
}
.about-toggle__chevron {
  transition: transform .3s ease;
  flex-shrink: 0;
}
.about-toggle.expanded .about-toggle__chevron {
  transform: rotate(180deg);
}
.about-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 16px;
  /* left-aligned: justified monospace creates large rivers between words */
  text-align: left;
}

/* ═══════════════════════════════════════════
   TIMELINE
═══════════════════════════════════════════ */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 72px 28px 1fr;
  gap: 0 8px;
  padding-bottom: 28px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* ── Date column ── */
.timeline-period {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: 2px;
  gap: 1px;
}

.tl-start {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  line-height: 1.3;
}

.tl-end {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  line-height: 1.3;
}


/* ── Track column (dot + line) ── */
.timeline-track {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-marker {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1.5px var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
  z-index: 1;
}

/* ── "Current position" marker (Google Maps style) ── */
.timeline-marker--current {
  position: relative;
}

.timeline-marker--current::before,
.timeline-marker--current::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: locPulse 2.4s ease-out infinite;
}

.timeline-marker--current::after {
  animation-delay: 1.2s;
}

@keyframes locPulse {
  0%   { transform: scale(1);   opacity: 0.45; }
  100% { transform: scale(2.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-marker--current::before,
  .timeline-marker--current::after { animation: none; }
}

/* ── Continuous line for Experience & Education ── */
#experience .timeline,
#education .timeline {
  position: relative;
}

#experience .timeline::before,
#education .timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--accent) 6%,
    var(--accent) 94%,
    transparent 100%
  );
  pointer-events: none;
}

/* left = col-date + gap + half-dot-width (13.25px = 14px - 0.75px to center the 1.5px line) */
#experience .timeline::before { left: calc(72px + 8px + 13.25px); }
#education .timeline::before  { left: calc(44px + 8px + 13.25px); }

#education .timeline-item {
  grid-template-columns: 44px 28px 1fr;
}

#education .timeline-content > p:not(.timeline-meta) {
  font-size: 11px;
  color: var(--muted);
}

/* ── Timeline group ── */
.timeline-group {
  display: contents;
}

/* Tighten the space between the group header and sub-items */
.timeline-group__header {
  padding-top: 14px;
  padding-bottom: 5px;
}

/* Align the dot to the optical center of the company name (15.5 px/800) */
.timeline-group__header .timeline-marker {
  margin-top: 5px;
}


.timeline-group__duration {
  font-size: 11px;
  color: var(--muted);
}

.timeline-group__header .timeline-header { gap: 12px; }

/* Global track center = 93 px in .timeline */
.timeline-group__items {
  position: relative;
  margin-left: 108px;
  padding-left: 10px;
  margin-bottom: 64px;   /* spacing between groups */
  display: flex;
  flex-direction: column;
}

/* No bottom margin on the last group */
.timeline-group__items:last-child {
  margin-bottom: 0;
}

.timeline-subitem {
  position: relative;
  padding-bottom: 18px;
}

.timeline-subitem:last-child {
  padding-bottom: 4px;
}

/* More space between the branch line and text for multi-role groups */
.timeline-group--multi .timeline-group__items {
  padding-left: 34px;
}

/* ─── Git-style branch : multi-position groups only ─────────────────────── */

/* "]"-shaped branch line: forks at the 1st title, merges at the last */
.timeline-group--multi .timeline-group__items::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 0;               /* fork at the exact level of the first job title */
  bottom: 2px;
  width: 31px;
  border-right:  1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-top:    1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-top-right-radius:    8px;
  border-bottom-right-radius: 8px;
}

/* Small circle centered on the branch line */
.timeline-group--multi .timeline-subitem::after {
  content: '';
  position: absolute;
  left: -21.75px; /* visual center of border-right = 16.25px from groupItems, minus half-diameter (4px) */
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 20%, var(--bg-alt));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  box-sizing: border-box;
}

/* First dot: shift down slightly to avoid the corner */
.timeline-group--multi .timeline-subitem:first-child::after {
  top: 10px;
}

/* ── Content column ── */
.timeline-content {
  min-width: 0;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.timeline-header .contract-badge {
  margin-left: 6px;
}

.timeline-header h3 {
  font-size: clamp(11px, 2.5vw, 13px);
  font-weight: 600;
}

.company {
  font-size: 11.5px;
  color: var(--accent-text);
}

/* Modifier: company name inside a group (must come after .company) */
.company--group {
  font-size: clamp(11px, 2.5vw, 13px);
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* Company names that link to the company website */
a.company:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.client-link {
  display: block;
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 4px;
}
.client-link:hover { color: var(--accent-text); text-decoration: underline; }

.date-short { display: none; }

.contract-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 500;
  font-style: normal;
  padding: 1px 6px;
  border-radius: 3px;
  border-left: 2px solid currentColor;
  white-space: nowrap;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.contract-badge--permanent {
  background: rgba(74, 124, 89, .08);
  color: var(--badge-green);
}

.contract-badge--alternance {
  background: rgba(61, 107, 163, .08);
  color: var(--badge-blue);
}

.contract-badge--stage {
  background: rgba(143, 100, 40, .08);
  color: var(--badge-ochre);
}

.contract-badge--perso {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.contract-badge--academic {
  background: rgba(91, 80, 160, .10);
  color: var(--badge-purple);
}

.contract-badge--pro {
  background: rgba(74, 124, 89, .08);
  color: var(--badge-green);
}

/* ── Pinned card: add data-pinned on .project-card to activate ── */
.project-card[data-pinned] {
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.project-card[data-pinned] .project-header::after {
  content: '★';
  margin-left: auto;
  color: var(--accent);
  opacity: 0.55;
  font-size: 22px;
  line-height: 1;
}


.timeline-meta {
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.timeline-desc {
  font-size: 12px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 8px;
  text-align: justify;
}

/* Shared text-toggle buttons: experience tasks, project "read more",
   and "show more projects". Common look here; per-button deltas below. */
.tasks-toggle,
.projects-more__btn,
.project-readmore {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--accent-text);
  opacity: 0.8;
  cursor: pointer;
  transition: opacity .15s;
}
.tasks-toggle:hover,
.projects-more__btn:hover,
.project-readmore:hover { opacity: 1; }

.tasks-toggle__chevron,
.projects-more__chevron,
.project-readmore__chevron {
  flex-shrink: 0;
  transition: transform .3s ease;
}
.tasks-toggle.expanded .tasks-toggle__chevron,
.projects-more__btn.expanded .projects-more__chevron,
.project-readmore.expanded .project-readmore__chevron { transform: rotate(180deg); }

.tasks-toggle { margin-bottom: 6px; }

.timeline-content ul {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 0;
  overflow: hidden;
  padding: 0;
  margin-bottom: 0;
  transition: max-height .35s ease, margin-bottom .35s ease;
}
.timeline-content ul.expanded {
  max-height: 300px;
  padding: 2px 0;
  margin-bottom: 8px;
}

.timeline-content ul li {
  font-size: 12px;
  color: var(--muted);
  padding-left: 12px;
  position: relative;
  line-height: 1.6;
}

.timeline-content ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: color-mix(in srgb, var(--text) 45%, transparent);
  font-size: 11px;
}

/* ═══════════════════════════════════════════
   TAGS
═══════════════════════════════════════════ */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 8px;
}
.project-card .tags { margin-top: 16px; margin-bottom: 0; }

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════
   PROJECTS
═══════════════════════════════════════════ */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Projects beyond the 3 most recent live in a collapsible wrapper.
   Smoothly expands/collapses by animating its height (grid-template-rows
   0fr→1fr) together with opacity — no layout jump. */
.projects-extra {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  /* visibility:hidden keeps the collapsed cards out of the tab order / a11y tree;
     its change is delayed until the height+fade finish so focus stays reachable
     during the collapse animation (WCAG 2.4.3). */
  visibility: hidden;
  transition: grid-template-rows .45s ease, opacity .4s ease, visibility 0s .45s;
}

.projects-extra__inner {
  overflow: hidden;
  min-height: 0;
}

.projects-extra__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
}

#projects.show-all .projects-extra {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows .45s ease, opacity .4s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .projects-extra,
  .projects-more__chevron { transition: none; }
}

.projects-more {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.projects-more__btn { gap: 5px; opacity: 0.7; }

.project-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: background .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
  scroll-margin-top: 60px; /* clear the sticky nav when deep-linked (#project-…) */
}

/* Deep-linked card: subtle accent ring so the visitor spots it */
.project-card:target {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}



.project-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  opacity: 0;
  transition: opacity .25s;
  z-index: 2;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 45%);
  mask-image: linear-gradient(to right, transparent 0%, black 45%);
  background: linear-gradient(to right,
    light-dark(rgba(250,245,240,0),    rgba(53,44,34,0))    0%,
    light-dark(rgba(250,245,240,0.55), rgba(53,44,34,0.55)) 45%);
}

.overlay-github {
  position: absolute;
  right: 52px;
}

.overlay-arrow {
  position: absolute;
  right: 18px;
  opacity: 0.85;
}

.project-overlay:hover {
  opacity: 1;
}

/* Private project: overlay is shown on hover but not clickable.
   Muted GitHub mark + lock icon signal that the code isn't available. */
.project-overlay--private {
  cursor: not-allowed;
}

.project-overlay--private:hover {
  opacity: 0.9;
}

.project-overlay--private .overlay-github {
  opacity: 0.5;
}

.project-overlay--private .overlay-lock {
  right: 16px;
  opacity: 0.9;
}

/* Overlay link: also visible on keyboard focus (WCAG 2.4.7) */
.project-overlay:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.project-header {
  margin-bottom: 4px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.project-header h3 {
  font-size: 13px;
  font-weight: 700;
}

.project-title-sub {
  display: block;
  font-size: 0.82em;
  font-weight: 500;
  opacity: 0.6;
  margin-top: 2px;
}

.project-header h3 .contract-badge {
  margin-left: 10px;
  vertical-align: middle;
}

.project-header h3 > span:first-child {
  vertical-align: middle;
}

.project-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.project-card > p:not(.project-meta) {
  font-size: 12.5px;
  line-height: 1.6;
}

.project-desc {
  margin-top: 6px;
}

.project-desc-body {
  position: relative;
  max-height: 58px;
  overflow: hidden;
  transition: max-height .4s ease;
}

.project-desc-body.expanded {
  max-height: 600px;
}

.project-desc-body p {
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 8px;
  text-align: justify;
}

.project-desc-body p:last-of-type {
  margin-bottom: 0;
}

.project-desc-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(to bottom, transparent, var(--bg-alt));
  pointer-events: none;
  transition: opacity .3s;
}

.project-desc-body.expanded .project-desc-fade {
  opacity: 0;
}

.project-desc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}


/* ═══════════════════════════════════════════
   MISC
═══════════════════════════════════════════ */
.misc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.misc-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.misc-emoji {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.misc-card strong {
  font-size: 13px;
  display: block;
  margin-bottom: 2px;
}

.misc-card p {
  font-size: 12px;
  color: var(--muted);
}

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
footer {
  padding: 0 20px 40px;
  color: var(--muted);
  font-size: 12px;
}

.footer-inner {
  padding-top: 52px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-tagline {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.footer-socials a {
  color: var(--muted);
  transition: color .15s, transform .15s;
  display: flex;
}

.footer-socials a:hover {
  color: var(--text);
  transform: translateY(-2px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 11px;
  color: var(--muted);
}

footer a:not(.back-to-top) {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a:not(.back-to-top):hover {
  color: var(--text);
}

.back-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 16px;
  text-decoration: none;
  transition: background .15s, transform .15s;
  box-shadow: var(--shadow);
}

.back-to-top:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  color: var(--text);
}

.footer-bottom__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ═══════════════════════════════════════════
   TERMINAL (easter egg)
═══════════════════════════════════════════ */
/* Discoverable easter egg: a live shell prompt cursor after the footer
   tagline. The blink draws a curious eye; muted at rest, accent on hover. */
.terminal-cue {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin-left: 8px;
  padding: 0 2px;
  background: none;
  border: none;
  vertical-align: baseline;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  opacity: .5;
  cursor: pointer;
  transition: color .2s, opacity .2s;
}

.terminal-cue:hover,
.terminal-cue:focus-visible {
  opacity: 1;
  color: var(--accent);
  outline: none;
}

.terminal-cue__cursor {
  display: inline-block;
  width: .5em;
  height: 1em;
  background: currentColor;
  animation: termCueBlink 1.1s steps(1) infinite;
}

@keyframes termCueBlink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-cue__cursor { animation: none; }
}

/* Dimmed + blurred backdrop, terminal centered */
/* display:flex below would override the UA [hidden] rule — restore it */
.terminal-overlay[hidden] {
  display: none;
}

.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000; /* above the cookie banner (9999); v16 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Window follows the site theme via the shared CSS variables */
.terminal {
  width: min(640px, 100%);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  font-size: 12.5px;
  line-height: 1.55;
  animation: terminalIn .18s ease-out;
  transition: width .2s ease;
}

.terminal--max {
  width: min(960px, 100%);
}

.terminal--max .terminal__body {
  height: min(70vh, 640px);
}

@keyframes terminalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

@keyframes terminalOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(12px) scale(.98); }
}

@keyframes overlayOut {
  to { opacity: 0; }
}

.terminal-overlay--closing {
  animation: overlayOut .18s ease-in forwards;
  pointer-events: none;
}

.terminal-overlay--closing .terminal {
  animation: terminalOut .18s ease-in forwards;
}

@media (prefers-reduced-motion: reduce) {
  .terminal { animation: none; transition: none; }
  .terminal-overlay--closing { animation: none; }
  .terminal-overlay--closing .terminal { animation: none; }
}

/* Minimized: backdrop gone, page usable, window docked bottom-right */
.terminal-overlay--min {
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}

.terminal-overlay--min .terminal {
  pointer-events: auto;
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: min(300px, calc(100vw - 32px));
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  animation: terminalDock .18s ease-out;
  transition: transform .16s ease, box-shadow .16s ease;
}

.terminal-overlay--min .terminal:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(0,0,0,.34);
}

@keyframes terminalDock {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-overlay--min .terminal { animation: none; transition: none; }
}

.terminal-overlay--min .terminal__body { display: none; }

/* Compact bar when docked: no centering margin, restore hint on the right */
.terminal-overlay--min .terminal__bar { cursor: pointer; }
.terminal-overlay--min .terminal__title { margin-right: 8px; }
.terminal-overlay--min .terminal__min-hint { display: inline-flex; }

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
}

.terminal--dragging .terminal__bar { cursor: grabbing; }

/* macOS window buttons — real controls: close / minimize / zoom */
.terminal__dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.terminal__dot--close { background: #f4655a; }
.terminal__dot--min   { background: #f5bd4f; }
.terminal__dot--max   { background: #61c455; }

/* Glyphs appear when hovering the dots, like on macOS */
.terminal__dot::before {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: rgba(0,0,0,.55);
  opacity: 0;
  transition: opacity .1s;
}

.terminal__dot--close::before { content: '×'; }
.terminal__dot--min::before   { content: '−'; }
.terminal__dot--max::before   { content: '+'; }

.terminal__bar:hover .terminal__dot::before,
.terminal__dot:focus-visible::before {
  opacity: 1;
}

.terminal__title {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* keep the title optically centered despite the 3 dots on the left */
  margin-right: 52px;
}

/* Restore affordance — only visible when the window is docked/minimized */
.terminal__min-hint {
  display: none;
  align-items: center;
  flex-shrink: 0;
  color: var(--muted);
  transition: color .16s ease;
}

.terminal-overlay--min .terminal:hover .terminal__min-hint {
  color: var(--accent);
}

.terminal__body {
  height: min(340px, 55vh);
  overflow-y: auto;
  padding: 10px 12px;
  overscroll-behavior: contain;
}

.terminal__line {
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal__line--error { color: #d9544d; }
.terminal__line--muted { color: var(--muted); }

.terminal__prompt {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

/* oh-my-zsh "robbyrussell" prompt: green arrow, cyan path.
   Tones chosen to stay legible on both the light and dark terminal cards. */
.terminal__ps1 {
  font-weight: 700;
  white-space: nowrap;
}

.terminal__ps1 .t-arrow { color: #4e9a3d; }
.terminal__ps1 .t-path  { color: #2f8fb0; }

.terminal__prompt input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  caret-color: var(--accent);
  padding: 0;
}

/* Mobile: bump to 16px so iOS Safari doesn't auto-zoom when the input gains
   focus (it zooms any focused field under 16px, which shifts the layout). */
@media (max-width: 540px) {
  .terminal { font-size: 16px; }
}

/* ═══════════════════════════════════════════
   STICKY NAV
═══════════════════════════════════════════ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease;
}

.site-nav.visible {
  background: var(--bg); /* fallback: browsers without color-mix() */
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

/* Buttons — absolutely positioned so nav-links center across the full width */
.lang-toggle-wrap {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 16px;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: 8px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.site-nav.visible .nav-links {
  opacity: 1;
  pointer-events: auto;
}

.nav-links a {
  font-size: 11px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--card);
}

/* ═══════════════════════════════════════════
   SCROLL REVEAL
═══════════════════════════════════════════ */
/* Hidden state only when JS is available (.js set inline in <head>),
   so content stays visible if scripts fail to load */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease;
}

.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    transition: none;
    transform: none;
  }
}

/* Lang-switch — a short, subtle opacity fade of the whole page content.
   #pageWrap wraps the hero, main and footer; the fixed nav/toggles, terminal,
   cookie banner and scroll bar sit OUTSIDE it, so they don't flicker. */
#pageWrap {
  transition: opacity .13s ease;
}

.lang-switching #pageWrap {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  #pageWrap { transition: none; }
  .lang-switching #pageWrap { opacity: 1; }
}

/* ═══════════════════════════════════════════
   TECH STACK
═══════════════════════════════════════════ */

/* Category cards grid */
.skills-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 10px;
  column-gap: 36px;
  margin-bottom: 12px;
}

.skill-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 0 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-card__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.skill-card__label::before {
  content: '';
  display: block;
  width: 3px;
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.7;
  flex-shrink: 0;
}

.skill-card__items {
  display: grid;
  /* Cap at 4 chips per row: the column min is the width of a 1/4 track
     (minus the 3 × 8px gaps), so a 5th never fits — but it still falls back
     to 55px on narrow screens and stretches to fill rows with fewer items. */
  grid-template-columns: repeat(auto-fit, minmax(max(55px, (100% - 24px) / 4), 1fr));
  gap: 8px;
}

/* Tool chip inside a card — <button>: click filters the experience timeline */
.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  width: 100%;
  height: 74px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, filter .15s, opacity .15s;
}

/* Selected chip (outline so the level stripe box-shadow is preserved) */
.stack-item.is-selected {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.stack-item::after {
  content: attr(data-years);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-btn);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  padding: 4px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity .2s;
}

.stack-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.stack-item:hover::after {
  opacity: 1;
}
.stack-item:hover > img,
.stack-item:hover > svg,
.stack-item:hover > span {
  filter: blur(2px);
  opacity: 0.2;
}

/* ── Level tiers ─────────────────────────────────────────────────────────────
   A deliberate three-step ramp so the levels read instantly:
     Expert     → filled accent card, thick solid stripe, accent border + glow
     Proficient → light fill, medium stripe, faint accent border
     Familiar   → no fill, faint thin stripe, desaturated + faded content
   Stripe opacities/thicknesses mirror the legend swatches (100/60/20%). */
.stack-item[data-level="3"] {
  background: color-mix(in srgb, var(--accent) 15%, var(--bg));
  border-width: 2px;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow:
    inset 0 4px 0 var(--accent),
    0 3px 12px -5px color-mix(in srgb, var(--accent) 55%, transparent);
}
.stack-item[data-level="2"] {
  background: color-mix(in srgb, var(--accent) 5%, var(--bg));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--accent) 60%, transparent);
}
/* Level 1: dim only the content (icon + label) so the colored stripe stays
   as vivid as the legend swatch — opacity/filter on the element itself would
   also wash out the box-shadow stripe. */
.stack-item[data-level="1"] {
  box-shadow: inset 0 2px 0 color-mix(in srgb, var(--accent) 20%, transparent);
}
.stack-item[data-level="1"] > img,
.stack-item[data-level="1"] > svg,
.stack-item[data-level="1"] > span {
  opacity: 0.42;
}
/* Desaturate Familiar icons by appending grayscale() to the theme-aware
   --icon-filter (a bare grayscale() would drop the dark-mode invert and leave
   the icons black). Single rule → hover blur below always wins on specificity. */
.stack-item[data-level="1"] > img {
  filter: var(--icon-filter) grayscale(100%);
}
.stack-item[data-level="1"]:hover > img,
.stack-item[data-level="1"]:hover > svg,
.stack-item[data-level="1"]:hover > span {
  filter: blur(2px);
  opacity: 0.2;
}

.stack-item img {
  width: 22px;
  height: 22px;
  filter: var(--icon-filter);
  transition: filter .2s, opacity .2s;
}

.stack-item span {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  transition: filter .2s, opacity .2s;
}

/* ── Skill → experience cross-filter ── */
.timeline-subitem,
.timeline-group__header {
  transition: opacity .25s ease;
}

#experience .skill-dim {
  opacity: .3;
}

.tag.skill-match-tag {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent-text);
}

.skill-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
  padding: 4px 11px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 20px;
  font-family: inherit;
  font-size: 11px;
  color: var(--accent-text);
  cursor: pointer;
  transition: background .15s;
}

.skill-filter-pill:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ── Skills legend ── */
.skills-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.legend-item i {
  display: block;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  font-style: normal;
  flex-shrink: 0;
}
.legend-item[data-level="3"] i { background: var(--accent); height: 4px; }
.legend-item[data-level="2"] i { background: color-mix(in srgb, var(--accent) 60%, transparent); height: 3px; }
.legend-item[data-level="1"] i { background: color-mix(in srgb, var(--accent) 20%, transparent); height: 2px; }

.stack-item svg {
  color: var(--tag-text);
  flex-shrink: 0;
}

/* Language cards */
.lang-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 10px;
  column-gap: 36px;
  margin-top: 4px;
}

.lang-card-item {
  background: transparent;
  border: none;
  padding: 4px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lang-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-flag {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.lang-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.lang-level {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.lang-bar {
  height: 3px;
  width: 100%;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.lang-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}



/* ═══════════════════════════════════════════
   HERO SPARKLINE
═══════════════════════════════════════════ */
.hero-name-wrap {
  position: relative;
  display: inline-block;
}

.hero-spark {
  position: absolute;
  bottom: -10px;
  left: -10px;
  width: calc(100% + 20px);
  height: 68px;
  pointer-events: none;
}

.hero-spark__axis {
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0;
  animation: sparkAxes .3s ease-out forwards 0s;
}

.hero-spark__axis-tip {
  fill: var(--accent);
  opacity: 0;
  animation: sparkAxes .3s ease-out forwards 0s;
}

.hero-spark__tick {
  stroke: var(--accent);
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0;
  animation: sparkAxes .3s ease-out forwards .1s;
}

@keyframes sparkAxes {
  to { opacity: 0.18; }
}

.hero-spark__fill {
  fill: url(#sparkAreaGrad);
  opacity: 0;
  animation: sparkFill 1.1s ease-out forwards 4.8s;
}

@keyframes sparkFill {
  to { opacity: 1; }
}

.hero-spark__line {
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.3;
  stroke-dasharray: 750;
  stroke-dashoffset: 750;
  animation: sparkDraw 4.5s ease-out forwards .3s;
}

@keyframes sparkDraw {
  to { stroke-dashoffset: 0; }
}

/* Sparkline is decorative — show it fully drawn, no animation, under reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-spark__axis,
  .hero-spark__axis-tip,
  .hero-spark__tick { animation: none; opacity: 0.18; }
  .hero-spark__fill { animation: none; opacity: 1; }
  .hero-spark__line { animation: none; stroke-dashoffset: 0; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */

@media (max-width: 620px) {
  .skills-cards { grid-template-columns: 1fr; }
}

/* ── Nav responsive ─────────────────────────────────────────────────────────
   > 900px  : sticky nav with centered links (appears on scroll)
   ≤ 900px  : nav hidden, theme/lang buttons scroll away with page
── */
@media (max-width: 900px) {
  /* Mobile: no nav bar — only theme/lang buttons visible at top, scroll away with page */
  .nav-links {
    display: none;
  }

  .site-nav {
    position: absolute;
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  .project-card[data-pinned] .project-header::after {
    position: absolute;
    top: 16px;
    right: 18px;
    margin-left: 0;
  }

  .project-card[data-pinned] .project-header {
    padding-right: 28px;
  }

  .lang-toggle {
    font-size: 10px;
    padding: 4px 10px;
  }
}

/* ── 480 px : general layout ── */
@media (max-width: 480px) {
  .stack-item span { font-size: 8.5px; }

  .timeline-desc       { font-size: 11px; }
  .project-desc-body p { font-size: 11px; }

  .btn-split__text { display: none; }
  .btn-split__part { padding: 7px 12px; }

  header {
    padding-top: 36px;
  }

  .edu-abbr   { display: none; }
  .date-long  { display: none; }
  .date-short { display: inline; }

  .avatar,
  .avatar-fallback {
    width: 100px;
    height: 100px;
    font-size: 22px;
  }

  .avatar-status__tooltip {
    bottom: calc(100% + 10px);
    left: 50%;
    right: auto;
    /* center the tooltip on the avatar (100px) rather than on the dot (26px) */
    transform: translateX(calc(-50% - 35px)) translateY(5px);
  }
  .avatar-status:hover .avatar-status__tooltip,
  .avatar-status:focus-visible .avatar-status__tooltip,
  .avatar-status__tooltip.is-open {
    transform: translateX(calc(-50% - 35px)) translateY(0);
  }

  .section { padding: 20px 16px; }

  /* Timeline */
  .timeline-item    { grid-template-columns: 24px 1fr; gap: 0 8px; }
  .timeline-period  { display: none; }
  .timeline-header  { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 5px; }
  .timeline-meta    { margin-top: 4px; }
  /* Experience timeline line: repositioned to the center of the mobile track column */
  #experience .timeline::before { left: 12px; }

  /* Education: mobile reset */
  #education .timeline-item { grid-template-columns: 24px 1fr; }
  #education .timeline::before { left: 12px; }

  /* Mobile group */
  .timeline-group__items { margin-left: 12px; padding-left: 20px; }

  /* Git branch: hidden on mobile, dot too, padding reset */
  .timeline-group--multi .timeline-group__items::before { display: none; }
  .timeline-group--multi .timeline-subitem::after       { display: none; }
  .timeline-group--multi .timeline-group__items         { padding-left: 20px; }

  .lang-cards { grid-template-columns: 1fr; }

  /* Projects / misc grid in 1 column */
  .misc-grid { grid-template-columns: 1fr; }

  /* Footer: hide tagline on small screens */
  .footer-left { display: none; }

  /* Project tags: smaller text on mobile */
  .project-card .tags .tag { font-size: 9px; }
}

/* GitHub text link: visible only on touch devices */
.project-github-link { display: none; }
@media (hover: none) {
  .project-overlay { display: none; }
  .project-github-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-text);
    opacity: 0.8;
    text-decoration: none;
    transition: opacity .15s;
  }
  .project-github-link:hover { opacity: 1; }
}

/* ═══════════════════════════════════════════
   CONTACT FORM
═══════════════════════════════════════════ */


.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form__field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.contact-form__field input,
.contact-form__field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  resize: vertical;
  max-height: 300px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.contact-form__field input::placeholder,
.contact-form__field textarea::placeholder {
  color: var(--muted);
  opacity: .7;
}

.contact-form__field input:focus,
.contact-form__field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-form__field input.is-invalid,
.contact-form__field textarea.is-invalid {
  border-color: #e05c5c;
  box-shadow: 0 0 0 3px rgba(224,92,92,.15);
}

.contact-form__submit-text { display: inline; }
.contact-form__spinner {
  display: none;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#contactSubmit.is-loading .contact-form__submit-text { display: none; }
#contactSubmit.is-loading .contact-form__spinner     { display: inline-block; }

.contact-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-form__status {
  font-size: 12px;
  color: var(--muted);
  min-height: 1em;
  flex: 1;
  transition: opacity .6s ease;
}

.contact-form__status.is-fading {
  opacity: 0;
}

.contact-form__status.is-success { color: #4caf50; }
.contact-form__status.is-error   { color: #e05c5c; }

.contact-form button[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

@media (max-width: 620px) {
  .contact-form__row { grid-template-columns: 1fr; }
  /* ≥16px so iOS Safari doesn't auto-zoom when a field gains focus (placed
     after the base 13px rule so it wins the cascade) */
  .contact-form__field input,
  .contact-form__field textarea { font-size: 16px; }
}

/* ═══════════════════════════════════════════
   PRINT
═══════════════════════════════════════════ */
@media print {
  *, *::before, *::after {
    box-shadow: none !important;
    animation: none !important;
    transition: none !important;
    text-shadow: none !important;
  }

  body {
    background: #fff !important;
    background-image: none !important;
    color: #111 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  .scroll-progress,
  .lang-toggle-wrap,
  .site-nav,
  .hero-actions,
  .socials,
  .about-toggle,
  .about-fade,
  .tasks-toggle,
  .avatar-status,
  .project-overlay,
  .footer-socials,
  .back-to-top,
  #contact { display: none !important; }

  header, main, footer {
    max-width: 100%;
    padding: 0 16px;
  }

  .section {
    border: 1px solid #ccc !important;
    border-radius: 0 !important;
    background: #fff !important;
    margin-top: 12pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .about-body {
    max-height: none !important;
    overflow: visible !important;
  }

  .timeline-subitem ul {
    display: block !important;
    max-height: none !important;
  }

  .project-card {
    background: #f9f9f9 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .project-desc-body {
    max-height: none !important;
    overflow: visible !important;
  }

  .project-desc-fade { display: none !important; }
  .project-readmore  { display: none !important; }

  /* Skill filter: never print a filtered/dimmed timeline */
  .skill-filter-pill { display: none !important; }
  .skill-dim { opacity: 1 !important; }

  a { color: inherit !important; }
  a[href]::after { content: none !important; }
}

/* ═══════════════════════════════════════════
   ERROR PAGES (403 / 404) — shared styles, previously duplicated in each page
═══════════════════════════════════════════ */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 16px;
}

.error-code {
  font-size: 80px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  opacity: .3;
}

.error-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.error-desc {
  font-size: 13px;
  color: var(--muted);
  max-width: 320px;
}

.error-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin-top: 4px;
}

.error-nav a {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity .15s;
}

.error-nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════
   LEGAL PAGE (privacy.html)
═══════════════════════════════════════════ */
.legal-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.legal-page h1 {
  font-size: 18px;
  margin-bottom: 4px;
}

.legal-updated {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 28px;
}

.legal-page h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin: 24px 0 8px;
}

.legal-page p {
  font-size: 12.5px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.legal-page p a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-back {
  margin-top: 32px;
}
