:root {
  --paper: #f2f2f2;
  --ink: #111110;
  --muted: #72726c;
  --cyan: #27d9f1;
  --cyan-deep: #007784;
  --cyan-pale: #7eddf0;
  --orange: #c64c10;
  --font-en: "Inter", sans-serif;
  --font-ja: "Noto Sans JP", sans-serif;
  --page-x: clamp(20px, 3vw, 48px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; background: var(--paper); }
body { min-width: 320px; overflow-x: clip; background: var(--paper); color: var(--ink); font-family: var(--font-en); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

#main-nav { position: fixed; inset: 0 0 auto; z-index: 100; height: 72px; color: #fff; mix-blend-mode: difference; }
.nav-inner { display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; gap: 16px; height: 100%; padding: 0 var(--page-x); }
.nav-logo { grid-column: 1 / 5; width: max-content; color: inherit; font-size: 16px; font-weight: 900; letter-spacing: -.045em; text-decoration: none; }
.nav-position { grid-column: 6 / 8; justify-self: center; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.nav-cta { grid-column: 11 / 13; justify-self: end; padding-bottom: 4px; border-bottom: 1px solid currentColor; color: inherit; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-decoration: none; }

.hero-stage { position: relative; z-index: 1; height: 350svh; background: var(--paper); }
/* #hero はアドレスバーの状態に追従（100dvh）して常に画面いっぱいを覆う。
   canvas は逆にアドレスバーが隠れた時の高さ（100lvh）で固定し、上端基準で配置する。
   → バー表示時は canvas の下端が overflow:hidden で切れるだけで、余白も引き伸ばしも起きない。
   WebGLの描画バッファ・カメラ・テキスト位置合わせはすべてこの固定サイズを基準にするため、
   アドレスバーの開閉で粒子とテキストの位置・サイズが変わらない。 */
#hero { position: sticky; top: 0; width: 100%; height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden; background: var(--paper); }
#vortex-canvas { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; height: 100lvh; }
.hero-content { position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; }
#real-logo, #real-catch { position: absolute; margin: 0; color: #444; line-height: 1.5; letter-spacing: 0; text-align: center; transform-origin: center; white-space: nowrap; }
#real-logo { font-family: var(--font-en); font-weight: 700; }
#real-catch { font-family: var(--font-ja); font-weight: 500; }
.logo-text-pc { display: inline; }
.logo-text-sp { display: none; }
.hero-scroll { position: absolute; z-index: 4; right: var(--page-x); bottom: 28px; display: flex; align-items: center; gap: 14px; font-size: 8px; font-weight: 700; letter-spacing: .18em; writing-mode: vertical-rl; }
.hero-scroll i { width: 1px; height: 58px; background: var(--ink); transform-origin: top; animation: scroll-line 2s ease-in-out infinite; }
@keyframes scroll-line { 0%, 100% { transform: scaleY(.2); opacity: .25; } 50% { transform: scaleY(1); opacity: 1; } }

/* セクション見出し（01 STATEMENT / 02 WORKS / 03 PRACTICE / 04 CONTACT 共通）。h2 として使う場合も見た目は同じ */
.section-index { display: flex; justify-content: space-between; width: calc((100% - 176px) / 12 * 3 + 32px); margin: 0; border-top: 1px solid rgba(17, 17, 16, .35); padding-top: 10px; font-family: var(--font-en); font-size: 12px; font-weight: 400; letter-spacing: .12em; line-height: 1.6; }
.section-index--light { border-color: rgba(255, 255, 255, .35); }

.statement { position: relative; min-height: 150svh; overflow: hidden; padding: 72px var(--page-x) 10svh; background: var(--paper); }
.statement-title { position: relative; z-index: 2; margin-top: 34svh; font-family: var(--font-ja); font-size: clamp(46px, 8.4vw, 134px); font-weight: 700; letter-spacing: -.07em; line-height: 1.17; }
.statement-title span { display: block; }
.statement-title span:last-child { margin-left: 41.666%; }
.statement-note { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 18svh; font-family: var(--font-ja); }
.statement-note .eyebrow { grid-column: 1 / 4; font-family: var(--font-en); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.statement-note > p:last-child { grid-column: 8 / 13; font-size: clamp(14px, 1.15vw, 18px); line-height: 2.15; }
.statement-word { position: absolute; right: -4vw; bottom: -3vw; color: transparent; font-size: 16vw; font-weight: 900; letter-spacing: -.08em; line-height: .75; -webkit-text-stroke: 1px rgba(0, 119, 132, .17); user-select: none; }

/* WORKS はFVの上に重ねて position: sticky で画面上端に固定し、その間に opacity でフェードインする。
   margin-top の -100vh は、sticky の #hero が最後に画面1つ分スライドして抜ける区間を WORKS で覆うため
   （これが無いと、白いFVがスライドで抜ける間ずっと真っ白な画面になり、WORKS はその下から動きながら現れる）。
   z-index は .hero-stage(1) より上にして、FVのホワイトアウト（z-index 10）より手前に描く。
   --works-pin  : 固定しておく長さ（この間は下スクロールに反応しない）
   --works-delay: 固定開始からフェードインを始めるまでの「真っ白な間」（vh 指定、site.js が読む）
   --works-fade : フェードインに使う長さ（vh 指定、site.js が読む）。delay + fade の残りは完全表示のまま固定する保持区間。
   sticky が動ける範囲は親のコンテンツ領域なので、padding ではなく ::after のスペーサーで余地を作る（padding だと固定されない）。
   JSの translateY で固定すると scroll イベントの遅れで1フレーム動いて見えるため、固定は必ず sticky で行う。 */
.works-stage { --works-pin: 125vh; --works-delay: 15vh; --works-fade: 60vh; position: relative; z-index: 2; margin-top: -100vh; margin-top: -100dvh; background: transparent; }
.works-stage::after { content: ''; display: block; height: var(--works-pin); }
#works { position: sticky; top: 0; opacity: var(--works-opacity, 0); will-change: opacity; }

.works { background: #111110; color: var(--paper); }
.works-header { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; min-height: 90svh; padding: 72px var(--page-x) 8svh; }
.works-header .section-index { grid-column: 1 / 4; }
.works-title { grid-column: 1 / 10; align-self: center; font-size: clamp(74px, 13vw, 202px); font-weight: 900; letter-spacing: -.085em; line-height: .75; }
.works-title span { color: var(--cyan); }
.works-lead { grid-column: 9 / 13; align-self: end; font-family: var(--font-ja); font-size: 14px; line-height: 2; }

.work-scene { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: auto 1fr auto; gap: 16px; min-height: 108svh; overflow: hidden; padding: 80px var(--page-x) 42px; isolation: isolate; }
.work-number { grid-column: 1 / 3; z-index: 3; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.work-name { position: relative; z-index: 3; align-self: center; font-size: clamp(92px, 17vw, 270px); font-weight: 900; letter-spacing: -.09em; line-height: .72; }
.work-meta, .work-result, .work-status, .work-link { position: relative; z-index: 3; }
.work-meta { grid-column: 1 / 5; align-self: end; font-size: 9px; font-weight: 700; letter-spacing: .15em; line-height: 1.9; }
.work-result { grid-column: 7 / 12; align-self: end; font-family: var(--font-ja); font-size: clamp(17px, 1.65vw, 26px); font-weight: 500; line-height: 1.8; }
.work-status, .work-link { position: absolute; right: var(--page-x); top: 84px; font-size: 9px; font-weight: 700; letter-spacing: .13em; text-decoration: none; }
.work-link span { color: var(--cyan); font-size: 16px; }

.work-scene--piano { background: #e9ded2; color: #171310; }
.work-name--piano { grid-column: 2 / 11; text-transform: uppercase; line-height: 1.05; }
.piano-visual { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.piano-keys { position: absolute; inset: 0 -4vw auto auto; display: flex; width: 58vw; height: 48svh; transform: rotate(-13deg) translateY(-10%); }
.piano-keys i { flex: 1; border: 1px solid rgba(17, 17, 16, .24); background: rgba(242, 242, 242, .2); }
.piano-keys i:nth-child(2), .piano-keys i:nth-child(4), .piano-keys i:nth-child(7) { height: 63%; background: #171310; }
.piano-orbit { position: absolute; border: 1px solid rgba(198, 76, 16, .55); border-radius: 50%; }
.piano-orbit--one { width: 41vw; height: 41vw; left: 7vw; bottom: -12vw; }
.piano-orbit--two { width: 22vw; height: 22vw; left: 17vw; bottom: -2vw; }
.piano-note { position: absolute; right: 8vw; bottom: 12vh; color: var(--orange); font-size: 18vw; line-height: 1; transform: rotate(8deg); opacity: .85; }

.work-scene--fuuchisou { background: #073f44; color: #f3f2ea; }
.work-name--fuuchisou { grid-column: 5 / 12; justify-self: end; font-family: var(--font-ja); font-size: clamp(80px, 11vw, 170px); letter-spacing: .01em; writing-mode: vertical-rl; line-height: 1; }
.work-kanji { position: absolute; left: -5vw; bottom: -12vw; z-index: -1; color: transparent; font-family: var(--font-ja); font-size: 57vw; font-weight: 900; line-height: .8; -webkit-text-stroke: 1px rgba(126, 221, 240, .18); }
.wind-field { position: absolute; inset: 0; z-index: -1; }
.wind-field i { position: absolute; left: -10%; width: 85%; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan-pale), transparent); transform: rotate(-9deg) scaleX(.4); transform-origin: left; opacity: .5; transition: transform 1.8s var(--ease); }
.work-scene.is-visible .wind-field i { transform: rotate(-9deg) scaleX(1); }
.wind-field i:nth-child(1) { top: 16%; transition-delay: .05s; }
.wind-field i:nth-child(2) { top: 23%; left: 22%; transition-delay: .15s; }
.wind-field i:nth-child(3) { top: 34%; transition-delay: .2s; }
.wind-field i:nth-child(4) { top: 43%; left: 35%; transition-delay: .1s; }
.wind-field i:nth-child(5) { top: 53%; transition-delay: .35s; }
.wind-field i:nth-child(6) { top: 61%; left: 15%; transition-delay: .25s; }
.wind-field i:nth-child(7) { top: 72%; transition-delay: .45s; }
.wind-field i:nth-child(8) { top: 81%; left: 28%; transition-delay: .3s; }
.wind-field i:nth-child(9) { top: 90%; transition-delay: .5s; }

.practice { padding: 36px var(--page-x) 88px; background: var(--paper); scroll-margin-top: 64px; }
/* 背景の粒子（js/practice-particles.js）。section 全体を覆う枠の中で canvas を画面1枚分だけ sticky にし、スクロールに付いてくる。
   isolation で section を独立した重なり順にし、z-index:-1 の canvas が section の背景より前・文字より後ろに来るようにする */
.practice { position: relative; isolation: isolate; }
.practice-canvas-wrap { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.practice-canvas { position: sticky; top: 0; display: block; width: 100%; height: 100vh; height: 100svh; }
.practice > .section-index { margin-bottom: 16px; }
/* Shared GROW layout for all three services. */
.practice-row { padding: 52px 0 80px 8%; }
.practice-row + .practice-row { border-top: 1px solid #c2c2bd; }
.practice-heading { min-width: 0; }
.practice-word { display: block; font: 900 clamp(80px, 14vw, 210px)/.95 var(--font-en); letter-spacing: -.025em; }
.practice-service { display: block; margin-top: 20px; font: 500 16px/1.7 var(--font-ja); }
.practice-detail { min-width: 0; max-width: 960px; margin-top: 24px; }
.practice-lead { margin-bottom: 34px; font: 500 clamp(19px, 1.7vw, 25px)/1.75 var(--font-ja); letter-spacing: -.025em; }
.practice-text { max-width: 760px; font: 400 16px/1.95 var(--font-ja); color: #414141; word-break: auto-phrase; text-wrap: pretty; overflow-wrap: anywhere; }
.practice-mobile-break { display: none; }
.practice-text .nobr { white-space: nowrap; }

.contact { position: relative; display: flex; flex-direction: column; min-height: 115svh; overflow: hidden; padding: 72px var(--page-x) 30px; background: #101010; color: var(--paper); }
.contact-thread { position: absolute; inset: 0; pointer-events: none; }
.contact-thread i { position: absolute; top: 53%; left: 0; width: 0; height: 1px; background: var(--cyan); box-shadow: 0 0 16px rgba(39, 217, 241, .55); transition: width 1.8s var(--ease); }
.contact-thread b { position: absolute; top: calc(53% - 4px); right: 17%; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 26px var(--cyan); opacity: 0; transition: opacity .4s 1.45s; }
.contact.is-visible .contact-thread i { width: 83%; }
.contact.is-visible .contact-thread b { opacity: 1; }
.contact-main { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; flex: 1; align-items: center; }
.contact-title { grid-column: 1 / 9; font-family: var(--font-ja); font-size: clamp(68px, 11.3vw, 176px); font-weight: 700; letter-spacing: -.08em; line-height: .97; }
.contact-side { grid-column: 9 / 13; padding-top: 15svh; font-family: var(--font-ja); font-size: 13px; line-height: 2; }
.contact-actions { margin-top: 48px; border-top: 1px solid rgba(255, 255, 255, .4); }
.contact-action { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 82px; border-bottom: 1px solid rgba(255, 255, 255, .4); color: inherit; text-decoration: none; transition: color .3s, padding .5s var(--ease); }
a.contact-action:hover { padding: 0 12px; color: var(--cyan); }
.contact-action span { font-size: 15px; font-weight: 700; }
.contact-action small { font-family: var(--font-en); font-size: 7px; letter-spacing: .13em; }
.contact-action--pending { opacity: .45; cursor: not-allowed; }
.site-footer { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: end; border-top: 1px solid rgba(255, 255, 255, .28); padding-top: 20px; font-size: 10px; font-weight: 700; letter-spacing: .1em; line-height: 1.6; }
.site-footer p:first-child { grid-column: 1 / 4; }
.site-footer p:nth-child(2) { grid-column: 5 / 8; }
.site-footer span { color: #858580; font-size: 8px; }
.site-footer .copyright { grid-column: 10 / 13; justify-self: end; color: #858580; font-size: 8px; }

.reveal { opacity: 0; transform: translateY(38px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.is-visible > .reveal, .is-visible .reveal, .reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
  :root { --page-x: 20px; }
  #main-nav { height: 62px; }
  .nav-inner { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .nav-logo { grid-column: 1 / 3; font-size: 14px; }
  .nav-position { display: none; }
  .nav-cta { grid-column: 4; font-size: 9px; }
  .logo-text-pc { display: none; }
  .logo-text-sp { display: inline-block; line-height: 1.1; }
  .hero-stage { height: 350svh; }
  #hero { min-height: 500px; }
  .hero-scroll { right: 14px; bottom: 20px; }
  .section-index { width: 100% !important; }
  .statement { min-height: 125svh; padding-top: 62px; }
  .statement-title { margin-top: 27svh; font-size: clamp(42px, 14.5vw, 70px); letter-spacing: -.08em; line-height: 1.22; }
  .statement-title span:last-child { margin-left: 18%; }
  .statement-note { grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18svh; }
  .statement-note .eyebrow { grid-column: 1 / 4; }
  .statement-note > p:last-child { grid-column: 2 / 5; margin-top: 36px; font-size: 13px; line-height: 2; }
  .statement-word { right: -9vw; bottom: 2vw; font-size: 31vw; }
  .works-header { grid-template-columns: repeat(4, 1fr); min-height: 78svh; padding-top: 62px; }
  .works-header .section-index { grid-column: 1 / 5; }
  .works-title { grid-column: 1 / 5; font-size: 20vw; }
  .works-lead { grid-column: 2 / 5; font-size: 12px; }
  .work-scene { grid-template-columns: repeat(4, 1fr); gap: 10px; min-height: 100svh; padding: 70px var(--page-x) 28px; }
  .work-number { grid-column: 1 / 2; }
  .work-name { font-size: 25vw; }
  .work-name--piano { grid-column: 1 / 5; align-self: center; }
  .work-meta { grid-column: 1 / 3; }
  .work-result { grid-column: 2 / 5; font-size: 15px; }
  .work-status, .work-link { top: 71px; right: 20px; max-width: 48%; text-align: right; }
  .work-status { width: 48%; line-height: 1.6; }
  .work-link { top: 112px; right: auto; left: 20px; max-width: 42%; text-align: left; line-height: 1.6; }
  .piano-keys { width: 100vw; height: 34svh; top: 5%; transform: rotate(-13deg) translate(10%, -10%); }
  .piano-orbit--one { width: 75vw; height: 75vw; left: -24vw; bottom: 7vh; }
  .piano-orbit--two { width: 42vw; height: 42vw; left: -5vw; bottom: 14vh; }
  .piano-note { right: 1vw; bottom: 20vh; font-size: 38vw; }
  .work-name--fuuchisou { grid-column: 2 / 5; font-size: 21vw; }
  .work-kanji { left: -25vw; bottom: 3vh; font-size: 105vw; }
  .wind-field i { width: 130%; }
  .practice { padding: 28px 24px 56px; }
  .practice > .section-index { margin-bottom: 8px; }
  .practice-row { padding: 38px 0 48px; }
  .practice-word { font-size: clamp(64px, 20vw, 150px); }
  .practice-service { margin-top: 14px; font-size: 15px; }
  .practice-detail { margin-top: 20px; }
  .practice-lead { margin-bottom: 26px; font-size: 19px; }
  .practice-mobile-break { display: block; }
  .contact { min-height: 105svh; padding-top: 62px; }
  .contact-main { grid-template-columns: repeat(4, 1fr); gap: 10px; align-content: center; }
  .contact-title { grid-column: 1 / 5; font-size: 18vw; }
  .contact-side { grid-column: 2 / 5; padding-top: 10svh; font-size: 12px; }
  .contact-thread i { top: 45%; }
  .contact-thread b { top: calc(45% - 4px); right: 10%; }
  .contact.is-visible .contact-thread i { width: 90%; }
  .contact-action { min-height: 70px; }
  .contact-action span { font-size: 13px; }
  .contact-action small { max-width: 46%; text-align: right; }
  .site-footer { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .site-footer p:first-child { grid-column: 1 / 3; }
  .site-footer p:nth-child(2) { grid-column: 3 / 5; text-align: right; }
  .site-footer .copyright { grid-column: 1 / 5; justify-self: start; margin-top: 14px; }
}

/* FLOW and STATEMENT share one pinned viewport; all values follow scroll directly. */
.hero-stage { height: 1200svh; --flow-opacity: 1; --statement-opacity: 0; --note-opacity: 0; --statement-shift: 26px; --whiteout-opacity: 0; }
#hero { min-height: 0; }
#vortex-canvas { opacity: var(--canvas-opacity, 1); transition: opacity 0.5s; will-change: opacity; }
.hero-scroll { opacity: var(--flow-opacity); will-change: opacity; }
#hero-real-text { filter: opacity(var(--flow-opacity)); will-change: filter; }
#hero > .statement { position: absolute; inset: 0; z-index: 5; min-height: 0; height: 100%; padding: 90px var(--page-x) 36px; background: transparent; pointer-events: none; }
/* iOS Safariでスクロールを素早く往復した際、var()経由のopacity更新が専用の描画レイヤーを
   持たないと再描画されず、前の状態がうっすら残ることがあるため will-change を付与 */
#hero .statement .reveal { transition: none; opacity: var(--statement-opacity); transform: translateY(var(--statement-shift)); will-change: opacity; }
/* letter-spacing: 0 は #real-logo / #real-catch と同じ理由（Canvas描画と字間を揃えるため） */
#hero .statement-title { position: absolute; top: 34%; margin: 0; font-size: clamp(40px, 7.7vw, 120px); line-height: 1.4; letter-spacing: 0; }
#hero .statement-title span { white-space: nowrap; }
#hero .statement-title span:last-child { margin-left: 34%; }
/* セレクタは #hero .statement .reveal（上）より優先されるよう詳細度を揃える（でないと --note-opacity が効かず title と同時に出る） */
#hero .statement .statement-note { position: absolute; bottom: 10%; left: var(--page-x); right: var(--page-x); margin: 0; opacity: var(--note-opacity); transform: none; will-change: opacity; }
#hero .statement-word { display: none; }
.hero-whiteout { position: absolute; inset: 0; z-index: 10; background: var(--paper); opacity: var(--whiteout-opacity); pointer-events: none; will-change: opacity; }
@media (max-width: 768px) {
  #hero > .statement { padding-top: 76px; }
  #hero .statement-title { top: 34%; font-size: 10.5vw; line-height: 1.4; }
  #hero .statement-title span:last-child { margin-left: 18%; }
  #hero .statement-note { bottom: 10%; }
  #hero .statement-note .eyebrow { grid-column: 1 / 5; font-size: 8px; }
  #hero .statement-note > p:last-child { margin-top: 16px; }
}
@media (max-height: 540px) and (min-width: 769px) {
  #hero .statement-title { top: 28%; font-size: 12vh; }
  #hero .statement-note { bottom: 4%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-stage { height: auto; }
  #hero { position: relative; height: auto; padding-top: 100svh; overflow: visible; }
  #vortex-canvas, #hero-real-text { height: 100svh; filter: none; }
  #hero > .statement { position: relative; min-height: 100svh; height: 100svh; }
  #hero .statement .reveal { opacity: 1; transform: none; }
  .hero-scroll { display: none; }
  .hero-whiteout { display: none; }
  .works-stage { margin-top: 0; }
  .works-stage::after { display: none; }
  #works { opacity: 1 !important; }
  #vortex-canvas { opacity: .18; }
  .hero-content { opacity: 1 !important; }
  .reveal { opacity: 1; transform: none; }
  .contact-thread i { width: 100%; }
  .contact-thread b { opacity: 1; }
}
