/* ---------- Design tokens ---------- */
:root {
  --bg: #faf8f4;
  --bg-alt: #f2efe8;
  --ink: #1c1a17;
  --ink-soft: #55504a;
  --line: rgba(28, 26, 23, 0.1);
  --accent: #b7282e;
  --accent-soft: rgba(183, 40, 46, 0.08);
  --radius: 2px;
  --max: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font-en-head: 'Cormorant Garamond', serif;
  --font-en-body: 'Inter', sans-serif;
  --font-jp-head: 'Noto Serif JP', serif;
  --font-jp-body: 'Noto Sans JP', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --bg-alt: #1f1c18;
    --ink: #f3efe8;
    --ink-soft: #b7b0a6;
    --line: rgba(243, 239, 232, 0.12);
    --accent: #d9534f;
    --accent-soft: rgba(217, 83, 79, 0.12);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-en-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
}

body.lang-jp { font-family: var(--font-jp-body); }
body.lang-jp .hero-eyebrow,
body.lang-jp h2 { font-family: var(--font-jp-head); }

h1, h2, h3 { font-family: var(--font-en-head); font-weight: 500; margin: 0; }

a { color: inherit; }

ul { list-style: none; margin: 0; padding: 0; }

/* subtle paper grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* decorative vertical Japanese label */
.vertical-mark {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--font-jp-body);
  font-size: .72rem;
  letter-spacing: .3em;
  color: var(--ink-soft);
  opacity: .35;
  z-index: 2;
  pointer-events: none;
}
@media (max-width: 900px) { .vertical-mark { display: none; } }

/* ---------- Header ---------- */
.header-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
/* backdrop-filter lives on a pseudo-element, not the header itself, so it
   doesn't become a new positioning context for the fixed mobile nav */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--ink);
}
.wordmark .mark {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.wordmark-text {
  font-family: var(--font-en-head);
  font-size: 1.15rem;
  letter-spacing: .04em;
}

.site-nav {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2.4rem;
}
.site-nav a {
  text-decoration: none;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color .25s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width .3s var(--ease);
}
.site-nav a:hover::after { width: 100%; }

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-switch button {
  font: inherit;
  font-size: .72rem;
  letter-spacing: .05em;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: .35rem .75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.lang-switch button.active {
  background: var(--accent);
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 20px; height: 1px;
  background: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* same width and side padding as .work so the photos line up with the gallery */
  max-width: min(94vw, 1760px);
  padding: 2rem clamp(1.25rem, 5vw, 4rem) 0;
  position: relative;
}
.hero-eyebrow {
  font-size: .8rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9rem;
}
.hero-title {
  font-size: clamp(3rem, 9vw, 6.5rem);
  letter-spacing: .01em;
  line-height: 1;
}
.hero-tagline {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 300;
}
/* Hero: one wide photo spanning the same width as the gallery below, with
   the name at its bottom left and the intro text at its bottom right. */
.hero-top { width: 100%; margin-bottom: 1.8rem; }
.hero-figure {
  margin: 0;
  aspect-ratio: 3 / 2;
  max-height: 70vh;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
}
.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  display: block;
}
.hero-intro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0 2rem;
  margin-top: 1.2rem;
}
/* Measurements wrap onto their own centred line by default... */
.hero-intro .hero-stats { flex-basis: 100%; margin-top: 1.4rem; }
/* Desktop: name left, intro text right, measurements as a single line.
   That line sits centred just beneath by default. When there is room for it
   dead centre between the name and the intro text, script.js (fitHero) adds
   .stats-inline and it moves up onto the same line. */
@media (min-width: 960px) {
  .hero-intro {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 0 1.5rem;
  }
  .hero-intro .hero-title { grid-area: 1 / 1; justify-self: start; white-space: nowrap; }
  .hero-intro-text { grid-area: 1 / 3; justify-self: end; white-space: nowrap; }
  .hero-intro .hero-stats {
    grid-area: 2 / 1 / 3 / -1;
    margin: 1.3rem 0 0;
    flex-wrap: nowrap;
  }
}
@media (min-width: 960px) {
  .hero-intro.stats-inline .hero-stats {
    grid-area: 1 / 2;
    margin: 0;
    padding-bottom: .45rem;
    gap: 0 clamp(.9rem, 1.25vw, 1.5rem);
  }
  .hero-intro.stats-inline .hero-stats div { gap: .4rem; }
  .hero-intro.stats-inline .hero-stats dt { font-size: .62rem; letter-spacing: .12em; }
  .hero-intro.stats-inline .hero-stats dd { font-size: .8rem; }
}
.hero-intro .hero-title {
  font-size: clamp(2.6rem, 4.6vw, 4.4rem);
  text-align: left;
}
.hero-intro-text { text-align: right; padding-bottom: .35rem; }
/* Phones: photo first, then the name and intro text centred beneath it */
@media (max-width: 720px) {
  .hero { max-width: none; padding-left: 1rem; padding-right: 1rem; }
  .hero-top { margin-bottom: 1.6rem; }
  .hero-figure { max-height: none; }
  .hero-intro { flex-direction: column; align-items: center; gap: 1rem; margin-top: 1.4rem; }
  .hero-intro .hero-title, .hero-intro-text { text-align: center; }
  .hero-intro-text { padding-bottom: 0; }
  /* tighter tracking so the three-part title fits on one line on a phone */
  .hero-intro .hero-eyebrow { font-size: .72rem; letter-spacing: .26em; }
  .hero-intro .hero-stats { flex-basis: auto; margin-top: .4rem; }
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.4rem;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: var(--ink);
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.hero-cta:hover { color: var(--accent); border-color: var(--accent); }
.hero-cta svg { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(4px);} }

/* Measurements strip at the foot of the hero */
.hero-stats {
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .7rem 2rem;
}
.hero-stats div { display: flex; align-items: baseline; gap: .55rem; }
.hero-stats dt {
  font-size: .65rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero-stats dd {
  margin: 0;
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--ink);
  white-space: nowrap;
}
@media (max-width: 720px) {
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 1.1rem 1.8rem;
  }
  .hero-stats div { flex-direction: column; align-items: center; gap: .25rem; }
}

.hero-line {
  width: 1px;
  height: 60px;
  margin: 3rem auto 0;
  background: linear-gradient(var(--line), var(--accent), var(--line));
}

.section-divider {
  width: 80px;
  height: 1px;
  margin: 3.5rem auto;
  background: var(--line);
}

/* ---------- Section shared ---------- */
main section { padding: 6rem clamp(1.25rem, 5vw, 4rem); max-width: var(--max); margin: 0 auto; }

/* Work's gallery reads better filling more of the screen on wide monitors,
   unlike the prose sections which stay narrower for readability. */
/* scroll-margin keeps the heading clear of the sticky header on "View Work" */
.work { max-width: min(94vw, 1760px); padding-top: 2.5rem; scroll-margin-top: 4.5rem; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3rem;
}
.section-head h2 { font-size: 2rem; }

.filters { display: flex; gap: .5rem; }
.filter-btn {
  font: inherit;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: .5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.filter-btn:hover { border-color: var(--accent); color: var(--ink); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Gallery ---------- */
/* Two photos per row, like spreads in a lookbook. script.js (layoutRows) groups
   the photos into .gallery-row and sizes each one from its own shape, so both
   photos in a row are the same height and none is cropped. */
.work {
  /* tallest a photo may be and still fit on screen below the header */
  --fit-h: calc(100vh - 140px);
  /* white space between the two photos of a pair */
  --pair-gap: clamp(2.5rem, 6vw, 6.5rem);
}
.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 3rem);
}
.gallery-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--pair-gap);
}
.gallery-item {
  position: relative;
  flex: none;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-alt);
  margin: 0;
}
.gallery-item.hidden { display: none; }

.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s var(--ease);
}
.gallery-item:hover img { transform: scale(1.05); }

/* Phones: still two per row, with tighter spacing */
@media (max-width: 720px) {
  main section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .work { max-width: none; padding-top: 2rem; padding-left: 1rem; padding-right: 1rem; }
  .section-head { margin-bottom: 1.6rem; gap: 1rem; }
  .filters { flex-wrap: wrap; gap: .4rem; }
  .filter-btn { padding: .45rem .85rem; font-size: .7rem; }
  .work { --pair-gap: .6rem; }
  .gallery-grid { gap: 1rem; }
}

.gallery-empty {
  padding: 4rem 0;
  text-align: center;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.placeholder-box {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background:
    radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%),
    linear-gradient(135deg, var(--bg-alt), var(--bg));
  border: 1px dashed var(--line);
}

.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: .9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  letter-spacing: .04em;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.gallery-item:hover .gallery-caption { opacity: 1; transform: translateY(0); }
.gallery-tag {
  text-transform: uppercase;
  font-size: .65rem;
  letter-spacing: .12em;
  color: rgba(255,255,255,.75);
}

/* ---------- About (merged into Contact) ---------- */
.about-section { text-align: center; }
.about-banner {
  font-size: 2rem;
  margin-bottom: 2.4rem;
}
.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3.5rem;
  align-items: start;
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}
.about-portrait .placeholder-box,
.about-portrait img {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.about-name {
  display: block;
  margin-top: .9rem;
  text-align: center;
  font-family: var(--font-en-head);
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: var(--ink);
}
.about-copy p { color: var(--ink-soft); font-size: 1rem; }

.about-facts {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 2rem;
}
.about-facts dt {
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .3rem;
}
.about-facts dd { margin: 0; font-size: .92rem; color: var(--ink-soft); }

@media (max-width: 720px) {
  .about-banner { font-size: 1.7rem; margin-bottom: 1.6rem; }
  .about-grid { grid-template-columns: 1fr; gap: 1.6rem; text-align: center; }
  .about-portrait { width: min(62vw, 240px); margin: 0 auto; }
  .about-portrait img { height: auto; }
  .about-copy p { max-width: 34ch; margin: 0 auto; line-height: 1.7; }
  .about-facts {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 0;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
  }
  .section-divider { margin: 2.5rem auto; }
}

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--line); text-align: center; }
.contact h2 { font-size: 2rem; margin-bottom: .8rem; }
.contact p { color: var(--ink-soft); margin-bottom: 1.8rem; }
.contact-email {
  display: inline-block;
  font-family: var(--font-en-head);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  transition: color .25s var(--ease);
}
.contact-email:hover { color: var(--accent); }

.social-row {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  margin-top: 2.6rem;
}
.social-row a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: all .25s var(--ease);
}
.social-row a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.social-row svg { width: 18px; height: 18px; }

/* Agency: "Represented by" with the agency logo, under the social links */
.agency {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
}
.agency-label {
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.agency-logo { width: 110px; height: auto; }
@media (prefers-color-scheme: dark) {
  .agency-logo { filter: invert(1); }
}

.social-link-labeled {
  width: auto !important;
  height: auto !important;
  border-radius: 999px !important;
  padding: .65rem 1.2rem .65rem 1rem;
  gap: .5rem;
}
.social-link-labeled span {
  font-size: .82rem;
  letter-spacing: .03em;
  white-space: nowrap;
}

.compcard-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .7rem 1.4rem;
  transition: all .25s var(--ease);
}
.compcard-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2.4rem 1.5rem 3rem;
  font-size: .75rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 8, .92);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease);
  padding: 2rem;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-stage {
  max-width: min(900px, 88vw);
  max-height: 74vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-stage img {
  max-width: 100%; max-height: 74vh;
  object-fit: contain;
  border-radius: var(--radius);
}
.lightbox-stage .placeholder-box {
  width: min(600px, 80vw);
  aspect-ratio: 4 / 3;
}
.lightbox-caption {
  color: #f3efe8;
  margin-top: 1.2rem;
  font-size: .85rem;
  letter-spacing: .05em;
  opacity: .8;
}
.lightbox-download {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: .9rem;
  padding-bottom: 3px;
  color: #f3efe8;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 239, 232, .5);
  opacity: .75;
  transition: opacity .2s var(--ease);
}
.lightbox-download:hover { opacity: 1; }
.lightbox-download[hidden] { display: none; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: none;
  border: none;
  color: #f3efe8;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  opacity: .75;
  transition: opacity .2s var(--ease);
}
.lightbox-close:hover, .lightbox-nav:hover { opacity: 1; }
.lightbox-close { top: 1.5rem; right: 1.5rem; font-size: 2.2rem; }
.lightbox-prev { left: clamp(.75rem, 3vw, 2.5rem); }
.lightbox-next { right: clamp(.75rem, 3vw, 2.5rem); }
.lightbox-nav { font-size: 3rem; top: 50%; transform: translateY(-50%); }

/* ---------- Mobile nav ---------- */
@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform .35s var(--ease);
    z-index: 1;
  }
  .site-nav.open { transform: translateX(0); }
  .site-nav a { font-size: 1.1rem; }
}
