/* After the VACANCE pictures site: white page, near-black text, Josefin Sans. */
/* Self-hosted subsets holding only the characters on this page. After changing text, run tools/build_fonts.py. */
@font-face { font-family: "Josefin Sans"; src: url("fonts/JosefinSans-400.woff2?v=3") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Josefin Sans"; src: url("fonts/JosefinSans-700.woff2?v=3") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Noto Sans JP"; src: url("fonts/NotoSansJP-400.woff2?v=4") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Noto Sans JP"; src: url("fonts/NotoSansJP-700.woff2?v=4") format("woff2"); font-weight: 700; font-display: block; }
/* hidden until the web fonts are ready (see the script in index.html), then shown at once */
html.fonts-loading body { visibility: hidden; }

:root {
  --bg: #fff;
  --fg: #111;
  --grey: #767676; /* 4.5:1 on white, the readability minimum (was #8c8c8c, 3.4:1) */
  --rule: #111;
  --side: 24px;
  --yr: 52px;      /* year column */
  --gap: 12px;
  --indent: calc(var(--yr) + var(--gap)); /* where titles start */
  --inset: 40px;   /* even space left and right of the text sections */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Josefin Sans", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 4px; }

main { max-width: calc(880px + 2 * var(--side)); margin: 0 auto; padding: 0 var(--side); }

/* Header: only the Instagram link, top right, over the first screen. */
.top {
  display: flex;
  align-items: baseline;
  gap: 14px;
  max-width: calc(880px + 2 * var(--side));
  margin: 0 auto;
  padding: 22px var(--side) 40px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  justify-content: flex-end;
}
/* First screen: only the name, centred; the profile comes in as you scroll. */
/* Height fixed in pixels by the script in index.html (--hero-h): phone browsers grow and shrink 100vh/svh as their address
   bar hides and shows, which pushed everything below (the profile) up and down while scrolling. */
.hero { min-height: 100vh; min-height: 100svh; min-height: var(--hero-h, 100svh); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hero h1 { margin: 0; font-size: var(--hero, 28px); font-weight: 700; letter-spacing: 0.02em; }
.hero p { margin: 4px 0 0; color: var(--grey); }
.ig {
  padding: 6px 14px 4px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
}
.ig:hover { background: var(--fg); color: var(--bg); }
.top .ig { margin-left: auto; }

/* Films: the newest one is wide, the rest sit two to a row. */
.works-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px 24px;
}
.work {
  display: block;
  align-self: start; /* buttons centre their content; keep every frame on the row's top line */
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.work:first-child { grid-column: 1 / -1; }
.work .thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover; /* for the one real <img> */
  height: auto;
  background: #eee center / cover no-repeat;
  filter: grayscale(0.15);
  transition: filter 0.4s ease;
}
.work:hover .thumb, .work:focus-visible .thumb { filter: none; }
.caption {
  display: grid;
  grid-template-columns: var(--yr) 1fr;
  column-gap: var(--gap);
  margin-top: 10px;
  line-height: 1.5;
}
.caption .y { color: var(--grey); }
.caption .t { font-weight: 700; }
.caption .r { grid-column: 2; font-size: 13px; color: var(--grey); white-space: pre-line; line-break: strict; word-break: auto-phrase; }

/* Credit lists: plain tables, year first. */
.list { margin: 120px 0 0; padding: 0 var(--inset); }
.list h2 { margin: 48px 0 8px; font-size: 13px; font-weight: 700; }
.list h2:first-child { margin-top: 0; }
.list table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--rule); }
.list td { padding: 9px var(--gap) 7px 0; border-bottom: 1px solid #e3e3e3; vertical-align: top; }
.list td:first-child { width: var(--indent); color: var(--grey); }
.list td:last-child { width: 38%; color: var(--grey); padding-right: 0; }
.list small { display: block; font-size: 12px; color: var(--grey); }
.list td a { text-decoration-color: #c8c8c8; text-decoration-thickness: 1px; }
.list td a:hover { text-decoration-color: currentColor; }

/* Profile: Japanese, then English, full width above the films. */
.about { margin: 24px 0 72px; }
.about p { margin: 0; line-break: strict; }
.about .ja p { font-size: 14px; text-align: justify; text-justify: inter-character; }
.about .en p { text-align: justify; hyphens: auto; }
.about .ja, .about .en { max-width: var(--bio, 518px); } /* a whole number of 14px characters, so justified lines stay even */
/* katakana words, titles and 第N回 never break */
.about .nb, .about i { white-space: nowrap; } /* keeps 第35回 and the film titles on one line */
.about p + p { margin-top: 12px; }
.about .en { margin-top: 24px; font-size: 13px; color: var(--grey); }

/* Reveal (profile paragraphs and films): a plain, quick fade the first time each one comes on screen, as Loewe, Khaite
   and Toteme do (opacity only, 0.3-0.5s). No sliding. Only with JS (html.reveal); main.js adds .in. */
.reveal .about p, .reveal .work { opacity: 0; transition: opacity 0.5s ease-out; }
.reveal .about p.in, .reveal .work.in { opacity: 1; }
/* The profile alone also drifts 8px from the left as it fades, as Mimo asked (横方向にふんわり). */
.reveal .about p { transform: translateX(-8px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.reveal .about p.in { transform: none; }

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin: 48px var(--inset) 0; /* same gap as between Film and Fashion, so it reads as part of the page */
  padding: 24px 0 48px;
  border-top: 1px solid var(--rule);
}
.contact a:not(.ig):hover { color: var(--grey); }
.contact .mail { margin: 0; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--side);
  background: #fff;
}
.lightbox[hidden] { display: none; }
.lightbox-frame { width: 100%; max-width: 1100px; aspect-ratio: 16 / 9; }
.lightbox-frame iframe { width: 100%; height: 100%; border: 0; }
.lightbox-close {
  position: absolute;
  top: 16px;
  right: var(--side);
  padding: 8px 0;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

p, td, .caption, h1 { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  :root { --side: 16px; --yr: 44px; --gap: 10px; --inset: 0px; }
  body { font-size: 14px; }
  .top { flex-wrap: wrap; column-gap: 10px; row-gap: 0; padding-bottom: 28px; }
  .works-grid { grid-template-columns: 1fr; gap: 36px; }
  .list { margin-top: 72px; }
  .about { margin: 20px 0 48px; }
  .about .en { margin-top: 20px; }
  .about .ja p, .about .en p { text-align: left; hyphens: none; } /* a phone line is too short to justify without spreading the characters */
  .list td:last-child, .list td:first-child { width: auto; }
  .list tr { display: grid; grid-template-columns: var(--yr) 1fr; column-gap: var(--gap); padding: 9px 0 7px; border-bottom: 1px solid #e3e3e3; }
  .list td { padding: 0; border: 0; }
  .list td:last-child { grid-column: 2; font-size: 13px; }
}
