/* =========================================================================
   Project Anthos — shared design system
   Aesthetic: "Gallery Stone" — greige paper, near-black ink, antique gold.
   Type: Cormorant Garamond (Latin) + Noto Serif JP (Japanese).
   ========================================================================= */

:root {
  --bg:        #eeece7;   /* soft greige stone */
  --bg-warm:   #f3f1ec;
  --ink:       #1c1b19;   /* near-black */
  --ink-soft:  #4c4943;
  --muted:     #7c776d;
  --accent:    #9a8253;   /* antique gold */
  --accent-dk: #806b41;
  --line:      rgba(28, 27, 25, 0.13);
  --line-2:    rgba(28, 27, 25, 0.22);
  --panel:     rgba(247, 245, 240, 0.72);

  --serif:    "Cormorant Garamond", "Noto Serif JP", "Hiragino Mincho ProN", "YuMincho", serif;
  --serif-jp: "Noto Serif JP", "Hiragino Mincho ProN", "YuMincho", "Cormorant Garamond", serif;

  --measure: 64rem;
  --gutter: clamp(1.1rem, 4vw, 3rem);
  --header-h: 76px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--serif-jp);
  font-size: 18px;
  line-height: 1.95;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- animated ink-wash bloom background (markup-free) ------------------- */
body::before {
  content: "";
  position: fixed;
  inset: -22%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(34% 30% at 22% 26%, rgba(154,130,83,0.16),  transparent 70%),
    radial-gradient(40% 36% at 80% 30%, rgba(58,60,70,0.10),    transparent 72%),
    radial-gradient(46% 42% at 64% 80%, rgba(154,130,83,0.13),  transparent 72%),
    radial-gradient(38% 34% at 28% 82%, rgba(120,92,70,0.09),   transparent 70%);
  filter: blur(10px);
  animation: ink-drift 52s ease-in-out infinite alternate;
}
@keyframes ink-drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.05); opacity: 0.9; }
  50%  { transform: translate3d(2%,  2%, 0) scale(1.13); opacity: 1; }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.07); opacity: 0.85; }
}

/* faint paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%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");
  background-size: 140px 140px;
}

/* ---- typography -------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif-jp);
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.6em;
  letter-spacing: 0.02em;
}
:lang(en) h1, :lang(en) h2, :lang(en) h3 { font-family: var(--serif); }

a { color: var(--accent-dk); text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--ink); }

p { margin: 0 0 1.4em; }

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

::selection { background: rgba(154,130,83,0.28); }

/* ---- shared layout ----------------------------------------------------- */
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.4rem, 6vw, 5rem) var(--gutter) 4rem;
}
.page--narrow { max-width: 52rem; }

.kicker {
  display: inline-block;
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--accent-dk);
  margin: 0 0 1.1rem;
}

.page-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 500;
  margin: 0 0 0.5em;
}
.title-rule {
  width: 64px; height: 1px;
  background: var(--accent);
  margin: 1.6rem 0 2.4rem;
  border: 0;
}
.page--centered .title-rule { margin-left: auto; margin-right: auto; }
.page--centered { text-align: center; }

.lead {
  font-size: 1.16rem;
  color: var(--ink-soft);
  max-width: 46rem;
}
.page--centered .lead { margin-left: auto; margin-right: auto; }

/* =========================================================================
   Header / navigation
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 clamp(1rem, 4vw, 2.4rem);
  min-height: var(--header-h);
  background: rgba(238, 236, 231, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
          backdrop-filter: blur(14px) saturate(1.05);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--serif-jp); font-size: 1.18rem; font-weight: 500; letter-spacing: 0.14em; }
.brand-sub  { font-family: var(--serif); font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); }

.site-nav { display: flex; align-items: center; gap: clamp(0.8rem, 1.8vw, 1.7rem); }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.6vw, 1.5rem);
  list-style: none;
  margin: 0; padding: 0;
}
.site-nav a {
  position: relative;
  font-family: var(--serif-jp);
  font-size: clamp(0.86rem, 1.35vw, 0.98rem);
  letter-spacing: 0.05em;
  color: var(--ink);
  padding: 4px 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.site-nav a:hover::after,
.site-nav a.is-current::after { transform: scaleX(1); }
.site-nav a.is-current { color: var(--accent-dk); }

/* language switch */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  padding-left: clamp(0.6rem, 1.6vw, 1.3rem);
  border-left: 1px solid var(--line);
}
.lang-switch a { color: var(--muted); padding: 2px 2px; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.is-active { color: var(--accent-dk); position: relative; }
.lang-switch a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: var(--accent);
}
.lang-sep { color: var(--line-2); }

/* mobile toggle */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 0; background: none; cursor: pointer;
  position: relative; flex: none;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 9px; right: 9px; height: 1.5px;
  background: var(--ink); transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle span { top: 19px; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after  { top: 7px; }

@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.6rem clamp(1rem, 5vw, 2.4rem) 1.4rem;
    background: rgba(238, 236, 231, 0.97);
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0; pointer-events: none;
    transition: opacity .28s ease, transform .28s ease;
  }
  .nav-open .site-nav { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0; width: 100%; }
  .site-nav li { width: 100%; border-bottom: 1px solid var(--line); }
  .site-nav ul a { display: block; padding: 0.85rem 0; font-size: 1.05rem; }
  .site-nav a::after { display: none; }
  .lang-switch { border-left: 0; padding: 1rem 0 0; }
  .nav-open .nav-toggle span { background: transparent; }
  .nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
  .nav-open .nav-toggle span::after  { transform: translateY(-7px) rotate(-45deg); }
}

/* =========================================================================
   Home hero (slideshow iframe)
   ========================================================================= */
.hero {
  position: relative;
  width: 100%;
  height: clamp(460px, calc(100vh - var(--header-h)), 1000px);
  background: #0b0707;
  overflow: hidden;
}
.hero-frame { display: block; width: 100%; height: 100%; border: 0; }
.scroll-cue {
  position: absolute;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  z-index: 5;
  color: rgba(255,255,255,0.8);
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  pointer-events: none;
  animation: cue 2.6s ease-in-out infinite;
}
@keyframes cue { 0%,100% { opacity: .4; transform: translate(-50%,0); } 50% { opacity: 1; transform: translate(-50%,6px); } }

.intro {
  text-align: center;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter);
  max-width: 46rem;
  margin: 0 auto;
}
.intro .kicker { letter-spacing: 0.5em; }
.intro h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0.4rem 0 0; font-weight: 500; }
.intro .intro-sub { font-family: var(--serif); letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); font-size: 0.8rem; margin-top: 1.1rem; }

/* =========================================================================
   Essay (recitalist) — literary long-form
   ========================================================================= */
.essay { max-width: 48rem; margin: 0 auto; }
.essay > p {
  text-indent: 1em;
  margin: 0 0 1.5em;
  color: var(--ink);
  line-height: 2.05;
}
.essay .section-title {
  font-size: clamp(1.4rem, 3.2vw, 1.9rem);
  font-weight: 500;
  margin: 2.6em 0 1em;
  padding-bottom: 0.4rem;
  position: relative;
}
.essay .section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 48px; height: 1px; background: var(--accent);
}
.essay .signature {
  text-align: right;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  margin: 2.4em 0 0.4em;
}
.essay .notes {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.8;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
  margin-top: 2.4rem;
  text-indent: 0;
}

/* floated figures inside prose */
figure { margin: 0; }
.figure {
  margin: 0.4rem 0 1.4rem;
  max-width: 50%;
}
.figure img {
  display: block;
  width: 100%;
  border-radius: 2px;
  box-shadow: 0 14px 40px -18px rgba(0,0,0,0.45);
}
.figure figcaption {
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  text-indent: 0;
}
.figure--right { float: right; margin-left: 2rem; }
.figure--left  { float: left;  margin-right: 2rem; }

/* =========================================================================
   Profile
   ========================================================================= */
.profile {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(1.6rem, 4vw, 3.2rem);
  align-items: start;
  max-width: 56rem;
  margin: 0 auto;
}
.profile-portrait { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.profile-portrait img {
  width: 100%;
  border-radius: 2px;
  box-shadow: 0 18px 50px -22px rgba(0,0,0,0.5);
}
.profile-portrait figcaption {
  margin-top: 0.7rem;
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.bio p { margin: 0 0 1.3em; text-indent: 1em; }
.bio .year { color: var(--accent-dk); font-variant-numeric: lining-nums; }

@media (max-width: 720px) {
  .profile { grid-template-columns: 1fr; }
  .profile-portrait { position: static; max-width: 280px; margin: 0 auto; }
}

/* =========================================================================
   Video grid (youtube / production)
   ========================================================================= */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1.6rem, 4vw, 2.6rem);
  margin-top: 2.4rem;
}
.video-card { text-align: left; }
.video-title {
  font-size: 1.08rem;
  font-weight: 500;
  margin: 0 0 0.7rem;
  letter-spacing: 0.03em;
}
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0707;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 16px 44px -22px rgba(0,0,0,0.5);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-meta { margin: 0.7rem 0 0; font-family: var(--serif); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--muted); }

.feature-video { max-width: 880px; margin: 2.4rem auto 0; }

/* =========================================================================
   Gallery (portfolio)
   ========================================================================= */
.gallery {
  columns: 2;
  column-gap: clamp(1rem, 3vw, 1.8rem);
  margin-top: 2.6rem;
}
.gallery figure {
  break-inside: avoid;
  margin: 0 0 clamp(1rem, 3vw, 1.8rem);
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 16px 44px -24px rgba(0,0,0,0.5);
}
.gallery img {
  display: block; width: 100%;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1);
}
.gallery figure:hover img { transform: scale(1.045); }
@media (max-width: 640px) { .gallery { columns: 1; } }

/* =========================================================================
   Contact / callout / construction
   ========================================================================= */
.contact-card {
  max-width: 40rem;
  margin: 2.6rem auto 0;
  text-align: center;
  padding: clamp(1.6rem, 4vw, 2.4rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.contact-card .label { font-family: var(--serif); letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.75rem; color: var(--muted); }
.contact-card a.mail { display: inline-block; margin-top: 0.6rem; font-size: 1.3rem; letter-spacing: 0.04em; }

.construction {
  min-height: 46vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  gap: 0.6rem;
}
.construction .mark { width: 44px; height: 44px; opacity: 0.7; }
.construction p { color: var(--muted); font-family: var(--serif); letter-spacing: 0.28em; text-transform: uppercase; font-size: 0.86rem; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  margin-top: 4rem;
  background: rgba(28,27,25,0.025);
  border-top: 1px solid var(--line);
}
.foot-inner {
  max-width: var(--measure);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: clamp(1.6rem, 4vw, 3rem);
  padding: clamp(2.4rem, 5vw, 3.6rem) var(--gutter) 2rem;
}
.foot-brand { display: flex; flex-direction: column; gap: 0.5rem; }
.foot-mark { width: 34px; height: 34px; }
.foot-name { font-size: 1.1rem; letter-spacing: 0.08em; margin: 0; }
.foot-tag  { font-family: var(--serif); font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin: 0; }

.foot-col h4 {
  font-family: var(--serif);
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
  font-weight: 500;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.foot-col a { color: var(--ink-soft); font-size: 0.95rem; }
.foot-col a:hover { color: var(--accent-dk); }
.foot-col .mail { font-size: 1.05rem; color: var(--accent-dk); }
.foot-org { color: var(--muted); font-size: 0.82rem; margin: 0.8rem 0 0; line-height: 1.6; }

.foot-base {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.foot-base .foot-lang a { color: var(--muted); }
.foot-base .foot-lang a:hover { color: var(--ink); }
.foot-base .foot-lang .is-active { color: var(--accent-dk); }

@media (max-width: 760px) {
  .foot-inner { grid-template-columns: 1fr; }
  .foot-base { flex-direction: column; gap: 0.4rem; text-align: center; }
}

/* =========================================================================
   Bilingual in-page language toggle
   JP is default. `.lang-en` on <html> flips to English.
   `.l-ja` / `.l-en` mark either inline spans or whole blocks; only the
   inactive language is ever display:none, so the visible element keeps its
   natural display (inline OR block) with no restore needed.
   ========================================================================= */
html:not(.lang-en) .l-en { display: none !important; }
html.lang-en        .l-ja { display: none !important; }

.lang-switch button {
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  background: none;
  border: 0;
  padding: 2px;
  margin: 0;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: color .25s ease;
}
.lang-switch button:hover { color: var(--ink); }
html:not(.lang-en) .lang-switch [data-set-lang="ja"],
html.lang-en        .lang-switch [data-set-lang="en"] {
  color: var(--accent-dk);
  position: relative;
}
html:not(.lang-en) .lang-switch [data-set-lang="ja"]::after,
html.lang-en        .lang-switch [data-set-lang="en"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: var(--accent);
}

.foot-lang button {
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  background: none; border: 0; padding: 0 1px; margin: 0;
  color: var(--muted); cursor: pointer;
  transition: color .25s ease;
}
.foot-lang button:hover { color: var(--ink); }
html:not(.lang-en) .foot-lang [data-set-lang="ja"],
html.lang-en        .foot-lang [data-set-lang="en"] { color: var(--accent-dk); }

/* =========================================================================
   Responsive refinements
   ========================================================================= */
/* tablet & below: let floated essay figures relax into the column */
@media (max-width: 760px) {
  .figure,
  .figure--right,
  .figure--left {
    float: none;
    max-width: 100%;
    margin: 1.6rem auto;
  }
  .figure img { box-shadow: 0 10px 30px -16px rgba(0,0,0,0.45); }
  .essay > p { line-height: 1.95; }
}

/* phones: ease type, tighten rhythm, guard against horizontal overflow */
@media (max-width: 520px) {
  body { font-size: 16px; line-height: 1.9; }
  .page { padding-left: 1.15rem; padding-right: 1.15rem; }
  .essay > p,
  .bio p { text-indent: 0.8em; }
  .lead { font-size: 1.05rem; }
  .brand-sub { letter-spacing: 0.26em; }
  .contact-card a.mail { font-size: 1.1rem; word-break: break-word; }
  .gallery { columns: 1; }
}

/* never allow a stray element to widen the page */
html, body { max-width: 100%; }
img, iframe, .video-frame, .gallery figure { max-width: 100%; }

/* =========================================================================
   Motion preferences
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { animation: none; }
  .scroll-cue { animation: none; }
  * { transition-duration: .01ms !important; }
}
