/* ==========================================================================
   maxsoar.ca — V3
   very minimal · black & white · mono · floating menu · WebGL form
   ========================================================================== */

@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }

:root {
  --bg: #f2f1ed;
  --fg: #111111;
  --mute: #8b8a85;
  --line: rgba(17, 17, 17, .14);

  --font: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs: clamp(12.5px, 0.25vw + 11.4px, 14px);

  --gut: clamp(18px, 3vw, 44px);   /* outer margin */
  --side: 0px;                       /* left column (desktop) */
  --head: 4rem;                      /* top bar (mobile) */
  --measure: 46rem;
  --ease: cubic-bezier(.2, .7, 0, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  /* the WebGL form: position + size, and how big it gets while loading */
  --fx: calc(50vw - var(--fsz) / 2);
  --fy: .4rem;
  --fsz: 3.2rem;
  --fk: 4.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --fg: #ecebe6;
    --mute: #77766f;
    --line: rgba(236, 235, 230, .14);
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scrollbar-gutter: stable;          /* the scrollbar never shifts the page when content length changes */
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head) + 1rem);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); padding-left: var(--side); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px dashed currentColor; outline-offset: 4px; }
img, video, iframe { display: block; max-width: 100%; }
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }  /* no long-press "save image" on phones */
ul, ol { list-style: none; }
strong, b { font-weight: 500; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--fg); color: var(--bg); }

.skip { position: absolute; left: var(--gut); top: -10rem; background: var(--fg); color: var(--bg); padding: .25rem .5rem; z-index: 100; }
.skip:focus { top: .5rem; }

/* ---------- WebGL form + loader veil ---------- */

/* faint full-screen point field behind everything */
.field { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.main { position: relative; z-index: 1; }
.no-gl .field { display: none; }

.form {
  position: fixed; z-index: 60;
  left: var(--fx); top: var(--fy);
  width: var(--fsz); height: var(--fsz);
  pointer-events: none;
  transform-origin: 50% 50%;
  transform: translate(var(--mx, 0px), var(--my, 0px));   /* drifts a few px towards the pointer */
  transition: transform 1.2s var(--ease), opacity .6s;
}
.no-gl .form { display: none; }

.veil {
  position: fixed; inset: 0; z-index: 55;
  background: var(--bg);
  opacity: 0; visibility: hidden;
  transition: opacity .9s var(--ease) .35s, visibility 0s 1.3s;
}
.veil__count {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, calc(var(--fsz) * var(--fk) / 2 + 1.75rem));
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  letter-spacing: .1em;
}
.is-loading .veil { opacity: 1; visibility: visible; transition: none; }
.is-loading .form {
  transform:
    translate(calc(50vw - var(--fx) - var(--fsz) / 2), calc(50vh - var(--fy) - var(--fsz) / 2))
    scale(var(--fk));
  transition: none;
}
.is-landing .form { transition: transform 1.3s var(--ease-io) !important; }
/* returning visitors: the same loader, quicker */
.is-quick.is-landing .form { transition-duration: .8s !important; }
.is-quick .veil { transition: opacity .5s var(--ease) .1s, visibility 0s .7s; }

/* page changes: content fades, the form morphs */
.main, .site-nav, .site-name, .site-tools, .clock { transition: opacity .45s var(--ease); }
.is-leaving .main { opacity: 0; }
.is-loading .main { opacity: 0; transition: none; }

/* ---------- header (mobile first: top line) ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--head);
  padding: 0 var(--gut);
  background: var(--bg);
}
.site-name { font-weight: 500; letter-spacing: .02em; white-space: nowrap; position: relative; z-index: 2; }

.site-nav a, .lang a, .menu-toggle, .clock { text-transform: uppercase; letter-spacing: .08em; }
.site-nav a {
  color: var(--mute);
  transition: color 1.1s var(--ease), text-shadow 1.1s var(--ease);   /* slow light-up on hover */
}
.site-nav a:hover { color: var(--fg); text-shadow: 0 0 14px color-mix(in srgb, var(--fg) 35%, transparent); }
.site-nav a[aria-current] { color: var(--fg); text-shadow: 0 0 14px color-mix(in srgb, var(--fg) 25%, transparent); }

.site-tools { display: flex; align-items: center; gap: 1.5rem; position: relative; z-index: 2; }
.lang { display: flex; gap: .9rem; }
.lang a { color: var(--mute); }
.lang a:hover, .lang a[aria-current] { color: var(--fg); }
.menu-toggle { padding: .5rem 0; min-width: 4.5rem; text-align: right; }
.clock { display: none; color: var(--mute); font-variant-numeric: tabular-nums; }
.wx { margin-left: .35em; font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "DejaVu Sans", var(--font); font-variant-emoji: text; cursor: default; }

@media (max-width: 61.99em) {
  .site-nav {
    position: fixed; inset: 0; z-index: 1;
    display: flex; align-items: center;
    padding: var(--head) var(--gut) 0 calc(var(--gut) + 6vw);
    background: var(--bg);
    opacity: 0; visibility: hidden;
    transition: opacity .4s var(--ease), visibility 0s .4s;
  }
  .menu-open .site-nav { opacity: 1; visibility: visible; transition: opacity .4s var(--ease); }
  .menu-open { overflow: hidden; }
  .site-nav ul { display: grid; gap: .35rem; }
  .site-nav a { font-size: clamp(1.5rem, 6.5vw, 2.4rem); line-height: 1.25; letter-spacing: .04em; }
  .site-nav li { transform: translateY(.6rem); opacity: 0; transition: transform .6s var(--ease), opacity .6s var(--ease); }
  .menu-open .site-nav li { transform: none; opacity: 1; }
  .menu-open .site-nav li:nth-child(2) { transition-delay: .04s; }
  .menu-open .site-nav li:nth-child(3) { transition-delay: .08s; }
  .menu-open .site-nav li:nth-child(4) { transition-delay: .12s; }
  .menu-open .site-nav li:nth-child(5) { transition-delay: .16s; }
  .menu-open .site-nav li:nth-child(6) { transition-delay: .2s; }
  .menu-open .site-nav li:nth-child(7) { transition-delay: .24s; }
  /* phones: the form is a small solid circle in the top bar (site.js stops drawing particles) */
  .form { background: radial-gradient(circle at 50% 50%, var(--fg) 0 .42rem, transparent calc(.42rem + 1px)); }
  .no-gl .form { display: block; }
}

/* ---------- desktop: floating left column ---------- */

@media (min-width: 62em) {
  :root {
    --side: clamp(15rem, 20vw, 21rem);
    --head: 0px;
    --fsz: 10rem;                                   /* the particle cloud, above the menu */
    --fx: calc(var(--gut) - 2.2rem);
    --fy: max(3.5rem, calc(50vh - 16.5rem));
    --fk: 2.4;
    --col: var(--gut);
  }
  html { scroll-padding-top: 2rem; }
  .site-header {
    position: fixed; inset: 0 auto 0 0;
    width: var(--side);
    height: auto;
    display: block;
    padding: 0;
    background: none;
  }
  .site-name { position: absolute; left: var(--col); top: calc(var(--gut) * .9); }
  .site-nav { position: absolute; left: var(--col); top: 50%; transform: translateY(-30%); }
  .site-nav ul { display: grid; gap: .5rem; }
  .site-nav a { display: inline-flex; align-items: center; }
  .site-tools { position: absolute; left: var(--col); bottom: calc(var(--gut) * .9); }
  .menu-toggle { display: none; }
  .clock { display: block; position: absolute; left: calc(var(--col) + 7rem); bottom: calc(var(--gut) * .9); }
}

/* ---------- main / page heads (first redesign) ---------- */

.main { flex: 1; width: 100%; max-width: 78rem; padding: 0 var(--gut) clamp(4rem, 10vh, 8rem); }

.page-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: clamp(1.75rem, 8vh, 6rem) 0 clamp(1.5rem, 4vh, 3rem);
}
.page-head h1 { font-size: 1em; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.page-head h1 a { color: var(--mute); transition: color .25s; }
.page-head h1 a:hover { color: var(--fg); }
.page-head .sep { color: var(--mute); margin: 0 .6em; }
.page-meta { color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prose--intro { margin-bottom: 3rem; }

/* ---------- prose ---------- */

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h1, .prose h2, .prose h3 {
  font-size: 1em; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 2.75rem 0 .45rem;
  border-bottom: 1px solid var(--line);
}
.prose > h1:first-child, .prose > h2:first-child, .prose > h3:first-child { padding-top: 0; }
.prose h2 + ul, .prose h2 + ol { margin-top: .25rem; }
.prose a, .project__text a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .22em; transition: text-decoration-color .25s; }
.prose a:hover, .project__text a:hover { text-decoration-color: currentColor; }
.prose ul > li, .prose ol > li { position: relative; padding: .4rem 0 .4rem 1.6rem; border-bottom: 1px dotted var(--line); }
.prose ul > li::before { content: "—"; position: absolute; left: 0; color: var(--mute); }
.prose ol { counter-reset: li; }
.prose ol > li::before { counter-increment: li; content: counter(li, decimal-leading-zero); position: absolute; left: 0; color: var(--mute); font-size: .85em; top: .55rem; }
.prose em, .project__text em { color: var(--mute); font-style: normal; }
.prose blockquote { padding-left: 1.6rem; color: var(--mute); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose img { height: auto; }
.prose iframe { width: 100%; border: 0; }
.prose iframe[src*="youtube"], .prose iframe[src*="vimeo"], .prose iframe[src$=".mp4"] { height: auto; aspect-ratio: 16 / 9; }

.index { margin-top: 3rem; border-top: 1px solid var(--fg); }
.index a { display: block; padding: .7rem 0; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- media ---------- */

.embed { margin-top: 1rem; }
.embed iframe { width: 100%; border: 0; }
.embed--video iframe { aspect-ratio: 16 / 9; height: auto; background: color-mix(in srgb, var(--fg) 5%, transparent); }
.embed--audio iframe { height: 166px; }
.embed--audio.embed--set iframe { height: 352px; }
.embed--file video { width: 100%; height: auto; background: #000; }
.embed--file audio { width: 100%; height: 2.5rem; }
.embed-link { margin-top: .75rem; color: var(--mute); }
.media-image { margin-top: 1rem; }
.media-image img { width: min(100%, 26rem); height: auto; }
.media-image figcaption { color: var(--mute); margin-top: .4rem; font-size: .9em; }

/* ---------- project lists (audio, interactif) ---------- */

.projects { border-top: 1px solid var(--fg); }
.project {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1.5rem;
  padding: 1.1rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
}
.project__title { font-size: 1em; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.project__year { color: var(--mute); font-variant-numeric: tabular-nums; }
.project__text { margin-top: .35rem; max-width: var(--measure); color: var(--mute); }
.project__text a { color: var(--fg); }
.project__text p + p { margin-top: .6em; }
.project__body { min-width: 0; max-width: 54rem; }
.project__body .embed:first-of-type, .project__body .media-image:first-of-type { margin-top: 1.25rem; }

/* ---------- photography index ---------- */

.albums { border-top: 1px solid var(--fg); }
.albums__item a {
  display: grid;
  grid-template-columns: 1fr;
  align-items: baseline;
  gap: 0 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding .45s var(--ease);
}
.albums__title { font-size: clamp(1.2rem, 2.2vw, 1.9rem); line-height: 1.15; text-transform: uppercase; letter-spacing: .02em; }
.albums__cover img { width: 100%; height: auto; aspect-ratio: var(--r); background: var(--line); }
.albums__sub { display: block; margin-top: .6rem; color: var(--mute); font-size: .9em; line-height: 1.5; text-transform: none; letter-spacing: 0; }

@media (hover: hover) and (min-width: 62em) {
  /* the album list is short: centre it vertically on the page, like the menu */
  /* a compact list, with the cover preview appearing right beside it */
  .albums { --list: 26rem; max-width: var(--list); }
  .albums__item a:hover { padding-left: 1.25rem; }
  .albums__item a:hover .albums__title { color: var(--fg); }
  .albums:hover .albums__item a:not(:hover) .albums__title { color: var(--mute); }
  .albums__title { transition: color .3s; }
  .albums__cover {
    position: fixed; z-index: 5;
    left: calc(var(--side) + var(--gut) + var(--list) + 3.5rem); top: 50%;
    width: min(26rem, calc(100vw - var(--side) - var(--gut) * 2 - var(--list) - 3.5rem));
    transform: translateY(-50%) scale(.97);
    opacity: 0; pointer-events: none;
    transition: opacity .35s var(--ease), transform .6s var(--ease);
  }
  .albums__cover img { max-height: 66vh; width: auto; max-width: 100%; }
  .albums__sub { max-width: 26rem; }
  .albums__item a:hover .albums__cover { opacity: 1; transform: translateY(-50%); }
}
@media (hover: none), (max-width: 61.99em) {
  .albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 0 var(--gut); border-top: 0; }
  .albums__item a { border-top: 1px solid var(--fg); border-bottom: 0; padding: .6rem 0 2.5rem; }
  .albums__title { font-size: 1.05rem; }
  .albums__cover { grid-column: 1 / -1; margin-top: .75rem; }
  .albums__sub { margin-top: .5rem; }
  .albums__cover img { aspect-ratio: 4 / 5; object-fit: cover; }
}

/* ---------- album: single column ---------- */

.sequence { display: flex; flex-direction: column; align-items: center; gap: clamp(3.5rem, 14vh, 10rem); }
.frame {
  --maxh: calc(100svh - var(--head) - 5rem);
  width: min(100%, calc(var(--maxh) * var(--r)), 110rem);
}
.frame img {
  width: 100%; height: auto; aspect-ratio: var(--r);
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .js .frame img { opacity: 0; transform: translateY(1rem); transition: opacity 1s var(--ease), transform 1.2s var(--ease); }
  .js .frame.is-in img { opacity: 1; transform: none; }
}
.frame figcaption { margin-top: .55rem; color: var(--mute); font-size: .9em; }

@media (max-width: 40em) {
  .tpl-album .main { padding-left: 0; padding-right: 0; }
  .tpl-album .page-head, .tpl-album .prose, .tpl-album .pager, .frame figcaption { padding-left: var(--gut); padding-right: var(--gut); }
  .frame { --maxh: calc(100svh - var(--head) - 2rem); }
}

/* ---------- album on a computer: a compact grid, two photos per row at most ----------
   Photos come in pairs (album.php); a pair shares one height and the column width,
   each photo keeps its proportions. A lone last photo takes half the width.
   Click a photo to see it large (site.js: lightbox). Phones keep the single column. */
.frame-row { display: contents; }
@media (min-width: 62em) {
  .sequence {
    --gap: clamp(.45rem, .7vw, .8rem);
    align-items: stretch;
    gap: var(--gap);
    max-width: min(100%, 50rem);
  }
  .frame-row { display: flex; align-items: flex-start; gap: var(--gap); }
  .frame { width: auto; flex: var(--r) 1 0; min-width: 0; cursor: zoom-in; transition: opacity .6s var(--ease); }
  .frame-row--single .frame { flex: 0 0 calc((100% - var(--gap)) / 2); }
  .frame figcaption { display: none; }
  .sequence:hover .frame:not(:hover) { opacity: .72; }
  .tpl-album .pager { margin-top: clamp(2.5rem, 8vh, 5rem); max-width: min(100%, 50rem); }
}

/* ---------- pages on a computer (not home): they begin level with the menu ----------
   site.js measures the menu and sets --lead; the space only exists above the first
   line, so as soon as you scroll the text rises to the top line like before. */
@media (min-width: 62em) {
  .main.is-long::before { flex: 0 0 var(--lead, 0px); }
}

/* ---------- lightbox (album photos, computer) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--gut) * .9) var(--gut);
  background: var(--bg);
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease), visibility 0s .45s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .45s var(--ease); }
.lightbox__fig { position: relative; z-index: 1; display: flex; flex-direction: column; max-width: 100%; pointer-events: none; }
.lightbox__img {
  display: block; width: auto; height: auto; max-width: 100%;
  max-height: calc(100svh - var(--gut) * 1.8 - 3.2rem);
  transition: opacity .35s var(--ease);
}
.lightbox__img.is-loading { opacity: 0; }
.lightbox__bar {
  display: flex; align-items: baseline; gap: 1.5rem;
  margin-top: .8rem;
  color: var(--mute); letter-spacing: .06em;
  pointer-events: auto;
}
.lightbox__bar { width: 0; min-width: 100%; }
.lightbox__cap { flex: 1 1 auto; min-width: 0; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox__count { font-variant-numeric: tabular-nums; }
.lightbox__count b { color: var(--fg); font-weight: 400; }
.lightbox__close { text-transform: uppercase; color: var(--mute); transition: color 1.1s var(--ease), text-shadow 1.1s var(--ease); }
.lightbox__close:hover { color: var(--fg); text-shadow: 0 0 14px color-mix(in srgb, var(--fg) 35%, transparent); }
.lightbox__prev, .lightbox__next { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 0; }
.lightbox__prev { left: 0; cursor: w-resize; }
.lightbox__next { right: 0; cursor: e-resize; }
.lightbox:focus, .lightbox__prev:focus-visible, .lightbox__next:focus-visible { outline: none; }
.lightbox-open .form { opacity: 0; }

.pager {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem;
  margin-top: clamp(4rem, 14vh, 10rem);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .06em;
}
.pager [rel="next"] { justify-self: end; text-align: right; }
.pager a { transition: color .25s; }
.pager__top { color: var(--mute); }
.pager a:hover { color: var(--mute); }
.pager__top:hover { color: var(--fg) !important; }

/* ---------- home ---------- */

.tpl-home .main { display: flex; flex-direction: column; justify-content: center; padding-bottom: 0; }
.hero { padding: clamp(1rem, 4vh, 3rem) 0; }
.hero__frame {
  --maxh: calc(100svh - var(--head) - 11rem);
  display: block;
  width: min(100%, calc(var(--maxh) * var(--r)));
  margin: 0 auto;
}
.hero__frame img { width: 100%; height: auto; aspect-ratio: var(--r); }
.hero__cap {
  display: flex; justify-content: space-between; gap: 1rem;
  width: min(100%, calc((100svh - var(--head) - 11rem) * var(--r, 1)));
  margin: .7rem auto 0;
  text-transform: uppercase; letter-spacing: .06em;
}
.hero__album { font-weight: 500; }
.hero__link { color: var(--mute); transition: color .25s; }
.hero__link:hover { color: var(--fg); }
.hero__text { max-width: var(--measure); margin: 2rem auto 0; text-align: center; color: var(--mute); }

/* ---------- carousel (projects with several media) ----------
   No frame or fill around the media: each item keeps its own shape, the track
   follows the current item's height, and thumbnails of every item sit below. */

.carousel { margin-top: 1.25rem; }
.carousel__track {
  display: flex; align-items: flex-start;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  outline: none;
  transition: height .6s var(--ease);
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__slide { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
.carousel__media { display: flex; align-items: flex-start; }
.carousel__media > * { width: 100%; margin: 0 !important; }
.carousel__media .media-image img { width: auto; max-width: 100%; height: auto; max-height: min(64vh, 40rem); aspect-ratio: var(--r); }
.carousel__media .embed--video iframe { background: none; }
.carousel__media .embed--file video { max-height: min(64vh, 40rem); }
.carousel__caption { margin-top: .5rem; color: var(--mute); font-size: .9em; }

.carousel__thumbs { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.carousel__thumb {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 2.6rem; min-width: 2.6rem;
  padding: 0; overflow: hidden;
  color: var(--mute);
  opacity: .42;
  transition: opacity .6s var(--ease), color .6s var(--ease);
}
.carousel__thumb:hover { opacity: .85; color: var(--fg); }
.carousel__thumb.is-current { opacity: 1; color: var(--fg); }
.carousel__thumb img, .carousel__thumb video { height: 100%; width: auto; max-width: 4.6rem; aspect-ratio: var(--r, 1.5); object-fit: cover; pointer-events: none; }
.carousel__thumb video { aspect-ratio: 16 / 9; }
.carousel__thumb::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transition: transform .6s var(--ease); }
.carousel__thumb.is-current::after { transform: scaleX(1); }
.thumb-glyph { display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 100%; }
.thumb-glyph svg { width: 1.15rem; height: 1.15rem; }
/* a glyph over a picture (videos): small, centred, light */
.carousel__thumb img + .thumb-glyph, .carousel__thumb video + .thumb-glyph { position: absolute; inset: 0; width: auto; color: #fff; filter: drop-shadow(0 0 4px rgba(0, 0, 0, .6)); }
.carousel__thumb img + .thumb-glyph svg, .carousel__thumb video + .thumb-glyph svg { width: .8rem; height: .8rem; }
@media (prefers-reduced-motion: reduce) { .carousel__track { scroll-behavior: auto; transition: none; } }

/* ---------- audio + video players (site.js replaces the browser's controls) ---------- */

.player { --ui: var(--fg); --ui-mute: var(--mute); --ui-line: var(--line); position: relative; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.player button { display: inline-flex; align-items: center; justify-content: center; color: var(--ui); transition: opacity .4s var(--ease), text-shadow 1.1s var(--ease), filter 1.1s var(--ease); }
.player button:hover { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ui) 45%, transparent)); }
.player svg { width: 100%; height: 100%; display: block; }
.player__toggle { width: 1.6rem; height: 1.6rem; flex: 0 0 auto; }
.player__toggle svg { width: .95rem; height: .95rem; }
.player__toggle .i-pause, .player.is-playing .player__toggle .i-play { display: none; }
.player.is-playing .player__toggle .i-pause { display: block; }
.player__time, .player__dur { color: var(--ui-mute); font-size: .9em; flex: 0 0 auto; min-width: 5ch; }
.player__time { color: var(--ui); }
.player__dur { text-align: right; }
.player__bar { position: relative; flex: 1 1 auto; height: 1.6rem; cursor: pointer; touch-action: none; outline: none; }
.player__bar::before, .player__buf, .player__fill { content: ""; position: absolute; left: 0; top: 50%; height: 1px; transform: translateY(-50%); transition: height .3s var(--ease); }
.player__bar::before { right: 0; background: var(--ui-line); }
.player__buf { width: 0; background: color-mix(in srgb, var(--ui) 22%, transparent); }
.player__fill { width: 0; background: var(--ui); }
.player__fill::after { content: ""; position: absolute; right: -3px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--ui); transform: translateY(-50%) scale(0); transition: transform .3s var(--ease); }
.player__bar:hover::before, .player__bar:hover .player__buf, .player__bar:hover .player__fill, .player__bar:focus-visible .player__fill, .player.is-seeking .player__fill { height: 3px; }
.player__bar:hover .player__fill::after, .player__bar:focus-visible .player__fill::after, .player.is-playing .player__fill::after, .player.is-seeking .player__fill::after { transform: translateY(-50%) scale(1); }
.player.is-loading .player__fill { opacity: .5; }
.player__ui { display: flex; align-items: center; gap: .9rem; }
.player__mute, .player__full { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; }
.player__mute svg, .player__full svg { width: .95rem; height: .95rem; }
.player__mute .i-off, .player.is-muted .player__mute .i-on { display: none; }
.player.is-muted .player__mute .i-off { display: block; }

/* audio: a single quiet line */
.player--audio { padding: .35rem 0; }
.embed--file .player--audio { max-width: 40rem; }

/* video: the picture, with the controls over its lower edge */
.player--video { background: none; line-height: 0; }
.player--video video { width: 100%; height: auto; background: none; cursor: pointer; }
.player--video { --ui: #f4f3ef; --ui-mute: rgba(244, 243, 239, .7); --ui-line: rgba(244, 243, 239, .3); }
.player--video .player__ui {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.2rem .9rem .5rem; line-height: 1.6;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
  opacity: 0; transition: opacity .5s var(--ease);
}
.player--video:not(.is-playing) .player__ui, .player--video.is-active .player__ui, .player--video:focus-within .player__ui { opacity: 1; }
.player--video.is-playing:not(.is-active) { cursor: none; }
.player__big {
  position: absolute; left: 50%; top: 50%; width: 3.4rem; height: 3.4rem;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, .45));
}
.player__big svg { width: 1.6rem; height: 1.6rem; }
.player--video.is-playing .player__big, .player--video.has-played .player__big { opacity: 0; pointer-events: none; }
.player--video:fullscreen { display: flex; align-items: center; justify-content: center; background: #000; }
.player--video:fullscreen video { max-height: 100vh; }

/* ---------- desktop: the content scrolls inside a band ----------
   <main> is a fixed box from the name line (top) to the language/clock line (bottom):
   long text scrolls inside it and fades out at those lines instead of at the window
   edges. Short content sits vertically centred in it (auto margins keep long content
   scrollable from the very top). */
@media (min-width: 62em) {
  html, body { height: 100%; overflow: hidden; }
  body { padding-left: 0; }
  .main {
    --edge: 1.1rem;                               /* soft fade at the top and bottom lines */
    position: fixed; z-index: 1;
    top: calc(var(--gut) * .9 - var(--edge));
    bottom: calc(var(--gut) * .9 - var(--edge));
    left: var(--side);
    width: calc(100vw - var(--side));
    max-width: 78rem;
    padding: var(--edge) var(--gut) !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    display: flex; flex-direction: column;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--edge), #000 calc(100% - var(--edge)), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 var(--edge), #000 calc(100% - var(--edge)), transparent 100%);
    outline: none;
  }
  .main::-webkit-scrollbar { display: none; }
  /* invisible spacers above and below: they centre short content and shrink to
     nothing when the content is longer than the band */
  .main::before, .main::after { content: ""; flex: 1 1 0; min-height: 0; }
  .tpl-home .main { padding-bottom: var(--edge) !important; }

  /* photos and the home image fit the band's height */
  .frame { --maxh: calc(100svh - var(--gut) * 1.8 - 3rem); }
  .hero__frame { --maxh: calc(100svh - var(--gut) * 1.8 - 6rem); }
  .hero__cap { width: min(100%, calc((100svh - var(--gut) * 1.8 - 6rem) * var(--r, 1))); }

  /* the menu shows which page you're on: no need to repeat its name */
  .page-head--menu { display: none; }
  .tpl-default .page-head, .tpl-projects .page-head, .tpl-photography .page-head, .tpl-error .page-head, .tpl-album .page-head { padding-top: 0; }
}

/* ---------- text page with a side image (e.g. à propos) ---------- */
.aside-image { margin-top: 2.5rem; }
.aside-image img { width: 100%; height: auto; aspect-ratio: var(--r); }
.aside-image figcaption { margin-top: .5rem; color: var(--mute); font-size: .9em; }
@media (min-width: 62em) {
  /* text, then the image just to its right — vertically centred, like the album previews */
  .with-aside { display: flex; align-items: flex-start; gap: 3.5rem; }   /* text and photo both start at the top line */
  .with-aside .prose { flex: 0 1 auto; max-width: min(var(--measure), 30rem); }
  .aside-image { flex: 0 0 auto; margin-top: 0; width: min(26rem, calc((100svh - var(--gut) * 1.8 - 4rem) * var(--r)), 40vw); }
}

/* main is focused for keyboard scrolling: no focus ring on it */
.main:focus, .main:focus-visible { outline: none; }

/* returning visitors: the cloud lands in place faster after the quick loader */
.is-quick.is-landing .form { transition-duration: .8s !important; }
