/* nicolasromanella.com — site layout on top of nr-design.css */
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; padding: 12px 0; }
.topbar .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-radius: var(--r-pill); padding: 6px 6px 6px 8px; box-shadow: var(--shadow);
}
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; }
.brand .mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-grad); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
.nav-link { text-decoration: none; font-size: 13.5px; font-weight: 550; color: var(--ink-2); padding: 8px 12px; border-radius: var(--r-pill); transition: background var(--t-fast), color var(--t-fast); }
.nav-link:hover, .nav-link.active { background: var(--card); color: var(--ink); }
.bar-actions { display: flex; gap: 6px; align-items: center; }
.pill-link { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--card); text-decoration: none; font-size: 13px; font-weight: 600; transition: transform var(--t-fast) var(--spring); }
.pill-link:active { transform: scale(.94); }
.pill-link svg { width: 14px; height: 14px; }
.spin-once svg { animation: spin-in var(--t-med) var(--spring); }
@keyframes spin-in { from { transform: rotate(-120deg) scale(.6); } to { transform: none; } }


/* ---------- Hero ---------- */
.hero { padding: 40px 0 18px; }
.hero h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1; letter-spacing: -0.04em; font-weight: 800; }
.headline { font-size: 17px; font-weight: 600; margin-top: 12px; }
.headline .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.summary { margin-top: 14px; color: var(--ink-2); font-size: 15.5px; max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; background: var(--inset); padding: 6px 12px; border-radius: var(--r-pill); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-grad); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Sections ---------- */
section.block { padding: 34px 0 6px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 4px 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; font-weight: 750; }
.section-head .count { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Accordion rows (experience / education) ---------- */
.list { display: grid; gap: 8px; }
details.acc { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; transition: background var(--t-med); }
details.acc > summary { list-style: none; cursor: pointer; display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; }
details.acc > summary::-webkit-details-marker { display: none; }
.acc-main { flex: 1; min-width: 0; }
.acc-main .role { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.acc-main .org { font-size: 14px; color: var(--ink-2); font-weight: 550; margin-top: 1px; }
.acc-main .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.acc-side { display: flex; align-items: center; gap: 10px; flex: none; }
.chev { width: 30px; height: 30px; border-radius: 50%; background: var(--inset); display: grid; place-items: center; transition: transform var(--t-med) var(--spring), background var(--t-med); }
.chev svg { width: 14px; height: 14px; }
details.acc.is-open .chev { transform: rotate(180deg); background: var(--accent-grad); color: var(--accent-ink); }
.acc-body { overflow: hidden; }
.acc-inner { padding: 0 18px 18px 76px; display: grid; gap: 12px; color: var(--ink-2); font-size: 14.5px; }
@media (max-width: 620px) { .acc-inner { padding-left: 18px; } }
.grade { font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: var(--r-pill); background: var(--inset); white-space: nowrap; }
.tool-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: var(--r-pill); background: var(--inset); color: var(--ink); text-decoration: none; transition: background var(--t-med), color var(--t-med), transform var(--t-fast) var(--spring); }
a.tag:hover { background: var(--accent-soft); }
a.tag.tag-proj::before { content: "↗ "; color: var(--accent); }
.sub-role { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; }
.sub-role:first-child { border-top: 0; padding-top: 0; }
.sub-role .role { color: var(--ink); font-weight: 650; font-size: 14.5px; }
.sub-role .meta { font-size: 12.5px; color: var(--muted); }
.empty-note { font-size: 13px; color: var(--muted); font-style: italic; }

/* ---------- Projects ---------- */
.filters { max-width: 440px; }
.proj-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.proj {
  position: relative; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit;
  background: var(--card); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow);
  transition: transform var(--t-med) var(--spring), opacity var(--t-med) var(--smooth), box-shadow var(--t-med);
}
a.proj:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 18px 40px rgba(0,0,0,.10); }
a.proj:active { transform: scale(.98); }
.proj.hidden { display: none; }
.proj.leaving { opacity: 0; transform: scale(.94); }
.proj .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kind { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.proj h3 { font-size: 17px; line-height: 1.25; letter-spacing: -0.015em; }
.proj p { font-size: 14px; color: var(--ink-2); }
.proj .ctx { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.proj .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 4px; }
.go { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--inset); flex: none; transition: transform var(--t-med) var(--spring), background var(--t-med), color var(--t-med); }
.go svg { width: 14px; height: 14px; }
a.proj:hover .go { background: var(--accent-grad); color: var(--accent-ink); transform: rotate(-45deg); }
.soon { font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--inset); padding: 5px 10px; border-radius: var(--r-pill); }
.proj.featured { background: var(--inverse); color: var(--inverse-ink); }
.proj.featured p, .proj.featured .ctx, .proj.featured .kind { color: color-mix(in srgb, var(--inverse-ink) 62%, transparent); }
.proj.featured .tag, .proj.featured .go { background: color-mix(in srgb, var(--inverse-ink) 12%, transparent); color: var(--inverse-ink); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.skill-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.skill-card h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-grad); }
.skill-card .chips { gap: 6px; }
.skill-card .chip { height: 30px; font-size: 12.5px; padding: 0 12px; box-shadow: none; background: var(--inset); }
.skill-card .chip[aria-pressed="true"] { background: var(--accent-grad); }
.skill-card .note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.used-in { font-size: 13px; color: var(--ink-2); margin-top: 10px; min-height: 0; }
.used-in a { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent); }
.flash { animation: flash 1.4s var(--smooth); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: var(--shadow); } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: var(--gap); grid-template-columns: 1.2fr 1fr; align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--inset); }
.contact-row .grow { flex: 1; min-width: 0; }
.contact-row b { display: block; font-size: 14px; }
.contact-row span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ai-card { align-content: start; background: var(--inverse); color: var(--inverse-ink); }
.ai-card p { color: color-mix(in srgb, var(--inverse-ink) 65%, transparent); font-size: 14px; }
.ai-card code { font-size: 12.5px; background: color-mix(in srgb, var(--inverse-ink) 12%, transparent); padding: 3px 8px; border-radius: 8px; }
.ai-card .btn { background: var(--accent-grad); color: var(--accent-ink); }
.ai-card .btn.ghost { background: color-mix(in srgb, var(--inverse-ink) 12%, transparent); color: var(--inverse-ink); }

/* ---------- Footer ---------- */
footer { padding: 46px 0 40px; color: var(--muted); font-size: 13px; }
footer .row { flex-wrap: wrap; justify-content: space-between; }
footer a { text-decoration: none; font-weight: 600; color: var(--ink-2); }

/* ---------- Project page ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink-2); margin: 28px 0 14px; }
.crumb svg { width: 14px; height: 14px; }
.p-hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; }
.p-hero .lead { font-size: 16.5px; color: var(--ink-2); margin-top: 12px; max-width: 65ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 20px; }
.fact { background: var(--card); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow); }
.fact .label { display: block; margin-bottom: 3px; }
.fact b { font-size: 14px; }
.p-body { display: grid; gap: var(--gap); margin-top: 26px; }
.p-sec { background: var(--card); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.p-sec h2 { font-size: 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.p-sec h2 .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--accent-grad); color: var(--accent-ink); }
.p-sec p { color: var(--ink-2); font-size: 15px; max-width: 72ch; }
.p-sec p + p { margin-top: 10px; }
.p-sec.insight { background: var(--inverse); color: var(--inverse-ink); }
.p-sec.insight p { color: color-mix(in srgb, var(--inverse-ink) 75%, transparent); }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery button { border: 0; padding: 0; border-radius: var(--r-md); overflow: hidden; cursor: zoom-in; background: var(--inset); aspect-ratio: 4/3; transition: transform var(--t-med) var(--spring); }
.gallery button:hover { transform: scale(1.02); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--smooth); padding: 24px; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: var(--r-lg); transform: scale(.94); transition: transform var(--t-med) var(--spring); }
.lightbox.open img { transform: none; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.pager a { text-decoration: none; }
.pager .label { display: block; }
.pager .card { transition: transform var(--t-med) var(--spring); }
.pager a:hover .card { transform: translateY(-3px); }
.pager .next { text-align: right; }
.fade-in { animation: swapIn var(--t-med) var(--smooth); } @keyframes swapIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Hero (wide) ---------- */
.hero-card { padding: 28px 30px; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; }
@media (max-width: 860px) { .hero-card { grid-template-columns: 1fr; align-items: start; } }
.hero-side { display: grid; gap: 16px; justify-items: start; }
.hero-side .hero-actions { margin-top: 0; }
.hero-links { display: grid; gap: 6px; }
.hero-links a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 14px; font-weight: 550; color: var(--ink-2); padding: 6px 12px 6px 6px; border-radius: var(--r-pill); transition: background var(--t-fast), color var(--t-fast); }
.hero-links a:hover { background: var(--inset); color: var(--ink); }
.hero-links svg { width: 30px; height: 30px; padding: 8px; border-radius: 50%; background: var(--inset); flex: none; }

/* ---------- Experience: multi-role org ---------- */
.org-group { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 18px 10px; }
.org-head { display: flex; gap: 14px; align-items: center; }
details.role-acc { box-shadow: none; background: transparent; border-radius: var(--r-md); overflow: visible; }
details.role-acc > summary { padding: 10px 8px 10px 14px; border-radius: var(--r-md); position: relative; align-items: center; transition: background var(--t-fast); }
details.role-acc > summary:hover { background: var(--inset); }
details.role-acc.is-open .tl-dot { background: var(--accent-grad); box-shadow: 0 0 0 3px var(--accent-soft); transform: scale(1.15); }
details.role-acc .acc-inner { padding: 4px 8px 14px 14px; }

/* ---------- Languages ---------- */
.langs { margin-top: var(--gap); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.langs h3 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.langs h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-grad); }
.lang-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lang { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.lang em { font-style: normal; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.ticks { display: inline-flex; gap: 3px; }
.ticks i { width: 14px; height: 8px; border-radius: var(--r-pill); background: var(--inset); transition: background var(--t-med) var(--smooth); transition-delay: calc(var(--k) * 90ms + 200ms); }
.langs.in .ticks i.on, .no-js .ticks i.on { background: var(--accent-grad); }
.theme-switch { width: auto; padding: 3px; }
.theme-switch button { width: 32px; height: 30px; padding: 0; display: grid; place-items: center; }
.theme-switch svg { width: 15px; height: 15px; }

/* ---------- Language switch ---------- */
.lang-switch { width: auto; padding: 3px; }
.lang-switch button { height: 30px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; }
.lang-switch .flag { width: 18px; height: 12px; flex: none; }
.lang-switch button[aria-disabled="true"] { cursor: default; opacity: .6; }
@media (max-width: 520px) { .lang-switch span { display: none; } }

.lang-switch button { width: 34px; padding: 0; justify-content: center; }
.lang-switch .flag { width: 20px; height: 14px; }
/* Consulting band */
.consult { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: var(--gap); padding: 20px 22px; }
@media (max-width: 680px) { .consult { flex-direction: column; align-items: flex-start; } }

/* ---------- Top bar: mark + evenly spaced items ---------- */
.bar { padding: 6px 8px 6px 6px; }
.bar-rest { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-left: 24px; }
@media (max-width: 900px) { .nav { display: none; } .bar-rest { justify-content: flex-end; gap: 8px; } }

/* ---------- CV-style org blocks (experience + education) ---------- */
.org { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 18px 10px; }
.org-head { display: flex; align-items: center; gap: 14px; }
.org-name { flex: 1; font-size: 17px; font-weight: 750; letter-spacing: -0.015em; }
.org-place { font-size: 13.5px; font-weight: 550; color: var(--ink-2); text-align: right; }
.roles { margin: 2px 0 0 58px; display: grid; }
details.role-acc { box-shadow: none; background: transparent; border-radius: var(--r-md); overflow: visible; }
details.role-acc > summary { display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 0 -10px; border-radius: var(--r-md); transition: background var(--t-fast); }
details.role-acc > summary:hover { background: var(--inset); }
.role-title { flex: 1; font-size: 15px; font-weight: 650; }
.role-dates { font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.grade-inline { margin-left: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
details.role-acc .chev { width: 26px; height: 26px; flex: none; }
details.role-acc .acc-inner { padding: 4px 0 14px; }
@media (max-width: 620px) { .roles { margin-left: 0; margin-top: 8px; } .role-dates { font-size: 12.5px; } }

/* ---------- Languages card ---------- */
.lang-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.lang-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.lang-list b { font-weight: 600; }
.lang-list span { font-size: 13px; color: var(--muted); }

/* ---------- Contact ---------- */
.row-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; }
.book { margin-top: var(--gap); display: grid; gap: 14px; padding: 20px 22px; }
.book-head { display: flex; align-items: center; gap: 12px; }
.book-slot { display:none; min-height: 180px; border-radius: var(--r-md); border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: 14px; font-weight: 550; }

/* ---------- Top bar groups ---------- */
.nav, .bar-files { display: flex; align-items: center; gap: 2px; }
.bar-files { gap: 6px; }
.topbar .tip::after { bottom: auto; top: calc(100% + 12px); transform: translate(-50%, -6px) scale(.9); }
.topbar .tip:hover::after, .topbar .tip:focus-visible::after { transform: translate(-50%, 0) scale(1); }

/* ---------- Timeline under the logo ---------- */
details.role-acc { position: relative; }
details.role-acc::before { content: ""; position: absolute; left: -37px; top: -10px; bottom: 0; width: 2px; background: var(--line); }
details.role-acc:last-child::before { bottom: auto; height: 32px; }
.roles { padding-top: 6px; }
.org-head { position: relative; z-index: 1; }
.tl-dot { position: absolute; left: -32px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 2px var(--line); z-index: 1;
  transition: background var(--t-med), box-shadow var(--t-med), transform var(--t-med) var(--spring); }
details.role-acc > summary { position: relative; }
details.role-acc.is-open .tl-dot { background: var(--accent-grad); box-shadow: 0 0 0 3px var(--accent-soft); transform: scale(1.15); }
@media (max-width: 620px) { .roles { margin-left: 22px; } details.role-acc::before { left: -15px; } .tl-dot { left: -10px; } }

/* ---------- Smaller project filter ---------- */
.filters { padding: 3px; }
.filters button { height: 30px; font-size: 13.5px; padding: 0 12px; }

/* ---------- Languages row (plain) ---------- */
.lang-row { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.lang { font-size: 14px; }
.lang b { font-weight: 600; }
.lang span { color: var(--muted); font-size: 13px; margin-left: 4px; }

/* ---------- AI card: same height as contacts ---------- */
.contact-grid { align-items: stretch; }
.ai-card { display: flex; flex-direction: column; gap: 10px; }
.ai-card .ai-actions { margin-top: auto; padding-top: 6px; }

/* ---------- Used in: links only ---------- */
.used-in { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.used-in:empty { display: none; }
.used-in a { font-size: 12.5px; font-weight: 600; text-decoration: none; border: 0; padding: 4px 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--ink); }
.used-in a::before { content: "↗ "; color: var(--accent); }
.used-in .muted { font-size: 12.5px; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) { .nav { display: none; } .bar-rest { justify-content: flex-end; gap: 8px; } }
@media (max-width: 480px) {
  .bar-rest { gap: 6px; margin-left: 8px; }
  .bar-files .pill-link { padding: 0 10px; }
  .bar-files .pill-link:first-child span { display: none; }
  .theme-switch button { width: 28px; }
  .lang-switch button { width: 30px; }
  .hero-card { padding: 22px 18px; }
  .hero-links span { overflow-wrap: anywhere; }
  .org { padding: 14px 14px 8px; }
  .org-name { font-size: 16px; }
}
.org-name, .role-title { min-width: 0; }
@media (max-width: 620px) {
  .org-head { flex-wrap: wrap; row-gap: 0; }
  .org-name { flex: 1 1 0; }
  .org-place { flex-basis: 100%; text-align: left; padding-left: 58px; margin-top: -10px; font-size: 12.5px; }
  details.role-acc > summary { flex-wrap: wrap; row-gap: 2px; }
  .role-title { flex-basis: calc(100% - 40px); }
  .role-dates { order: 3; flex-basis: 100%; }
  details.role-acc > summary .chev { order: 2; }
}

/* ---------- Top bar right cluster ---------- */
.bar-right { display: flex; align-items: center; gap: 14px; }
@media (max-width: 480px) { .bar-right { gap: 6px; } }

/* ---------- Project kinds ---------- */
:root { --c-work: #3B9EFF; --c-personal: var(--accent); --c-academic: #8B5CF6; --c-wip: #F2562E; --c-app: #22C55E; }   /* Nov 19: academic purple again, apps green */
.kind { display: inline-block; padding: 3px 9px; border-radius: var(--r-pill); letter-spacing: .05em; }
.kind-work { color: var(--c-work); background: color-mix(in srgb, var(--c-work) 14%, transparent); }
.kind-personal { color: color-mix(in srgb, var(--c-personal) 85%, var(--ink)); background: color-mix(in srgb, var(--c-personal) 16%, transparent); }
.kind-academic { color: var(--c-academic); background: color-mix(in srgb, var(--c-academic) 14%, transparent); }
.proj.featured .kind.kind-work { color: #7CC0FF; background: rgba(59,158,255,.18); }
#projFilter .thumb { transition: transform var(--t-med) var(--spring), width var(--t-med) var(--spring), background var(--t-med) var(--smooth); }
#projFilter[data-active="Work"] .thumb { background: color-mix(in srgb, var(--c-work) 20%, var(--card)); }
#projFilter[data-active="Personal"] .thumb { background: color-mix(in srgb, var(--c-personal) 24%, var(--card)); }
#projFilter[data-active="Academic"] .thumb { background: color-mix(in srgb, var(--c-academic) 20%, var(--card)); }
#projFilter[data-active="Work"] button[data-value="Work"] { color: var(--c-work); }
#projFilter[data-active="Personal"] button[data-value="Personal"] { color: color-mix(in srgb, var(--c-personal) 80%, var(--ink)); }
#projFilter[data-active="Academic"] button[data-value="Academic"] { color: var(--c-academic); }

/* ---------- Nested vs flat sections ---------- */
html[data-nest="1"] .sec-body { background: var(--surface); border-radius: var(--r-xl); padding: 12px; transition: background var(--t-med) var(--smooth); }
html[data-nest="0"] .sec-body { background: none; padding: 0; }
.hero .sec-body .hero-card { box-shadow: var(--shadow); }

/* ---------- Timeline continues below the last role ---------- */
details.role-acc:last-child::before { height: auto; bottom: -10px; background: linear-gradient(var(--line) 0 30px, transparent); }

/* ---------- Right cluster: equal spacing for .md, CV, flags, themes ---------- */
.bar-files { display: contents; }

/* ---------- NR mark opens to "Home" on hover ---------- */
.brand { gap: 0; padding: 0; border-radius: var(--r-pill); transition: background var(--t-med) var(--smooth); }
.brand-home { display: inline-block; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--ink);
  transition: max-width var(--t-med) var(--spring), opacity var(--t-fast), margin var(--t-med) var(--spring); }
.brand:hover, .brand:focus-visible { background: var(--card); }
.brand:hover .brand-home, .brand:focus-visible .brand-home { max-width: 60px; opacity: 1; margin: 0 4px 0 8px; }
.bar-rest { margin-left: -2px; }

/* ---------- Brand: NR circle grows into a "Home" pill, space reserved so the nav never moves ---------- */
.brand-slot { width: 70px; flex: none; display: flex; align-items: center; }
.brand { position: relative; height: 34px; width: 34px; padding: 0; border-radius: var(--r-pill); background: var(--accent-grad); color: var(--accent-ink);
  display: grid; place-items: center; overflow: hidden; text-decoration: none; font-size: 13px; font-weight: 800;
  transition: width var(--t-med) var(--spring), transform var(--t-fast) var(--spring); }
.brand:hover, .brand:focus-visible { width: 70px; background: var(--accent-grad); }
.brand:active { transform: scale(.95); }
.b-nr, .b-home { grid-area: 1 / 1; white-space: nowrap; transition: opacity var(--t-fast), transform var(--t-med) var(--spring); }
.b-home { opacity: 0; transform: translateY(8px); font-size: 13.5px; font-weight: 650; }
.brand:hover .b-nr, .brand:focus-visible .b-nr { opacity: 0; transform: translateY(-8px); }
.brand:hover .b-home, .brand:focus-visible .b-home { opacity: 1; transform: none; }
@media (max-width: 900px) { .brand-slot { width: 34px; } .brand:hover { width: 34px; } .brand:hover .b-nr { opacity: 1; transform: none; } .brand:hover .b-home { opacity: 0; } }

/* ---------- Right cluster: tighter, equal gaps ---------- */
.bar-right { gap: 6px; }

/* ---------- Projects: first three, then "View all" ---------- */
.more-row { display: flex; justify-content: center; margin-top: 12px; }
.more-row[hidden] { display: none; }
.more-btn { height: 38px; font-size: 13.5px; background: var(--card); box-shadow: var(--shadow); }
.more-btn .more-n { color: var(--muted); font-weight: 550; }
.more-btn svg { width: 14px; height: 14px; transition: transform var(--t-med) var(--spring); }
.more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.proj.enter { animation: projIn var(--t-med) var(--spring) backwards; }
@keyframes projIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* Alternative layout (not active): one horizontal rail */
.proj-grid.rail { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.proj-grid.rail > .proj { flex: 0 0 300px; scroll-snap-align: start; }
.proj-grid.rail > .proj.over { display: flex; }

/* ---------- Section nav with sliding pill (scroll spy) ---------- */
.seg-nav { position: relative; padding: 3px; border-radius: var(--r-pill); }
.nav-thumb { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: var(--r-pill); background: var(--accent-grad);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform var(--t-med) var(--spring), width var(--t-med) var(--spring), opacity var(--t-fast); }
.seg-nav .nav-link { position: relative; z-index: 1; transition: color var(--t-med) var(--smooth), background var(--t-fast); }
.seg-nav .nav-link.active { color: var(--accent-ink); background: none; }
.seg-nav .nav-link:not(.active):hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.bar-rest { margin-left: 0; }

/* ---------- Collapsible lists ---------- */
.collapsible { margin: -12px; padding: 12px; overflow: visible; }
.collapsible.is-collapsed, .collapsible.animating { overflow: hidden; }
.collapsible.is-collapsed { -webkit-mask-image: linear-gradient(#000 calc(100% - 120px), transparent 100%); mask-image: linear-gradient(#000 calc(100% - 120px), transparent 100%); }
.more-row { display: flex; justify-content: center; position: relative; z-index: 2; margin-top: -34px; transition: margin var(--t-med) var(--smooth); }
.more-row.open { margin-top: 14px; }
.more-row[hidden] { display: none; }
.more-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 18px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 650; color: var(--ink);
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow);
  transition: transform var(--t-fast) var(--spring), background var(--t-med); }
.more-btn:hover { transform: translateY(-1px); }
.more-btn:active { transform: scale(.96); }
.more-btn .more-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: var(--r-pill); background: var(--inset); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.more-btn svg { width: 14px; height: 14px; transition: transform var(--t-med) var(--spring); }
.more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------- Footer credit ---------- */
footer .built-with { font-weight: 550; color: var(--muted); text-decoration: none; transition: color var(--t-fast); }
footer .built-with:hover { color: var(--muted); }

/* ---------- v3: plain thumb, small Show more, footer credit ---------- */
.nav-thumb { box-shadow: none; }
.collapsible { margin: 0; padding: 0; }
.collapsible .cut { display: none; }
.collapsible.is-collapsed { -webkit-mask-image: none; mask-image: none; }
.more-row, .more-row.open { margin-top: 12px; }
.more-btn { height: 30px; padding: 0 12px 0 14px; font-size: 13px; font-weight: 600; background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; }
.more-btn svg { width: 12px; height: 12px; }
footer .built-with { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--muted); }
footer .built-with img { width: 14px; height: 14px; }

/* ---------- Hero v7: [photo|text] slider on the left, quick-contact column on the right ---------- */
:root { --spring: cubic-bezier(.3, 1.12, .5, 1); }
.hero-card { position: relative; display: flex; align-items: stretch; gap: 32px; padding: 28px 30px; --side: 300px; --ico: 38px; --ph: 210px; --tw: 560px; }
.hero-view { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.hero-track { display: flex; gap: 32px; align-items: flex-start; transform: translateX(calc(-1 * (var(--ph) + 32px))); transition: transform 560ms var(--smooth); }
.hero-card[data-slide="0"] .hero-track { transform: none; }
.hero-photo { flex: 0 0 var(--ph); margin: 0; transition: opacity 420ms var(--smooth); }
.hero-photo img { display: block; width: var(--ph); height: var(--ph); object-fit: cover; border-radius: var(--r-lg); }
.hero-card[data-slide="1"] .hero-photo { opacity: 0; }
.hero-text { flex: 0 0 var(--tw); min-width: 0; }
.hero-quick { flex: 0 0 var(--side); width: var(--side); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  transition: flex-basis 560ms var(--smooth), width 560ms var(--smooth); }
.hero-card[data-slide="0"] .hero-quick { flex-basis: var(--ico); width: var(--ico); }
.hero-quick a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink-2); font-size: 14.5px; font-weight: 550; white-space: nowrap; border-radius: var(--r-pill); transition: color var(--t-fast); }
.hero-quick a:hover { color: var(--ink); }
.hero-quick svg { flex: none; width: var(--ico); height: var(--ico); padding: 10px; border-radius: 50%; background: var(--inset); transition: background var(--t-fast), transform var(--t-fast) var(--smooth); }
.hero-quick a:hover svg { background: color-mix(in srgb, var(--ink) 12%, var(--inset)); }
.hero-quick a.q-book { color: var(--ink); font-weight: 650; }
.hero-quick a.q-book svg { background: var(--accent-grad); color: var(--accent-ink); }
.hero-quick a.q-book:hover svg { background: var(--accent-grad); transform: scale(1.06); }
.hero-quick span { transition: opacity 360ms var(--smooth); }
.hero-card[data-slide="0"] .hero-quick span { opacity: 0; }
.hero-dots { position: absolute; top: 12px; right: 16px; z-index: 2; display: flex; gap: 6px; }
.hero-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--line); cursor: pointer; transition: width 300ms var(--smooth), background 300ms; }
.hero-dots button[aria-selected="true"] { width: 22px; background: var(--accent-grad); }
@media (max-width: 860px) {
  .hero-card { display: grid; gap: 20px; padding: 30px 18px 22px; }
  .hero-track { display: grid; gap: 20px; transform: none !important; }
  .hero-text { order: 0; } .hero-photo { order: 1; }
  .hero-card[data-slide="1"] .hero-photo { display: none; }
  .hero-photo img { width: 100%; max-width: 300px; height: auto; aspect-ratio: 1; }
  .hero-quick, .hero-card[data-slide="0"] .hero-quick { width: auto; gap: 8px; }
  .hero-card[data-slide="0"] .hero-quick { flex-direction: row; justify-content: flex-start; }
  .hero-quick a span { white-space: normal; overflow-wrap: anywhere; }
  .hero-card[data-slide="0"] .hero-quick span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hero-track, .hero-quick { transition: none; } }

/* ---------- Show more: just an arrow ---------- */
.more-row, .more-row.open { margin-top: 2px; margin-bottom: -6px; }
.more-btn { width: 34px; height: 26px; padding: 0; justify-content: center; background: none; box-shadow: none; color: var(--muted); border-radius: var(--r-pill); }
.more-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); transform: none; }
.more-btn svg { width: 18px; height: 18px; }

/* ---------- Project footer: never grows, "+N" for extra tools ---------- */
.proj .foot { flex-wrap: nowrap; align-items: center; }
.proj .foot .tool-row { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; gap: 6px; overflow: hidden; }
.proj .foot .tag { flex: none; white-space: nowrap; }
.proj .foot .soon { flex: none; white-space: nowrap; }
.more-tag { color: var(--muted); }
.proj .foot .tool-row .tag.solo { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.proj.enter { animation: projIn 320ms var(--smooth) backwards; }
@keyframes projIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- v8 (Nov 16): equal hero spacing, yellow Book-a-call, CV menu, centred thumbs ---------- */
/* Hero: one gap --g everywhere. JS sets --tw (text width), --ph (photo = text height), --side (labels column)
   so that  photo | g | text | g | icons  and  text | g | labels  both fill the card exactly. */
.hero-card { --g: 40px; gap: var(--g); }
.hero-track { gap: var(--g); transform: translateX(calc(-1 * (var(--ph) + var(--g)))); align-items: center; }
.hero-card[data-slide="0"] .hero-track { transform: none; }
/* icons: compact, centred on the text block (inside name top / last paragraph line), set a bit in from the right edge */
.hero-quick { justify-content: center; gap: 12px; }
/* padding: 60px on the side with the arrow, 30px on the other; JS keeps the inner width constant */
@media (min-width: 861px) { .hero-card { padding: 30px 30px 30px 60px; transition: padding 560ms var(--smooth); } .hero-card[data-slide="0"] { padding: 30px 60px 30px 30px; } }
.hero .summary { max-width: none; font-size: 16px; }
.hero-quick a { font-weight: 550; }
/* Book a call: same round button as the others, tinted yellow; full yellow on hover */
.hero-quick a.q-book { color: var(--ink-2); font-weight: 550; }
.hero-quick a.q-book svg { background: color-mix(in srgb, var(--accent) 22%, var(--inset)); color: var(--accent); transition: background var(--t-fast), color var(--t-fast); }
.hero-quick a.q-book:hover { color: var(--ink); }
.hero-quick a.q-book:hover svg { background: var(--accent-grad); color: var(--accent-ink); transform: none; }
@media (max-width: 860px) { .hero-track { transform: none !important; } }

/* CV: hover/click opens a small tooltip-style bubble (same look as the .md tooltip) with US / EU */
.cv-menu { position: relative; }
.cv-btn { border: 0; cursor: pointer; color: inherit; font: inherit; font-size: 13px; font-weight: 600; }
.cv-pop { position: absolute; top: calc(100% + 12px); left: 50%; z-index: 60; display: flex; gap: 4px; padding: 4px;
  background: var(--inverse); color: var(--inverse-ink); border-radius: 12px; white-space: nowrap;
  opacity: 0; transform: translate(-50%, -6px) scale(.9); pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-med) var(--spring); }
.cv-pop::before { content: ""; position: absolute; left: -8px; right: -8px; top: -14px; height: 14px; } /* hover bridge */
.cv-menu:hover .cv-pop, .cv-menu:has(:focus-visible) .cv-pop, .cv-menu.open .cv-pop { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.cv-opt { display: inline-grid; place-items: center; min-width: 40px; height: 28px; padding: 0 10px; border-radius: 9px;
  font-size: 12px; font-weight: 650; text-decoration: none; color: var(--inverse-ink); transition: background var(--t-fast), color var(--t-fast); }
a.cv-opt:hover, a.cv-opt:focus-visible { background: var(--accent-grad); color: var(--accent-ink); }
.cv-opt.off { opacity: .45; cursor: default; }

/* Segmented thumbs: same inset as the track padding, so the pill sits exactly centred */
.filters .thumb, .lang-switch .thumb, .theme-switch .thumb { top: 3px; bottom: 3px; }

/* ---------- Book a call (calendar -> time -> details) ---------- */
.book-head .grow { flex: 1; min-width: 0; }
.book-head .q-cal { background: color-mix(in srgb, var(--accent) 22%, var(--inset)); color: var(--accent); }
.bk-dur { width: auto; padding: 3px; flex: none; }
.bk-dur button { height: 30px; font-size: 13px; padding: 0 14px; }
.bk-dur .thumb { top: 3px; bottom: 3px; }
.bk { display: grid; grid-template-columns: 1.15fr 1fr 1.1fr; gap: var(--gap); position: relative; }
.bk-col { background: var(--inset); border-radius: var(--r-md); padding: 14px; min-width: 0; transition: opacity var(--t-med) var(--smooth); }
.bk .label { margin-bottom: 10px; }
.bk .cal-head { margin-bottom: 6px; }
.bk .cal-head .icon-btn { background: var(--card); width: 30px; height: 30px; }
.bk .cal-head .icon-btn:disabled { opacity: .35; cursor: default; }
.bk .cal-head .icon-btn svg { width: 14px; height: 14px; }
.bk-month { font-size: 14px; }
.bk .cal-grid button { font-size: 13px; }
.bk .cal-grid button:not(:disabled):not(.sel) { background: var(--card); }
.bk .cal-grid button:not(:disabled):not(.sel):hover { background: color-mix(in srgb, var(--accent) 18%, var(--card)); }
.bk-tz { margin: 10px 0 0; }
.bk-day { color: var(--ink); font-weight: 650; font-size: 13.5px; }
.bk .slots { grid-template-columns: repeat(3, 1fr); max-height: 252px; overflow: auto; padding: 2px; margin: -2px; }
.bk .slots .chip { justify-content: center; height: 34px; padding: 0; box-shadow: none; font-variant-numeric: tabular-nums; }
.bk-empty { font-size: 13px; }
.bk-form { display: grid; gap: 8px; align-content: start; }
.bk-form .label { margin-bottom: 2px; }
.bk-pick { background: var(--card); font-size: 12.5px; color: var(--muted); transition: background var(--t-med), color var(--t-med); }
.bk-pick.on { background: var(--accent-soft); color: var(--ink); }
.field { width: 100%; border: 0; border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; padding: 10px 12px; outline: none; resize: vertical;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow var(--t-fast); }
.field::placeholder { color: var(--muted); }
.field:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.bk-go { height: 42px; margin-top: 2px; }
.bk-go:disabled { opacity: .45; cursor: default; filter: none; }
.bk-msg { font-size: 12.5px; color: var(--ink-2); min-height: 0; }
.bk-msg:empty { display: none; }
.bk.is-loading .bk-cal, .bk.is-loading .bk-times { opacity: .5; }
.bk-done { position: absolute; inset: 0; border-radius: var(--r-md); background: var(--inset); display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px;
  animation: projIn 360ms var(--smooth) both; }
.bk-done .title { font-size: 18px; }
.bk-done .ink-2 { max-width: 46ch; font-size: 14px; }
.bk-check { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-grad); color: var(--accent-ink); animation: pop var(--t-med) var(--spring); }
.bk-check svg { width: 20px; height: 20px; }
.bk.is-done > .bk-col { visibility: hidden; }
@media (max-width: 900px) { .bk { grid-template-columns: 1fr 1fr; } .bk-form { grid-column: 1 / -1; } }
@media (max-width: 600px) { .bk { grid-template-columns: 1fr; } .book-head { flex-wrap: wrap; } }
.bk-done[hidden] { display: none; }
.bk-done .btn.ghost { background: var(--card); }
.bk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.bk-times { display: flex; flex-direction: column; }
.bk-times .bk-tz { margin: auto 0 0; padding-top: 12px; }
.bk .cal-grid .pad { aspect-ratio: 1; }
.bk-times .bk-tz { margin: auto 0 0; padding-top: 12px; }
/* "Can't find a time?" switches the details panel to a message form */
.bk-times .bk-foot { margin-top: auto; padding-top: 12px; display: grid; gap: 0; justify-items: start; line-height: 1.35; }
.bk-times .bk-foot .bk-tz { margin: 0; padding: 0; }
.bk-ask { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); transition: color var(--t-fast); }
.bk-ask:hover { color: var(--ink); }
.bk.is-msg .bk-ask { color: var(--accent); }
.bk-form-head { display: flex; justify-content: space-between; align-items: center; }
.bk-form-head .label { margin: 0; }
.bk-back { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 12px; }
.bk-back:hover { color: var(--ink); }
.bk.is-msg .bk-pick { opacity: .5; }

/* ---------- Hero arrows (replace the dots): left = photo, right = back to contacts ---------- */
.hero-dots { display: none; }
.hero-arrow { position: absolute; top: 50%; z-index: 2; width: 34px; height: 34px; margin-top: -17px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: none; color: var(--muted); cursor: pointer; transition: opacity 300ms var(--smooth), color var(--t-fast), background var(--t-fast); }
.hero-arrow:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.hero-arrow svg { width: 18px; height: 18px; }
.hero-arrow.prev { left: 14px; } .hero-arrow.prev svg { transform: rotate(90deg); }
.hero-arrow.next { right: 14px; } .hero-arrow.next svg { transform: rotate(-90deg); }
.hero-card[data-slide="1"] .hero-arrow.next, .hero-card[data-slide="0"] .hero-arrow.prev { opacity: 0; pointer-events: none; }
@media (max-width: 860px) { .hero-arrow { top: 12px; margin-top: 0; } .hero-arrow.prev { left: auto; right: 12px; } .hero-arrow.next { right: 12px; } }
.bk .bk-foot .label, .bk .bk-foot .bk-ask { margin: 0; }

/* ---------- Projects: cards per row (3 / 2 / list) + "+N" tools popover (Nov 16) ---------- */
.proj-head { align-items: center; }
.proj-head .sh-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.view-switch { width: auto; padding: 3px; }
.view-switch button { height: 30px; width: 38px; padding: 0; display: grid; place-items: center; }
.view-switch svg { width: 16px; height: 16px; }
.view-switch .thumb { top: 3px; bottom: 3px; }
#projGrid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#projGrid[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#projGrid[data-cols="2"] .proj { padding: 20px 22px; }
#projGrid[data-cols="2"] .proj h3 { font-size: 18px; }
#projGrid[data-cols="1"] { grid-template-columns: 1fr; gap: 10px; }
#projGrid[data-cols="1"] .proj { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr); grid-template-areas: "top foot" "h3 p" "ctx p"; column-gap: 32px; row-gap: 6px; padding: 16px 20px; align-items: start; }
#projGrid[data-cols="1"] .proj .top { grid-area: top; justify-content: flex-start; gap: 10px; }
#projGrid[data-cols="1"] .proj h3 { grid-area: h3; }
#projGrid[data-cols="1"] .proj > .ctx { grid-area: ctx; }
#projGrid[data-cols="1"] .proj p { grid-area: p; }
#projGrid[data-cols="1"] .proj .foot { grid-area: foot; margin: 0; padding: 0; }
@media (max-width: 860px) {
  #projGrid[data-cols] { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  #projGrid[data-cols="1"] .proj { display: flex; padding: 18px; }
  .view-switch { display: none; }
}
.more-tag { cursor: default; }
.tool-pop { position: fixed; z-index: 120; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: var(--r-md);
  background: var(--card); box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 14px 34px rgba(0,0,0,.16); pointer-events: none;
  opacity: 0; transform: translateY(4px) scale(.96); transform-origin: bottom center; transition: opacity var(--t-fast), transform var(--t-med) var(--spring); }
.tool-pop.on { opacity: 1; transform: none; }
.tool-pop .tag { white-space: nowrap; }
#projGrid .proj.cut, #projGrid .proj.hidden { display: none; }
.proj-head .sh-left { flex-wrap: nowrap; }
.proj-head .sh-left .filters { width: 400px; max-width: none; flex: none; }
@media (max-width: 860px) { .proj-head .sh-left { flex-wrap: wrap; } .proj-head .sh-left .filters { width: 100%; max-width: 440px; } }

/* ---------- v9 (Nov 16): filters on the right next to the view switch ---------- */
.proj-head .sh-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.proj-head .sh-right .filters { width: 400px; max-width: none; flex: none; }
@media (max-width: 860px) { .proj-head .sh-right { width: 100%; margin-left: 0; } .proj-head .sh-right .filters { width: 100%; max-width: 440px; flex: 1 1 auto; } }

/* Project link inside an experience paragraph: a small arrow dot that opens into the title on hover */
.pdot { display: inline-flex; align-items: center; vertical-align: -5px; height: 22px; margin-left: 4px; border-radius: var(--r-pill);
  text-decoration: none; color: var(--ink); background: transparent; transition: background var(--t-med) var(--smooth), padding var(--t-med) var(--smooth); }
.pdot + .pdot { margin-left: 3px; }
.pdot-i { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-grad); color: var(--accent-ink);
  transition: transform var(--t-med) var(--spring); }
.pdot-i svg { width: 12px; height: 12px; transform: rotate(-45deg); }
.pdot-t { max-width: 0; overflow: hidden; white-space: nowrap; font-size: 12.5px; font-weight: 650; opacity: 0;
  transition: max-width 480ms var(--smooth), opacity 300ms var(--smooth), padding 480ms var(--smooth); }
.pdot:hover, .pdot:focus-visible { background: var(--accent-soft); }
.pdot:hover .pdot-t, .pdot:focus-visible .pdot-t { max-width: 460px; opacity: 1; padding: 0 10px 0 8px; }
.pdot:hover .pdot-i { transform: scale(1.06); }

/* ---------- Mobile (≤ 860 px): no photo slider, top bar = .md, CV, language, theme only ---------- */
@media (max-width: 860px) {
  .hero-arrow, .hero-photo, .hero-card .hero-photo { display: none !important; }
  .hero-card[data-slide="0"] .hero-quick { flex-direction: column; }
  .hero-card[data-slide="0"] .hero-quick span { display: inline; opacity: 1; }
}
@media (max-width: 900px) { .topbar .seg-nav, .topbar .nav, .topbar .brand-slot, .topbar .brand { display: none !important; } }

/* ---------- v10: project dots on the right of the tools row, grey dot + accent arrow, active = yellow + black arrow ---------- */
.tool-row .pdots { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.pdot { height: 26px; margin: 0; vertical-align: middle; background: var(--inset); color: var(--ink); }
.pdot + .pdot { margin-left: 0; }
.pdot-i { width: 26px; height: 26px; background: transparent; color: var(--accent); transition: background var(--t-med) var(--smooth), color var(--t-med) var(--smooth), transform var(--t-med) var(--spring); }
.pdot-i svg { width: 13px; height: 13px; }
.pdot:hover, .pdot:focus-visible { background: var(--accent-grad); color: var(--accent-ink); }
.pdot:hover .pdot-i, .pdot:focus-visible .pdot-i { color: var(--accent-ink); transform: none; }
.pdot:hover .pdot-t, .pdot:focus-visible .pdot-t { padding: 0 2px 0 12px; }
.pdot { transition: padding var(--t-med) var(--smooth); }

/* ---------- v11: one link-arrow style everywhere (26px, grey dot + accent ↗; active = yellow dot + black arrow) ---------- */
.go, .pdot-i { width: 26px; height: 26px; border-radius: 50%; background: var(--inset); color: var(--accent); }
.go svg, .pdot-i svg { width: 13px; height: 13px; transform: rotate(-45deg); }
a.proj:hover .go, .pdot:hover .pdot-i, .pdot:focus-visible .pdot-i { background: var(--accent-grad); color: var(--accent-ink); transform: none; }
a.proj:hover { transform: translateY(-2px); }
/* dot pill: softer on hover, only the arrow dot turns yellow */
.pdot { background: transparent; }
.pdot:hover, .pdot:focus-visible { background: var(--inset); color: var(--ink); }
/* v12: more room between title and arrow; softer "For AI agents" card in light theme */
.pdot:hover .pdot-t, .pdot:focus-visible .pdot-t { padding: 0 10px 0 12px; }
:root[data-theme="light"] .ai-card { background: #E4E4E8; color: var(--ink); box-shadow: none; }
:root[data-theme="light"] .ai-card p { color: var(--ink-2); }
:root[data-theme="light"] .ai-card code { background: rgba(0,0,0,.07); }
:root[data-theme="light"] .ai-card .btn.ghost { background: rgba(0,0,0,.08); color: var(--ink); }

/* ---------- v13 (Nov 17): smartphone pass ---------- */
.bar-home { display: none; }
@media (max-width: 900px) {
  /* top bar: Home + .md + CV + language + theme, spread over the full width, pills like desktop */
  .bar-home { display: inline-flex; width: 36px; padding: 0; justify-content: center; }
  .bar-home svg { width: 16px; height: 16px; }
  .bar-rest { margin-left: 0; }
  .bar-right { flex: 1; justify-content: space-between; gap: 6px; }
  .bar-files { gap: 6px; }
  .bar-files .pill-link, .bar-files .pill-link:first-child { padding: 0 12px; }
  .bar-files .pill-link:first-child span { display: inline; }
}
@media (max-width: 860px) {
  /* hero: tighter text → contacts spacing; name on one line */
  .hero-card { --g: 22px; gap: 22px; }
  .hero-track { gap: 14px; }
  .hero h1 { font-size: min(44px, 9.2vw); white-space: nowrap; }
  .hero .headline { margin-top: 10px; }
}
@media (max-width: 620px) {
  /* experience/education: no timeline line or dots, roles use the full card width */
  .roles { margin-left: 0; }
  details.role-acc::before, .tl-dot { display: none; }
  /* booking: no subtitle */
  .book-sub { display: none; }
  .book-head { flex-wrap: nowrap; }
}
@media (max-width: 400px) {
  .bar-files .pill-link, .bar-files .pill-link:first-child { padding: 0 10px; }
  .bar-right { gap: 4px; }
  .theme-switch button { width: 27px; }
}
.grade-m { display: none; }
@media (max-width: 620px) {
  .grade-inline { display: none; }
  .grade-m { display: inline; }
  .role-title { font-size: 14.5px; }
}
@media (max-width: 375px) {
  .bar { padding-left: 5px; padding-right: 5px; }
  .bar-right { gap: 3px; }
  .bar-home { width: 32px; }
  .bar-files { gap: 3px; }
  .bar-files .pill-link, .bar-files .pill-link:first-child { padding: 0 8px; gap: 4px; }
  .lang-switch button { width: 27px; }
  .theme-switch button { width: 25px; }
  .role-title { font-size: 13.5px; }
  .hero-quick a { font-size: 13.5px; }
}

/* ---------- v14 (Nov 17): mobile org header + headline ---------- */
@media (max-width: 620px) {
  /* logo on the left, name + place as one block centred on the logo */
  .org-head { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 1px; align-items: center; }
  .org-head .logo { grid-row: 1 / 3; align-self: center; }
  .org-name { grid-column: 2; align-self: end; line-height: 1.2; }
  .org-place { grid-column: 2; align-self: start; padding-left: 0; margin-top: 0; text-align: left; line-height: 1.3; }
  /* role rows closer to the header */
  .roles { margin-top: 4px; padding-top: 0; }
  .org { padding-bottom: 6px; }
}
@media (max-width: 860px) {
  .hl-sep { display: none; }
  .hl-2 { display: block; margin-top: 2px; }
}


/* ---------- v18 (Nov 17): project cards (3 and 2 per row) = cover photo on top, org next to the kind tag; mobile without photos ---------- */
.proj-img, .ctx-top { display: none; }
#projGrid .proj { padding: 10px 10px 14px; gap: 7px; }
#projGrid[data-cols="2"] .proj { padding: 12px 12px 16px; gap: 8px; }
#projGrid .proj-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--r-lg) - 6px); background: var(--inset); margin-bottom: 3px; }
#projGrid .proj > :not(.proj-img) { margin-left: 6px; margin-right: 6px; }
#projGrid[data-cols="2"] .ctx-top { display: inline; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#projGrid[data-cols="2"] .proj .top > .ctx:last-child { white-space: nowrap; }
#projGrid[data-cols="2"] .proj > .ctx { display: none; }
/* Phones: projects become a horizontal carousel (swipe), photo on top, all cards (no "show more") */
@media (max-width: 860px) {
  #projGrid[data-cols] { display: flex; grid-template-columns: none; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding: 0 20px; margin: 0 -20px; padding: 4px 20px 12px; scrollbar-width: none; }
  #projGrid::-webkit-scrollbar { display: none; }
  #projGrid[data-cols] > .proj { flex: 0 0 84%; width: 84%; min-width: 0; max-width: 84%; scroll-snap-align: start; padding: 10px 10px 14px; gap: 7px; }
  #projGrid[data-cols] > .proj > :not(.proj-img) { margin-left: 6px; margin-right: 6px; }
  #projGrid[data-cols] > .proj.cut { display: flex; }
  #projGrid[data-cols] > .proj.hidden { display: none; }
  #projects .more-row { display: none !important; }
  a.proj:hover { transform: none; }
}

/* Nov 17: card descriptions limited to 3 lines (…), same height for every card; full text on the project page */
#projGrid .proj p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
/* titles: 2 lines in 3 columns and on phones, 1 line in 2 columns (titles are chosen to fit; clamp is only a safety net) */
#projGrid .proj h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2.5em; }
#projGrid[data-cols="2"] .proj h3 { -webkit-line-clamp: 1; min-height: 0; }
@media (max-width: 860px) { #projGrid[data-cols] .proj h3 { -webkit-line-clamp: 2; min-height: 2.5em; } }
@media (max-width: 860px) { #projGrid .proj h3 { font-size: 16px; letter-spacing: -0.02em; } }
@media (max-width: 380px) { #projGrid .proj h3 { font-size: 14.5px; } }
/* Nov 17: descriptions 4 lines in 3 columns and on phones, 3 lines in 2 columns */
#projGrid .proj p { -webkit-line-clamp: 4; line-clamp: 4; }
#projGrid[data-cols="2"] .proj p { -webkit-line-clamp: 3; line-clamp: 3; }
@media (max-width: 860px) { #projGrid[data-cols] .proj p { -webkit-line-clamp: 4; line-clamp: 4; } }

/* Nov 18: "show more" arrow below the list (more space), "show less" arrow to the right of the section title */
.sh-title { display: flex; align-items: center; gap: 10px; }
.sh-title .more-row, .sh-title .more-row.open { margin: 0; }
.sh-title .more-btn { height: 30px; width: 30px; padding: 0; justify-content: center; }
.sec-body > .more-row, .sec-body > .more-row.open { margin-top: 14px; }   /* same gap as between the filters and the cards */
/* Work in progress: one red tag like the kind tags, with a clock */
.proj .kinds { display: inline-flex; align-items: center; gap: 6px; }
.kind.kind-wip { display: inline-flex; align-items: center; gap: 4px; color: var(--c-wip); background: color-mix(in srgb, var(--c-wip) 15%, transparent); }
.kind.kind-wip svg { width: 11px; height: 11px; flex: none; }
/* App button (purple), next to the Report button on project pages */
.pp-actions { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pp-actions .pp-pdf { margin-left: 0; }
.pp-tools .pp-app { height: 30px; padding: 0 13px 0 11px; gap: 6px; font-size: 12.5px; font-weight: 700; color: #fff; background: var(--c-app); border: 0; text-decoration: none; }
.pp-tools .pp-app:hover { background: color-mix(in srgb, var(--c-app) 88%, #fff); }
.pp-tools .pp-app svg { width: 12px; height: 12px; }
.pp-tools .pp-code { height: 30px; padding: 0 13px 0 11px; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink); background: var(--inset); border: 0; text-decoration: none; }
.pp-tools .pp-code:hover { filter: brightness(1.08); }
.pp-tools .pp-code svg { width: 13px; height: 13px; }
@media (max-width: 760px) { .pp-actions { margin-left: 0; } }
/* Cover with a live app: "Try" button on the image */
#projGrid .proj > .proj-media { position: relative; margin: 0; }
.proj-media .app-cta { position: absolute; right: 10px; bottom: 13px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, #FFC93C, #FF7A1A); color: #1A1206; font-size: 12.5px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform var(--t-fast) var(--spring); }
.proj-media .app-cta:hover { transform: translateY(-1px); }
.proj-media .app-cta svg { width: 12px; height: 12px; }
.proj .top .kind { white-space: nowrap; }
.proj .top .kind.kind-wip { letter-spacing: .04em; }
.proj .top > .ctx { white-space: nowrap; }
.proj .foot .kind-wip { flex: none; margin-left: auto; margin-right: 8px; white-space: nowrap; }

/* Nov 19: five quick contacts (GitHub added): smaller circles, same rhythm */
.hero-card:has(.hero-quick.n5) { --ico: 34px; }
.hero-quick.n5 { gap: 9px; }
.hero-quick.n5 svg { padding: 8.5px; }
/* contacts 12px closer to the text (and further from the right edge in the photo view); widths unchanged */
@media (min-width: 861px) { .hero-quick.n5 { margin-left: -12px; margin-right: 12px; } }
.hero .summary { text-wrap: pretty; }   /* no lone word on the last line */

/* Nov 19: contact = booking only; email and phone as buttons in its head; AI agents band in the footer */
.book-alt { display: flex; gap: 9px; }
/* same round buttons as the hero contacts */
.book-alt a { display: flex; color: var(--ink-2); text-decoration: none; transition: color var(--t-fast); }
.book-alt a svg { width: 34px; height: 34px; padding: 8.5px; border-radius: 50%; background: var(--inset); transition: background var(--t-fast); }
.book-alt a:hover { color: var(--ink); }
.book-alt a:hover svg { background: color-mix(in srgb, var(--ink) 12%, var(--inset)); }
.ai-band { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px; border-radius: var(--r-xl); background: var(--inverse); color: var(--inverse-ink); }
.ai-band .muted { color: color-mix(in srgb, var(--inverse-ink) 70%, transparent); }
.ai-band .btn { background: color-mix(in srgb, var(--inverse-ink) 12%, transparent); color: var(--inverse-ink); }
.ai-band .btn.dl { background: var(--accent-grad); color: var(--accent-ink); }
:root[data-theme="light"] .ai-band { background: #E4E4E8; color: var(--ink); }
:root[data-theme="light"] .ai-band .muted { color: var(--muted); }
:root[data-theme="light"] .ai-band .btn { background: rgba(0,0,0,.08); color: var(--ink); }
:root[data-theme="light"] .ai-band .btn.dl { background: var(--accent-grad); color: var(--accent-ink); }
.ai-band .ai-t { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.ai-band .ai-t svg { width: 18px; height: 18px; color: var(--accent); }
.ai-band .ai-b { display: flex; gap: 8px; }
.ai-band .btn { height: 34px; padding: 0 14px; font-size: 13px; }
.ai-band .btn svg { width: 14px; height: 14px; }
@media (max-width: 860px) {
  .book-head { flex-wrap: wrap; }
  .book-head .grow { flex: 1 1 calc(100% - 52px); }
  .book-head .bk-dur { order: 2; }
  .book-alt { order: 3; margin-left: auto; }
}
.skills-grid .chip { cursor: default; }
}
