@font-face {
  font-family: 'Varela Round';
  font-display: swap;
  src: url("varela-round-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: 'Varela Round';
  font-display: swap;
  src: url("varela-round-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;
}

/* JUNE: the halftone clown, fixed behind every page. Mobile first.
   The site is dark; only the home poster has a light version (paper), chosen by the device setting or the
   ☾/☀ switch. In the light version the clown fades from black-on-paper to white-on-black while scrolling
   past the poster (--fade, set by static/js/fade.js), so the content below is dark in both versions. */
:root {--paper:#efece6; --ink:#111; --bg:#0b0b0b; --fg:#f2f2f2; --acid:#c6ff1a; --pad:1rem;
  --page:var(--bg); --text:var(--fg); --accent:var(--acid); --line:rgba(198,255,26,.3); --veil:rgba(11,11,11,.84); --frame:var(--fg);}
* {margin:0;padding:0;box-sizing:border-box;}
html {color:var(--text);font:16px/1.4 'Varela Round',system-ui,sans-serif;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;
  background:var(--page);}
body {min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;}
main {flex:1;width:100%;}
a {color:inherit;text-decoration:none;}
a:focus-visible {outline:2px solid var(--accent);outline-offset:3px;}
h2 {font-weight:normal;font-size:.8rem;letter-spacing:.3em;text-transform:uppercase;color:var(--accent);margin:3rem 0 .75rem;}

/* The clown: two fixed layers behind every page (they do not move while scrolling): black-on-paper, and
   white-on-black above it, shown with opacity --fade (1 = dark). Dark everywhere except the light home poster. */
.clown, .clown::after {position:fixed;inset:0;z-index:-1;pointer-events:none;background:#0000 url("../img/clown-dots.png") center 20%/min(140vw,110svh) no-repeat;}
.clown {background-color:var(--paper);}
.clown::after {content:"";z-index:0;background-color:var(--bg);background-image:url("../img/clown-dots-dark.png");opacity:var(--fade);}
body {--fade:1;}
.home {--fade:0;}  /* light poster at the top; fade.js raises it while scrolling */
@media (prefers-color-scheme:dark) {:root:not([data-theme="light"]) .clown::after {opacity:1;}}
:root[data-theme="dark"] .clown::after {opacity:1;}
/* Home poster: the first screen, straight on the clown; light text colours unless dark. */
.poster {--p-fg:var(--ink);--label:var(--ink);--label-fg:var(--acid);--frame:var(--ink);--p-langbg:var(--ink);
  position:relative;min-height:100vh;min-height:100svh;display:flex;flex-direction:column;justify-content:flex-end;padding:var(--pad);color:var(--p-fg);}
@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) .poster {--p-fg:var(--paper);--label:var(--ink);--label-fg:var(--acid);--frame:var(--paper);--p-langbg:transparent;}
}
:root[data-theme="dark"] .poster {--p-fg:var(--paper);--label:var(--ink);--label-fg:var(--acid);--frame:var(--paper);--p-langbg:transparent;}
/* JUNE is as wide as the subtitle label: both sized from .ident (measured with Varela Round:
   label = 15.66em incl. padding, JUNE = 2.905em at .08em spacing, so 15.66 / 2.905 = 5.39). */
.ident {position:relative;align-self:flex-start;font-size:.95rem;}
.poster h1 {font-weight:normal;font-size:5.39em;line-height:1;letter-spacing:.08em;margin-right:-.08em;}
.roles {display:inline-block;margin-top:.6em;padding:.2em .5em;letter-spacing:.04em;white-space:nowrap;background:var(--label);color:var(--label-fg);}
.roles i {font-style:normal;opacity:.6;}

/* Home content */
/* Under the poster: a dark veil over the clown keeps the text readable. */
.sheet, body:not(.home), .foot {background:var(--veil);}
.sheet {padding:2.5rem 0 1px;}  /* space above the first title inside the dark block */
.sheet > * {margin:0 var(--pad);max-width:900px;}
.sheet > :first-child > h2 {margin-top:0;}
.dates, .links {list-style:none;}
.dates li {display:flex;gap:1rem;align-items:baseline;padding:.55rem 0;border-bottom:1px solid var(--line);}
.dates li > a {flex:1;display:flex;gap:1rem;align-items:baseline;margin:-.55rem 0;padding:.55rem 0;}
.dates a:hover .title {color:var(--accent);}
.dates time {flex:none;min-width:5.2rem;color:var(--accent);}
.dates .title {flex:1;overflow-wrap:anywhere;}
#next .dates li {font-size:1.3rem;}
#next .dates time {min-width:6.5rem;}
.links li {border-bottom:1px solid var(--line);}
.links a, .links span {display:block;padding:.55rem 0;}
.links a:hover {color:var(--accent);}
.links a[target]::after {content:" ↗";color:var(--accent);}
.links span {opacity:.45;}
/* Links: two columns (social | crews), each headed like a section title. */
.linkcols {display:grid;grid-template-columns:1fr 1fr;column-gap:2rem;}
.linkcols > h2 {white-space:nowrap;}
@media (max-width:599px) {.linkcols > h2 {letter-spacing:.18em;}}
@media (max-width:359px) {
  .linkcols {grid-template-columns:1fr;}
  .linkcols > .links:not(.crews) {order:1;}
  .crews-sub {order:2;margin-top:1.5rem;}
  .crews {order:3;}
}
/* Archives: a section title that is a link. */
#archives h2 a:hover {color:var(--text);}
.empty {opacity:.7;}
.bio {font-size:1.1rem;line-height:1.65;}  /* full width of the section */
.bio p + p {margin-top:1rem;}
#old .links span {opacity:1;}  /* projects without a link are not "missing" links: full white */
#old .links {columns:2;column-gap:2rem;}  /* two columns, filled top to bottom */
#old .links li {break-inside:avoid;}
@media (max-width:359px) {#old .links {columns:1;}}

/* Other pages: small home link on top */
.top {padding:1rem var(--pad);}
/* Theme switch: the moon on the light theme, the sun on the dark one. */
.lang .sep {width:1px;margin:.2rem .3rem;background:var(--text);opacity:.3;}
.lang .to-dark, .lang .to-light {font-size:1.05rem;line-height:1;padding:.15rem .45rem;}
.lang .to-light {display:none;}
@media (prefers-color-scheme:dark) {:root:not([data-theme="light"]) .lang .to-dark {display:none;} :root:not([data-theme="light"]) .lang .to-light {display:inline;}}
:root[data-theme="dark"] .lang .to-dark {display:none;}
:root[data-theme="dark"] .lang .to-light {display:inline;}
:root[data-theme="light"] .lang .to-dark {display:inline;}

/* Language and theme switch: top left, next to JUNE (in the corner of the home poster). */
.top {display:flex;align-items:center;flex-wrap:wrap;gap:.5rem 1.25rem;}
.lang {display:flex;gap:.15rem;font-size:.8rem;letter-spacing:.08em;}
.poster .lang {position:absolute;top:1rem;left:var(--pad);z-index:5;background:var(--p-langbg);}
.lang a {padding:.25rem .45rem;color:var(--text);opacity:.65;}
.lang a:hover {opacity:1;color:var(--accent);}
.lang a[aria-current] {opacity:1;color:var(--accent);}
/* Chinese and Japanese: Varela Round has no CJK glyphs, so name good system fonts per language. */
:lang(zh-hans) {font-family:'Varela Round',"PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Microsoft YaHei",system-ui,sans-serif;}
:lang(ja) {font-family:'Varela Round',"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans CJK JP","Yu Gothic","Meiryo",system-ui,sans-serif;}
.top .home {display:inline-flex;align-items:center;gap:.6rem;color:var(--accent);letter-spacing:.3em;}
.top .home span {color:var(--text);}
.top .home:hover span {color:var(--accent);}

/* Error pages */
.lost main {padding:2rem var(--pad);display:flex;flex-direction:column;justify-content:center;}
/* Fits a 16-digit line (binary 404/500) on any screen; short words get the 8rem cap. */
.big {font-weight:normal;font-size:min(8rem,calc((100vw - 2 * var(--pad)) / 11));line-height:1;letter-spacing:.02em;overflow-wrap:anywhere;}
.say {margin:2rem 0 1.25rem;font-size:1.3rem;}
.back {display:inline-block;padding:.2rem .5rem;background:var(--acid);color:var(--bg);}
.back:hover {background:var(--text);color:var(--page);}

/* Home trailer: on the poster, left side between the language bar and JUNE (over the clown on phones). */
.ptrailer {position:relative;z-index:1;width:100%;max-width:640px;margin-bottom:1.75rem;}
.ptrailer video {display:block;width:100%;max-height:55vh;background:#000;border:3px solid var(--frame);}
.nofilm a {display:inline-block;padding:.2rem .5rem;background:var(--ink);color:var(--acid);}

/* Media in a folder: photo/video squares that open the viewer. */
.media {display:grid;grid-template-columns:repeat(auto-fill,minmax(6.5rem,1fr));gap:.5rem;margin-bottom:2rem;}
.thumb {position:relative;aspect-ratio:1;overflow:hidden;border:2px solid var(--frame);background:#141414;}
.thumb:hover {border-color:var(--accent);}
.thumb img, .thumb video {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;}
.play {position:absolute;left:.4rem;bottom:.3rem;padding:.05rem .35rem;background:var(--acid);color:var(--bg);font-size:.75rem;}
.viewer {width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--bg);color:var(--fg);}
.viewer[open] {display:flex;flex-direction:column;}
.viewer::backdrop {background:rgba(0,0,0,.6);}
.stage {flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:1rem 3.5rem;}
.stage img, .stage video {max-width:100%;max-height:100%;object-fit:contain;}
.fail {position:absolute;left:0;right:0;bottom:1.5rem;text-align:center;}
/* Left / right arrows on the edges, close in the corner. */
.viewer button {position:absolute;z-index:1;background:none;border:0;color:var(--acid);font:inherit;line-height:1;cursor:pointer;}
.viewer button:hover {color:var(--fg);}
.viewer .nav {top:50%;transform:translateY(-50%);font-size:2.5rem;padding:1rem .75rem;text-shadow:0 0 8px rgba(0,0,0,.8);}
.viewer .prev {left:0;}
.viewer .next {right:0;}
.viewer .close {top:.5rem;right:.5rem;font-size:1.5rem;padding:.5rem;}
@media (max-width:599px) {.stage {padding:3rem 0;} .viewer .nav {font-size:2rem;padding:1rem .5rem;}}

/* File listing */
.files main {padding:.5rem var(--pad) 2.5rem;max-width:1100px;}
.path {font-weight:normal;font-size:1.5rem;margin-bottom:1rem;overflow-wrap:anywhere;}
.up {margin:-.25rem 0 1.25rem;}
.up a:hover {color:var(--accent);}
/* Folders as squares: cover (or generated rings + date), title over the bottom. */
/* Archives: event folders grouped by year, each under a title with a line. */
.year {display:flex;align-items:center;gap:1rem;margin:2.25rem 0 1rem;font-size:1.1rem;letter-spacing:.25em;}
.year::after {content:"";flex:1;height:1px;background:var(--line);}
.year:first-of-type {margin-top:1rem;}
/* Folders that are not events: acid frames, no letter. Phones: a last section titled "Others", same squares.
   From 900px: a fixed column at the bottom right (no title), events 3 per line beside it. */
.others .tile {border-color:var(--acid);}
.others .tile:hover {border-color:var(--fg);}
.others .gen {display:none;}
.tiles {display:grid;grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));gap:.75rem;margin-bottom:2rem;}
.tile {position:relative;aspect-ratio:1;overflow:hidden;border:3px solid var(--frame);color:var(--fg);display:flex;flex-direction:column;justify-content:flex-end;padding:.75rem;
  background:repeating-radial-gradient(circle at 70% 30%,transparent 0 10px,rgba(198,255,26,.12) 10px 11px) #141414;}
.tile img {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.7;transition:opacity .2s;}
.tile::after {content:"";position:absolute;inset:0;background:linear-gradient(transparent 55%,rgba(11,11,11,.7));}
.gen {position:absolute;top:.6rem;right:.75rem;font-size:clamp(1.8rem,7vw,2.6rem);line-height:1;color:var(--acid);}
.tile .t, .tile .m {position:relative;z-index:1;}
.tile .t {font-size:1rem;line-height:1.15;text-transform:uppercase;letter-spacing:.03em;overflow-wrap:anywhere;}
.tile .m {margin-top:.3rem;font-size:.75rem;letter-spacing:.08em;text-transform:uppercase;color:var(--acid);}
.tile:hover img {opacity:1;}
.tile:hover .t {color:var(--acid);}
.tile:hover {border-color:var(--accent);}
/* Tiles with a flyer: the whole flyer, bright, title hidden (the flyer shows it), date as a small label. */
.tile.flyer {padding:0;background:#0b0b0b;}
.tile.flyer img {object-fit:contain;opacity:1;}
.tile.flyer::after {display:none;}
.tile.flyer .t {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.tile.flyer .m {position:absolute;left:0;bottom:0;margin:0;padding:.2rem .45rem;background:var(--acid);color:var(--bg);}
.scroll {overflow-x:auto;}
table {width:100%;border-collapse:collapse;text-align:left;font-size:.9rem;}
th {font-weight:normal;white-space:nowrap;color:var(--accent);}
th a:hover {color:var(--text);}
td, th {border-bottom:1px solid var(--line);padding:.7rem .75rem .7rem 0;vertical-align:top;}
td.name {overflow-wrap:anywhere;}
td.name a {display:block;}
td.name a:hover {color:var(--accent);}
.size, .date {white-space:nowrap;text-align:right;opacity:.75;}
.date {display:none;}

.foot {display:flex;align-items:center;gap:1rem;padding:3rem var(--pad);color:var(--accent);}
.foot .mark {display:block;flex:none;}
.copy {font-size:.8rem;color:var(--text);opacity:.6;}

/* Phones and narrow screens: the clown is sized by the screen height and starts under the language bar,
   and the trailer is capped in height, so on every phone format (9:16 included) the video sits over the
   clown's body, below the face, between the clown and JUNE. */
@media (max-width:899px) {
  .clown, .clown::after {background-size:auto min(58svh,140vw);background-position:center 3.25rem;}
  .ptrailer video {width:auto;max-width:100%;max-height:30svh;}
}
@media (min-width:600px) {
  .date {display:table-cell;}
  .size, .date {text-align:left;}
  th.name {width:55%;}
}
@media (min-width:900px) {
  :root {--pad:2.5rem;}
  .ident {font-size:1.2rem;}
  /* centred vertically between the language bar and JUNE, left-aligned with both */
  .ptrailer {width:46vw;margin:auto 0;}
  .clown, .clown::after {background-position:right -4vw top 0;background-size:auto 100%;}
  .path {font-size:2.25rem;}
  .tiles {grid-template-columns:repeat(auto-fill,minmax(14rem,1fr));gap:1rem;}
  .media {grid-template-columns:repeat(auto-fill,minmax(9rem,1fr));gap:.75rem;}
  .tile {padding:1rem;}
  .tile .t {font-size:1.25rem;}
  .files:has(.others) main {padding-right:calc(var(--pad) + 11rem);}  /* events: 3 per line, clear of the column */
  .others {position:fixed;right:var(--pad);bottom:var(--pad);z-index:4;width:9.5rem;max-height:calc(100vh - 6rem);overflow-y:auto;}
  .others h2 {display:none;}
  .others .tiles {grid-template-columns:1fr;gap:.6rem;margin:0;}
  .others .tile {padding:.6rem;}
  .others .tile .t {font-size:.85rem;}
  table {width:85%;}
}
