/* Meisou (めいそう) film site. Plain CSS, no build step.
   Bone-white #EDEAE0 on near-black, as on the title cards (cards/make_cards.py). */

@font-face {
  font-family: "Kouzan Meisou";
  /* Aoyagi Kouzan Mouhitsu, subset to the display glyphs only (めいそう瞑冥迷想走終).
     Free for commercial use: assets/fonts/LICENSE_kouzan.md.
     Used only on elements with class="brush". New brush glyphs: run make_fonts.py (README). */
  src: url("../fonts/kouzan-meisou-subset.woff2") format("woff2");
  font-display: block;
}
/* Shippori Mincho (OFL, assets/fonts/OFL_ShipporiMincho.txt): Japanese body text.
   Subset to the glyphs the built pages use (make_fonts.py). */
@font-face {
  font-family: "Shippori Mincho Meisou";
  src: url("../fonts/shippori-mincho-400-meisou.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Shippori Mincho Meisou";
  src: url("../fonts/shippori-mincho-600-meisou.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("../fonts/librebaskerville-var-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("../fonts/librebaskerville-italic-var-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bone: #edeae0;
  --bone-2: #c9c5b9;
  --muted: #9b978c;
  --ink: #0b0c0d;
  --ink-2: #131517;
  --ink-3: #1c1f22;
  --rule: #2a2d30;
  --orange: #ff6a2b;          /* the blaze-orange poncho: the film's last color */
  --serif: "Libre Baskerville", Baskerville, "Baskerville Old Face", Georgia, serif;
  --jp: "Shippori Mincho Meisou", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "Source Han Serif JP", serif;
  --brush: "Kouzan Meisou", var(--jp);
  --max: 1100px;
  --text: 680px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  font-feature-settings: "kern", "onum";
}
:where(:lang(ja)) { font-family: var(--jp); }                 /* zero specificity: any class rule wins */
:where(:lang(en)) { font-family: var(--serif); }
.brush, .brush:lang(ja) { font-family: var(--brush); font-weight: normal; font-style: normal; }

/* ---------- Japanese pages: Mincho body, no italics, looser leading ---------- */
html:lang(ja) body {
  font-family: var(--jp); font-size: 16px; line-height: 1.95; letter-spacing: .04em;
  font-feature-settings: normal; line-break: strict; word-break: normal; overflow-wrap: anywhere;
}
html:lang(ja) main p, html:lang(ja) main dd { text-align: justify; text-justify: inter-character; }
html:lang(ja) em, html:lang(ja) i { font-style: normal; }
html:lang(ja) strong { font-weight: 600; }
html:lang(ja) .lead { line-height: 1.85; font-size: clamp(17px, 2vw, 21px); letter-spacing: .05em; }
html:lang(ja) .tagline { font-style: normal; letter-spacing: .14em; }
html:lang(ja) .sig { font-style: normal; text-align: right; }
html:lang(ja) h2, html:lang(ja) h3.small { letter-spacing: .2em; }
html:lang(ja) h3 { font-weight: 600; font-size: 18px; letter-spacing: .06em; }
html:lang(ja) h3.small { font-weight: 400; }
html:lang(ja) .readings .g { letter-spacing: .08em; }
html:lang(ja) .meta-line { letter-spacing: .12em; }

a { color: var(--bone); text-decoration-color: rgba(237,234,224,.4); text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--orange); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--bone); color: var(--ink); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 16px; top: 12px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ----------
   Identical box on EN and JA pages: fixed heights, line-height 1, and one font stack
   (Latin face first, Japanese face as fallback) so font metrics can't move anything. */
.bar {
  --bar-font: "Libre Baskerville", "Shippori Mincho Meisou", "Hiragino Mincho ProN", serif;
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  height: 52px; padding: 0 24px; box-sizing: border-box;
  background: rgba(11,12,13,.86);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: var(--bar-font); font-size: 12px; line-height: 1; letter-spacing: .16em; text-transform: uppercase;
}
.bar *, .bar *:lang(ja), .bar *:lang(en) { font-family: var(--bar-font); line-height: 1; }
.bar a { text-decoration: none; color: var(--bone-2); }
.bar a:hover, .bar a[aria-current="page"] { color: var(--bone); }
.bar .home { display: flex; align-items: center; gap: 10px; white-space: nowrap; height: 22px; }
.bar .home img { width: 22px; height: 22px; filter: invert(1); opacity: .85; }
.bar nav { margin-left: auto; }
.bar nav ul { display: flex; flex-wrap: nowrap; gap: 20px; list-style: none; margin: 0; padding: 0; height: 22px; align-items: center; }
.bar nav li, .bar nav a { display: block; height: 12px; white-space: nowrap; }
.bar .lang { margin: 0; white-space: nowrap; display: flex; gap: 8px; align-items: center; height: 22px; letter-spacing: .1em; }
.bar .lang > * { display: block; height: 12px; }
.bar .lang span[aria-current] { color: var(--bone); text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 4px; }
.bar .lang .sep { color: var(--muted); }
@media (max-width: 1100px) { .bar nav li.opt { display: none; } }
@media (max-width: 640px) {
  .bar { height: 84px; padding: 0 16px; flex-wrap: wrap; align-content: center; row-gap: 14px; column-gap: 12px; }
  .bar .home { order: 1; }
  .bar .lang { order: 2; margin-left: auto; }
  .bar nav { order: 3; flex-basis: 100%; margin: 0; }
  .bar nav ul { gap: 18px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: min(92vh, 900px);
  display: grid; place-items: center; text-align: center;
  padding: 80px 16px 72px;
  background:
    radial-gradient(ellipse at center, rgba(11,12,13,.15) 0%, rgba(11,12,13,.65) 70%, rgba(11,12,13,.96) 100%),
    image-set(url("../img/stills/10-fog-ridge-1920.jpg") 1x) center / cover no-repeat,
    var(--ink);
}
@media (max-width: 960px) {
  .hero { background:
    radial-gradient(ellipse at center, rgba(11,12,13,.2) 0%, rgba(11,12,13,.7) 70%, rgba(11,12,13,.96) 100%),
    url("../img/stills/10-fog-ridge-960.jpg") center / cover no-repeat, var(--ink); }
}
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 140px; background: linear-gradient(transparent, var(--ink)); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; }
@media (max-width: 640px) { .tagline, .meta-line { min-height: 3.2em; } }
/* same line boxes on EN + JA so the title never shifts when switching language */
.tagline { line-height: 1.6; }
.meta-line, .readings .g { line-height: 1.6; }
.readings .g { height: 1.6em; }
.title-jp {
  font-family: var(--brush); font-weight: normal;
  font-size: clamp(76px, 15vw, 210px); line-height: 1.1; margin: 0;
  letter-spacing: .06em; padding-left: .06em;
  text-shadow: 0 0 18px rgba(0,0,0,.75), 0 0 48px rgba(0,0,0,.5);
}
.title-en {
  display: block; margin-top: 18px;
  font-size: clamp(15px, 2.1vw, 24px); letter-spacing: .3em; padding-left: .3em; text-transform: uppercase;
  text-shadow: 0 0 12px rgba(0,0,0,.8);
}
.tagline { margin: 34px auto 0; max-width: 34em; font-style: italic; font-size: clamp(16px, 2vw, 20px); color: var(--bone); text-shadow: 0 0 12px rgba(0,0,0,.9); }
.meta-line { margin: 18px 0 0; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--bone-2); text-shadow: 0 0 10px rgba(0,0,0,.9); }
.readings { margin: 44px 0 0; display: flex; justify-content: center; gap: clamp(14px, 4vw, 40px); flex-wrap: wrap; list-style: none; padding: 0; }
.readings li { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.readings .k { font-family: var(--brush); font-size: clamp(26px, 4vw, 40px); line-height: 1.2; text-shadow: 0 0 12px rgba(0,0,0,.8); }
.readings .g { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--bone-2); }

/* ---------- sections ---------- */
main section { padding: 88px 24px; border-top: 1px solid var(--rule); scroll-margin-top: 52px; }
@media (max-width: 640px) { main section { scroll-margin-top: 84px; } }
main section:first-of-type { border-top: 0; }
@media (max-width: 600px) { main section { padding: 64px 16px; } }
.wrap { max-width: var(--max); margin: 0 auto; }
.narrow { max-width: var(--text); margin: 0 auto; }
h2 {
  font-weight: 400; font-size: 13px; letter-spacing: .3em; text-transform: uppercase;
  margin: 0 0 40px; color: var(--bone-2);
  display: flex; align-items: center; gap: 16px;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
h3 { font-weight: 400; font-size: 20px; margin: 40px 0 12px; }
h3.small { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 36px 0 10px; }
p { margin: 0 0 1.1em; }
.lead { font-size: clamp(19px, 2.3vw, 24px); line-height: 1.55; }
.bi { display: grid; gap: 28px; }
@media (min-width: 900px) { .bi.two { grid-template-columns: 1fr 1fr; gap: 56px; } }

.q { color: #d8b44a; font-style: italic; }
.longsyn { margin-top: 40px; }
.note { margin-top: 16px; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.muted.small { font-size: 14px; }
.press-top { padding-top: 72px !important; }
.brush-sm { font-family: var(--brush); text-transform: none; letter-spacing: .1em; font-size: 1.4em; }
.sig { color: var(--bone-2); font-style: italic; }

/* ---------- trailer ---------- */
.trailer {
  aspect-ratio: 16 / 9; width: 100%;
  display: grid; place-items: center; text-align: center;
  background: linear-gradient(rgba(11,12,13,.72), rgba(11,12,13,.72)), url("../img/stills/04-fog-clearing-960.jpg") center / cover;
  border: 1px solid var(--rule);
}
.trailer p { margin: 0; letter-spacing: .28em; text-transform: uppercase; font-size: 13px; color: var(--bone-2); }
.trailer .k { display: block; font-family: var(--jp); letter-spacing: .2em; margin-top: 10px; text-transform: none; }

/* ---------- gallery + lightbox ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.gallery button { all: unset; display: block; cursor: zoom-in; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink-3); }
.gallery button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease, filter .6s ease; filter: brightness(.9); }
.gallery button:hover img { transform: scale(1.025); filter: brightness(1); }

dialog.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(5,6,7,.97); color: var(--bone);
}
dialog.lightbox::backdrop { background: rgba(0,0,0,.85); }
.lb-figure { margin: 0; height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 56px 72px 20px; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.lb-figure figcaption { font-size: 14px; color: var(--bone-2); text-align: center; max-width: 60em; padding-top: 12px; }
.lb-btn { position: absolute; background: rgba(11,12,13,.6); color: var(--bone); border: 1px solid var(--rule); width: 46px; height: 46px; font-size: 20px; line-height: 1; cursor: pointer; font-family: var(--serif); }
.lb-btn:hover { border-color: var(--bone-2); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 24px; left: 20px; font-size: 12px; letter-spacing: .2em; color: var(--muted); }
@media (max-width: 600px) { .lb-figure { padding: 64px 8px 16px; } .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; } .lb-figure img { max-height: calc(100vh - 200px); } }

/* ---------- credits ---------- */
.credits { display: grid; gap: 4px 48px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .credits { grid-template-columns: 1fr 1fr; } }
.credit { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.credit .role { display: block; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.credit .name { font-size: 19px; }
.credit .jp { display: block; font-family: var(--jp); color: var(--bone-2); font-size: 14px; }
.thanks { columns: 2 220px; column-gap: 48px; list-style: none; margin: 0; padding: 0; }
.thanks li { break-inside: avoid; padding: 3px 0; }
.thanks .jp { font-family: var(--jp); color: var(--muted); font-size: 13px; margin-left: .5em; }
.company { text-align: center; margin-top: 64px; }
.company .jp { font-family: var(--jp); display: block; color: var(--bone-2); letter-spacing: .2em; }
.company .en { display: block; letter-spacing: .3em; text-transform: uppercase; font-size: 15px; margin-top: 8px; }
.company .copy { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; letter-spacing: normal; }

/* ---------- festivals ---------- */
.laurels { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 32px 0 0; list-style: none; padding: 0; }
.laurels li { aspect-ratio: 3 / 2; border: 1px dashed #3b3f43; display: grid; place-items: center; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #5d6166; text-align: center; padding: 8px; }

/* ---------- specs ---------- */
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 10px 32px; margin: 0; }
.specs dt { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.specs dd { margin: 0; }
@media (max-width: 520px) { .specs { grid-template-columns: 1fr; gap: 2px; } .specs dd { margin-bottom: 12px; } }

/* ---------- press ---------- */
.btn { display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px; border: 1px solid var(--bone); text-decoration: none; letter-spacing: .18em; text-transform: uppercase; font-size: 13px; }
.btn:hover { background: var(--bone); color: var(--ink); }
.btn small { letter-spacing: .05em; text-transform: none; color: inherit; opacity: .7; }
.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 24px 0 0; }
.downloads a { display: block; text-decoration: none; font-size: 14px; color: var(--bone-2); }
.downloads img { display: block; width: 100%; height: auto; margin-bottom: 6px; background: var(--ink-3); }
.poster-row { display: grid; gap: 32px; align-items: start; }
@media (min-width: 800px) { .poster-row { grid-template-columns: 280px 1fr; } }
.poster-row img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--rule); padding: 56px 24px 64px; text-align: center; color: var(--muted); font-size: 13px; }
footer.site .owari { font-family: var(--brush); font-size: 64px; color: var(--bone); display: block; line-height: 1; margin-bottom: 28px; }
footer.site img { width: 160px; height: auto; filter: invert(1); opacity: .8; display: block; margin: 0 auto 16px; }
footer.site p { margin: 6px 0; }
.credit .jp:lang(en), .thanks .jp:lang(en) { font-family: var(--serif); letter-spacing: normal; }
i:lang(ja-Latn), em:lang(ja-Latn) { font-family: var(--serif); font-style: italic; }
@media (max-width: 640px) { .hero { place-items: start center; padding-top: min(22vh, 190px); } }
@media (max-width: 640px) { html:lang(ja) main p, html:lang(ja) main dd { text-align: start; } }
