@charset "UTF-8";
/* ============================================================
   style.css — 002_showcase_portfolio「組み上がる夜のアトリエ」
   starter基盤を継承(リセット/a11y/フォーム/停止ポリシー)し、
   トークンとコンポーネントをダーク×2温度ライティングへ引き直し。
   構成: 1.トークン → 2.リセット/ベース → 3.レイアウト
        → 4.コンポーネント → 5.ショーケース演出 → 6.停止ポリシー
   ============================================================ */

/* ---------- 1. トークン ---------- */
:root {
  /* 2温度の光(design-preview.html 承認済みパレット) */
  --color-bg: #05070D;           /* 宵闇 */
  --color-surface: #0D1322;      /* 藍鼠 */
  --color-text: #E9EDF6;         /* 月白 */
  --color-muted: #8B94A9;        /* 薄墨 */
  --color-cold: #AFC8FF;         /* 冷光 — AIの光 */
  --color-warm: #FFB454;         /* 暖光 — 手元の光 */
  --color-warm-ink: #2A1B05;     /* 暖光ボタン上の文字 */
  --color-line: rgba(233, 237, 246, 0.1);

  --glow-cold: rgba(175, 200, 255, 0.5);
  --glow-warm: rgba(255, 180, 84, 0.45);

  --font-display: "Space Grotesk", "Zen Kaku Gothic New", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;

  --space: 8px;
  --section-pad: clamp(64px, 12vw, 140px);
  --container: 1120px;
  --container-narrow: 760px;
  --radius: 10px;

  --z-canvas: 0;
  --z-content: 1;
  --z-header: 100;
  --z-nav: 200;
  --z-grain: 900;
  --z-modal: 1000;
  --z-loader: 1100;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.8s;
}

/* ---------- 2. リセット/ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.9;
  font-size: 16px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

/* フィルムグレイン(全面・静的) */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: var(--z-grain);
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; }
a:hover { opacity: 0.75; transition: opacity 0.3s; }

:focus-visible {
  outline: 2px solid var(--color-cold);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-body);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

main { position: relative; z-index: var(--z-content); }

/* 等幅HUDラベル(このサイトの共通装置) */
.hud {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.hud--warm { color: var(--color-warm); }

/* ---------- 3. レイアウト ---------- */
.container { width: min(var(--container), 100% - 48px); margin-inline: auto; }
.container--narrow { width: min(var(--container-narrow), 100% - 48px); margin-inline: auto; }

.section { padding-block: var(--section-pad); }

.section-head { margin-bottom: calc(var(--space) * 7); }
.section-head__en {
  display: block;
  color: var(--color-cold);
  margin-bottom: calc(var(--space) * 2);
}
.section-head__title { font-size: clamp(28px, 4.5vw, 44px); }
.section-head__note { margin-top: calc(var(--space) * 2); font-size: 13px; color: var(--color-muted); }

/* ---------- 4. コンポーネント ---------- */

/* WebGLキャンバス(全ページ背面) */
.gl-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: var(--z-canvas);
  pointer-events: none;
}
/* WebGL非対応フォールバック */
body.no-webgl .gl-canvas { display: none; }
body.no-webgl {
  background:
    radial-gradient(ellipse 60% 45% at 18% 12%, rgba(175, 200, 255, 0.1), transparent 65%),
    radial-gradient(ellipse 55% 40% at 85% 85%, rgba(255, 180, 84, 0.08), transparent 65%),
    var(--color-bg);
  background-attachment: fixed;
}

/* カーソルグロー(hover:hover環境のみJSが有効化) */
.cursor-glow {
  position: fixed; left: 0; top: 0;
  width: 340px; height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(175, 200, 255, 0.09), transparent 62%);
  pointer-events: none;
  z-index: var(--z-content);
  opacity: 0;
  transform: translate(-100vw, -100vh);
}

/* ローディング */
.loader {
  position: fixed; inset: 0;
  z-index: var(--z-loader);
  background: var(--color-bg);
  display: grid; place-content: center; gap: calc(var(--space) * 2);
  text-align: center;
  transition: transform 0.9s var(--ease-out-expo);
}
.loader.is-done { transform: translateY(-100%); }
.loader__label { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.3em; color: var(--color-cold); }
.loader__tick { color: var(--color-warm); animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.loader__pct { font-family: var(--font-mono); font-size: 40px; color: var(--color-text); }
.loader__bar {
  width: 220px; height: 2px; margin-inline: auto;
  background: rgba(233, 237, 246, 0.12);
  overflow: hidden;
}
.loader__bar span {
  display: block; width: 0; height: 100%;
  background: linear-gradient(90deg, var(--color-cold), var(--color-warm));
  transition: width 0.2s linear;
}

/* ヘッダー */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-header);
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px clamp(20px, 4vw, 48px);
  transition: background 0.4s, box-shadow 0.4s;
}
.site-header.is-scrolled {
  background: rgba(5, 7, 13, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--color-line);
}
.site-header__logo {
  font-family: var(--font-body); font-weight: 900; font-size: 18px;
  text-decoration: none; letter-spacing: 0.04em;
}
.site-header__logo span {
  font-family: var(--font-mono); font-weight: 500; font-size: 12px;
  color: var(--color-cold); margin-left: 6px; letter-spacing: 0.12em;
}

.global-nav ul { display: flex; gap: calc(var(--space) * 4); list-style: none; padding: 0; }
.global-nav a {
  text-decoration: none; font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.14em;
}
.global-nav a:hover { color: var(--color-warm); opacity: 1; }

/* ハンバーガー(SP) */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  position: relative; z-index: calc(var(--z-nav) + 1);
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; margin: 5px auto;
  background: var(--color-text); transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 767px) {
  .nav-toggle { display: block; }
  .global-nav {
    position: fixed; inset: 0; z-index: var(--z-nav);
    background: rgba(5, 7, 13, 0.96);
    display: grid; place-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s;
  }
  .global-nav.is-open { opacity: 1; visibility: visible; }
  .global-nav ul { flex-direction: column; text-align: center; gap: calc(var(--space) * 4); }
  .global-nav a { font-size: 18px; }
}

/* ボタン */
.button {
  display: inline-block;
  padding: 16px 44px;
  background: var(--color-warm); color: var(--color-warm-ink);
  border: 1px solid var(--color-warm); border-radius: 999px;
  font-family: var(--font-body); font-weight: 700;
  font-size: 15px; letter-spacing: 0.06em; text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 24px var(--glow-warm);
  transition: box-shadow 0.3s, transform 0.3s;
}
.button:hover { box-shadow: 0 0 48px var(--glow-warm); transform: translateY(-2px); opacity: 1; }
.button:disabled { opacity: 0.5; cursor: wait; box-shadow: none; transform: none; }

/* フォーム */
.form { display: grid; gap: calc(var(--space) * 4); }
.form__field { display: grid; gap: calc(var(--space) * 1); }
.form__field label { font-size: 14px; font-weight: 700; }
.form__field .required { color: var(--color-warm); font-size: 12px; margin-left: 0.5em; }
.form input, .form textarea {
  font: inherit; color: var(--color-text);
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-line); border-radius: var(--radius);
}
.form input:focus, .form textarea:focus {
  border-color: var(--color-cold); outline: none;
  box-shadow: 0 0 18px rgba(175, 200, 255, 0.18);
}
.form [aria-invalid="true"] { border-color: #E06A5A; }
.form__error { color: #E06A5A; font-size: 13px; min-height: 1.2em; }
.form__hp { position: absolute; left: -9999px; }  /* ハニーポット: 削除禁止 */
.form__privacy { font-size: 13px; color: var(--color-muted); }
.form__success {
  padding: 16px 20px;
  border: 1px solid rgba(255, 180, 84, 0.4); border-radius: var(--radius);
  background: rgba(255, 180, 84, 0.08);
  font-size: 14px;
}

/* フッター */
.site-footer {
  position: relative; z-index: var(--z-content);
  padding: calc(var(--space) * 8) 0 calc(var(--space) * 4);
  border-top: 1px solid var(--color-line);
  font-size: 13px; color: var(--color-muted);
  display: block;
}
.site-footer .hud { margin-bottom: calc(var(--space) * 1); }

/* ---------- 5. ショーケース演出 ---------- */

/* 幕1: ヒーロー */
.hero {
  min-height: 100svh;
  display: grid; place-content: center;
  text-align: center;
  position: relative;
  padding: calc(var(--space) * 12) 24px;
}
.hero__hud { margin-bottom: calc(var(--space) * 3); }
.hero__en {
  display: block; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(52px, 11vw, 128px);
  line-height: 1.05; letter-spacing: 0.01em;
}
.glow-cold { color: var(--color-cold); text-shadow: 0 0 46px var(--glow-cold); }
.glow-warm { color: var(--color-warm); text-shadow: 0 0 46px var(--glow-warm); }
.hero__ja {
  display: block;
  font-size: clamp(16px, 2.6vw, 24px);
  font-weight: 500;
  margin-top: calc(var(--space) * 3);
}
.hero__lead {
  margin: calc(var(--space) * 3) auto 0;
  max-width: 32em;
  font-size: 14px;
  color: var(--color-muted);
}
.hero__cue {
  position: absolute; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  animation: cueFloat 2.4s var(--ease-out) infinite;
}
@keyframes cueFloat { 50% { transform: translateX(-50%) translateY(8px); } }

/* ヒーローのロードシーケンス(body.is-loaded で開演) */
.hero__hud, .hero__en, .hero__ja, .hero__lead, .hero__cue { opacity: 0; }
.is-loaded .hero__hud  { animation: heroUp 0.9s var(--ease-out-expo) 0.05s forwards; }
.is-loaded .hero__en   { animation: heroUp 1.0s var(--ease-out-expo) 0.2s forwards; }
.is-loaded .hero__ja   { animation: heroUp 0.9s var(--ease-out-expo) 0.45s forwards; }
.is-loaded .hero__lead { animation: heroUp 0.9s var(--ease-out-expo) 0.62s forwards; }
.is-loaded .hero__cue  { animation: heroFade 1.2s var(--ease-out-expo) 1.1s forwards; }
@keyframes heroUp   { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes heroFade { from { opacity: 0; } to { opacity: 1; } }
/* cueはfloatと併用するためanimation合成 */
.is-loaded .hero__cue { animation: heroFade 1.2s var(--ease-out-expo) 1.1s forwards, cueFloat 2.4s var(--ease-out) 2.3s infinite; }

/* 幕2: 組み上がり(破調・最大の見せ場) */
.assemble { height: 460svh; position: relative; }
.assemble__sticky {
  position: sticky; top: 0;
  height: 100svh;
  overflow: hidden;
}
.assemble__hud {
  position: absolute; left: clamp(20px, 5vw, 64px); bottom: clamp(24px, 6vh, 64px);
  z-index: 2;
  width: min(480px, 80vw); /* 子が全員absoluteのため幅を明示(収縮事故防止) */
}
.assemble__progress { margin-bottom: calc(var(--space) * 2); color: var(--color-cold); }
.assemble__steps { position: relative; min-height: 9.5em; }
.assemble__step {
  position: absolute; inset: 0 auto auto 0; width: 100%;
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  pointer-events: none;
}
.assemble__step.is-active { opacity: 1; transform: none; }
.assemble__step .hud { color: var(--color-warm); margin-bottom: 4px; }
.assemble__step h2 { font-size: clamp(22px, 3.4vw, 34px); }
.assemble__note { font-size: 13.5px; color: var(--color-muted); margin-top: 4px; }

/* 組み上がった実画面(JSがopacity/transformを駆動) */
.assemble__frame {
  position: absolute; left: 50%; top: 50%;
  width: min(720px, 86vw);
  transform: translate(-50%, -46%) scale(0.94);
  opacity: 0;
  z-index: 1;
}
.assemble__frame figcaption { margin-top: calc(var(--space) * 2); text-align: center; }

/* ブラウザフレーム(スクショの額縁) */
.browser-frame {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(175, 200, 255, 0.14), 0 24px 60px rgba(0, 0, 0, 0.5);
}
.browser-frame__bar {
  display: flex; gap: 6px; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-line);
}
.browser-frame__bar i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--color-muted); opacity: 0.5;
}
.browser-frame__bar i:first-child { background: var(--color-warm); opacity: 0.9; }
.browser-frame__bar i:nth-child(2) { background: var(--color-cold); opacity: 0.7; }

/* 幕3: Works 横スクロール */
.works { position: relative; padding-top: var(--section-pad); }
.works__head { margin-bottom: calc(var(--space) * 4); }
.hscroll { overflow: hidden; }
body.no-gsap .hscroll { overflow-x: auto; } /* GSAP読込失敗時はネイティブ横スクロール */
.hscroll__track {
  display: flex; gap: clamp(24px, 4vw, 56px);
  align-items: center;          /* pin中はパネルを垂直センターに */
  min-height: 100svh;
  padding: 0 clamp(20px, 5vw, 64px);
  width: max-content;
}
.work-panel {
  width: min(680px, 78vw);
  flex-shrink: 0;
}
.work-panel .browser-frame {
  transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.work-panel:hover .browser-frame {
  box-shadow: 0 0 80px rgba(175, 200, 255, 0.24), 0 24px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(-6px);
}
.work-panel__body { margin-top: calc(var(--space) * 3); }
.work-panel__body .hud { color: var(--color-cold); margin-bottom: 4px; }
.work-panel__body h3 { font-size: 20px; }
.work-panel__body p:not(.hud) { font-size: 14px; color: var(--color-muted); margin-top: 6px; max-width: 36em; }

@media (max-width: 767px) {
  .hscroll__track {
    flex-direction: column; width: auto;
    min-height: 0; align-items: stretch;
    padding-bottom: var(--section-pad);
  }
  .work-panel { width: 100%; }
}

/* 幕4: Approach */
.approach__statement {
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 500;
  line-height: 2.2;
  margin-bottom: calc(var(--space) * 7);
  max-width: min(30em, 100%);
  line-break: strict;
}
/* 蛍光マーカー(IntersectionObserverで.is-marked付与) */
.marker {
  border-radius: 4px; padding: 0 0.14em;
  transition: background-size 0.9s var(--ease-out-expo) 0.25s;
  background-repeat: no-repeat;
  background-position: left 62%;
  background-size: 0% 58%;
}
.marker--cold { background-image: linear-gradient(rgba(175, 200, 255, 0.26), rgba(175, 200, 255, 0.26)); }
.marker--warm { background-image: linear-gradient(rgba(255, 180, 84, 0.28), rgba(255, 180, 84, 0.28)); }
.marker.is-marked { background-size: 100% 58%; }

.twolight { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lit-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 14px;
  padding: 34px 30px;
}
.lit-card--cold { box-shadow: inset 3px 0 24px -12px rgba(175, 200, 255, 0.7); border-left: 1px solid rgba(175, 200, 255, 0.45); }
.lit-card--warm { box-shadow: inset -3px 0 24px -12px rgba(255, 180, 84, 0.65); border-right: 1px solid rgba(255, 180, 84, 0.45); }
.lit-card h3 { font-size: 17px; margin-bottom: 8px; }
.lit-card--cold h3 { color: var(--color-cold); }
.lit-card--warm h3 { color: var(--color-warm); }
.lit-card p { font-size: 13.5px; color: var(--color-muted); }
@media (max-width: 720px) { .twolight { grid-template-columns: 1fr; } }

/* スクロールリビール基盤(starter継承。削除禁止) */
.js-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}
.js-reveal.is-inview { opacity: 1; transform: none; }
.js-reveal[data-delay="1"] { transition-delay: 0.1s; }
.js-reveal[data-delay="2"] { transition-delay: 0.2s; }
.js-reveal[data-delay="3"] { transition-delay: 0.3s; }

/* ---------- 6. モーション停止(SKILL.mdのポリシー実装。削除禁止) ---------- */
.motion-stop {
  display: none;
  position: fixed; right: 16px; bottom: 16px; z-index: var(--z-modal);
  padding: 10px 16px; font-size: 12px;
  color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: 999px; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .motion-stop { display: block; }     /* reduced-motion環境にだけボタンを出す */
}
html.is-motion-off .js-reveal,
html.is-motion-off *[class] {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
}
html.is-motion-off .js-reveal { opacity: 1; transform: none; }
/* 停止時: sticky/演出を解いて全内容を静的表示(レイアウト破綻防止) */
html.is-motion-off .loader { display: none; }
html.is-motion-off .hero__hud, html.is-motion-off .hero__en, html.is-motion-off .hero__ja,
html.is-motion-off .hero__lead, html.is-motion-off .hero__cue { opacity: 1; }
html.is-motion-off .assemble { height: auto; }
html.is-motion-off .assemble__sticky { position: static; height: auto; overflow: visible; padding: var(--section-pad) 24px; }
html.is-motion-off .assemble__hud { position: static; max-width: var(--container-narrow); margin: 0 auto calc(var(--space) * 5); }
html.is-motion-off .assemble__steps { min-height: 0; }
html.is-motion-off .assemble__step { position: static; opacity: 1; transform: none; margin-bottom: calc(var(--space) * 4); }
html.is-motion-off .assemble__frame { position: static; transform: none; opacity: 1; margin: 0 auto; }
html.is-motion-off .marker { background-size: 100% 58%; }
html.is-motion-off .cursor-glow { display: none; }
html.is-motion-off .gl-canvas { opacity: 0.15 !important; } /* 背景は塵程度に */
html.is-motion-off .hscroll__track {
  flex-direction: column; width: auto;
  align-items: stretch; min-height: 0;
  transform: none !important;
  padding-bottom: var(--section-pad);
}
html.is-motion-off .work-panel { width: min(680px, 100%); }
