/* Portfolio — a light plaster room: one serif line, a moving strip of the work,
   then project cards in each client's own colours that stack as you scroll */

:root {
  --bg: #ECEEE8;
  --surface: #F7F8F4;
  --fg: #16221E;
  --muted: #4B5A54;
  --accent: #25584A;
  --accent-deep: #1B4237;
  --rule: rgba(22, 34, 30, 0.16);

  /* Latin faces first; Japanese glyphs fall through to the Japanese faces behind them */
  --display: "Instrument Serif", "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --ui: "Hanken Grotesk", "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", Arial, sans-serif;

  --gutter: clamp(1rem, 5vw, 4rem);
  --max: 84rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

section[id], article[id] { scroll-margin-top: 1.5rem; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--fg); color: var(--bg);
  padding: 0.6rem 1rem; z-index: 30;
}
.skip:focus { top: 0.75rem; }

.label {
  font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0.7rem 1.75rem;
  font-weight: 600; font-size: 1.1rem; line-height: 1.2;
  background: var(--accent); color: var(--surface);
  border-radius: 999px; text-decoration: none;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.button:hover { background: var(--accent-deep); }
.button:active { transform: scale(0.97); }
.button-small { min-height: 2.75rem; padding: 0.5rem 1.25rem; font-size: 1rem; }

/* Header */
.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2rem;
  padding-block: 1.25rem;
}
.bar nav { display: flex; gap: clamp(1rem, 2.5vw, 2rem); }
.bar nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  color: var(--fg); text-decoration: none; text-underline-offset: 0.3em;
}
.bar nav a:hover, .bar nav a[aria-current="page"] { text-decoration: underline; }
.lang { display: flex; padding: 3px; border: 1px solid var(--rule); border-radius: 999px; }
.lang button {
  appearance: none; border: 0; border-radius: 999px; background: transparent; color: var(--fg); cursor: pointer;
  font: 600 0.8125rem/1 var(--ui); min-height: 2.25rem; padding: 0 0.75rem; white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.lang button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.bar .name {
  margin-right: auto;
  font-family: var(--display); font-size: 1.9rem; line-height: 1;
  color: var(--fg); text-decoration: none;
}

/* Hero */
.eyebrow { margin: 0; }
.hero { display: grid; gap: 1.25rem; padding-block: clamp(2rem, 6vw, 5rem) clamp(2rem, 5vw, 3.5rem); }
h1 {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3rem, 10.5vw, 9.5rem);
  line-height: 0.92; letter-spacing: -0.02em;
}
h1 span { display: block; }
h1 i, .contact h2 i { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  h1 span { animation: rise 0.9s var(--ease) both; }
  h1 span + span { animation-delay: 0.12s; }
  @keyframes rise { from { transform: translateY(0.35em); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* About heading: the photo carries the words in English, so the text heading is only
   shown on screen in Japanese (it stays in the page for screen readers and search engines) */
.photo-title { display: grid; gap: clamp(1.25rem, 3vw, 2.25rem); }
.photo-title img { width: 100%; max-width: 42rem; border-radius: 10px; }
.photo-title h1 span { display: inline; animation: none; }
.photo-title h1 > span { display: block; }
:lang(en) .photo-title h1 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Film strip: the image set is repeated once so the loop has no seam */
.strip {
  overflow: hidden; padding-block: 0.5rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
/* main.js eases the strip to a stop while the pointer is over it */
.track { display: flex; gap: 1rem; width: max-content; animation: roll 48s linear infinite; }
.track a { flex: none; display: block; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); }
.track a:focus-visible { outline-offset: 2px; }
.track img {
  height: clamp(11rem, 26vw, 21rem); width: auto; max-width: none;
  object-fit: cover; object-position: 0 0;
  transition: transform 0.5s var(--ease);
}
.track a:hover img { transform: scale(1.03); }
.track .tall { aspect-ratio: 390 / 844; }
.track .wide { aspect-ratio: 16 / 10; }
@keyframes roll { to { transform: translateX(calc(-50% - 0.5rem)); } }

/* What I do, in one line */
.skills {
  list-style: none; margin-block: 0;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem;
  font-family: var(--display); font-size: clamp(1.5rem, 3.6vw, 2.75rem); line-height: 1.15;
}
.skills li:nth-child(even) { font-style: italic; color: var(--muted); }

/* Project cards: each sticks a little lower than the last, so they stack */
.cards { display: grid; gap: 1rem; padding-bottom: clamp(3rem, 8vw, 6rem); }
.card {
  position: sticky; top: calc(1rem + var(--i) * 1.1rem);
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(1.25rem, 3vw, 3rem); align-items: center;
  min-height: min(34rem, 78vh);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--c-bg); color: var(--c-fg);
  border: 1px solid var(--rule); border-radius: 22px;
  box-shadow: 0 -16px 36px -24px rgba(22, 34, 30, 0.35);
}
.card-luna { --i: 0; --c-bg: #0D1524; --c-fg: #EDE6D6; --c-accent: #C9A45C; }
.card-sawa { --i: 1; --c-bg: #F4F0E6; --c-fg: #221D18; --c-accent: #B8392B; }
.card-iron { --i: 2; --c-bg: #0B0B0D; --c-fg: #F2F2F2; --c-accent: #FF6A1A; }

.card .label { color: var(--c-accent); }
.card h2 {
  margin: 0.5rem 0 1rem;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.5rem, 5.4vw, 5rem); line-height: 0.95; letter-spacing: -0.02em;
}
.card ul { list-style: none; margin: 0 0 1.75rem; padding: 0; }
.card li { padding: 0.6rem 0; border-top: 1px solid color-mix(in srgb, var(--c-fg) 18%, transparent); }
.card :focus-visible { outline-color: var(--c-accent); }

.arrow-link {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem;
  color: var(--c-fg); font-weight: 600; text-underline-offset: 0.25em;
}
.arrow-link svg {
  width: 1.1rem; height: 1.1rem;
  fill: none; stroke: currentColor; stroke-width: 2;
  transition: transform 0.25s var(--ease);
}
.arrow-link:hover svg { transform: translate(3px, -3px); }

/* A desktop view with a phone overlapping its corner */
.shot { position: relative; }
.shot img { width: 100%; border-radius: 10px; }
.shot .m {
  position: absolute; right: -2%; bottom: -6%; width: 21%;
  border-radius: 12px; border: 4px solid var(--c-fg);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
}

/* About and questions page */
.page-title { font-size: clamp(2.75rem, 8.5vw, 7.5rem); max-width: 12ch; }
.split {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 5vw, 5rem); align-items: start;
  padding-block: clamp(2.5rem, 7vw, 5rem);
  border-top: 1px solid var(--rule);
}
.split h2 {
  margin: 0.5rem 0 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1; letter-spacing: -0.02em;
}
.where { margin: 0.75rem 0 0; color: var(--muted); }
.about-text p { margin: 0 0 1.25rem; max-width: 38rem; }
.about-text p:first-child { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.45; }
.about-text p:last-child { margin-bottom: 0; color: var(--muted); }
.portrait { width: 100%; max-width: 20rem; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; margin-top: 2rem; }
/* Stand-in until there is a real photo (set PORTRAIT in build.py) */
.portrait-empty {
  display: grid; place-content: center; justify-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px dashed var(--rule); color: var(--muted);
}
.portrait-empty span { font-family: var(--display); font-size: 4rem; line-height: 1; color: var(--accent); }
.portrait-empty small { font-size: 0.875rem; }


.prices { margin: 0; border-top: 1px solid var(--rule); }
.prices div {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 2rem;
  padding: 1rem 0; border-bottom: 1px solid var(--rule);
}
.prices dt { flex: 1 1 16rem; min-width: 0; font-weight: 500; font-size: 1.125rem; line-height: 1.4; }
.prices dd { margin: 0; font-family: var(--display); font-size: 1.6rem; line-height: 1.2; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-note { margin: 1rem 0 0; color: var(--muted); font-size: 0.95rem; }

.faq-list { border-top: 1px solid var(--rule); }
.faq-list details { border-bottom: 1px solid var(--rule); }
.faq-list summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  min-height: 3.5rem; padding: 1.1rem 0; cursor: pointer; list-style: none;
  font-weight: 500; font-size: 1.25rem; line-height: 1.25;
  transition: color 0.2s var(--ease);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--accent); }
.faq-list summary::after {
  content: ""; flex: none; width: 0.7rem; height: 0.7rem; margin-right: 0.3rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg); transition: transform 0.25s var(--ease);
}
.faq-list details[open] summary::after { transform: translateY(25%) rotate(225deg); }
.faq-list details p { margin: 0; padding: 0 2.5rem 1.4rem 0; max-width: 36rem; color: var(--muted); }

/* Contact page */
.reach { display: grid; gap: 1.25rem; align-content: start; }
.reach p { margin: 0; max-width: 30rem; font-size: 1.15rem; }
.reach dl { margin: 0; border-top: 1px solid var(--rule); }
.reach dl div { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1rem; align-items: center; min-height: 3.25rem; border-bottom: 1px solid var(--rule); }
.reach dt { font-weight: 600; }
.reach dd { margin: 0; overflow-wrap: anywhere; }
.reach a { color: var(--fg); text-underline-offset: 0.2em; }
.reach a:hover { color: var(--accent); }

.form { display: grid; gap: 1.25rem; padding: clamp(1.25rem, 3vw, 2.25rem); background: var(--surface); border: 1px solid var(--rule); border-radius: 22px; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; }
.field input, .field textarea {
  width: 100%; min-height: 3rem; padding: 0.7rem 0.9rem;
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid rgba(22, 34, 30, 0.35); border-radius: 10px;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--accent); }
.field small { color: var(--muted); font-size: 0.9rem; }
.form .button { justify-self: start; border: 0; cursor: pointer; font-family: inherit; min-width: 9rem; }

.thanks { justify-items: start; gap: 1.5rem; padding-bottom: clamp(4rem, 12vw, 9rem); }
.thanks p { margin: 0; font-size: 1.15rem; }

/* Contact */
.contact {
  display: grid; gap: 1.5rem;
  padding-block: clamp(2.5rem, 7vw, 5rem);
  border-top: 1px solid var(--rule);
}
.contact h2 {
  margin: 0; max-width: 14ch;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 7rem); line-height: 0.95; letter-spacing: -0.02em;
}
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.addr {
  display: inline-flex; align-items: center; min-height: 2.75rem; min-width: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.9rem); font-weight: 500;
  color: var(--fg); text-underline-offset: 0.2em; overflow-wrap: anywhere;
}
.addr:hover { color: var(--accent); }

.site-footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}
.site-footer a { color: var(--fg); }

/* Japanese: no italics, looser leading, and smaller display sizes because every glyph is full width */
:lang(ja) body { line-height: 1.8; }
:lang(ja) i, :lang(ja) .skills li { font-style: normal; }
:lang(ja) .label { letter-spacing: 0.08em; }
:lang(ja) h1, :lang(ja) .card h2, :lang(ja) .contact h2, :lang(ja) .split h2 { letter-spacing: 0; line-height: 1.25; line-break: strict; text-wrap: balance; }
:lang(ja) h1 { font-size: clamp(2rem, 7.4vw, 6.5rem); }
:lang(ja) .page-title { font-size: clamp(1.5rem, 5vw, 4.5rem); max-width: none; }
:lang(ja) .card h2 { font-size: clamp(2.1rem, 4.4vw, 4rem); }
:lang(ja) .contact h2 { font-size: clamp(1.9rem, 5.6vw, 4.75rem); max-width: none; }
:lang(ja) .contact h2 i { display: block; }
:lang(ja) .split h2 { font-size: clamp(1.5rem, 2.8vw, 2.25rem); }
:lang(ja) .skills { font-size: clamp(1.3rem, 3vw, 2.25rem); line-height: 1.5; gap: 0 0.5rem; }
:lang(ja) .faq-list summary { font-size: 1.125rem; line-height: 1.5; }

/* Narrow screens */
@media (max-width: 52rem) {
  .bar { flex-wrap: nowrap; gap: 0.6rem; }
  .bar nav { gap: 0.7rem; font-size: 0.9375rem; }
  .lang button { padding: 0 0.55rem; }
  .bar .button-small { display: none; }
  .bar nav a { white-space: nowrap; }
  .split { grid-template-columns: 1fr; }
  .card { grid-template-columns: 1fr; min-height: 0; }
  .shot { order: -1; margin-bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .strip { overflow-x: auto; }
  .track { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
