/* ==========================================================================
   Fonts — three families, kept in assets/fonts/ (no request to any other server), font-display: swap, no slanting made by the browser
   (font-synthesis: none): only the real files.
     --font-display  Instrument Serif (SIL OFL)   regular + italic, one weight only (never bold): the two big titles and their italic word
     --font-body     Inter Tight (SIL OFL)         variable, weights 100-900, normal + italic: every text that is not in capitals
     --font-mono     DM Mono (SIL OFL)             weights 300, 400, 500, normal + italic: the labels, always in capitals
   ========================================================================== */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/instrumentserif-regular-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/instrumentserif-regular-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/instrumentserif-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/instrumentserif-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/intertight-variable-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/intertight-variable-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter Tight"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/intertight-variable-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/intertight-variable-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("/assets/fonts/dmmono-300-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("/assets/fonts/dmmono-300-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/dmmono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/dmmono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/dmmono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/dmmono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: italic; font-weight: 300; font-display: swap;
  src: url("/assets/fonts/dmmono-300-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: italic; font-weight: 300; font-display: swap;
  src: url("/assets/fonts/dmmono-300-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/dmmono-400-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/dmmono-400-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: italic; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/dmmono-500-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: italic; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/dmmono-500-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ==========================================================================
   Design tokens — colours, fonts, the type scale and the spaces live HERE and nowhere else
   ========================================================================== */
:root {
  /* colours */
  --bg: #3b3fd2;            /* the blue of the whole site */
  --ink: #000000;           /* black: video and photo backgrounds (not text) */
  --text: #ffffff;          /* ALL the text, the underlines, the dividers and the arrows (they use currentColor) */
  --text-rgb: 255 255 255;
  --paper: #ffffff;         /* controls on top of video */
  --accent: #ff4fd8;        /* reserve, not used. Defined so that it can be turned on again; no rule uses it now. */
  --ink-rgb: 0 0 0;         /* black as channels, for the veils over video: rgb(var(--ink-rgb) / .35) */
  --paper-rgb: 255 255 255;
  --line: rgb(var(--text-rgb) / 0.35);       /* dividers at rest: white at 35 % */

  /* the fonts and their weights */
  --font-display: "Bricolage Grotesque", sans-serif;   /* the big titles, the Photography title and the Plus captions (no italic: stays upright) */
  --font-body: "Inter Tight", sans-serif;              /* every text that is not in capitals */
  --font-mono: "DM Mono", monospace;                   /* the labels, always in capitals */
  --fw-display: 500;        /* weight of Bricolage Grotesque for the titles */
  --fw-body: 400;           /* regular */
  --fw-medium: 500;         /* names of the Works list, project titles, the email */
  --nav-fw: 400;            /* DM Mono at rest */
  --nav-fw-bold: 500;       /* DM Mono, hovered and current item of the bar */
  --about-italic: italic;   /* the italic word of the About title (move the class .is-italic to the other word to change the word) */

  /* type scale: the SAME for every page (project pages included); each size has its own line height and letter-spacing */
  --fs-display: clamp(48px, 9.6vw, 220px);    /* the big titles: "Mattia Dallapiccola" (About) and "Want to reach out?" (Contact), one size for both, two tight lines each */
  --lh-display: 0.84;
  --ls-display: -0.02em;
  --fs-names: clamp(20px, 2.8vw, 52px);        /* the names of the projects in the Works section */
  --lh-names: 1.15;
  --ls-names: -0.02em;
  --fs-body: clamp(15px, 1.2vw, 24px);         /* texts: About, "+", the side texts of the project pages */
  --lh-body: 1.35;
  --ls-body: -0.01em;
  --fs-title-project: clamp(20px, 2.6vw, 48px);   /* title of a project page */
  --lh-title-project: 1.05;
  --ls-title-project: -0.025em;
  --fs-label: clamp(11px, 0.9vw, 16px);        /* the small labels in capitals */
  --fs-nav: clamp(12px, 1vw, 18px);            /* the top bar, Close and the contact line: the same type as the labels, a little bigger */
  --lh-label: 1;
  --ls-label: 0.04em;
  --fs-email: clamp(22px, 3.2vw, 60px);        /* the email */
  --ls-email: -0.025em;
  --ul-lh: 1.1;                                /* the line height at which the underline measures below were taken */

  /* spaces: one scale for all the groups of text */
  --space-margin: 1.8vw;                       /* side margins and distance from the top edge, bar and sections */
  --space-1: 0.6vw;
  --space-2: 1.2vw;                            /* between lines of text and small blocks */
  --space-3: 2.4vw;                            /* between groups of text, and between text and video */
  --space-4: 4.8vw;
  --pad: clamp(16px, 2.2vw, 32px);             /* margins of the old page template (article, hidden Projects page) */

  /* underline (measured on DM Mono, the font of the bar and of the capitals): ascent 0.992 and descent 0.310 em -> the baseline is 0.891 em
     from the top of a line of 1.1; descenders 0.22 em deep, capitals 0.70 em tall. thickness = 0.73 x stem = about 0.09 em;
     the line starts 0.07 em below the lowest descender. */
  --stem: 0.125;
  --ul-thickness: calc(var(--stem) * 0.73em);
  --ul-offset: 0.07em;
  --ul-desc: 0.22em;
  --ul-base: 0.891;
  --cap: 0.700;
  --name-fs: clamp(32px, 4.6vw, 80px);      /* the name at the bottom right ("Mattia Dallapiccola", one line, hidden for now) */

  /* the fixed bar (measures of the reference) */
  --bar-top: 2.1vw;                                           /* top of the bar's boxes (the text starts about 2.5vw from the top edge) */
  --nav-ul: 0.09em;                                           /* thickness of the hover underline at weight 400 */
  --nav-ul-bold: 0.1em;                                       /* ... and at weight 500, a little thicker; the line of the current section always has this one */
  --nav-ul-top: calc((var(--ul-base) + (var(--lh-label) - var(--ul-lh)) / 2) * 1em + var(--ul-desc) + var(--ul-offset));   /* where the underline starts, under the descenders */
  --bar-h: calc(var(--bar-top) + var(--fs-nav) * 1.4);        /* real height of the fixed bar */
  --section-top: calc(var(--bar-h) + var(--space-margin));    /* top margin of a section: the bar plus the standard margin */
  --section-offset: 0px;                                      /* scroll-margin-top of the sections: they start at the top, their own padding clears the bar */
  --edge-b: max(var(--space-margin), env(safe-area-inset-bottom, 0px));   /* shared bottom edge of the fixed elements */
  --nav-h: clamp(52px, 5vw, 68px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
/* phones: the same variables, bigger in vw */
@media (max-width: 860px) { :root { --fs-display: clamp(44px, 13.6vw, 130px); } }
@media (max-width: 720px) { :root { --fs-names: clamp(20px, 6vw, 36px); --fs-body: clamp(15px, 4vw, 20px); } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; text-rendering: optimizeLegibility; }
html { scrollbar-gutter: stable; }
/* The warm player of a project (vlayer.js), made on the home: OFF the screen (not display:none and not hidden: it must really play, muted, to buffer) until the project page
   takes it over. Here, and not in project.css, because the home does not load project.css. */
.vbox.is-warm { position: fixed; left: -200vw; top: 0; width: 100vw; height: 100vh; height: 100svh; overflow: hidden; pointer-events: none; background: transparent; }
.vbox.is-warm .vin { position: absolute; left: 50%; top: 50%; }
.vbox.is-warm .vposter, .vbox.is-warm .vframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }                    /* the room of the scrollbar is always reserved: every page has the same usable width, the content never moves sideways between sections */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  font-optical-sizing: auto; font-kerning: normal; font-feature-settings: "kern" 1;
  font-synthesis: none;       /* no slanting or thickening made by the browser: only the real weights and the real italic */
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; }
h1, h2, h3 { font-weight: inherit; }                /* headings take the weight of their rule (Instrument Serif has no bold) */
ul { list-style: none; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }

/* ==========================================================================
   Page transitions: the content of #app is swapped by router.js with a soft cross-fade
   (View Transitions API, or a plain fade as fallback).
   ========================================================================== */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.55s; animation-timing-function: var(--ease-out); }
/* ---- Opening and closing a project (router.js puts html.vt-open / html.vt-close while the transition runs). Opening: the project slides up over the page like a sheet; closing:
   the project slides down and the page is under it. Only a transform of the whole picture (nothing is clipped, nothing is faded, the text of the old page does not move).
   Meanwhile no transition of the page itself runs: the texts of the new page are already in their place, so they do not move twice. ---- */
html.vt-open *, html.vt-close * { transition: none !important; }
html.vt-open::view-transition-old(root), html.vt-open::view-transition-new(root),
html.vt-close::view-transition-old(root), html.vt-close::view-transition-new(root) { animation-duration: 0.8s; animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1); animation-fill-mode: both; mix-blend-mode: normal; }
html.vt-open::view-transition-old(root) { animation-name: vt-frost-in; z-index: 1; }
html.vt-open::view-transition-new(root) { animation-name: vt-sheet-in; z-index: 2; }
html.vt-close::view-transition-old(root) { animation-name: vt-sheet-out; z-index: 2; }
html.vt-close::view-transition-new(root) { animation-name: vt-frost-out; z-index: 1; }
@keyframes vt-sheet-in  { from { transform: translateY(100%); } to { transform: none; } }
@keyframes vt-sheet-out { from { transform: none; } to { transform: translateY(100%); } }
/* the page that stays under the sheet is FROSTED while the sheet covers it (blur + a little dimmer, a little smaller) and clears as the sheet goes away: the same frosted glass as the carousel of Plus */
@keyframes vt-frost-in  { from { filter: blur(0) brightness(1); transform: none; } to { filter: blur(14px) brightness(0.82); transform: scale(0.97); } }
@keyframes vt-frost-out { from { filter: blur(14px) brightness(0.82); transform: scale(0.97); } to { filter: blur(0) brightness(1); transform: none; } }
@media (max-width: 700px) {
  /* phone: the same settings as the carousel of the photos (plus-viewer.js): opening 560 ms with cubic-bezier(.22,1,.36,1), closing 420 ms with cubic-bezier(.65,0,.35,1); the page under is frosted
     (blur 16 px) behind a veil of the colour of the site: it goes frosted and veiled when the project opens, and clears as the project goes away */
  html.vt-open::view-transition-old(root), html.vt-open::view-transition-new(root) { animation-duration: 0.56s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  html.vt-close::view-transition-old(root), html.vt-close::view-transition-new(root) { animation-duration: 0.42s; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  html.vt-open::view-transition-old(root) { animation-name: vt-frost-in-m; }
  html.vt-close::view-transition-new(root) { animation-name: vt-frost-out-m; }
}
@keyframes vt-frost-in-m  { from { filter: blur(0); opacity: 1; transform: none; } to { filter: blur(16px); opacity: 0; transform: none; } }
@keyframes vt-frost-out-m { from { filter: blur(16px); opacity: 0; transform: none; } to { filter: blur(0); opacity: 1; transform: none; } }
#app { transition: opacity 0.5s var(--ease-out); }
html.is-swapping #app { opacity: 0; transition-duration: 0.3s; }

/* Content rises in */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Navigation (top left) + name (top right)
   ========================================================================== */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: block;
  padding: var(--bar-top) var(--space-margin) 0;
  font-family: var(--font-mono);
  font-weight: var(--nav-fw);
  font-size: var(--fs-nav);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  line-height: var(--lh-label);
  color: var(--text);
  pointer-events: none;
}
.site-nav a { pointer-events: auto; }
/* ==========================================================================
   Entrance of the elements of About, Contact and "+" (enter.js): fade + 16 px rise, once, 650 ms.
   Visible by default; hidden only while the script is on, and shown again by enter.js (or by the safety net).
   ========================================================================== */
html.js [data-enter] {
  opacity: 0; transform: translateY(16px); will-change: opacity, transform;
  transition: opacity 650ms cubic-bezier(0.25, 0, 0, 1) var(--enter-delay, 0ms), transform 650ms cubic-bezier(0.25, 0, 0, 1) var(--enter-delay, 0ms);
}
html.js [data-enter].is-entered { opacity: 1; transform: none; will-change: auto; }
html.enter-off [data-enter] { opacity: 1 !important; transform: none !important; transition: none !important; }    /* if enter.js never ran */
@media (prefers-reduced-motion: reduce) {
  html.js [data-enter] { opacity: 1; transform: none; transition: none; will-change: auto; }
}

/* ==========================================================================
   The fixed bar of the one-page site: transparent, always on screen, four items spread over the whole width,
   black, one underline that slides to the current section (nav.js). Hover = a thin underline that runs in.
   ========================================================================== */
.topbar nav { position: relative; }
.topbar ul { display: flex; justify-content: space-between; align-items: baseline; }
.nav-item {
  display: inline-block; color: var(--text); white-space: nowrap; text-decoration: none; pointer-events: auto;
  font-weight: var(--nav-fw); transition: font-weight 180ms ease-out;                      /* hover: lighter -> heavier in 180 ms, and back */
}
.nav-item[data-active] { font-weight: var(--nav-fw-bold); transition-duration: 220ms; }   /* the current section: heavier, changing in 220 ms */
/* an invisible copy of the text at the heavier weight keeps the width of every item always the same: nothing moves when the weight changes */
.nav-item::before { content: attr(data-label); display: block; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; font-weight: var(--nav-fw-bold); }
@media (hover: hover) and (pointer: fine) { .nav-item:hover, .nav-item:focus-visible { font-weight: var(--nav-fw-bold); } }
@media (prefers-reduced-motion: reduce) { .nav-item, .nav-item[data-active] { transition: none; } }
.nav-item:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.nav-indicator {
  position: absolute; left: 0; width: 0; top: var(--nav-ul-top);
  height: var(--nav-ul-bold); background: var(--text); pointer-events: none; opacity: 0;   /* the current item is heavier: its line is thicker */
  transition: transform 350ms cubic-bezier(0.65, 0, 0.35, 1), width 350ms cubic-bezier(0.65, 0, 0.35, 1);
}
.nav-indicator.is-set { opacity: 1; }
.nav-indicator.no-anim { transition: none; }
@media (prefers-reduced-motion: reduce) { .nav-indicator { transition: none; } }

/* Hover underline for the links that only changed colour before (bar, Close, links of Contact):
   a thin line that runs in from the left (250 ms, ease-out) and goes out to the right. */
.ul-slide { position: relative; display: inline-block; text-decoration: none; }
.ul-slide::after {
  content: ""; position: absolute; left: 0; top: 100%; margin-top: var(--ul-offset); width: 100%; height: var(--ul-thickness); background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 250ms ease-out; pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .ul-slide:hover::after, .ul-slide:focus-visible::after { transform: scaleX(1); transform-origin: left; }
}
@media (prefers-reduced-motion: reduce) { .ul-slide::after { transition: none; } }
.nav-item.ul-slide::after {                      /* in the bar: under the descenders; it grows from 0.09em to 0.105em together with the weight (180 ms) */
  top: var(--nav-ul-top); margin-top: 0; height: var(--nav-ul);
  transition: transform 250ms ease-out, height 180ms ease-out;
}
@media (hover: hover) and (pointer: fine) { .nav-item.ul-slide:hover::after, .nav-item.ul-slide:focus-visible::after { height: var(--nav-ul-bold); } }
@media (prefers-reduced-motion: reduce) { .nav-item.ul-slide::after { transition: none; } }

@media (max-width: 720px) {
  :root { --name-fs: 9vw; }
}

/* Hover on clickable texts (".split-link", see split.js): the letters rise a little one after the other
   (left to right in, right to left out) and a thin line runs under the text. Mouse only. */
.roll { display: inline-block; line-height: 1.15; vertical-align: top; }
.roll > span { white-space: nowrap; }
.split-link { position: relative; text-decoration: none; }
.split-link::after {
  content: ""; position: absolute; left: 0; top: 100%; margin-top: var(--ul-offset); width: 100%; height: var(--ul-thickness); background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 250ms ease-out;     /* out: retracts to the right */
  pointer-events: none;
}
.sl-word { display: inline-block; white-space: nowrap; }
.sl-ch { display: inline-block; transition: transform 200ms ease-out, color 200ms ease-out; transition-delay: var(--d-out, 0ms); }
@media (hover: hover) and (pointer: fine) {
  .split-link:hover::after, .split-link:focus-visible::after { transform: scaleX(1); transform-origin: left; transition-duration: 300ms; }   /* in: grows from the left */
  .split-link:hover .sl-ch, .split-link:focus-visible .sl-ch { transform: translateY(-4px); transition-delay: var(--d-in, 0ms); }
}
@media (prefers-reduced-motion: reduce) {
  .split-link::after { transition: none; }
  .sl-ch, .split-link:hover .sl-ch, .split-link:focus-visible .sl-ch { transition: none; transform: none; }
}
/* the player buttons: no plain underline of their own; the only line is the animated one of .ul-slide (project.css), the same as the top bar */
.pbtn, .pbtn:hover, .pbtn:focus-visible { text-decoration: none; border-bottom: 0; }
button.roll { background: none; border: 0; padding: 0; margin: 0; font-family: inherit; font-size: inherit; font-weight: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }

/* ==========================================================================
   Slide link — one hover animation, used by the home list and by the email on the Contact page.
   At rest:   [lead]  text, with a thick line under both.
   On hover:  the lead shrinks away, the text slides into its place, the line retracts to the right, an arrow
              grows after the text. Leaving plays it backwards. Only transform and opacity move (no colour change). Per link: --lead-w (width of the lead) and --gap (space after it).
   ========================================================================== */
.slide-link {
  --lead-w: 1em; --gap: 0.2em; --ease-sl: cubic-bezier(0.65, 0, 0.35, 1);
  --ul-base: 0.914; --ul-desc: 0.204em; --cap: 0.728;               /* measures of Inter (the email): baseline at 0.914 em in a line of 1.1, descenders 0.204 em, capitals 0.728 em */
  display: grid; grid-template-columns: var(--lead-w) minmax(0, max-content) 1fr; column-gap: var(--gap); align-items: baseline;
  color: var(--text);
}
.sl-lead {
  grid-area: 1 / 1; width: var(--lead-w); position: relative; transform-origin: 0 100%;
  transition: transform 200ms var(--ease-sl) 200ms, opacity 150ms var(--ease-sl) 250ms;          /* coming back */
}
.sl-lead::before { content: "\200b"; }                                                          /* gives the lead a baseline */
.sl-main {
  grid-area: 1 / 2; position: relative; min-width: 0; color: var(--text);
  transition: transform 350ms var(--ease-sl) 50ms;
}
/* the line: 0.095 em thick, starting 0.07 em below the descenders of the font, under lead + text */
.sl-line {
  position: absolute; left: calc(-1 * (var(--lead-w) + var(--gap))); right: 0; top: 100%;
  margin-top: calc(var(--ul-desc) + var(--ul-offset) - (var(--ul-lh) - var(--ul-base)) * 1em);
  height: var(--ul-thickness); background: currentColor; pointer-events: none;
  transform-origin: left; transition: transform 300ms var(--ease-sl) 100ms;                      /* coming back: grows from the left */
}
/* arrows: drawn in a 12-unit box = 0.70 em (capitals); 1 unit = 0.058 em, the stroke is as thick as the stems */
.sl-arrow path, .sl-lead-arrow path { stroke-width: calc(var(--stem) / (var(--cap) / 12)); }
.sl-arrow {
  position: absolute; left: 100%; top: calc((var(--ul-base) - var(--cap)) * 1em); margin-left: 0.17em;
  width: calc(var(--cap) * 1em); height: calc(var(--cap) * 1em); overflow: visible;
  opacity: 0; transform: scale(0.2); transform-origin: 0 100%; pointer-events: none;
  transition: transform 200ms var(--ease-sl), opacity 200ms var(--ease-sl);                      /* leaving: shrinks first */
}
.slide-link[data-lead="arrow"] { --lead-w: calc(var(--cap) * 1em); --gap: 0.25em; }
.sl-lead-arrow { position: absolute; left: 0; top: calc((var(--ul-base) - var(--cap)) * 1em); width: calc(var(--cap) * 1em); height: calc(var(--cap) * 1em); overflow: visible; }
@media (hover: hover) and (pointer: fine) {
  .slide-link:hover .sl-lead, .slide-link:focus-visible .sl-lead { transform: scale(0); opacity: 0; transition: transform 200ms var(--ease-sl), opacity 100ms var(--ease-sl) 100ms; }
  .slide-link:hover .sl-main, .slide-link:focus-visible .sl-main { transform: translateX(calc(-1 * (var(--lead-w) + var(--gap)))); transition: transform 350ms var(--ease-sl); }
  .slide-link:hover .sl-line, .slide-link:focus-visible .sl-line { transform: scaleX(0); transform-origin: right; transition: transform 300ms var(--ease-sl); }
  .slide-link:hover .sl-arrow, .slide-link:focus-visible .sl-arrow { opacity: 1; transform: scale(1); transition: transform 300ms var(--ease-sl) 150ms, opacity 300ms var(--ease-sl) 150ms; }
}
.slide-link:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) {
  /* no movement: only the arrow, appearing at once */
  .sl-lead, .sl-main, .sl-line, .sl-arrow,
  .slide-link:hover .sl-lead, .slide-link:hover .sl-main, .slide-link:hover .sl-line, .slide-link:hover .sl-arrow,
  .slide-link:focus-visible .sl-lead, .slide-link:focus-visible .sl-main, .slide-link:focus-visible .sl-line, .slide-link:focus-visible .sl-arrow { transition: none; }
  .slide-link:hover .sl-lead, .slide-link:hover .sl-main, .slide-link:hover .sl-line,
  .slide-link:focus-visible .sl-lead, .slide-link:focus-visible .sl-main, .slide-link:focus-visible .sl-line { transform: none; opacity: 1; }
  .slide-link:hover .sl-arrow, .slide-link:focus-visible .sl-arrow { transform: none; }
}

/* ==========================================================================
   The sections of the one-page site: #works, #about, #contact, #plus (plain background, no lines or boxes)
   ========================================================================== */
.section { position: relative; background: var(--bg); scroll-margin-top: var(--section-offset); }
.sec-page { padding: var(--section-top) var(--pad) clamp(64px, 9vw, 140px); }

/* the big titles of About and Contact: Instrument Serif, white, tight lines; the italic word uses the real italic of the font */
.big-title { margin: 0; font-family: var(--font-display); font-weight: var(--fw-display); font-synthesis: none; color: var(--text); font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
.big-title span { display: block; white-space: nowrap; }   /* one line each; a word never breaks */
.big-title em, .big-title .is-italic { font-style: normal; }   /* Bricolage Grotesque has no italic: the word stays upright */

/* ==========================================================================
   Shared page layout and big type
   ========================================================================== */
.page { padding: calc(var(--nav-h) + clamp(8px, 1.5vw, 20px)) var(--pad) clamp(64px, 9vw, 140px); }   /* the content starts right under the menu */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.display {
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  margin-bottom: var(--space-4);
}
.crumb { font-family: var(--font-mono); font-weight: var(--nav-fw); text-transform: uppercase; letter-spacing: var(--ls-label); font-size: var(--fs-label); line-height: var(--lh-label); margin-bottom: var(--space-2); }

/* ==========================================================================
   Reduced motion: no rising, no sliding; state changes stay visible
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
  #app { transition: none; }
}
