:root {
  --paper: #ffffff;
  --ink: #111111;
  --muted: #8a8a8a;
  --rule: #e2e2e2;
  --empty: #ececec;
  --pill: rgba(255, 255, 255, 0.85);       /* the pills and Sound on buttons */
  --pill-hover: #ffffff;
  --pill-edge: rgba(17, 17, 17, 0.08);
  --edge: clamp(16px, 3vw, 40px);
  --gap: clamp(12px, 1.6vw, 24px);
}
/* dark mode: switched on once you scroll down the page (the script at the end of index.html),
   and off again back at the top; everything fades between the two */
html.dark {
  --paper: #0b0b0b;
  --ink: #f4f4f0;
  --muted: #8c8c86;
  --rule: #2a2a28;
  --empty: #1c1c1b;
  --pill: rgba(34, 34, 33, 0.85);
  --pill-hover: #2e2e2c;
  --pill-edge: rgba(255, 255, 255, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--paper); transition: background 0.6s ease; }
body, .top, .pill, .sound, .play, .logo-mark, .head, .services, .services li, .foot, figure {
  transition: background 0.6s ease, color 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
  padding: 0 var(--edge);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 500; font-size: inherit; }
.muted { color: var(--muted); }
.num { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 0.8em; }

/* top bar: a white band across the whole width, pinned while scrolling, holding the logo and
   the nav pills (styled like the Sound on buttons); the work scrolls underneath it */
.top {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--gap); /* logo in the middle */
  margin: 0 calc(-1 * var(--edge)); /* edge to edge, past the page's side margins */
  padding: 16px var(--edge);
  background: var(--paper);
}
.top-line { grid-column: 1; grid-row: 1; font-size: 13px; }
.work-line { display: none; } /* on computers the line is in the top band instead */
.head:has(.work-line) { justify-content: flex-end; }
.top .brand { grid-column: 2; grid-row: 1; }
.top nav { grid-column: 3; grid-row: 1; justify-self: end; display: flex; gap: 6px; }
.pill {
  display: inline-block;
  font-size: 13px; color: var(--ink);
  background: var(--pill); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px var(--pill-edge); /* a faint edge so the pill shows on the page colour too */
  border-radius: 999px; padding: 7px 14px;
}
.pill:hover { background: var(--pill-hover); }
/* EN / JP: two small pills after the menu; the language on show is outlined, like List / Grid */
.lang-switch { display: flex; gap: 4px; margin-left: 10px; }
.lang-switch .pill { font: inherit; font-size: 13px; border: 0; cursor: pointer; color: var(--muted); }
.lang-switch .pill[aria-pressed="true"] { color: var(--ink); background: var(--pill-hover); box-shadow: 0 0 0 1px var(--ink); }
/* Japanese type: the Mac's and Windows' own Japanese fonts, after the Latin ones */
html[lang="ja"] body { font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif; line-break: strict; }
html[lang="ja"] .services h3, html[lang="ja"] .mail { letter-spacing: 0; }

/* the logo: plain, not a pill */
.brand { display: flex; align-items: center; gap: 1em; font-size: 13px; }
.logo { font-weight: 600; align-self: center; }
.logo-mark { display: block; height: 22px; width: auto; color: var(--ink); } /* the logo */


/* the grey stand-in for a picture that hasn't been added yet */
figure.empty img, figure.empty video { visibility: hidden; }
figure.empty::after {
  content: attr(data-label); position: absolute; inset: 0;
  display: grid; place-items: center; color: var(--muted); font-size: 13px;
}
figure { position: relative; background: var(--empty); overflow: hidden; }
figure img, figure video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* a film's controls, top right: play / pause (a small round button) and Sound on / off */
.film-controls { position: absolute; right: 16px; top: 16px; display: flex; gap: 6px; }
.sound, .play {
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--pill); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.sound:hover, .play:hover { background: var(--pill-hover); }
.play { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; }
.play svg { width: 10px; height: 10px; fill: currentColor; }
.play .icon-play { margin-left: 2px; } /* the triangle looks centred when nudged right */
.restart svg { width: 12px; height: 12px; } /* the circular arrow reads better a touch larger */
.play[aria-pressed="true"] .icon-pause, .play[aria-pressed="false"] .icon-play { display: none; }

/* sections share the ruled heading */
.section { padding-top: clamp(80px, 14vh, 160px); }
main > .section:first-child { padding-top: clamp(40px, 8vh, 80px); }
@media (min-width: 701px) { main > .section:first-child { padding-top: clamp(80px, 16vh, 160px); } } /* twice the space under the logo on computers */
main > .section:first-child .head { border-top: 0; padding-top: 0; }
.head { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--rule); margin-bottom: clamp(28px, 4vw, 48px); }

/* work: landscapes full width, portraits in pairs with the second set lower */
.work { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); row-gap: clamp(48px, 9vh, 110px); }
.project { grid-column: 1 / 6; }
.project.low { grid-column: 8 / 13; margin-top: clamp(80px, 16vh, 200px); }
.project.wide { grid-column: 1 / -1; }
.project figure { aspect-ratio: 16 / 9; margin-bottom: 12px; }
.project figure.tall { aspect-ratio: 4 / 5; }
.project img { transition: transform 0.6s ease; }
.project:hover img { transform: scale(1.02); }

/* the List / Grid switch beside the project count */
.head-side { display: flex; align-items: center; gap: 14px; }
.view-switch { display: flex; gap: 4px; }
.view-switch .pill { font: inherit; font-size: 13px; border: 0; cursor: pointer; color: var(--muted); }
.view-switch .pill[aria-pressed="true"] { color: var(--ink); background: var(--pill-hover); box-shadow: 0 0 0 1px var(--ink); }
.head { align-items: center; flex-wrap: wrap; gap: 10px; } /* on phones the switch drops under the heading */

/* grid view: every project the same size, three across (two on tablets, one on phones) */
.work.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: clamp(32px, 5vh, 56px); }
.work.grid .project, .work.grid .project.low, .work.grid .project.wide { grid-column: auto; margin-top: 0; }
.work.grid .project figure, .work.grid .project figure.tall { aspect-ratio: 16 / 9; }
.work.grid .film-controls { right: 10px; top: 10px; gap: 4px; }
.work.grid .sound { padding: 5px 11px; font-size: 12px; }
.work.grid .play { width: 28px; height: 28px; }
@media (max-width: 1000px) { .work.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .work.grid { grid-template-columns: minmax(0, 1fr); } }

/* the statement: large, regular weight, tightly set across the full width, the first line
   starting a quarter of the way in */
.statement {
  font-size: clamp(22px, 3vw, 50px); font-weight: 400; line-height: 1.16; letter-spacing: -0.025em;
  text-indent: 25%;
  margin: 0 0 clamp(56px, 8vw, 120px);
}
html[lang="ja"] .statement { font-size: clamp(18px, 2.4vw, 40px); line-height: 1.4; letter-spacing: 0; }
@media (max-width: 700px) { .statement { text-indent: 15%; } }
/* captures: a slideshow of day-to-day pictures, all the same height, sliding sideways */
.captures-track {
  display: flex; gap: var(--gap);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 calc(-1 * var(--edge)); padding: 0 var(--edge); scroll-padding: 0 var(--edge);
  outline: none;
}
.captures-track::-webkit-scrollbar { display: none; }
.capture { flex: none; height: clamp(260px, 62vh, 640px); scroll-snap-align: start; }
.capture img { width: auto; height: 100%; }
.capture.empty { aspect-ratio: 4 / 5; } /* the grey stand-in, until the picture is added */
.view-switch .capture-prev, .view-switch .capture-next { color: var(--ink); }
@media (max-width: 700px) { .capture { height: 56vh; } }

/* services as a ruled list */
.services { list-style: none; border-top: 1px solid var(--rule); }
.services li { display: grid; grid-template-columns: 1fr 2fr 3fr; gap: var(--gap); padding: 18px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.services h3 { font-size: clamp(20px, 2vw, 30px); letter-spacing: -0.02em; line-height: 1.1; }

.big { font-size: clamp(24px, 3vw, 46px); font-weight: 500; line-height: 1.12; letter-spacing: -0.025em; max-width: 24em; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-top: 48px; }

.mail { display: inline-block; font-size: clamp(20px, 2vw, 30px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; } /* the same size as the capability names */
.mail:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.links { display: flex; gap: 2em; margin-top: 24px; }

.foot { display: flex; justify-content: space-between; margin-top: clamp(80px, 14vh, 160px); padding: 14px 0 24px; border-top: 1px solid var(--rule); } /* every line on the page is the same fine rule */

/* phones: everything in one column */
@media (max-width: 700px) {
  .logo-mark { height: 13px; } /* smaller on phones, so the logo and the menu share one line */
  .top { grid-template-columns: 1fr; justify-items: center; gap: 12px; } /* phones: the logo centred, the menu under it */
  .top .brand, .top nav { grid-column: 1; justify-self: center; grid-row: auto; }
  .top-line { display: none; }
  .work-line { display: block; }
  .head:has(.work-line) { justify-content: space-between; }
  .top nav { gap: 4px; flex-wrap: wrap; justify-content: center; } /* the menu and EN / JP wrap onto two lines if they need to */
  .pill { padding: 7px 10px; }
  .lang-switch { margin-left: 4px; }
  .film-controls, .work.grid .film-controls { right: 8px; top: 8px; gap: 4px; } /* smaller film controls on phones */
  .sound, .work.grid .sound { padding: 4px 9px; font-size: 11px; }
  .play, .work.grid .play { width: 24px; height: 24px; }
  .play svg { width: 8px; height: 8px; }
  .restart svg { width: 10px; height: 10px; }
  .work { grid-template-columns: 1fr; row-gap: 40px; }
  .project, .project.low, .project.wide { grid-column: 1; margin-top: 0; }
  .services li { grid-template-columns: auto 1fr; }
  .services li p { grid-column: 2; }
  .facts { grid-template-columns: 1fr 1fr; }
}
