@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url("fonts/instrument-sans-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url("fonts/instrument-sans-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("fonts/instrument-sans-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, sans-serif;
  text-transform: lowercase;
}
html.zscroll, html.zscroll body { height: 100%; overflow: hidden; }

/* chrome: edge elements shared by every section */
#chrome {
  position: fixed; top: 1.3rem; right: 1.4rem; z-index: 999;
  display: flex; gap: 1.8rem; align-items: baseline;
  font-weight: 700; font-size: 1.05rem;
}
#chrome a, #chrome summary { color: var(--ink); text-decoration: none; cursor: pointer; }
.langs { display: flex; gap: 0.7rem; }
.langs b { color: var(--ink); }
html.on-dark .langs b { color: var(--paper); }
#chrome .langs a { opacity: 0.45; }
#chrome .langs a:hover { opacity: 1; }
#chrome a:hover, #chrome summary:hover { opacity: 0.65; }
#chrome a:focus-visible, #chrome summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
html.on-dark #chrome > a, html.on-dark #chrome summary { color: var(--paper); }
#chrome details { position: relative; }
#chrome summary { list-style: none; }
#chrome summary::-webkit-details-marker { display: none; }
/* the drop boxes hang from their button, flush right, no chrome around them */
#chrome .box {
  position: absolute; right: 0; top: calc(100% + 0.9rem);
  display: flex; flex-direction: column; gap: 0.8rem;
  text-align: right;
}
#chrome .box a, #chrome .box .copy-email { color: var(--ink); white-space: nowrap; }
html.on-dark #chrome .box a, html.on-dark #chrome .box .copy-email { color: var(--paper); }
#chrome .box .copy-email { justify-content: flex-end; }

/* email copies to the clipboard, styled like its sibling links */
.copy-email {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 700; color: inherit; text-transform: lowercase;
}
.copy-email:hover { opacity: 0.65; }
.copy-email:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.copy-ic { width: 0.85em; height: 0.85em; }
.copy-ic rect, .copy-ic path { fill: none; stroke: currentColor; stroke-width: 1.6; }

.hint { display: none; }
html.zscroll .hint {
  display: block; position: fixed; left: 50%; bottom: 1.15rem;
  transform: translateX(-50%); z-index: 998; margin: 0;
  font-size: 0.78rem; color: rgba(var(--ink-rgb), 0.55);
  transition: opacity 0.4s;
}
html.zscroll.moved .hint { opacity: 0; }

#backdrop { display: none; }
html.zscroll #backdrop {
  display: block; position: fixed; inset: 0; z-index: 0;
  background: var(--paper);
}

/* gauge: vertical rail on the right, every label always beside its square;
   buttons keep a constant 19px hit area, the square itself grows when active */
.gauge { display: none; }
html.zscroll .gauge {
  display: flex; flex-direction: column; gap: 13px;
  position: fixed; right: 1.4rem; top: 50%; transform: translateY(-50%);
  z-index: 999;
}
.gauge .sq {
  width: 19px; height: 19px; padding: 0; position: relative;
  appearance: none; border: 0; background: none; cursor: pointer;
}
.gauge .sq::before {
  content: ""; position: absolute; inset: 3px;
  border: 1px solid rgba(var(--ink-rgb), 0.45);
  background: var(--pg);
  transition: inset 0.2s;
}
.gauge .sq.on::before { inset: 0; border-color: var(--ink); }
.gauge .sq b {
  position: absolute; right: calc(100% + 11px); top: 50%; transform: translateY(-50%);
  font-weight: 400; font-size: 0.78rem; color: rgba(var(--ink-rgb), 0.55);
  white-space: nowrap;
}
.gauge .sq.on b { font-weight: 700; font-size: 0.85rem; color: var(--ink); }
html.on-dark .gauge .sq::before { border-color: rgba(var(--paper-rgb), 0.55); }
html.on-dark .gauge .sq.on::before { border-color: var(--paper); }
html.on-dark .gauge .sq b { color: rgba(var(--paper-rgb), 0.65); }
html.on-dark .gauge .sq.on b { color: var(--paper); }
@media (max-width: 760px) { html.zscroll .gauge { display: none; } }

/* stage: full-page fields on the z axis */
html.zscroll #stage { position: fixed; inset: 0; overflow: hidden; z-index: 1; }
html.zscroll .layer {
  position: absolute; inset: 0;
  /* the vanishing point sits low, like in the Trinità */
  transform-origin: 50% 82%;
  will-change: transform, opacity;
}
html:not(.zscroll) .layer { position: relative; }

.field {
  position: absolute; inset: 0;
  overflow: hidden;
  background: var(--bg); color: var(--fg);
  --muted: rgba(var(--ink-rgb), 0.55);
  --line: rgba(var(--ink-rgb), 0.18);
}
/* in z-mode the blending backdrop paints the colour: transparent fields mean
   transitions grow the content alone, no solid rectangle sliding in */
html.zscroll .field { background: transparent; }
html:not(.zscroll) .field { position: relative; min-height: 100svh; }
.field.dark {
  --muted: rgba(var(--paper-rgb), 0.6);
  --line: rgba(var(--paper-rgb), 0.25);
}
/* the content lives in a fixed reduced window and scrolls inside it */
html.zscroll .scroll {
  position: absolute; left: 0; right: 0;
  top: clamp(5rem, 16.5vh, 11.5rem); bottom: clamp(5rem, 16.5vh, 11.5rem);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;
  /* soft-start ramp: anything parked in the first ~1.2rem of the fade stays
     nearly invisible, so clipped dots don't read as floating dashes */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.12) 1.2rem, #000 3.2rem, #000 calc(100% - 3.2rem), rgba(0, 0, 0, 0.12) calc(100% - 1.2rem), transparent);
  mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.12) 1.2rem, #000 3.2rem, #000 calc(100% - 3.2rem), rgba(0, 0, 0, 0.12) calc(100% - 1.2rem), transparent);
}
html.zscroll .scroll::-webkit-scrollbar { display: none; }
.inner {
  /* content runs edge to edge: graphics (git tree, photo) and section labels
     sit on the left edge, free prose spans the full width, and item text
     starts after the gutter (rail + years) reaching the right edge */
  --gutter: calc(46px + 9.7rem);
  min-height: 100%;
  max-width: 1060px; margin: 0 auto;
  padding: clamp(1.6rem, 6vh, 4rem) clamp(1.4rem, 6vw, 4rem);
  display: flex; flex-direction: column; justify-content: center;
}
html.zscroll .inner {
  /* vertical padding clears the full mask ramp so resting lines stay crisp */
  padding: 3.4rem clamp(1.4rem, 6vw, 4rem);
  /* the right edge pulls in to keep clear of the gauge and its labels */
  padding-right: clamp(9rem, 14vw, 13rem);
}
/* no gauge on mobile: the text takes the right edge back; and with no side
   margins there is no frame effect to preserve, so the window opens up
   vertically too, stopping only under the chrome bar */
@media (max-width: 760px) {
  html.zscroll .inner { padding-right: clamp(1.4rem, 6vw, 4rem); }
  html.zscroll .scroll { top: 4rem; bottom: 1.4rem; }
}
html:not(.zscroll) .inner { min-height: 100svh; }

.avatar {
  width: clamp(104px, 13vw, 160px); aspect-ratio: 1;
  border-radius: 50%; object-fit: cover;
}
.id-row {
  display: grid; grid-template-columns: var(--gutter) 1fr; align-items: center;
  margin-bottom: 1.4rem;
}
.id-text h1 { margin: 0.3rem 0 0.9rem; }
.id-text .loc { margin-top: 0.8rem; }
.sect-label { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ac, var(--fg)); margin: 0 0 1.2rem; }
.lead { font-size: 0.98rem; opacity: 0.85; margin: -0.6rem 0 1rem; }
/* prose justifies edge to edge, whole words only */
.bio, .bio-more, .lead, .note, .entry p { text-align: justify; }
.lead a, .note a { color: var(--fg); }
.entry h3 a { color: inherit; text-decoration: none; }
.entry h3 a:hover { opacity: 0.65; }
.sub a { color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 0.9rem; margin: 0; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 700; letter-spacing: -0.035em; line-height: 0.98; margin: 0.5rem 0 1.2rem; }
.bio { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: inherit; margin: 0; }
.loc { font-size: 0.9rem; color: var(--muted); margin: 1.1rem 0 0; }
.links { display: flex; gap: 1.6rem; font-weight: 700; flex-wrap: wrap; margin-top: 1.8rem; }
.links a { color: var(--fg); text-decoration: none; }
.links a:hover { opacity: 0.65; }
.links a:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.note { font-size: 0.88rem; color: var(--muted); margin: 1.4rem 0 0; }
.more-label {
  font-size: 1.05rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--muted); margin: 2.6rem 0 0.7rem;
}
.bio-more { font-size: clamp(1rem, 2.1vw, 1.16rem); opacity: 0.85; margin: 0; }
.colophon { font-size: 0.78rem; color: var(--muted); margin: 2rem 0 0; }
.lorem { max-width: 60ch; font-size: 0.95rem; opacity: 0.82; margin: 1rem 0 0; }

/* timeline: a git tree, oldest at the bottom, today on top */
.tl { margin: 0.4rem 0 0.6rem; }
.entry {
  position: relative;
  display: grid; grid-template-columns: 46px 7.5rem 1fr; gap: 0 1.1rem;
  padding: 1.1rem 0 1.3rem;
}
.entry::before {
  content: ""; position: absolute; left: 17px; width: 6px; top: 0; bottom: 0;
  background: var(--fg);
}
.entry.planned::before {
  background: repeating-linear-gradient(180deg, var(--fg) 0 9px, transparent 9px 18px);
}
.entry.planned.tip::before { top: calc(1.2rem + 9px); }
.entry.tip:not(.planned)::before { top: calc(1.2rem + 9px); }
.entry.root::before { bottom: calc(100% - 1.2rem - 9px); }
.dot {
  position: absolute; left: 11px; top: 1.2rem;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--fg); z-index: 1;
}
.dot.open { background: var(--bg); border: 4px solid var(--fg); }
.entry.planned h3 { opacity: 0.75; }
.year { grid-column: 2; font-size: 0.82rem; color: var(--muted); padding-top: 0.15rem; }
.entry > div { grid-column: 3; }
h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.15rem; }
.entry p { margin: 0; color: inherit; opacity: 0.82; font-size: 0.95rem; }
.sub { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

@media (max-width: 620px) {
  .entry { grid-template-columns: 46px 1fr; }
  .year { padding-top: 0; }
  .entry > div { grid-column: 2; }
  .id-row { display: block; }
  .id-row .avatar { margin-bottom: 1.2rem; }
}
