/* ==========================================================================
   TAKANORI NISHIMURA | Bottega Ruan
   Prototype stylesheet (static HTML, ready to be fed by headless WordPress)

   Design base : 1920px wide comp (TAKANORI NOSHIMURA.pdf)
   Unit        : 1u = 1px at 1920px  ->  calc(N * var(--u))
   Grid        : 12 columns / gutter 39u / outer margin 117u
   Vertical    : spacing values are measured ink to ink in the comp
                 (cap height to baseline). Text boxes are trimmed with
                 .cap so that margins can use those values directly.
   ========================================================================== */


/* 1. Tokens
   ========================================================================== */

:root {
  --u: calc(100vw / 1920);

  /* color */
  --c-bg: #f5f5f5;
  --c-ink: #000;
  --c-btn: #1e1e1e;
  --c-mute: #8a8a8a;
  --c-line: rgba(0, 0, 0, .14);
  --c-media: #000;
  --c-error: #b3261e;
  --c-grid: rgba(255, 32, 80, .07);
  --c-grid-line: rgba(255, 32, 80, .32);
  --c-grid-ink: #e0103c;

  /* grid */
  --cols: 12;
  --margin: calc(117 * var(--u));
  --gutter: calc(39 * var(--u));

  /* type */
  --ff: "Inter", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Helvetica Neue", Arial, sans-serif;
  --fs-display: max(48px, calc(200 * var(--u)));
  --fs-menu: max(31px, calc(89.6 * var(--u)));   /* menu labels: 70% of the former 128u */
  --fs-heading: max(18px, calc(25 * var(--u)));
  --fs-body: max(15px, calc(20 * var(--u)));
  --fs-nav: max(13px, calc(20 * var(--u)));
  --fs-button: max(15px, calc(23 * var(--u)));
  --fs-small: max(13px, calc(16 * var(--u)));
  --fs-foot: max(11px, calc(15 * var(--u)));
  --fs-xs: max(10px, calc(13 * var(--u)));

  /* space (ink to ink at 1920px) */
  --s-16: max(10px, calc(16 * var(--u)));
  --s-20: max(12px, calc(20 * var(--u)));
  --s-30: max(18px, calc(30 * var(--u)));
  --s-60: max(32px, calc(60 * var(--u)));
  --s-100: max(40px, calc(100 * var(--u)));
  --s-120: max(48px, calc(120 * var(--u)));
  --s-160: max(64px, calc(160 * var(--u)));
  --s-180: max(72px, calc(180 * var(--u)));
  --s-185: max(72px, calc(185 * var(--u)));
  --s-200: max(72px, calc(200 * var(--u)));
  --s-250: max(96px, calc(250 * var(--u)));
  --s-350: max(112px, calc(350 * var(--u)));
  --s-420: max(140px, calc(420 * var(--u)));

  --header-top: max(22px, calc(67 * var(--u)));
  --menu-gap: max(32px, calc(60 * var(--u)));    /* baseline to cap height between menu labels */
  --page-top: max(112px, calc(264 * var(--u)));

  /* motion */
  --ease: cubic-bezier(.19, 1, .22, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-reveal: cubic-bezier(.25, .1, .25, 1);
  --reveal-time: 1s;
  --reveal-blur: min(.45em, 24px);   /* resolved per element: 9px for body text */
}

@media (max-width: 1023px) {
  :root {
    --margin: 40px;
    --gutter: 20px;
  }
}

@media (max-width: 767px) {
  :root {
    --margin: 20px;
    --gutter: 12px;
    --fs-display: max(48px, 13.5vw);
    --fs-menu: 8.4vw;
  }
}


/* 2. Base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--ff);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-optical-sizing: none;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, p, ol, ul, dl, dd, figure, fieldset, legend {
  margin: 0;
  padding: 0;
}

fieldset { border: 0; min-width: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img, video { display: block; max-width: 100%; height: auto; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

::selection {
  background: var(--c-ink);
  color: var(--c-bg);
}

[lang="ja"] {
  line-break: strict;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: var(--c-ink);
  color: var(--c-bg);
  font-size: 14px;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }


/* 3. Typography
   ========================================================================== */

/* Trim the line box to cap height (top) and baseline (bottom).
   Inter: ascent .96875 / descent .24121 / cap height .72754
   -> trim = (0.3638 - line-height / 2) em on both sides. */
.cap::before,
.cap::after {
  content: "";
  display: table;
}
.cap::before { margin-bottom: calc((0.3638 - var(--lh, 1.5) / 2) * 1em); }
.cap::after  { margin-top:    calc((0.3638 - var(--lh, 1.5) / 2) * 1em); }

.t-display {
  --lh: 1;
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: var(--lh);
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.t-heading {
  --lh: 1.2;
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: var(--lh);
}

/* Section heading inside long texts: body size, bold */
.t-subheading {
  --lh: 1.5;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: var(--lh);
}

/* Links inside running text stay underlined */
.text-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: opacity .3s;
}

.text-link:hover { opacity: .6; }

/* A value still to be filled in (draft only) */
.todo {
  padding: 0 .15em;
  background: #fff0a6;
}

.t-body {
  --lh: 1.5;
  font-size: var(--fs-body);
  line-height: var(--lh);
}

.t-label {
  --lh: 1.2;
  font-size: var(--fs-xs);
  line-height: var(--lh);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Paragraph spacing: one blank line, as in the comp */
.prose p + p { margin-top: calc(var(--lh, 1.5) * 1em); }
.prose--tight p + p { margin-top: .85em; }
.prose p { text-wrap: pretty; }

/* Heading followed by text: 30u from baseline to cap height */
.heading-gap { margin-bottom: var(--s-30); }

.link-arrow {
  display: inline-flex;
  align-items: baseline;
  gap: .35em;
}
.link-arrow::after {
  content: "\2192";
  font-weight: 400;
  opacity: 0;
  transform: translateX(-.4em);
  transition: opacity .4s var(--ease), transform .7s var(--ease);
}
.link-arrow:hover::after,
.link-arrow:focus-visible::after {
  opacity: 1;
  transform: none;
}


/* 4. Grid
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
}

.container { padding-inline: var(--margin); }
.col-full { grid-column: 1 / -1; }


/* 5. Media (placeholders are plain black boxes)
   ========================================================================== */

.media {
  position: relative;
  overflow: hidden;
  background: var(--c-media);
  aspect-ratio: var(--ar, 1685 / 895);
}

.media > img,
.media > picture > img,
.media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Art direction: reproduce a designed crop. The image keeps its own
   proportions; --crop-w sets its width relative to the box and
   --crop-x / --crop-y move its top-left corner (percent of the box). */
.media > img.media__img--crop {
  inset: auto;
  left: var(--crop-x, 0%);
  top: var(--crop-y, 0%);
  width: var(--crop-w, 100%);
  max-width: none;
  height: auto;
  object-fit: fill;
}

.media--hero { --ar: 1685 / 895; }
.media--land { --ar: 392 / 278; }
.media--tall { --ar: 392 / 630; }

.media__hover {
  position: absolute;
  left: var(--s-16);
  right: var(--s-16);
  bottom: var(--s-16);
  color: #fff;
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .5s var(--ease), transform .7s var(--ease);
}

a:hover .media__hover,
a:focus-visible .media__hover {
  opacity: 1;
  transform: none;
}


/* 6. Header, side labels, footer
   ========================================================================== */

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--header-top) var(--margin) 0;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}

.site-header > * { pointer-events: auto; }

.site-header__name {
  --lh: 1;
  font-size: var(--fs-nav);
  line-height: var(--lh);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.menu-toggle {
  --bar-w: max(16px, calc(18 * var(--u)));
  --bar-h: max(1.5px, calc(2 * var(--u)));
  --bar-gap: max(4px, calc(5 * var(--u)));
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -16px calc((44px - var(--bar-w)) / -2) -16px 0;
}

.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  position: absolute;
  width: var(--bar-w);
  height: var(--bar-h);
  background: currentColor;
  transition: transform .6s var(--ease), background-color .2s;
}

.menu-toggle__bars {
  top: 50%;
  left: 50%;
  margin: calc(var(--bar-h) / -2) 0 0 calc(var(--bar-w) / -2);
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  left: 0;
}

.menu-toggle__bars::before { transform: translateY(calc(-1 * var(--bar-gap))); }
.menu-toggle__bars::after  { transform: translateY(var(--bar-gap)); }

.is-menu-open .menu-toggle__bars { background-color: transparent; }
.is-menu-open .menu-toggle__bars::before { transform: rotate(45deg); }
.is-menu-open .menu-toggle__bars::after  { transform: rotate(-45deg); }

/* Vertical labels sit in the outer margins, centred on the hero image,
   and scroll away with it (as in the comp). Their centre is 0.36 of the
   margin away from the image edge: x = 75 / 1845 at 1920px. */
.side-label {
  position: absolute;
  top: 50%;
  font-size: var(--fs-xs);
  line-height: 1;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.side-label--left {
  left: calc(var(--margin) * -.36);
  transform: translate(-50%, -50%) rotate(-90deg);
}

.side-label--right {
  left: calc(100% + var(--margin) * .36);
  transform: translate(-50%, -50%) rotate(90deg);
}

/* The copyright sits as far from the bottom edge as the header name sits
   from the top edge (67u), so the page is framed evenly. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 2.5em;
  row-gap: 1em;
  padding: var(--s-180) var(--margin) var(--header-top);
  font-size: var(--fs-foot);
  text-align: center;
}

.site-footer__copy {
  --lh: 1;
  font-size: var(--fs-foot);
  font-weight: 400;
  line-height: var(--lh);
}

.site-footer__link {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  transition: text-decoration-color .3s;
}

.site-footer__link:hover,
.site-footer__link:focus-visible { text-decoration-color: currentColor; }

.page-main { padding-bottom: var(--s-250); }


/* 7. Menu overlay
   ========================================================================== */

.is-menu-open { overflow: hidden; }

.site-menu {
  position: fixed;
  z-index: 40;
  inset: 0;
  overflow-y: auto;
  background: var(--c-bg);
  visibility: hidden;
  opacity: 0;
  transition: opacity .5s var(--ease), visibility 0s linear .5s;
}

.is-menu-open .site-menu {
  visibility: visible;
  opacity: 1;
  transition: opacity .5s var(--ease), visibility 0s;
}

.site-menu__inner {
  min-height: 100%;
  padding-top: var(--page-top);
  padding-bottom: var(--header-top);
  grid-template-rows: 1fr auto;
  row-gap: var(--s-120);
}

.site-menu__nav {
  grid-column: 1 / span 9;
  grid-row: 1;
  display: grid;
  grid-template-columns: subgrid;
  align-content: start;
}

.site-menu__list,
.site-menu__item,
.site-menu__link {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
}

.site-menu__list { row-gap: var(--menu-gap); }

/* Menu labels arrive like page text: blur clears while opacity rises */
.site-menu__link {
  align-items: start;
  opacity: 0;
  filter: blur(12px);
  transition: opacity .3s var(--ease), filter .3s var(--ease);
}

.is-menu-open .site-menu__link {
  opacity: 1;
  filter: none;
  transition:
    opacity var(--reveal-time) var(--ease-reveal) calc(var(--i, 0) * 160ms + 120ms),
    filter var(--reveal-time) var(--ease-reveal) calc(var(--i, 0) * 160ms + 120ms);
}

.site-menu__no {
  --lh: 1.2;
  grid-column: 1;
  font-size: var(--fs-xs);
  line-height: var(--lh);
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.site-menu__no::after {
  content: "";
  display: inline-block;
  width: .5em;
  height: .5em;
  margin-left: .6em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: .1em;
  opacity: 0;
}

.site-menu__link[aria-current] .site-menu__no::after { opacity: 1; }

.site-menu__label {
  --lh: 1;
  grid-column: 2 / -1;
  font-size: var(--fs-menu);
  font-weight: 700;
  line-height: var(--lh);
  transition: opacity .4s var(--ease);
}

/* Dim the other items while one is hovered, or while one has keyboard focus */
.site-menu__list:hover .site-menu__link:not(:hover) .site-menu__label,
.site-menu__list:has(.site-menu__link:focus-visible) .site-menu__link:not(:focus-visible):not(:hover) .site-menu__label {
  opacity: .18;
}

.site-menu__list:hover .site-menu__link:hover .site-menu__label { opacity: 1; }

/* The preview box runs from the first label's cap height to the last
   label's baseline: 4 trimmed labels (cap height .7275em) + 3 gaps. */
.site-menu__preview {
  aspect-ratio: auto;
  height: calc(var(--fs-menu) * .7275 * 4 + var(--menu-gap) * 3);
  grid-column: 10 / span 3;
  grid-row: 1;
  align-self: start;
}

/* One photo per menu item, cropped to the box (about 0.89 : 1). The photo
   of the hovered or focused item fades in over the others. */
.site-menu__img {
  opacity: 0;
  transition: opacity .6s var(--ease);
}

.site-menu__img.is-active { opacity: 1; }

.site-menu__meta {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: var(--s-16);
}

.site-menu__meta > * { grid-column: span 3; }


/* 8. Page head and hero (shared by inner pages)
   ========================================================================== */

.page-head { padding-top: var(--page-top); }
.page-head__title { grid-column: 1 / -1; }

.page-hero { margin-top: var(--s-120); }

/* Pages without a hero (Artworks, Contact): the first section takes the
   hero's place, 120u below the title's baseline. */
.page-head + .works,
.page-head + .contact,
.page-head + .policy { margin-top: var(--s-120); }

/* Hero image with its two side labels */
.hero {
  position: relative;
  grid-column: 1 / -1;
}


/* 9. Home
   ========================================================================== */

.home-hero { padding-top: var(--s-250); }

.brand {
  margin-top: var(--s-250);
  padding-inline: var(--margin);
  text-align: center;
}

/* The exhibition poster under the brand name is the landscape version.
   It spans all 12 columns (1686 x 948px at 1920px) and keeps its own
   proportions, 120u below the brand's baseline and 250u above WHO I AM.
   On phones held upright (767px wide or less, portrait orientation) the
   portrait version takes its place (picture/source in index.html), and
   the box takes the portrait proportions there. Phones held sideways keep
   the landscape version, which fits their short screens. */
.home-poster { margin-top: var(--s-120); }

.home-poster__item { grid-column: 1 / -1; }

.home-poster__media { --ar: 3372 / 1897; }

.home-about { margin-top: var(--s-160); }
.home-poster + .home-about { margin-top: var(--s-250); }

/* WHO I AM: the text runs to the right edge of the second work photo
   below (columns 1 to 6, 824px at 1920px). */
.home-about .home-block { grid-column: 1 / span 6; }

/* The comp sets these short texts on a narrower measure than 3 columns */
.home-block .prose { max-width: 18em; }
.home-about .prose { max-width: none; }

.home-works {
  margin-top: var(--s-120);
  align-items: start;
}

.home-works__item { display: block; }
.home-works__item--1 { grid-column: 1 / span 3; grid-row: 1; }
.home-works__item--2 { grid-column: 4 / span 3; grid-row: 1; }
.home-works__item--3 { grid-column: 7 / span 3; grid-row: 1; }

/* Column 4 stacks the fourth work and the ARTWORKS text, so the text
   always starts below the photo whatever its height is. */
.home-works__col4 {
  grid-column: 10 / span 3;
  grid-row: 1;
}

.home-works__col4 .home-block { margin-top: var(--s-250); }

.home-works__item .media { transition: opacity .6s var(--ease); }
.home-works__item:hover .media { opacity: .9; }

.home-what { margin-top: var(--s-420); }
.home-what__title { grid-column: 1 / -1; }
.home-what__col--a { grid-column: 1 / span 6; }
.home-what__col--b { grid-column: 7 / span 6; }


/* 10. About
   ========================================================================== */

.bio,
.history {
  margin-top: var(--s-250);
  align-items: start;
}

.bio__col--ja,
.history__col--a { grid-column: 1 / span 5; }

.bio__col--en,
.history__col--b { grid-column: 8 / span 5; }

.history__title { grid-column: 1 / -1; }


/* 11. Artworks index
   ========================================================================== */

.works {
  margin-top: var(--s-250);
  row-gap: var(--s-200);
  align-items: start;
}

.work-card { grid-column: span 3; }
.work-card__link { display: block; }

/* The thumbnail keeps the featured image's own proportions: the template
   sets --ar from the image's width and height. The value below is only a
   fallback for records without a featured image. Each row hangs from a
   common top line (align-items: start on .works). */
.work-card .media { --ar: 392 / 278; }

.work-card .media { transition: opacity .6s var(--ease); }
.work-card__link:hover .media { opacity: .9; }

.work-card__caption {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-16);
  margin-top: var(--s-20);
}

.work-card__title {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: text-decoration-color .3s;
}

.work-card__link:hover .work-card__title,
.work-card__link:focus-visible .work-card__title { text-decoration-color: currentColor; }

.work-card__no {
  --lh: 1;
  flex: none;
  line-height: var(--lh);
  color: var(--c-mute);
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}

.load-more {
  margin-top: var(--s-350);
  display: flex;
  justify-content: center;
  padding-inline: var(--margin);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max(200px, calc(350 * var(--u)));
  height: max(56px, calc(98 * var(--u)));
  padding: 0 1.5em;
  background: var(--c-btn);
  color: #fff;
  font-size: var(--fs-button);
  font-weight: 500;
  line-height: 1;
  transition: background-color .3s, opacity .3s;
}

.btn:hover { background: #000; }
.btn:focus-visible { outline-color: var(--c-ink); }
.btn[disabled] { opacity: .55; cursor: progress; }

.notice {
  padding: var(--s-60) var(--margin) 0;
  color: var(--c-mute);
  font-size: var(--fs-small);
}


/* 12. Single artwork
   ==========================================================================
   One image per work, laid out as in TAKANORI NOSHIMURA1.pdf. From 1024px
   up the page sits on its own 5-column grid, measured from that PDF:
   margin 117u, column 190u, gutter 184u (.grid--5).
   - portrait image : image in columns 1-3, text in columns 4-5; the text
                      box ends at the image's bottom edge
   - landscape image: image across all 5 columns, 作品 in columns 1-2 and
                      ART in columns 3-4, 185u below the image
   The image is never cropped: the grid sets its width and the photo's own
   proportions set its height. Below 1024px the 12-column grid takes over
   and the text moves under the image.
   ========================================================================== */

.work {
  margin-top: var(--s-120);
  align-items: start;
}

.work__media { grid-column: 1 / -1; }

/* Placeholder proportions, used only while a work has no image */
.work--portrait .media { --ar: 3 / 4; }
.work--landscape .media { --ar: 3 / 2; }

.work__text { grid-column: 1 / -1; }
.work__en { margin-top: var(--s-120); }

@media (min-width: 1024px) {
  .grid--5 {
    --cols: 5;
    --gutter: calc(184 * var(--u));
  }

  .work--portrait .work__media { grid-column: 1 / span 3; }

  .work--portrait .work__text {
    grid-column: 4 / span 2;
    align-self: end;
  }

  /* The PDF aligns the text box, not the last baseline, with the image's
     bottom edge, so the space under the last line stays. */
  .work--portrait .work__en .prose::after { margin-top: 0; }

  .work--landscape .work__text {
    grid-column: 1 / span 4;
    display: grid;
    grid-template-columns: subgrid;
    margin-top: var(--s-185);   /* image bottom to the headings' cap height */
  }

  .work--landscape .work__ja { grid-column: 1 / span 2; }

  .work--landscape .work__en {
    grid-column: 3 / span 2;
    margin-top: 0;
  }

  .pager.grid--5 .pager__link--prev { grid-column: 1 / span 2; }
  .pager.grid--5 .pager__link--index { grid-column: 3; }
  .pager.grid--5 .pager__link--next { grid-column: 4 / span 2; }
}

.pager {
  margin-top: var(--s-250);
  align-items: end;
}

.pager__link { display: block; }
.pager__link--prev { grid-column: 1 / span 4; }
.pager__link--index { grid-column: 5 / span 4; text-align: center; }
.pager__link--next { grid-column: 9 / span 4; text-align: right; }

.pager__label {
  display: block;
  margin-bottom: var(--s-16);
  color: var(--c-mute);
}

.pager__title {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: text-decoration-color .3s;
}

.pager__link:hover .pager__title,
.pager__link:focus-visible .pager__title { text-decoration-color: currentColor; }


/* 13. Contact
   ========================================================================== */

.contact {
  margin-top: var(--s-250);
  align-items: start;
}

.contact__intro { grid-column: 1 / span 5; }
.contact__intro-en { margin-top: var(--s-120); }

.contact__meta {
  margin-top: var(--s-120);
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--s-60);
  row-gap: var(--s-16);
  align-items: baseline;
}

.contact__meta dt { color: var(--c-mute); }

.contact__form { grid-column: 7 / span 6; }

.field + .field { margin-top: var(--s-60); }

.field__label {
  display: flex;
  align-items: baseline;
  gap: .9em;
  width: 100%;
  margin-bottom: var(--s-16);
  font-size: var(--fs-xs);
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
}

legend.field__label { float: left; }
legend.field__label + * { clear: both; }

.field__ja {
  letter-spacing: .02em;
  text-transform: none;
}

.field__req {
  margin-left: auto;
  color: var(--c-mute);
  letter-spacing: .02em;
}

.field__control {
  display: block;
  width: 100%;
  padding: .45em 0 .55em;
  border: 0;
  border-bottom: 1px solid var(--c-ink);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--fs-body);
  line-height: 1.5;
  appearance: none;
  transition: box-shadow .3s var(--ease);
}

.field__control:focus {
  outline: none;
  box-shadow: inset 0 -1px 0 var(--c-ink);
}

textarea.field__control {
  min-height: calc(1.5em * 7);
  resize: vertical;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-16) var(--gutter);
  padding-top: .3em;
}

.choice,
.consent,
.wpcf7-list-item > label {
  display: flex;
  align-items: center;
  gap: .7em;
  cursor: pointer;
}

.choice input,
.consent input,
.wpcf7-list-item input[type="radio"],
.wpcf7-list-item input[type="checkbox"] {
  flex: none;
  width: .72em;
  height: .72em;
  margin: 0;
  border: 1px solid var(--c-ink);
  border-radius: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

.choice input:checked,
.consent input:checked,
.wpcf7-list-item input:checked { background: var(--c-ink); }

.choice__en {
  margin-left: .35em;
  color: var(--c-mute);
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.choice input:focus-visible,
.consent input:focus-visible,
.wpcf7-list-item input:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
}

.consent__note {
  margin-bottom: var(--s-16);
  color: var(--c-mute);
  font-size: var(--fs-small);
  line-height: 1.6;
}

.field__error {
  margin-top: .7em;
  color: var(--c-error);
  font-size: var(--fs-xs);
  letter-spacing: .02em;
}

.is-invalid .field__control { border-bottom-color: var(--c-error); }
.is-invalid .choice input,
.is-invalid .consent input { border-color: var(--c-error); }

.form-actions { margin-top: var(--s-120); }

.form-status {
  margin-top: var(--s-30);
  font-size: var(--fs-small);
}

.form-done__note {
  margin-top: var(--s-30);
  color: var(--c-mute);
  font-size: var(--fs-small);
}


/* 13a. Contact Form 7
   ==========================================================================
   In the WordPress theme the contact form is rendered by Contact Form 7
   (6.2). Its form template (wordpress/contact-form-7/1_form.txt) reuses
   the classes above: .field, .field__label, .field__control, .choices,
   .consent__note, .form-actions, .btn. The rules below cover the markup the
   plugin adds around them. The plugin's own stylesheet is switched off
   (wpcf7_load_css), so the few rules it provided are restated here.
   ========================================================================== */

/* Status text for screen readers only (the plugin's own rule) */
.wpcf7 .screen-reader-response {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  border: 0;
  word-wrap: normal;
}

.wpcf7 .hidden-fields-container { display: none; }

.wpcf7-form-control-wrap {
  position: relative;
  display: block;
}

/* English sub-labels of the subject options, as in the prototype. The
   option values stay Japanese, so the mail reads naturally; if an option
   is renamed in the form template, rename it here too. */
.wpcf7-radio .wpcf7-list-item-label::after {
  margin-left: .8em;   /* the prototype's word space plus .choice__en's .35em */
  color: var(--c-mute);
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.wpcf7-radio input[value="作品のご購入"] + .wpcf7-list-item-label::after { content: "Purchase"; }
.wpcf7-radio input[value="展示のご依頼"] + .wpcf7-list-item-label::after { content: "Exhibition"; }
.wpcf7-radio input[value="制作のご依頼"] + .wpcf7-list-item-label::after { content: "Commission"; }
.wpcf7-radio input[value="取材のお申し込み"] + .wpcf7-list-item-label::after { content: "Press"; }
.wpcf7-radio input[value="その他"] + .wpcf7-list-item-label::after { content: "Other"; }

/* Errors: same look as .field__error and .is-invalid */
.wpcf7-not-valid-tip {
  display: block;
  margin-top: .7em;
  color: var(--c-error);
  font-size: var(--fs-xs);
  letter-spacing: .02em;
}

.field__control.wpcf7-not-valid { border-bottom-color: var(--c-error); }

.wpcf7-not-valid .wpcf7-list-item input { border-color: var(--c-error); }

/* The submit button is an <input>, so it needs the font reset a <button> gets */
.wpcf7-submit.btn {
  border: 0;
  border-radius: 0;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
}

.wpcf7-submit.btn:disabled { opacity: .55; cursor: progress; }

/* Small spinner next to the button while the form is being sent */
.wpcf7-spinner {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-left: 1.2em;
  border: 1px solid var(--c-ink);
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  visibility: hidden;
  animation: wpcf7-spin .9s linear infinite;
}

.wpcf7 form.submitting .wpcf7-spinner { visibility: visible; }

@keyframes wpcf7-spin {
  to { transform: rotate(360deg); }
}

/* Message under the button: same place and size as .form-status */
.wpcf7 form .wpcf7-response-output {
  margin-top: var(--s-30);
  font-size: var(--fs-small);
}

.wpcf7 form.init .wpcf7-response-output,
.wpcf7 form.resetting .wpcf7-response-output,
.wpcf7 form.submitting .wpcf7-response-output { display: none; }

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output { color: var(--c-error); }

.wpcf7 [inert] { opacity: .5; }


/* 13b. Privacy policy
   ==========================================================================
   Japanese and English side by side, like the About page: Japanese in
   columns 1-5, English in columns 8-12. On phones the English follows
   the Japanese.
   ========================================================================== */

.policy { align-items: start; }

.policy__col--ja { grid-column: 1 / span 5; }
.policy__col--en { grid-column: 8 / span 5; }

.policy__section { margin-top: var(--s-60); }

.policy .prose > ul,
.policy .prose > dl { margin-top: .6em; }

.policy .prose > ul + p,
.policy .prose > dl + p { margin-top: calc(var(--lh, 1.5) * 1em); }

.policy__list > li {
  position: relative;
  padding-left: 1.2em;
}

.policy__list > li + li { margin-top: .35em; }

.policy__list > li::before {
  content: "\2022";
  position: absolute;
  left: .2em;
}

.policy__col--ja .policy__list > li::before { content: "\30FB"; left: 0; }

.policy__contact {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 1.5em;
  row-gap: .35em;
}

.policy__contact dt { color: var(--c-mute); }

.policy__date {
  margin-top: var(--s-60);
  color: var(--c-mute);
}


/* 14. Grid overlay (press G)
   ========================================================================== */

.grid-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  pointer-events: none;
}

.show-grid .grid-overlay { display: block; }

.grid-overlay__cols { height: 100%; }

.grid-overlay__cols > span {
  background: var(--c-grid);
  box-shadow: inset 1px 0 var(--c-grid-line), inset -1px 0 var(--c-grid-line);
}

@media (min-width: 1024px) {
  .grid-overlay__cols.grid--5 > span:nth-child(n + 6) { display: none; }
}

.grid-overlay__spec {
  position: absolute;
  left: var(--margin);
  bottom: 14px;
  padding: 4px 6px;
  background: var(--c-bg);
  color: var(--c-grid-ink);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.show-grid .media::after {
  content: attr(data-spec);
  position: absolute;
  top: 8px;
  left: 8px;
  color: #ff6b8a;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}


/* 15. Motion
   ========================================================================== */

/* Leaving a page: the content fades out. Opacity is set on the header
   itself, never on <body>: a translucent ancestor would isolate the
   header's mix-blend-mode, which turns the black name and icon white. */
.is-leaving main,
.is-leaving .site-footer,
.is-leaving .site-header,
.is-leaving .site-menu {
  opacity: 0;
  transition: opacity .32s var(--ease-io);
}

/* Reveal, modelled on the reference recording (TANABIKU EYEWEAR):
   - text loses its blur while it gains opacity, about 1s, no movement
   - long text arrives line by line, about 0.16s apart (JS splits lines)
   - images only fade in, about 1s, no blur and no movement
   The JS assigns --d so that whatever enters the viewport together
   appears in reading order. */

/* Text: headings, captions, single lines */
.has-reveal [data-reveal]:not(.media) {
  transition:
    opacity var(--reveal-time) var(--ease-reveal) var(--d, 0ms),
    filter var(--reveal-time) var(--ease-reveal) var(--d, 0ms);
}

.has-reveal [data-reveal]:not(.media):not(.is-in) {
  opacity: 0;
  filter: blur(var(--reveal-blur));
}

/* Paragraphs stay hidden until they are split into lines */
.has-reveal [data-reveal-lines]:not(.is-split) { opacity: 0; }

.line { display: block; }

/* Images: a cover in the page colour fades away. The box keeps its size
   and its own opacity, so IntersectionObserver and hover states work. */
.has-reveal .media[data-reveal] {
  transition: opacity .6s var(--ease);
}

.has-reveal .media[data-reveal]::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -1px;
  background: var(--c-bg);
  pointer-events: none;
  transition: opacity var(--reveal-time) var(--ease-reveal) var(--d, 0ms);
}

.has-reveal .media[data-reveal].is-in::before { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}


/* 16. Responsive
   ========================================================================== */

@media (max-width: 1023px) {
  .side-label { display: none; }

  .home-works__col4 { display: contents; }
  .home-works__col4 > .home-works__item { grid-column: 10 / span 3; grid-row: 1; }

  .home-works__col4 .home-block {
    grid-column: 7 / span 6;
    grid-row: 2;
    margin-top: var(--s-120);
  }

  .site-menu__nav { grid-column: 1 / -1; }
  .site-menu__preview { display: none; }
  .site-menu__meta > * { grid-column: span 6; }

  .work--portrait .work__media { grid-column: 1 / span 8; }

  .work__text {
    display: grid;
    grid-template-columns: subgrid;
    margin-top: var(--s-120);
  }

  .work__ja { grid-column: 1 / span 6; }

  .work__en {
    grid-column: 7 / span 6;
    margin-top: 0;
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  .home-poster__media { --ar: 1897 / 3372; }
}

@media (max-width: 767px) {
  .home-about .home-block { grid-column: 1 / -1; }

  .home-works { row-gap: var(--gutter); }
  .home-works__item--1 { grid-column: 1 / span 6; }
  .home-works__item--2 { grid-column: 7 / span 6; }
  .home-works__item--3 { grid-column: 1 / span 6; grid-row: 2; }
  .home-works__col4 > .home-works__item { grid-column: 7 / span 6; grid-row: 2; }

  .home-works__col4 .home-block {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: var(--s-100);
  }

  .home-what__col--a,
  .home-what__col--b { grid-column: 1 / -1; }
  .home-what__col--b { margin-top: var(--s-30); }

  .bio__col--ja,
  .bio__col--en,
  .history__col--a,
  .history__col--b { grid-column: 1 / -1; }

  .bio__col--en,
  .history__col--b { margin-top: var(--s-100); }

  .policy__col--ja,
  .policy__col--en { grid-column: 1 / -1; }

  .policy__col--en { margin-top: var(--s-120); }

  .works { row-gap: var(--s-100); }
  .work-card { grid-column: span 6; }

  .work--portrait .work__media { grid-column: 1 / -1; }

  .work__text {
    display: block;
    margin-top: var(--s-100);
  }

  .work__en { margin-top: var(--s-100); }

  .pager { row-gap: var(--s-60); }
  .pager__link:empty { display: none; }
  .pager__link--prev,
  .pager__link--index,
  .pager__link--next { grid-column: 1 / -1; text-align: left; }
  .pager__link--index { order: 3; }

  .contact__intro,
  .contact__form { grid-column: 1 / -1; }
  .contact__form { margin-top: var(--s-120); }
  .choices { grid-template-columns: minmax(0, 1fr); }

  .site-menu__no { grid-column: 1 / span 2; }
  .site-menu__label { grid-column: 3 / -1; }
}
