/* ============================================================
   Julien Litrico personal site
   Light/dark via light-dark() + color-scheme, with a light-only fallback. No external deps.
   ============================================================ */

/* ---------- Fonts (self-hosted, Latin subset) ---------- */
@font-face { font-family: "Lora"; src: url(/fonts/lora-var.woff) format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-regular.woff) format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-medium.woff) format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-semibold.woff) format("woff"); font-weight: 600 700; font-style: normal; font-display: swap; }

/* ---------- Tokens ----------
   1) Plain light-theme values: the fallback for browsers that do not know light-dark()
      (Safari before 17.5, Chrome before 123, Firefox before 120). They get the light theme only.
   2) The @supports block below turns on the real light/dark pairs for everyone else. */
:root {
  color-scheme: light;
  --bg:        #FAF7F2;
  --bg-alt:    #F1EBE0;
  --surface:   #FFFFFF;
  --text:      #1B1A17;
  --muted:     #625C52;
  --line:      #E3DACB;
  --accent:    #B8372A;
  --accent-strong: #9E2D21;
  --on-accent: #FFFFFF;
  --gold:      #8A5A00;
  --gold-fill: #D4962A;
  --focus:     #8A5A00;
  --shadow:    0 18px 40px -18px rgb(60 40 20 / .35);
  --band-dark-bg: #231D19;
  --band-contact-bg: #8F2A20;
  --footer-bg: #17120F;
  --ok:        #2E8555;
  --jarvis-bg-1: #F6EBCF;
  --jarvis-bg-2: #E7D3A4;

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1rem, 4vw, 2rem);
  --skew: clamp(28px, 5vw, 72px);
  --band-pad: clamp(4rem, 9vw, 7rem);
  --header-h: 4rem;
  --r: 18px;
}
@supports (color: light-dark(#000, #fff)) {
  :root {
    color-scheme: light dark;
    --bg:        light-dark(#FAF7F2, #121110);
    --bg-alt:    light-dark(#F1EBE0, #1A1816);
    --surface:   light-dark(#FFFFFF, #201D1A);
    --text:      light-dark(#1B1A17, #F2EDE4);
    --muted:     light-dark(#625C52, #A8A196);
    --line:      light-dark(#E3DACB, #34302B);
    --accent:    light-dark(#B8372A, #F0735F);
    --accent-strong: light-dark(#9E2D21, #F58A78);
    --on-accent: light-dark(#FFFFFF, #1A0B08);
    --gold:      light-dark(#8A5A00, #E8B04B);
    --focus:     light-dark(#8A5A00, #E8B04B);
    --shadow:    light-dark(0 18px 40px -18px rgb(60 40 20 / .35), 0 18px 40px -18px rgb(0 0 0 / .7));
    --band-dark-bg: light-dark(#231D19, #0C0B0A);
    --band-contact-bg: light-dark(#8F2A20, #3A1612);
    --footer-bg: light-dark(#17120F, #0A0908);
    --ok:        light-dark(#2E8555, #5CC98A);
    --jarvis-bg-1: light-dark(#F6EBCF, #3A2E10);
    --jarvis-bg-2: light-dark(#E7D3A4, #0C0A07);
  }
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"]  { color-scheme: dark; }
}
/* Without light-dark() there is no dark theme: hide the switches that would do nothing */
@supports not (color: light-dark(#000, #fff)) {
  .theme-toggle, .more-theme { display: none !important; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
img { max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; transition: top .2s; }
.skip:focus { top: 1rem; }

/* ---------- Buttons, badges, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: .6rem; padding: .8rem 1.3rem; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1.5px solid transparent; transition: transform .2s, background-color .2s, box-shadow .2s; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px var(--accent); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.badge { display: inline-block; margin: 0 0 .75rem; padding: .2rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-strong); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .92rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--bg); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line); }
/* Translucent header only where color-mix() exists (otherwise the solid colours above stay) */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: color-mix(in srgb, var(--bg) 84%, transparent); border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
}
.bar { height: 100%; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; margin-right: auto; }
.brand-mark { width: 40px; height: 40px; flex: none; background-color: var(--accent); -webkit-mask: url(/img/monogram-mask.png) center / contain no-repeat; mask: url(/img/monogram-mask.png) center / contain no-repeat; }
.primary-nav ul { display: flex; gap: .25rem; }
.primary-nav a { display: block; padding: .5rem .8rem; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .96rem; color: var(--muted); transition: color .2s, background-color .2s; }
.primary-nav a:hover, .primary-nav a[aria-current="true"] { color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tools { display: flex; align-items: center; gap: .5rem; }
.lang-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.lang-switch a { display: flex; align-items: center; gap: .35rem; min-height: 2rem; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none; color: var(--muted); }
.lang-switch a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
/* Link back to the illustrated home ("GTA" version), same language. Two lines at most. */
.gta-link { display: inline-flex; align-items: center; gap: .35rem; max-width: 12.5rem; padding: .3rem .65rem .3rem .55rem; border: 1px solid var(--accent); border-radius: 999px; background: var(--surface); color: var(--accent-strong); font-size: .75rem; font-weight: 600; line-height: 1.2; text-decoration: none; transition: background-color .2s; }
.gta-link .icon { width: 1rem; height: 1rem; flex: none; }
.gta-link:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
@media (min-width: 1180px) { .site-header .brand { white-space: nowrap; flex: none; } }
/* Mid-size screens: not enough room for the text, so a round star button (the text stays for screen readers
   and shows as a tooltip) and flags only in the language switch */
@media (min-width: 900px) and (max-width: 1179px) {
  .gta-link { width: 2.5rem; height: 2.5rem; padding: 0; justify-content: center; }
  .gta-link .icon { width: 1.15rem; height: 1.15rem; }
  .gta-label, .site-header .lang-switch a .lang-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .site-header .lang-switch a { padding: .15rem .45rem; }
}
.icon-btn { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .2s; }
.icon-btn:hover { border-color: var(--accent); }
.i-sun, .i-moon { display: none; }
:root:not([data-theme]) .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .i-moon { display: none; } :root:not([data-theme]) .i-sun { display: block; } }
:root[data-theme="light"] .i-moon { display: block; }
:root[data-theme="dark"] .i-sun { display: block; }

/* ---------- Mobile tab bar (replaces the burger menu) ----------
   Floating bar at the bottom: 4 sections (Profile, Experience, Projects, Contact) + "More".
   "More" opens a small panel with Education, the language and the theme. Without JS, the header shows everything instead. */
.tabbar { display: none; }
@media (max-width: 899px) {
  html:not(.js) .site-header { height: auto; position: static; }
  html:not(.js) .bar { flex-wrap: wrap; padding-block: .5rem; }
  html:not(.js) .primary-nav { order: 3; width: 100%; overflow-x: auto; }
  .js .site-header .primary-nav, .js .site-header .tools { display: none; }
  .brand span:not(.brand-mark) { display: none; }

  .js .tabbar { display: block; }
  .tabbar-nav {
    position: fixed; z-index: 60; left: .75rem; right: .75rem; bottom: max(.75rem, env(safe-area-inset-bottom));
    max-width: 30rem; margin-inline: auto; padding: .35rem;
    border: 1px solid var(--line); border-radius: 28px;
    background: var(--surface);
    -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    box-shadow: 0 1px 0 0 color-mix(in srgb, #fff 40%, transparent) inset, 0 16px 36px -14px rgb(0 0 0 / .45), 0 2px 6px rgb(0 0 0 / .08);
    transition: transform .3s ease, opacity .3s ease;
  }
  @supports (color: color-mix(in srgb, red 50%, blue)) {
    .tabbar-nav { border-color: color-mix(in srgb, var(--line) 80%, transparent); background: color-mix(in srgb, var(--surface) 86%, transparent); }
  }
  .tabbar-nav ul { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; width: 100%;
    min-height: 3.4rem; padding: .3rem .1rem; border: 0; border-radius: 22px; background: none; cursor: pointer;
    font: inherit; font-size: .75rem; font-weight: 600; line-height: 1.1; color: var(--muted); text-decoration: none;
    -webkit-tap-highlight-color: transparent; transition: color .2s;
  }
  .tab .icon { width: 1.35rem; height: 1.35rem; }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab[aria-current="true"], .tab-more.is-current, .tab-more[aria-expanded="true"] { color: var(--accent-strong); }
  .tab:focus-visible { outline-offset: -3px; }
  /* Sliding highlight behind the active tab (--slot set by app.js, -1 = none) */
  .tab-pill {
    position: absolute; top: .35rem; bottom: .35rem; left: .35rem; width: calc((100% - .7rem) / 5);
    border-radius: 22px; background: color-mix(in srgb, var(--accent) 14%, transparent);
    transform: translateX(calc(var(--slot, 0) * 100%)); opacity: 0; transition: transform .35s cubic-bezier(.3, .7, .2, 1), opacity .25s;
  }
  .tabbar-nav.has-current .tab-pill { opacity: 1; }
  /* "+" that turns into a cross */
  .plus-icon { position: relative; width: 1.35rem; height: 1.35rem; }
  .plus-icon span { position: absolute; left: 50%; top: 50%; width: 1rem; height: 2px; margin: -1px 0 0 -.5rem; border-radius: 2px; background: currentColor; transition: transform .3s ease; }
  .plus-icon span:last-child { transform: rotate(90deg); }
  .tab-more[aria-expanded="true"] .plus-icon span:first-child { transform: rotate(45deg); }
  .tab-more[aria-expanded="true"] .plus-icon span:last-child { transform: rotate(135deg); }
  .when-open, .tab-more[aria-expanded="true"] .when-closed { display: none; }
  .tab-more[aria-expanded="true"] .when-open { display: inline; }

  /* "More" panel */
  .more-panel {
    position: fixed; z-index: 59; left: .75rem; right: .75rem; bottom: calc(max(.75rem, env(safe-area-inset-bottom)) + 4.9rem);
    max-width: 30rem; margin-inline: auto; padding: .5rem; display: grid; gap: .25rem;
    border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow);
    visibility: hidden; opacity: 0; transform: translateY(14px) scale(.98); transform-origin: 85% 100%;
    transition: opacity .25s ease, transform .3s cubic-bezier(.3, .7, .2, 1), visibility 0s .3s;
  }
  .more-open .more-panel { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .more-link { display: flex; align-items: center; gap: .75rem; padding: .85rem .9rem; border-radius: 14px; text-decoration: none; font-weight: 600; font-size: 1.05rem; color: var(--text); }
  .more-link:hover, .more-link[aria-current="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .more-link .icon { width: 1.3rem; height: 1.3rem; color: var(--accent-strong); }
  .more-link .more-arrow { margin-left: auto; color: var(--muted); }
  .more-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .9rem; border-top: 1px solid var(--line); }
  .more-label { display: flex; align-items: center; gap: .75rem; font-weight: 500; color: var(--muted); }
  .more-label .icon { width: 1.3rem; height: 1.3rem; color: var(--accent-strong); }
  .more-row .lang-switch a { padding: .35rem .65rem; }
  .theme-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
  .theme-switch button { padding: .35rem .85rem; border: 0; border-radius: 999px; background: none; font: inherit; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
  .theme-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
  .more-backdrop {
    position: fixed; inset: 0; z-index: 58; background: rgb(0 0 0 / .35);
    visibility: hidden; opacity: 0; transition: opacity .25s, visibility 0s .25s;
  }
  .more-open .more-backdrop { visibility: visible; opacity: 1; transition-delay: 0s; }
  /* Keep the page end and anchors clear of the bar; hide the bar while typing in the form */
  .js { scroll-padding-bottom: 6rem; }
  .js .site-footer { padding-bottom: calc(2rem + 5.5rem); }
  .foot a { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .js body:has(input:focus, textarea:focus) .tabbar-nav { transform: translateY(150%); opacity: 0; }
}
@media (max-width: 359px) { .tab { font-size: .6875rem; padding-inline: 0; } .tabbar-nav { left: .5rem; right: .5rem; padding-inline: .2rem; } }
@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  .tabbar-nav, .tab-pill, .plus-icon span, .more-panel, .more-backdrop { transition: none; }
}
@media (min-width: 900px) { .primary-nav { margin-inline: auto; } .brand { margin-right: 0; } }

/* ---------- Bands (diagonal sections) ---------- */
main { position: relative; }
.band { position: relative; background-color: var(--bg); padding-block: var(--band-pad); padding-bottom: calc(var(--band-pad) + var(--skew)); clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--skew)), 0 100%); }
.band + .band { margin-top: calc(var(--skew) * -1); padding-top: calc(var(--band-pad) + var(--skew)); }
.band:nth-child(1) { z-index: 8; } .band:nth-child(2) { z-index: 7; } .band:nth-child(3) { z-index: 6; }
.band:nth-child(4) { z-index: 5; } .band:nth-child(5) { z-index: 4; } .band:nth-child(6) { z-index: 3; }
.band:nth-child(7) { z-index: 2; }
.band-alt { background: var(--bg-alt); }
.band-dark { background-color: var(--band-dark-bg); }
/* These bands are always dark, whatever the theme: the dark values are written out so they
   also apply in browsers without light-dark(). */
.band-dark > .wrap, .band-contact > .wrap, .site-footer {
  color-scheme: dark;
  --surface: #201D1A; --text: #F2EDE4; --muted: #A8A196; --line: #34302B;
  --accent: #F0735F; --accent-strong: #F58A78; --on-accent: #1A0B08;
  --gold: #E8B04B; --focus: #E8B04B; --shadow: 0 18px 40px -18px rgb(0 0 0 / .7);
}
.band-dark > .wrap, .band-contact > .wrap { color: var(--text); }
.band-pattern {
  background-image:
    radial-gradient(900px 480px at 85% 0%, rgb(240 115 95 / .16), transparent 60%),
    linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px);
  background-size: auto, 30px 30px, 30px 30px;
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) { .band-pattern { background-attachment: fixed; } }
.band-contact { background: var(--band-contact-bg); }
.band-hero { padding-top: calc(var(--header-h) * .5 + 2.5rem); background: radial-gradient(800px 460px at 88% 8%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 62%), radial-gradient(600px 380px at 0% 100%, color-mix(in srgb, var(--gold-fill) 18%, transparent), transparent 62%), var(--bg); }
.band-legal { min-height: 60vh; }

/* ---------- Section heads ---------- */
.section-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.section-head h2 { margin: 0; font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
.section-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); flex: none; }
.section-icon .icon { width: 1.5rem; height: 1.5rem; }
.band-dark .section-icon, .band-contact .section-icon { background: var(--gold-fill); color: #1B1A17; }
.section-intro { color: var(--muted); max-width: 62ch; margin-bottom: 2rem; }
.section-intro-wide { max-width: 90ch; }
.band-contact .section-intro { color: #E9D9D4; }

/* ---------- Hero ---------- */
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.portrait { position: relative; margin: 0; justify-self: center; width: min(230px, 60vw); }
.portrait img { position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 999px 999px 22px 22px; box-shadow: var(--shadow); }
.portrait::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--gold-fill); border-radius: 999px 999px 22px 22px; }
.portrait::after { content: ""; position: absolute; z-index: 0; left: -26px; bottom: 34px; width: 70%; height: 36%; background: var(--accent); border-radius: 12px; transform: skewY(-7deg); }
.eyebrow { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .95rem; font-weight: 500; margin-bottom: 1.25rem; }
.eyebrow .icon { width: 1.1em; height: 1.1em; color: var(--accent); }
.band-hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.3rem); margin-bottom: .15em; font-weight: 700; }
.hero-role { font-family: var(--serif); font-size: clamp(1.25rem, 3vw, 1.75rem); color: var(--accent-strong); margin-bottom: 1.25rem; }
/* Availability line under the job title: a small green dot, then the sentence */
.hero-status { display: flex; align-items: baseline; gap: .6rem; max-width: 46ch; margin: -.5rem 0 1.25rem; font-weight: 500; color: var(--text); }
.status-dot { flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--ok) 22%, transparent); transform: translateY(-.05rem); }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 54ch; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.75rem; }
/* LinkedIn in the first screen: a plain link, lighter than the two buttons */
.hero-link { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; padding: .4rem .5rem; border-radius: 999px; font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color .2s, color .2s; }
.hero-link .icon { color: var(--accent); }
.hero-link:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
/* Phones: smaller portrait and the buttons right under the job title, so the name,
   the title and the way to get in touch all fit in the first screen. */
@media (max-width: 599px) {
  .band-hero { padding-top: 1.25rem; }
  .hero-grid { gap: 1.25rem; }
  .portrait { width: min(140px, 40vw); }
  .portrait::before { inset: 10px -10px -10px 10px; }
  .portrait::after { left: -18px; bottom: 24px; }
  .hero-text { display: flex; flex-direction: column; }
  .hero-role { margin-bottom: .75rem; }
  .hero-status { margin: -.25rem 0 .9rem; font-size: .96rem; }
  .eyebrow { margin-bottom: 1rem; }
  .cta { order: 1; margin-top: 0; margin-bottom: 1.5rem; gap: .5rem; }
  .cta .btn { padding: .65rem .95rem; font-size: .96rem; gap: .4rem; }
  .lead { order: 2; margin-bottom: 0; }
}
/* Small laptops: keep the two buttons and the LinkedIn link on one row */
@media (min-width: 900px) and (max-width: 1099px) {
  .cta { gap: .5rem; }
  .cta .btn { padding: .75rem 1.05rem; }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.2fr .8fr; gap: 4rem; }
  .portrait { order: 2; width: min(330px, 100%); }
  .hero-text { order: 1; }
}

/* ---------- Hero parallax (desktop only) ----------
   The hero stays pinned right below the header (or a bit higher on short screens,
   so its buttons stay visible) and the Profile band slides over it. app.js sets
   --hero-pin and the scroll range of the effect (--hero-from, --hero-to). */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .js .band-hero { position: sticky; top: var(--hero-pin, 0px); z-index: 0; }
  .js .band-hero.is-covered { visibility: hidden; }
  /* The Profile band now sits above the hero: it draws its own slanted top edge
     (transparent triangle) and casts a soft shadow on the hero. The clip-path
     leaves room above the band so the shadow is not cut off. */
  .js .band-hero + .band-alt {
    clip-path: polygon(0 -80px, 100% -80px, 100% calc(100% - var(--skew)), 0 100%);
    background:
      linear-gradient(to top left, var(--bg-alt) calc(50% - 1px), transparent calc(50% + 1px)) top / 100% var(--skew) no-repeat,
      linear-gradient(var(--bg-alt), var(--bg-alt)) 0 var(--skew) / 100% 100% no-repeat;
    filter: drop-shadow(0 -10px 22px rgb(60 40 20 / .3));
    filter: drop-shadow(0 -10px 22px light-dark(rgb(60 40 20 / .3), rgb(0 0 0 / .65)));
  }
  /* While it is being covered, the hero darkens.
     Scroll-driven animation: browsers without support simply skip it. */
  @supports (animation-timeline: scroll()) {
    .js .band-hero::after {
      content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
      background: rgb(27 26 23 / .3); background: light-dark(rgb(27 26 23 / .3), rgb(0 0 0 / .6)); opacity: 0;
      animation: hero-dim linear both;
      animation-timeline: scroll(root);
      animation-range: var(--hero-from, 0px) var(--hero-to, 100vh);
    }
  }
}
@keyframes hero-dim { to { opacity: 1; } }

/* ---------- Profile ---------- */
.profile-grid { display: grid; gap: 2.5rem; }
.profile-text p { font-size: 1.12rem; max-width: 60ch; }
.pillars { display: grid; gap: 1rem; }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.35rem; box-shadow: var(--shadow); }
.pillar h3 { font-size: 1.2rem; margin: .8rem 0 .4rem; }
.pillar p { margin: 0; color: var(--muted); font-size: .98rem; }
.pillar-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-strong); }
.skill-groups { display: grid; gap: 1.5rem; }
.chips[hidden] { display: none; }
.skill-head { display: flex; align-items: center; gap: .6rem; }
.skill-count { display: none; }
/* Phones: app.js turns each group title into a button (folded tags) */
.skill-groups:has(.skill-toggle) { gap: .6rem; }
.skill-head:has(.skill-toggle[aria-expanded="false"]) { margin-bottom: 0; }
.skill-toggle { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 44px; padding: .45rem .5rem .45rem 1rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; }
.skill-toggle .skill-count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.35rem; padding: 0 .45rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); font-size: .75rem; letter-spacing: 0; }
.skill-chevron { position: relative; flex: none; width: 1.9rem; height: 1.9rem; margin-left: auto; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); transition: transform .3s; }
.skill-chevron::before, .skill-chevron::after { content: ""; position: absolute; left: 50%; top: 50%; width: .75rem; height: 2px; margin: -1px 0 0 -.375rem; border-radius: 2px; background: var(--accent-strong); }
.skill-chevron::after { transform: rotate(90deg); }
.skill-toggle[aria-expanded="true"] .skill-chevron { transform: rotate(135deg); }
.skill-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .skill-chevron { transition: none; } }
.skill-group h3, .skill-langs h3 { font-family: var(--sans); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: .75rem; }
.skill-langs { margin-top: 2rem; }
.lang-list { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; }
.lang-list li { display: flex; align-items: center; gap: .6rem; }
.flag { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: #FAF7F2; color: #1B1A17; border: 1px solid #D6CBB8; border-color: light-dark(#D6CBB8, #5B5348); font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
@media (min-width: 700px) { .pillars { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .profile-grid { grid-template-columns: .9fr 1.1fr; gap: 3.5rem; align-items: start; } .skill-groups { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

/* ---------- Experience ---------- */
.key-figures { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 0 0 2.75rem; }
.figure { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r); background: rgb(255 255 255 / .05); }
.figure-value { font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; line-height: 1.1; color: var(--gold); }
.figure-text { color: var(--muted); font-size: .9rem; line-height: 1.45; }
@media (min-width: 900px) { .key-figures { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 3.5rem; } .figure { padding: 1.25rem 1.35rem; } .figure-text { font-size: .95rem; } }
.employers { display: grid; gap: 3rem; }
.employer-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.employer-head h3 { margin: 0; font-size: 1.6rem; }
.employer-head h3 small { font-family: var(--sans); font-size: .85rem; font-weight: 500; color: var(--muted); margin-left: .4rem; }
.employer-head p { margin: 0; color: var(--muted); }
.monogram { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; background: linear-gradient(135deg, #E8B04B, #B87A12); color: #1B1A17; font-family: var(--serif); font-weight: 700; font-size: 1.5rem; flex: none; }
.emp-logo { display: flex; align-items: center; height: 3.5rem; padding: 0 .9rem; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .08); flex: none; }
.emp-logo img { display: block; height: 2.4rem; width: auto; max-width: none; }
.roles { display: grid; gap: .85rem; }
.role { background: rgb(255 255 255 / .05); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s, background-color .2s; }
.role:hover { border-color: rgb(240 115 95 / .5); }
.role-heading { margin: 0; font-family: var(--sans); }
.role-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; background: none; border: 0; text-align: left; cursor: pointer; border-radius: var(--r); }
.role-main { display: grid; gap: .15rem; }
.role-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.role-period { color: var(--muted); font-size: .92rem; font-weight: 400; }
.role-chevron { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); flex: none; transition: transform .3s; }
.role-toggle[aria-expanded="true"] .role-chevron { transform: rotate(135deg); }
/* The summary stays visible when a role is folded; the button folds the details */
.role-summary { margin: 0; padding: 0 1.25rem 1.25rem; color: var(--muted); }
.role:has(.role-toggle[aria-expanded="true"]) .role-summary { padding-bottom: .9rem; }
.role-panel { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s ease, visibility .35s; }
.role-inner { overflow: hidden; min-height: 0; padding: 0 1.25rem; }
.role-inner > :first-child { margin-top: 0; }
.role-inner > :last-child { margin-bottom: 1.25rem; }
.role-inner ul { display: grid; gap: .55rem; }
.role-inner li { position: relative; padding-left: 1.4rem; }
.role-inner li::before { content: ""; position: absolute; left: 0; top: .7em; width: .55rem; height: .55rem; border-radius: 2px; background: var(--gold-fill); transform: rotate(45deg); }
.js .role:has(.role-toggle[aria-expanded="false"]) .role-panel { grid-template-rows: 0fr; visibility: hidden; }
@media (min-width: 900px) { .employers { grid-template-columns: 1fr 1fr; align-items: start; gap: 2.5rem; } }

/* ---------- Timeline (education) ---------- */
.timeline { position: relative; display: grid; gap: 1.75rem; padding-left: 3.25rem; }
.tl-item { position: relative; }
.tl-date { display: inline-block; margin-bottom: .4rem; font-weight: 600; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.tl-dot { position: absolute; left: -3.25rem; top: 0; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); z-index: 1; }
.tl-item::before { content: ""; position: absolute; left: -2.05rem; top: 2.5rem; bottom: -1.75rem; width: 2px; background: var(--accent); transform-origin: top; transition: transform .9s ease .15s; }
.tl-item:last-child::before { display: none; }
.js .tl-item.reveal:not(.in)::before { transform: scaleY(0); }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem 1.35rem; box-shadow: var(--shadow); }
.tl-card h3 { font-size: 1.25rem; margin-bottom: .25rem; }
.tl-card p:last-child { margin-bottom: 0; }
.tl-place { color: var(--gold); font-weight: 600; font-size: .95rem; }
.tl-card .badge { margin-bottom: .6rem; }
@media (min-width: 900px) {
  .timeline { padding-left: 0; gap: 2rem; }
  .tl-item { display: grid; grid-template-columns: 1fr 3rem 1fr; column-gap: 1.5rem; align-items: start; }
  .tl-dot { position: static; grid-column: 2; grid-row: 1; justify-self: center; }
  .tl-item::before { left: 50%; margin-left: -1px; top: 2.5rem; bottom: -2rem; }
  .tl-card { grid-row: 1; }
  .tl-date { grid-row: 1; padding-top: .35rem; }
  .tl-item:nth-child(odd) .tl-card { grid-column: 1; text-align: right; }
  .tl-item:nth-child(odd) .tl-date { grid-column: 3; }
  .tl-item:nth-child(even) .tl-card { grid-column: 3; }
  .tl-item:nth-child(even) .tl-date { grid-column: 1; text-align: right; }
}

/* ---------- Projects ---------- */
.proj-grid { display: grid; gap: 1.5rem; margin-bottom: 4rem; }
.proj-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.proj-visual { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; gap: 1.25rem; min-height: 150px; color: #fff; }
.proj-visual .icon { width: 3.5rem; height: 3.5rem; stroke-width: 1.6; }
.proj-gigsaur .proj-visual, .proj-visual.proj-gigsaur { background: linear-gradient(135deg, #E0912A, #B8372A); }
.proj-visual.proj-retabbed { background: linear-gradient(135deg, #5B1F18, #B8372A); }
/* J.A.R.V.I.S.: gold, like its interface. Cream banner in the light theme, black in the dark theme. */
.proj-visual.proj-jarvis { background: linear-gradient(135deg, var(--jarvis-bg-1), var(--jarvis-bg-2)); }
.proj-jarvis .proj-shot { object-fit: contain; background: #0C0A07; }

/* ---------- J.A.R.V.I.S. animated logo (src/jarvis-logo.mjs) ----------
   Recreated from Julien's SVG. Each part is its own layer and only transform/opacity move,
   so the graphics card runs it smoothly. Colour = --gold: dark gold on cream in the light theme,
   bright gold on black in the dark theme. Without animation (reduced motion), the JL monogram stays still. */
.jl-anim { position: relative; display: block; width: 150px; height: 150px; color: var(--gold); }
.jl-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.jl-piece, .jl-links, .jl-node, .jl-ball, .jl-core { opacity: 0; }
/* Centre of the monogram (625, 610 in a 1254 box): the ball, the ring and the links grow from there */
.jl-links, .jl-ball, .jl-core { transform-origin: 49.841% 48.644%; }
/* Each piece shrinks around its own middle while it travels to the centre */
.jl-piece { transform-origin: calc(49.841% - var(--tx)) calc(48.644% - var(--ty)); }
/* How far each piece travels to the centre, and where each node starts (percent of the logo size) */
.jl-p0 { --tx: -14.593%; --ty: 0%; } .jl-p1 { --tx: -11.806%; --ty: -8.577%; } .jl-p2 { --tx: -4.510%; --ty: -13.879%; } .jl-p3 { --tx: 4.510%; --ty: -13.879%; } .jl-p4 { --tx: 11.806%; --ty: -8.577%; } .jl-p5 { --tx: 14.593%; --ty: 0%; } .jl-p6 { --tx: 11.806%; --ty: 8.577%; } .jl-p7 { --tx: 4.510%; --ty: 13.879%; } .jl-p8 { --tx: -4.510%; --ty: 13.879%; } .jl-p9 { --tx: -11.806%; --ty: 8.577%; }
.jl-n0 { --nx: 0%; --ny: 26.475%; } .jl-n1 { --nx: -23.365%; --ny: 13.158%; } .jl-n2 { --nx: -23.365%; --ny: -12.919%; } .jl-n3 { --nx: 0%; --ny: -26.475%; } .jl-n4 { --nx: 23.365%; --ny: -12.998%; } .jl-n5 { --nx: 23.365%; --ny: 12.998%; }
@media (prefers-reduced-motion: no-preference) {
  .jl-still { animation: jl-still 9s linear infinite; }
  .jl-piece { animation: jl-piece 9s cubic-bezier(.46, 0, .25, 1) infinite; }
  .jl-ball { animation: jl-ball 9s ease-in-out infinite; }
  .jl-core { animation: jl-core 9s ease-in-out infinite; }
  .jl-links { animation: jl-links 9s cubic-bezier(.32, .8, .25, 1) infinite; }
  .jl-node { animation: jl-node 9s cubic-bezier(.32, .8, .25, 1) infinite; }
}
@keyframes jl-still { 0%, 19% { opacity: 1; } 20%, 94% { opacity: 0; } 96%, 100% { opacity: 1; } }
/* Gathering: the pieces rush to the centre and shrink while the big ball grows over them,
   so they melt into it (no pile of pieces). The way back is the same, reversed. */
@keyframes jl-piece {
  0%, 19% { transform: translate(0, 0) scale(1); opacity: 1; }
  25% { transform: translate(calc(var(--tx) * .55), calc(var(--ty) * .55)) scale(.8); opacity: 1; }
  30% { transform: translate(var(--tx), var(--ty)) scale(.3); opacity: .4; }
  32%, 84% { transform: translate(var(--tx), var(--ty)) scale(.3); opacity: 0; }
  86% { transform: translate(var(--tx), var(--ty)) scale(.3); opacity: .4; }
  91% { transform: translate(calc(var(--tx) * .55), calc(var(--ty) * .55)) scale(.8); opacity: 1; }
  96%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
}
/* Big ball: grows while the pieces arrive, breathes, then shrinks to the size of the ring */
@keyframes jl-ball {
  0%, 20% { opacity: 0; transform: scale(.1); }
  25% { opacity: 1; transform: scale(.55); }
  30% { opacity: 1; transform: scale(1); }
  36% { opacity: 1; transform: scale(1.05); }
  41% { opacity: 1; transform: scale(1); }
  48% { opacity: 1; transform: scale(.46); }
  54%, 73% { opacity: .28; transform: scale(.46); }
  79% { opacity: 1; transform: scale(.46); }
  84% { opacity: 1; transform: scale(1); }
  87% { opacity: 1; transform: scale(1.05); }
  91% { opacity: 1; transform: scale(.55); }
  95%, 100% { opacity: 0; transform: scale(.1); }
}
@keyframes jl-core {
  0%, 44% { opacity: 0; transform: scale(.13); }
  49%, 78% { opacity: 1; transform: scale(1); }
  84%, 100% { opacity: 0; transform: scale(.13); }
}
/* The links grow out of the centre (the original drew them with a dash; a scale moves the same way, smoothly) */
@keyframes jl-links {
  0%, 47% { opacity: 0; transform: scale(0); }
  52% { opacity: 1; transform: scale(.25); }
  62%, 70% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(.25); }
  84%, 100% { opacity: 0; transform: scale(0); }
}
@keyframes jl-node {
  0%, 49% { opacity: 0; transform: translate(var(--nx), var(--ny)); }
  54% { opacity: 1; transform: translate(var(--nx), var(--ny)); }
  62%, 70% { opacity: 1; transform: translate(0, 0); }
  80% { opacity: 1; transform: translate(var(--nx), var(--ny)); }
  84%, 100% { opacity: 0; transform: translate(var(--nx), var(--ny)); }
}

.bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; }
.bars i { display: block; width: 8px; height: 100%; border-radius: 4px; background: rgb(255 255 255 / .9); transform-origin: bottom; animation: eq 1.1s ease-in-out infinite alternate; }
.bars i:nth-child(1) { animation-delay: -.9s; } .bars i:nth-child(2) { animation-delay: -.5s; } .bars i:nth-child(3) { animation-delay: -.2s; }
.bars i:nth-child(4) { animation-delay: -.7s; } .bars i:nth-child(5) { animation-delay: -.3s; } .bars i:nth-child(6) { animation-delay: -.8s; } .bars i:nth-child(7) { animation-delay: -.1s; }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.proj-body { padding: 1.5rem 1.5rem 1.75rem; display: flex; flex-direction: column; flex: 1; align-items: flex-start; }
.proj-body h3 { font-size: 1.8rem; }
.proj-body > p:not(.badge) { color: var(--muted); }
.proj-body .chips { margin: .25rem 0 1.5rem; }
.proj-body .btn { margin-top: auto; }
.archive-title { font-size: 1.6rem; }
/* Past projects folded behind a button (app.js); without JavaScript the button stays hidden */
.archive-toggle-row { margin: -.5rem 0 1.5rem; }
.archive-toggle[hidden], .arch-wrap.is-folded { display: none; }
.archive-toggle .icon { width: 1.1rem; height: 1.1rem; transition: transform .3s; }
.archive-toggle[aria-expanded="true"] .icon { transform: rotate(135deg); }
@media (prefers-reduced-motion: reduce) { .archive-toggle .icon { transition: none; } }
.arch-grid { display: grid; gap: 1.25rem; }
.arch-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: transform .3s, box-shadow .3s; }
.arch-media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--bg-alt); }
.arch-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; filter: saturate(.92); }
.badge-float { position: absolute; top: .75rem; left: .75rem; margin: 0; background: rgb(18 17 16 / .78); color: #F2EDE4; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.arch-body { padding: 1.1rem 1.25rem 1.4rem; }
.arch-type { margin: 0 0 .15rem; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.arch-body h4 { font-size: 1.3rem; margin-bottom: .4rem; }
.arch-body p:last-child { margin: 0; color: var(--muted); font-size: .96rem; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .arch-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); } .arch-card:hover img { transform: scale(1.05); } }
@media (min-width: 700px) { .arch-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .proj-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 1.1rem; }
.contact-card { position: relative; display: block; min-height: 190px; border-radius: 22px; overflow: hidden; text-decoration: none; color: #F2EDE4; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .14); }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1rem; text-align: center; }
.face .icon { width: 2.8rem; height: 2.8rem; stroke-width: 1.6; }
.face-label { font-size: .95rem; font-weight: 500; }
.face-value { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; word-break: break-word; }
.face-2 { background: var(--gold-fill); color: #1B1A17; clip-path: circle(0% at 100% 100%); transition: clip-path .55s cubic-bezier(.2, .8, .2, 1); }
.contact-card:hover .face-2, .contact-card:focus-visible .face-2 { clip-path: circle(150% at 100% 100%); }
@media (hover: none), (prefers-reduced-motion: reduce) {
  .contact-card { min-height: 0; display: flex; flex-direction: column; }
  .face { position: static; }
  .face-1 { padding-bottom: .25rem; }
  .face-2 { clip-path: none; background: none; color: inherit; padding-top: 0; }
  .face-2 .face-label { display: none; }
}
.contact-cell { position: relative; display: grid; }
.contact-cell:hover .face-2 { clip-path: circle(150% at 100% 100%); }
.copy-email { position: absolute; bottom: .9rem; left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 2; display: inline-flex; align-items: center; gap: .4rem; min-height: 2rem; padding: .3rem .75rem; border: 0; border-radius: 999px; background: rgb(18 17 16 / .72); color: #F2EDE4; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.copy-email[hidden] { display: none; }
/* Hidden until the card is hovered or focused (computer), or until the address is shown (touch screen) */
.copy-email { opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s; }
.contact-cell:has(:focus-visible) .copy-email, .contact-cell.is-revealed .copy-email { opacity: 1; visibility: visible; }
@media (hover: hover) {
  .contact-cell:hover .copy-email { opacity: 1; visibility: visible; transition-delay: .15s; }
  .contact-cell.is-revealed:not(:hover):not(:has(:focus-visible)) .copy-email { opacity: 0; visibility: hidden; }
}
.copy-email .icon { width: 1rem; height: 1rem; }
.copy-email:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Leave room under the address for the button */
.has-copy .face-2 { padding-bottom: 3rem; }
@media (hover: none), (prefers-reduced-motion: reduce) { .has-copy .face-2 { padding-bottom: 0; } .has-copy.is-revealed .contact-card { padding-bottom: 3.2rem; } }
.noscript-note { margin-top: 1.5rem; color: #E9D9D4; }
html:not(.js) .contact-cell, html:not(.js) #open-form, html:not(.js) .form-wrap { display: none; }
@media (min-width: 800px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }

.contact-form { position: relative; margin-top: 1.6rem; padding: 1.5rem; border-radius: 22px; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .14); color: #F2EDE4; }
.contact-form h3 { margin-bottom: 1rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: .3rem; font-weight: 600; font-size: .92rem; }
.field input, .field textarea { width: 100%; padding: .75rem .9rem; font: inherit; color: #1B1A17; background: #FAF7F2; border: 2px solid transparent; border-radius: 12px; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid #E8B04B; outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-privacy { margin: 0; font-size: .85rem; color: #E9D9D4; }
.form-status { min-height: 1.5em; margin: 1rem 0 0; font-weight: 600; }
.form-status.is-ok { color: #BFE8C2; } .form-status.is-error { color: #FFD2C9; }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 0; margin-top: calc(var(--skew) * -1); padding-top: calc(var(--skew) + 2.5rem); padding-bottom: 2rem; background: var(--footer-bg); color-scheme: dark; color: #A8A196; font-size: .92rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.foot p { margin: 0; }
.foot a { color: #F2EDE4; }
.to-top { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Legal page ---------- */
.legal { max-width: 70ch; }
.legal h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1.5rem; }
.legal-sec h2 { font-size: 1.3rem; margin-top: 2rem; }

/* ---------- Reveal on scroll (only when JS runs) ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.stagger > :nth-child(2) { transition-delay: .08s; } .stagger > :nth-child(3) { transition-delay: .16s; } .stagger > :nth-child(4) { transition-delay: .24s; }

/* ---------- Reduced motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .tl-item.reveal:not(.in)::before { transform: none; }
}
@media print {
  /* Printing or "Save as PDF": a compact, black-on-white document of a few pages.
     Screen-only parts are removed: navigation, buttons, pictures of projects, the form. */
  @page { margin: 12mm 14mm; }
  .site-header, .skip, .tabbar, .cta, .to-top, .tools, .lightbox, .proj-zoom, .proj-visual,
  .section-icon, .pillar-icon, .role-chevron, .tl-dot, .copy-email, #open-form, .form-wrap, .noscript-note, .site-footer { display: none !important; }
  :root, .band-dark > .wrap, .band-contact > .wrap {
    color-scheme: light;
    --bg: #fff; --bg-alt: #fff; --surface: #fff; --text: #000; --muted: #333; --line: #bbb;
    --accent: #9E2D21; --accent-strong: #9E2D21; --on-accent: #fff; --gold: #6B4500; --shadow: none;
  }
  body { background: #fff; color: #000; font-size: 10pt; line-height: 1.4; }
  p { margin-bottom: .55em; }
  a { text-decoration: none; }
  .wrap { width: 100%; }
  .band, .band + .band { clip-path: none; margin: 0; padding: .6rem 0 0; background: #fff !important; filter: none !important; }
  .band-hero { position: static !important; visibility: visible !important; padding-top: 0; }
  .band-hero::after { display: none !important; }
  .band-dark > .wrap, .band-contact > .wrap { color: #000; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  h2, h3, h4, .section-head, .employer-head, .role-heading { break-after: avoid; }
  .pillar, .tl-item, .role-inner li, .contact-card, .contact-cell { break-inside: avoid; }
  .section-head { margin-bottom: .4rem; }
  .section-head h2 { font-size: 16pt; }
  .section-intro { margin-bottom: .6rem; max-width: none; }
  .badge { margin-bottom: .2rem; padding: 0; background: none; color: #333; }
  /* First block: text on the left, small portrait on the right */
  .hero-grid { grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start; }
  .hero-text { display: block; order: 1; }
  .portrait { order: 2; width: 110px; margin: 0; }
  .portrait::before, .portrait::after { display: none; }
  .portrait img { box-shadow: none; }
  .band-hero h1 { font-size: 26pt; }
  .hero-role { font-size: 13pt; margin-bottom: .5rem; }
  .hero-status { max-width: none; margin: 0 0 .5rem; }
  .status-dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .eyebrow { margin-bottom: .6rem; }
  .lead { max-width: none; font-size: inherit; }
  /* Profile and skills (every tag shown, even if folded on screen) */
  .profile-grid { display: block; }
  .profile-text p { max-width: none; font-size: inherit; }
  .pillars { grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .6rem; }
  .pillar { padding: .5rem .7rem; }
  .pillar h3 { margin-top: 0; font-size: 11pt; }
  .pillar p { font-size: 9pt; }
  .chips[hidden] { display: flex !important; }
  .skill-toggle { display: inline; min-height: 0; padding: 0; border: 0; background: none; }
  .skill-count, .skill-chevron { display: none !important; }
  .skill-groups { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .skill-group h3, .skill-langs h3 { margin-bottom: .35rem; }
  .skill-langs { margin-top: .8rem; }
  .chips { gap: .25rem; }
  .chips li { padding: .05rem .45rem; font-size: 8.5pt; }
  /* Experience: every role unfolded */
  /* Key figures: left out of print, the same figures are in the role details (keeps 4 pages) */
  .key-figures { display: none !important; }
  .employers { display: block; }
  .employer { margin-bottom: .7rem; }
  .employer-head { margin-bottom: .3rem; }
  .employer-head h3 { font-size: 13pt; }
  .emp-logo { height: auto; padding: 0; box-shadow: none; }
  .emp-logo img { height: 1.8rem; }
  .roles { display: block; }
  .role { background: none; border: 0; border-top: 1px solid #bbb; border-radius: 0; }
  .role-toggle { padding: .45rem 0 .2rem; }
  .role-title { font-size: 11.5pt; }
  .role-panel { grid-template-rows: 1fr !important; visibility: visible !important; }
  .role-inner { padding: 0; }
  .role-inner > :last-child { margin-bottom: .6rem; }
  .role-summary { padding: 0; margin-bottom: .4rem; }
  .role-inner ul { gap: .2rem; }
  .role-inner li { padding-left: 1rem; }
  .role-inner li::before { top: .6em; width: .35rem; height: .35rem; background: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Education */
  .timeline { padding-left: 0; gap: .3rem; }
  .tl-item { display: grid; grid-template-columns: 6.5rem 1fr; column-gap: 1rem; }
  .tl-item::before { display: none !important; }
  .tl-date, .tl-card { grid-column: auto !important; grid-row: auto !important; text-align: left !important; padding-top: 0; }
  .tl-card { padding: 0; border: 0; }
  .tl-card h3 { font-size: 11pt; }
  .tl-card p { margin-bottom: .15rem; }
  .tl-card .badge { margin-bottom: 0; }
  /* Projects: text only, with the address of each link */
  .proj-grid { display: block; margin-bottom: .6rem; }
  .proj-card { display: block; margin-bottom: .6rem; border: 0; border-radius: 0; }
  .proj-body { display: block; padding: 0; }
  .proj-body h3 { font-size: 12pt; margin-bottom: .2rem; }
  .proj-body .chips { margin: 0 0 .3rem; }
  .proj-body .btn { display: block; padding: 0; border: 0; background: none; color: #000; font-weight: 400; font-size: 9pt; }
  .proj-body .btn .icon { display: none; }
  .proj-body a.btn::after { content: " (" attr(href) ")"; }
  /* Past study projects are left out of the printed version (kept on screen) */
  .archive-title, .section-intro-wide, .archive-toggle-row, .arch-wrap { display: none !important; }
  /* Contact: LinkedIn address and e-mail address written out (app.js fills in the e-mail) */
  .band-contact .section-intro { color: #333; }
  .contact-grid { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0 2rem; }
  .contact-cell { display: block; }
  .contact-card { display: block; min-height: 0; margin: .4rem 0; padding: 0; border: 0; border-radius: 0; background: none; color: #000; }
  .face { position: static; display: block; padding: 0; text-align: left; }
  .face-1 { display: none; }
  .face-2 { clip-path: none; background: none; color: #000; padding: 0 !important; }
  .face-2 .face-label { display: block; font-weight: 600; }
  .face-value { font-family: var(--sans); font-size: inherit; font-weight: 400; }
  a.contact-card[href^="http"] .face-value { display: none; }
  a.contact-card[href^="http"]::after { content: attr(href); }
}

/* ---------- Round 3 tweaks ---------- */
.flag-svg { border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / .18); flex: none; }
.lang-list .flag { display: inline-grid; vertical-align: middle; }
@media (max-width: 420px) {
  .lang-switch a .lang-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .lang-switch a { padding: .3rem .45rem; }
}
@media (min-width: 900px) {
  .hero-grid { align-items: start; }
  .portrait { margin-top: .55rem; }
}
.proj-shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); margin: 0 0 1.5rem; }
.proj-zoom { position: relative; display: block; width: 100%; padding: 0; margin: 0 0 1.5rem; border: 0; border-radius: 14px; background: none; font: inherit; color: inherit; cursor: zoom-in; }
.proj-zoom .proj-shot { margin: 0; transition: filter .25s; }
.proj-zoom-hint { position: absolute; right: .75rem; bottom: .75rem; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: rgb(18 17 16 / .72); color: #F2EDE4; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); pointer-events: none; transition: transform .25s; }
.proj-zoom-hint .icon { width: 1.15rem; height: 1.15rem; }
.proj-zoom:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (hover: hover) { .proj-zoom:hover .proj-shot { filter: brightness(1.06); } .proj-zoom:hover .proj-zoom-hint { transform: scale(1.1); } }
.lightbox { position: fixed; inset: 0; margin: auto; padding: 0; border: 0; border-radius: 16px; background: #0C0B0A; color: #F2EDE4; max-width: 96vw; max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgb(10 8 6 / .84); }
.lightbox-body { max-width: 96vw; max-height: 94vh; overflow: auto; border-radius: 16px; }
.lightbox img { display: block; width: auto; height: auto; max-width: 96vw; max-height: 90vh; margin: 0 auto; object-fit: contain; }
.lightbox img.is-wide { max-width: none; height: min(78vh, 674px); }
@media (min-width: 900px) { .lightbox img.is-wide { width: min(96vw, 1600px); height: auto; max-height: 90vh; } }
.lightbox-close { position: absolute; top: .6rem; right: .6rem; z-index: 2; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0; border: 1px solid rgb(255 255 255 / .35); border-radius: 50%; background: rgb(18 17 16 / .8); color: #F2EDE4; cursor: pointer; }
.lightbox-close .icon { width: 1.2rem; height: 1.2rem; }
.lightbox-close:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:root:has(dialog[open]) { overflow: hidden; }
button.contact-card { font: inherit; cursor: pointer; width: 100%; text-align: inherit; }
.form-wrap { display: grid; grid-template-rows: 1fr; }
.form-wrap > .contact-form { min-height: 0; overflow: hidden; }
.js .form-wrap { grid-template-rows: 0fr; transition: grid-template-rows .45s ease; }
.js .form-wrap.is-open { grid-template-rows: 1fr; }
.js .form-wrap:not(.is-open) .contact-form { visibility: hidden; margin-top: 0; padding-block: 0; border-width: 0; }
.js .form-wrap.is-open .contact-form { margin-top: 1.6rem; }
@media (prefers-reduced-motion: reduce) { .js .form-wrap { transition: none; } }
