/* barellevi.com — one type family, one content column, one spacing rhythm.
   Palette is unchanged from the original site: blue-black, mint, a little sand. */
:root {
  --bg: #0b1115;
  --surface: #10181d;
  --surface-2: #15212a;
  --line: #1f2d32;
  --line-strong: #34494b;
  --ink: #edf1ed;
  --text: #c3d0cb;
  --muted: #8fa09b;
  --mint: #b7d9ca;
  --sand: #d9b992;
  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --header: 68px;
  --section: clamp(64px, 9vw, 112px);
  --font: "Heebo", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--mint); color: #10201b; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { color: var(--ink); font-weight: 700; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(40px, 6.2vw, 80px); letter-spacing: -0.01em; }
h2 { font-size: clamp(30px, 3.8vw, 48px); }
h3 { font-size: clamp(19px, 1.7vw, 22px); line-height: 1.35; }
h1 em, h2 em { font-style: normal; font-weight: 400; color: var(--mint); }
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--line); }
.label { display: block; margin-bottom: 14px; color: var(--sand); font-size: 14px; font-weight: 500; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head .lead { margin-top: 18px; }
.lead { font-size: clamp(18px, 1.5vw, 20px); line-height: 1.65; color: var(--text); max-width: 62ch; }
.prose p + p { margin-top: 1.1em; }
.prose { max-width: 66ch; }

.skip-link { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--bg); border-radius: 4px; }
.skip-link:focus { top: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); font-size: 16px; font-weight: 500; transition: border-color .2s, background .2s, transform .2s; }
.btn:hover { border-color: var(--mint); }
.btn-primary { background: var(--mint); border-color: var(--mint); color: #0e1c18; font-weight: 700; }
.btn-primary:hover { background: #d3ebe0; transform: translateY(-2px); }
.link { color: var(--mint); font-weight: 500; text-decoration: underline; text-decoration-color: #b7d9ca55; text-underline-offset: 5px; }
.link:hover { text-decoration-color: var(--mint); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header); background: #0b1115e6; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; font-weight: 800; font-size: 17px; direction: ltr; }
.brand-mark i { font-style: normal; color: var(--sand); }
/* Bar L logo (2026-11-26): the mark shows the official logo file; the old B. letters stay in the markup, hidden */
.brand-mark { background-image: url(/assets/bar-l.svg); background-repeat: no-repeat; background-position: center; background-size: 70%; font-size: 0; color: transparent; }
.brand-mark i { display: none; }
.site-nav { display: flex; gap: 26px; margin-inline-start: auto; }
.site-nav a { color: var(--muted); font-size: 15px; font-weight: 500; padding-block: 8px; transition: color .2s; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.menu-toggle { display: none; min-height: 40px; padding: 0 14px; background: none; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 14px; }

@media (max-width: 880px) {
  .site-nav { display: none; position: absolute; inset-inline: 0; top: var(--header); flex-direction: column; gap: 0; margin: 0; padding: 8px var(--gutter) 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding-block: 13px; font-size: 17px; border-bottom: 1px solid var(--line); }
  .header-actions { margin-inline-start: auto; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .header-actions .btn-contact { display: none; }
}

/* Hero */
.hero { padding-block: clamp(48px, 8vw, 104px) clamp(56px, 8vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: clamp(24px, 3vw, 36px); font-size: 16px; }
.hero-id strong { color: var(--ink); font-size: 20px; font-weight: 700; }
.hero-id span { color: var(--muted); }
.hero h1 { margin-bottom: clamp(20px, 2.5vw, 30px); }
.hero .lead { margin-bottom: clamp(28px, 3.5vw, 40px); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.hero-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; color: var(--muted); font-size: 14px; }
.hero-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px #b7d9ca22; }
.hero-art { color: var(--mint); }
.hero-art svg { width: 100%; height: auto; overflow: visible; }
.hero-art .trace { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.hero-art .trace-lit { fill: none; stroke: var(--mint); stroke-width: 1.5; opacity: .75; }
.hero-art .node { fill: var(--bg); stroke: var(--mint); stroke-width: 1.5; }
.hero-art .node-box { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; }
.hero-art text { fill: var(--ink); font-family: var(--font); font-size: 17px; font-weight: 500; }
.hero-art .pulse, .hero-art .pulse-halo { offset-path: path("M20 110 H272 Q290 110 290 128 V412 Q290 430 308 430 H510"); animation: travel 12s linear infinite; }
.hero-art .pulse { fill: #e9fff6; filter: drop-shadow(0 0 4px #d6fff0) drop-shadow(0 0 12px var(--mint)) drop-shadow(0 0 28px #b7d9caaa); }
.hero-art .pulse-halo { fill: var(--mint); opacity: .25; filter: blur(6px); }
.hero-art .hero-box .node-box, .hero-art .hero-box text { animation: 12s linear infinite; }
.hero-art .b1 .node-box { animation-name: box-lit-1; } .hero-art .b1 text { animation-name: text-lit-1; }
.hero-art .b2 .node-box { animation-name: box-lit-2; } .hero-art .b2 text { animation-name: text-lit-2; }
.hero-art .b3 .node-box { animation-name: box-lit-3; } .hero-art .b3 text { animation-name: text-lit-3; }
.hero-art .node-end { stroke: var(--sand); animation: end-glow 2.4s ease-in-out infinite; }

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { width: 100%; max-width: 400px; margin: 4px auto 0; }
  .hero-art text { font-size: 21px; }
}

/* Selected work: a pinned horizontal gallery driven by vertical scroll */
.work { padding-block: var(--section) clamp(48px, 6vw, 80px); }
.story { position: relative; }
.story-viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.story-viewport::-webkit-scrollbar { display: none; }
.story-track { display: flex; gap: clamp(14px, 2vw, 28px); width: max-content; padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); }
.story-card { display: grid; grid-template-rows: auto 1fr; flex: 0 0 auto; width: min(84vw, 420px); scroll-snap-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color .25s; }
.story-card:hover { border-color: var(--line-strong); }
.story-art { background: #0e171c; border-bottom: 1px solid var(--line); }
.story-art svg { width: 100%; height: 100%; }
.story-body { display: flex; flex-direction: column; gap: 12px; padding: clamp(20px, 2.6vw, 40px); }
.story-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; color: var(--muted); font-size: 14px; }
.story-meta b { color: var(--sand); font-weight: 700; font-size: 15px; }
.story-card h3 { font-size: clamp(24px, 2.7vw, 36px); line-height: 1.2; }
.story-sub { color: var(--mint); font-size: 17px; }
.story-desc { color: var(--text); font-size: 16px; max-width: 54ch; }
.story-role { color: var(--muted); font-size: 15px; max-width: 54ch; }
.story-role b { color: var(--ink); font-weight: 500; }
.story-more { margin-top: auto; padding-top: 8px; color: var(--mint); font-weight: 500; font-size: 16px; }

.story-controls { display: grid; justify-items: center; gap: 6px; padding: clamp(14px, 2.4vh, 26px) var(--gutter) 0; }
.story-hint { color: var(--muted); font-size: 14px; }
.story-dial { position: relative; width: min(100%, 420px); display: grid; align-items: center; }
.story-dial:has(:focus-visible) { outline: 2px solid var(--mint); outline-offset: 4px; border-radius: 4px; }
.story-scrubber { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: grab; touch-action: pan-y; }
.story.is-scrubbing .story-scrubber { cursor: grabbing; }
.story-circuit { width: 100%; height: auto; overflow: visible; color: var(--mint); fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
[dir="rtl"] .story-circuit { transform: scaleX(-1); }
.story-circuit .story-signal { fill: currentColor; stroke: none; filter: drop-shadow(0 0 5px currentColor); }
.story-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.story-nav button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s, border-color .2s; }
.story-nav button:hover { color: var(--ink); }
.story-nav button[aria-current] { color: var(--ink); border-color: var(--mint); }
.story-nav bdi { color: var(--sand); font-size: 13px; }

.story[data-mode="scroll"] .story-sticky { position: sticky; top: var(--header); height: calc(100dvh - var(--header)); display: flex; flex-direction: column; padding-block: clamp(12px, 2.5vh, 28px) clamp(10px, 2vh, 22px); background: var(--bg); }
.story[data-mode="scroll"] .story-viewport { flex: 1; min-height: 0; overflow: clip; scroll-snap-type: none; }
.story[data-mode="scroll"] .story-track { height: 100%; transform: translateX(var(--story-shift, 0px)); will-change: transform; }
.story[data-mode="scroll"] .story-card { width: min(74vw, 1040px); grid-template-rows: none; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); }
.story[data-mode="scroll"] .story-art { border-bottom: 0; border-inline-end: 1px solid var(--line); }
.story[data-mode="scroll"] .story-body { justify-content: center; overflow: hidden; }
.story[data-mode="scroll"] .story-more { margin-top: 8px; }
@media (max-width: 899px) {
  .story[data-mode="scroll"] .story-sticky { height: calc(100svh - var(--header)); }
  .story[data-mode="scroll"] .story-card { width: 84vw; grid-template-columns: none; grid-template-rows: minmax(0, 26%) minmax(0, 1fr); }
  .story[data-mode="scroll"].is-stepped .story-track { transition: transform .55s cubic-bezier(.22, .8, .3, 1); }
  .story[data-mode="scroll"] .story-art { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .story[data-mode="scroll"] .story-body { justify-content: flex-start; gap: 8px; padding: 18px; }
  .story[data-mode="scroll"] .story-hint { display: none; }
  .story[data-mode="scroll"] .story-body > * { flex-shrink: 0; }
  .story[data-mode="scroll"] .story-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .story[data-mode="scroll"] .story-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .story[data-mode="scroll"] .story-role { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .story[data-mode="scroll"] .story-card h3 { font-size: 22px; }
  .story[data-mode="scroll"] .story-sub { font-size: 16px; }
  .story[data-mode="scroll"] .story-nav button { min-height: 40px; padding: 0 10px; font-size: 14px; }
}
@media (max-height: 620px) {
  .story[data-mode="scroll"] .story-desc, .story[data-mode="scroll"] .story-hint { display: none; }
  .story[data-mode="scroll"] .story-card h3 { font-size: clamp(22px, 2.4vw, 30px); }
  .story[data-mode="scroll"] .story-body { gap: 8px; padding-block: 16px; }
}
@media (max-height: 470px) {
  .story[data-mode="scroll"] .story-role { display: none; }
  .story[data-mode="scroll"] .story-dial { width: min(100%, 300px); }
}
.work-foot { margin-top: clamp(28px, 4vw, 44px); }

/* Career timeline */
.timeline { max-width: 900px; border-inline-start: 1px solid var(--line-strong); }
.timeline li { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 28px; padding-block: 24px; padding-inline-start: 32px; }
.timeline li + li { border-top: 1px solid var(--line); }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -5px; top: 34px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--mint); }
.timeline li:first-child::before { background: var(--mint); box-shadow: 0 0 0 5px #b7d9ca22; }
.timeline .when { color: var(--mint); font-size: 15px; font-weight: 500; padding-top: 3px; font-variant-numeric: tabular-nums; }
.timeline h3 { margin-bottom: 4px; }
.timeline p { font-size: 16px; max-width: 60ch; }
.note { margin-top: 24px; color: var(--muted); font-size: 15px; max-width: 70ch; }
@media (max-width: 640px) { .timeline li { grid-template-columns: 1fr; padding-inline-start: 24px; } }

/* Two-column editorial sections */
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.points li { padding-block: 22px; border-top: 1px solid var(--line); }
.points li:last-child { border-bottom: 1px solid var(--line); }
.points small { display: block; margin-bottom: 4px; color: var(--sand); font-size: 14px; font-weight: 500; }
.points h3 { margin-bottom: 4px; }
.points p { font-size: 16px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-block: clamp(36px, 5vw, 56px); background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stats li { padding: clamp(20px, 2.4vw, 30px); background: var(--surface); }
.stats b { display: block; color: var(--ink); font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; line-height: 1.1; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.stats strong { display: block; margin-top: 10px; color: var(--mint); font-size: 16px; font-weight: 500; }
.stats span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.55; }
@media (max-width: 880px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .stats { grid-template-columns: 1fr; } }

/* Disciplines and project cards */
.grid { display: grid; gap: clamp(14px, 1.8vw, 22px); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1040px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-4, .grid-3 { grid-template-columns: 1fr; } }

.tile { display: flex; flex-direction: column; gap: 8px; padding: clamp(20px, 2.2vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; transition: border-color .25s, transform .25s; }
.tile:hover { border-color: var(--mint); transform: translateY(-3px); }
.tile small { color: var(--sand); font-size: 14px; font-weight: 500; }
.tile p { font-size: 16px; }
.tile .more { margin-top: auto; padding-top: 14px; color: var(--mint); font-size: 15px; font-weight: 500; }

.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color .25s, transform .25s; }
.card:hover { border-color: var(--mint); transform: translateY(-3px); }
.card-art { aspect-ratio: 20 / 9; background: #0e171c; border-bottom: 1px solid var(--line); }
.card-art svg { width: 100%; height: 100%; }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 22px 22px 24px; }
.card-meta { color: var(--muted); font-size: 14px; }
.card p { font-size: 16px; }
.card .role { color: var(--muted); font-size: 15px; }
.card .role b { color: var(--ink); font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 12px; }
.tags span { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 13px; line-height: 1.5; direction: ltr; }

.group + .group { margin-top: clamp(48px, 6vw, 72px); }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.group-head span { color: var(--muted); font-size: 14px; }
.group-head h2 { font-size: clamp(22px, 2.2vw, 28px); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(32px, 4vw, 48px); }
.filters button { min-height: 44px; padding: 0 18px; background: none; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); font-size: 15px; font-weight: 500; transition: border-color .2s, background .2s, color .2s; }
.filters button:hover { border-color: var(--mint); }
.filters button[aria-pressed="true"] { background: var(--mint); border-color: var(--mint); color: #0e1c18; font-weight: 700; }

/* Inner page head */
.page-head { padding-block: clamp(48px, 7vw, 96px) clamp(36px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(36px, 5vw, 64px); max-width: 18ch; }
.page-head .lead { margin-top: 20px; }
.page-head .hero-cta { margin-top: 30px; }
.crumb { display: inline-block; margin-bottom: 22px; color: var(--muted); font-size: 15px; }
.crumb:hover { color: var(--ink); }

/* Project page */
.project { max-width: 820px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chips span { padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 14px; }
.chips span:first-child { border-color: var(--mint); color: var(--mint); }
.project-role { margin-block: clamp(32px, 4vw, 48px); padding-block: 4px; padding-inline-start: 22px; border-inline-start: 2px solid var(--mint); }
.project-role p { color: var(--ink); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; }
.block { padding-block: 28px; border-top: 1px solid var(--line); }
.block h2 { margin-bottom: 12px; font-size: clamp(21px, 2vw, 26px); }
.block p { max-width: 68ch; }
.block .tags { padding-top: 0; }
.block .tags span { font-size: 14px; padding: 5px 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding-top: 32px; border-top: 1px solid var(--line); }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 48px; }
.pager a { display: grid; gap: 4px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; transition: border-color .2s; }
.pager a:hover { border-color: var(--mint); }
.pager a:last-child { text-align: end; }
.pager small { color: var(--muted); font-size: 14px; }
.pager strong { color: var(--ink); font-weight: 500; line-height: 1.4; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager a:last-child { text-align: start; } }

/* Contact and footer */
.contact h2 { font-size: clamp(34px, 5vw, 64px); margin-bottom: 20px; }
.contact-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 32px; }
.contact-links a[dir="ltr"] { unicode-bidi: isolate; }
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a:hover { color: var(--ink); }

/* Entrance: sections rise once as they enter. Skipped entirely for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
  .rise.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art .pulse, .hero-art .pulse-halo { animation: none; }
  * { transition-duration: 0s !important; }
}
@media print {
  .site-header, .site-footer, .hero-art, .story-controls { display: none !important; }
  body { background: #fff; color: #17231e; }
}

.page-head + .section { padding-top: clamp(40px, 5vw, 64px); }
.project > .project-role:first-child { margin-top: 0; }

/* Hero facts and the named-systems tiles */
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 28px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-facts li { display: flex; flex-direction: column; gap: 2px; }
.hero-facts b { color: var(--ink); font-size: 24px; font-weight: 700; line-height: 1.2; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.hero-facts span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.stack-tile:hover { border-color: var(--line); transform: none; }
.stack-tile .tags { padding-top: 16px; }
.stack-tile .tags span { color: var(--text); border-color: var(--line-strong); font-size: 14px; padding: 5px 12px; }
.timeline .kit { margin-top: 10px; color: var(--muted); font-size: 14px; text-align: start; unicode-bidi: plaintext; }
.timeline .org { margin-bottom: 6px; color: var(--sand); font-size: 15px; font-weight: 500; }
[dir="rtl"] .timeline .kit { text-align: right; }
@media (max-width: 899px) and (max-height: 760px) { .story[data-mode="scroll"] .story-role { display: none; } }
@media (max-width: 899px) and (max-height: 620px) { .story[data-mode="scroll"] .story-desc { display: -webkit-box; -webkit-line-clamp: 2; } }

/* Career timeline: travelling marker and drawn role icons */
.tl-wrap { position: relative; max-width: 900px; }
.tl-marker { position: absolute; top: 0; inset-inline-start: -11px; width: 23px; height: 23px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 6px #b7d9ca2e, 0 0 22px #b7d9ca8c; pointer-events: none; transition: transform .18s ease-out; will-change: transform; }
.tl-marker::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--mint); opacity: 0; }
.tl-marker.is-pulse::after { animation: tl-pulse .9s ease-out; }
@keyframes tl-pulse { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.8); } }
.timeline li:first-child::before { background: var(--bg); box-shadow: none; }
.timeline li.is-drawn::before { background: var(--mint); }
.timeline li h3, .timeline li .when { transition: color .3s; }
.timeline li:not(.is-active) .when { color: var(--muted); }
.when-col { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.tl-icon { width: 78px; height: 78px; fill: none; stroke: var(--line-strong); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s; }
.timeline li.is-active .tl-icon, .timeline li.is-drawn .tl-icon { stroke: var(--mint); }
/* A drawn icon keeps running: a glint passes along its strokes in drawing order, on a 5s loop, also after the marker has moved on. */
.timeline li.is-drawn .tl-icon > * { animation: tl-lit 5s linear infinite; animation-delay: calc(1.4s + var(--d, 0s) * 4); }
@keyframes tl-lit { 0%, 24%, 100% { filter: none; } 5%, 11% { filter: brightness(1.8) drop-shadow(0 0 3px #b7d9ca) drop-shadow(0 0 9px #b7d9caaa); } }
.tl-icon > * { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .9s ease var(--d, 0s), opacity .05s linear var(--d, 0s); }
.timeline li.is-drawn .tl-icon > * { stroke-dashoffset: 0; opacity: 1; }
@media (max-width: 640px) {
  .when-col { flex-direction: row; align-items: center; justify-content: space-between; }
  .tl-icon { width: 46px; height: 46px; }
  .tl-marker { inset-inline-start: -10px; width: 21px; height: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-marker, .tl-icon > * { transition: none; }
  .tl-marker.is-pulse::after { animation: none; }
  .tl-icon > * { stroke-dashoffset: 0; opacity: 1; animation: none !important; }
}
@media print { .tl-marker { display: none; } .tl-icon > * { stroke-dashoffset: 0; opacity: 1; } }

/* Project pages: separate pieces of work inside one project */
.parts .part { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 18px; padding: 20px 0; border-top: 1px solid var(--line); }
.parts .part:first-of-type { margin-top: 14px; }
.parts .part-no { color: var(--sand); font-weight: 700; font-size: 15px; padding-top: 4px; }
.parts .part h3 { font-size: 20px; margin-bottom: 6px; }
.focus-note { margin-top: 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 15px; }
.focus-note b { color: var(--ink); font-weight: 500; }
@media (max-width: 560px) { .parts .part { grid-template-columns: 1fr; } }

/* Hero diagram: the healthy route lights each box in mint as the signal passes; the dead-end branches flicker in soft orange, like a fault */
@media (prefers-reduced-motion: reduce) { .hero-art .pulse-halo, .hero-art .hero-box .node-box, .hero-art .hero-box text, .hero-art .node-end { animation: none; } }

/* Hero diagram: a line drawing appears beside each box while the signal lights it */
.hero-art .hero-ico > * { fill: none; stroke: var(--mint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; animation: ico-draw 12s linear infinite backwards; }
@media (prefers-reduced-motion: reduce) { .hero-art .hero-ico > * { animation: none; } }

/* Hero diagram timing. One loop is 12s: the signal travels for 9s (0–75%), then the end point blinks green for 3s (75–100%).
   Every animation below shares the 12s loop, so the boxes, icons and end point stay in step with the signal. */
@keyframes travel { 0% { offset-distance: 0%; visibility: visible; } 75% { offset-distance: 100%; visibility: visible; } 75.1%, 100% { offset-distance: 100%; visibility: hidden; } }
@keyframes box-lit-1 { 0%, 4.5%, 25.5%, 100% { stroke: var(--line-strong); fill: var(--surface-2); filter: none; } 7.5%, 21% { stroke: var(--mint); fill: #1d3530; filter: drop-shadow(0 0 8px #b7d9ca99) drop-shadow(0 0 22px #b7d9ca55); } }
@keyframes box-lit-2 { 0%, 33.75%, 46.5%, 100% { stroke: var(--line-strong); fill: var(--surface-2); filter: none; } 37.5%, 42% { stroke: var(--mint); fill: #1d3530; filter: drop-shadow(0 0 8px #b7d9ca99) drop-shadow(0 0 22px #b7d9ca55); } }
@keyframes box-lit-3 { 0%, 54.75%, 77%, 100% { stroke: var(--line-strong); fill: var(--surface-2); filter: none; } 58.5%, 73% { stroke: var(--mint); fill: #1d3530; filter: drop-shadow(0 0 8px #b7d9ca99) drop-shadow(0 0 22px #b7d9ca55); } }
@keyframes text-lit-1 { 0%, 4.5%, 25.5%, 100% { fill: var(--ink); } 7.5%, 21% { fill: #e9fff6; } }
@keyframes text-lit-2 { 0%, 33.75%, 46.5%, 100% { fill: var(--ink); } 37.5%, 42% { fill: #e9fff6; } }
@keyframes text-lit-3 { 0%, 54.75%, 77%, 100% { fill: var(--ink); } 58.5%, 73% { fill: #e9fff6; } }
@keyframes ico-draw { 0% { opacity: 0; stroke-dashoffset: 1; } .75% { opacity: 1; stroke-dashoffset: 1; } 5.25% { opacity: 1; stroke-dashoffset: 0; } 15.75% { opacity: 1; stroke-dashoffset: 0; } 19.5%, 100% { opacity: 0; stroke-dashoffset: 0; } }
@keyframes end-glow {
  0%, 100% { fill: var(--bg); filter: none; }
  40% { fill: var(--sand); filter: drop-shadow(0 0 6px var(--sand)) drop-shadow(0 0 16px #d9b992aa); }
  48% { fill: #d9b99244; filter: drop-shadow(0 0 3px #d9b99277); }
  58% { fill: var(--sand); filter: drop-shadow(0 0 6px var(--sand)) drop-shadow(0 0 16px #d9b992aa); }
}
/* The end point: quiet while the signal travels, then four green blinks over the last 3 seconds */
.hero-art .node-finish { animation: finish-blink 12s linear infinite; }
@keyframes finish-blink {
  0%, 74.9% { fill: var(--bg); stroke: var(--mint); filter: none; }
  75%, 78% { fill: #5dff9e; stroke: #5dff9e; filter: drop-shadow(0 0 5px #5dff9e) drop-shadow(0 0 16px #5dff9ecc); }
  80%, 81.2% { fill: var(--bg); stroke: var(--mint); filter: none; }
  82.4%, 85.4% { fill: #5dff9e; stroke: #5dff9e; filter: drop-shadow(0 0 5px #5dff9e) drop-shadow(0 0 16px #5dff9ecc); }
  87.4%, 88.6% { fill: var(--bg); stroke: var(--mint); filter: none; }
  89.8%, 92.8% { fill: #5dff9e; stroke: #5dff9e; filter: drop-shadow(0 0 5px #5dff9e) drop-shadow(0 0 16px #5dff9ecc); }
  94.8%, 95.4% { fill: var(--bg); stroke: var(--mint); filter: none; }
  96.4%, 98.6% { fill: #5dff9e; stroke: #5dff9e; filter: drop-shadow(0 0 5px #5dff9e) drop-shadow(0 0 16px #5dff9ecc); }
  100% { fill: var(--bg); stroke: var(--mint); filter: none; }
}
@media (prefers-reduced-motion: reduce) { .hero-art .node-finish { animation: none; } }

/* Contact QR: dots that light up under the pointer */
.contact-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.qr-card { margin: 0; padding: 22px 22px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); text-align: center; }
.qr-box { position: relative; width: 268px; height: 268px; }
.qr-dots { display: block; width: 100%; height: 100%; cursor: crosshair; }
.qr-mark { position: absolute; inset: 0; margin: auto; width: 23%; height: 23%; display: flex; align-items: center; justify-content: center; border-radius: 14px; font-size: 32px; pointer-events: none; box-shadow: 0 0 18px #b7d9ca33; }
.qr-card figcaption { margin-top: 14px; color: var(--muted); font-size: 14px; }
@media (max-width: 899px) {
  .contact-wrap { grid-template-columns: 1fr; gap: 36px; }
  .qr-card { justify-self: start; }
  .qr-box { width: 232px; height: 232px; }
  .qr-mark { font-size: 28px; border-radius: 12px; }
}
@media print { .qr-card { border-color: #999; } }
.qr-mark { background: var(--bg); }

/* Gallery drawings: drawn in when their card comes into view, then a few parts keep pulsing */
.story-art { overflow: hidden; }
.story-art svg { overflow: visible; }
.story.is-animated .story-art .sd { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; transition: stroke-dashoffset .8s ease, fill-opacity .5s ease; }
.story.is-animated .story-art .sf { opacity: 0; transition: opacity .4s ease; }
.story.is-animated .is-drawn .story-art .sd { stroke-dashoffset: 0; fill-opacity: 1; transition-delay: var(--d), calc(var(--d) + .5s); }
.story.is-animated .is-drawn .story-art .sf { opacity: 1; transition-delay: calc(var(--d) + .4s); }
.story.is-animated .is-drawn .story-art [fill="#d9b992"] { animation: art-blink 2.2s ease-in-out 2.4s infinite; }
/* Same language as the hero diagram: a glowing dot travels a route (6s of an 8s loop), lights what it passes, and the end point blinks green for the last 2s. */
.story-art .art-dot, .story-art .art-finish { opacity: 0; }
.story-art .art-pulse { fill: #e9fff6; filter: drop-shadow(0 0 4px #d6fff0) drop-shadow(0 0 12px var(--mint)) drop-shadow(0 0 26px #b7d9caaa); }
.story-art .art-halo { fill: var(--mint); opacity: .25; filter: blur(6px); }
.story-art .art-finish { fill: #5dff9e; filter: drop-shadow(0 0 6px #5dff9e) drop-shadow(0 0 16px #5dff9ecc); }
.story.is-animated .is-drawn .story-art .art-dot { animation: art-travel 8s linear 2.2s infinite; }
.story.is-animated .is-drawn .story-art .art-finish { animation: art-finish 8s linear 2.2s infinite; }
.story.is-animated .is-drawn .story-art .art-on:not([fill="#d9b992"]) { animation: art-lit 8s linear infinite; animation-delay: calc(2.2s + var(--t)); }
@keyframes art-travel { 0% { offset-distance: 0%; opacity: 0; } 3% { opacity: 1; } 72% { opacity: 1; } 75%, 100% { offset-distance: 100%; opacity: 0; } }
@keyframes art-finish { 0%, 74% { opacity: 0; } 77%, 81% { opacity: 1; } 84% { opacity: .15; } 87%, 91% { opacity: 1; } 94% { opacity: .15; } 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes art-lit { 0%, 18%, 100% { filter: none; } 3%, 8% { filter: brightness(1.9) drop-shadow(0 0 4px #b7d9ca) drop-shadow(0 0 11px #b7d9caaa); } }
@keyframes art-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes art-glow { 0%, 100% { stroke: #b7d9ca; } 50% { stroke: #f2fff9; } }
@media print { .story .story-art .sd, .story .story-art .sf { stroke-dashoffset: 0 !important; fill-opacity: 1 !important; opacity: 1 !important; } }
