/* フジの紹介ページ（Claude Haiku 5.5 の版）
 * 色は :root の土台だけを見れば分かる。地は陽だまりの紙、最初の一枚だけ暗い茶（歯車の絵の地と揃える）。
 * 外の CDN・フォント・スクリプトは使わない（字は手元の日本語フォント）。
 */

:root {
  --paper: #f6efe5;
  --paper-2: #efe4d3;
  --card: #fbf7f0;
  --ink: #2e2118;
  --ink-2: #6e5a4c;
  --red: #c0453a;
  --red-soft: #f1d3c9;
  --brass: #b98443;
  --dark: #22170f;
  --dark-2: #2d2016;
  --line: rgba(46, 33, 24, 0.14);
  --gutter: clamp(20px, 6vw, 96px);
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Yu Mincho Demibold", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }

/* 紙のざらつき（インラインの SVG のノイズ・ごく薄く） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 読み進み（上の赤い線） */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30;
}
.progress span {
  display: block; height: 100%; background: var(--red);
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

/* 上の名前（最初の一枚の上では紙の色へ） */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 25;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--gutter);
  /* 紙の色の字を差の合成で重ねる＝紙の上では暗く、暗い所では明るく出る（どの章の上でも読める） */
  color: #f6efe5;
  mix-blend-mode: difference;
  font-size: 0.85rem;
}
.topbar__name { font-family: var(--serif); font-size: 1.05rem; text-decoration: none; letter-spacing: 0.08em; }
.topbar__home { text-decoration: none; opacity: 0.7; }

.chapter {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em;
  color: var(--red); margin-bottom: 1.1rem;
}

mark {
  color: inherit;
  background: linear-gradient(transparent 58%, rgba(192, 69, 58, 0.22) 58%);
  padding: 0 0.12em;
}
.em { color: var(--red); font-weight: 700; }

/* 段ごとに出す字・かたまり（JS が is-in を付ける） */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- 00 ひらく */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--dark);
  color: #f6efe5;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 72% 50%;
}
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(34, 23, 15, 0.94) 0%, rgba(34, 23, 15, 0.6) 36%, rgba(34, 23, 15, 0) 62%),
    linear-gradient(0deg, rgba(34, 23, 15, 0.9) 0%, rgba(34, 23, 15, 0) 28%);
}
.hero__copy {
  position: relative; z-index: 2;
  padding: 0 var(--gutter);
  max-width: 44rem;
}
.eyebrow {
  font-size: 0.85rem; letter-spacing: 0.12em; color: #e9c9b8; margin-bottom: 1.4rem;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.3rem, 5.4vw, 5.3rem);
  line-height: 1.34;
  letter-spacing: 0.04em;
}
.hero__title .line { display: block; }
.hero__title .pause { margin-top: 0.55em; }
.hero__title .mark {
  color: #fff;
  white-space: nowrap;
  background: linear-gradient(transparent 60%, var(--red) 60%, var(--red) 92%, transparent 92%) no-repeat 0 0 / 0% 100%;
  padding: 0 0.04em;
  animation: underline 0.9s ease-out 2.6s forwards;
}
.hero__sub {
  margin-top: 1.8rem;
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
  color: #e6d6c8;
  max-width: 28em;
}
.cue {
  position: absolute; left: var(--gutter); bottom: 26px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.78rem; letter-spacing: 0.14em; text-decoration: none; color: #e6d6c8; opacity: 0.8;
}
.cue__line {
  display: block; width: 1px; height: 38px; background: rgba(246, 239, 229, 0.35); position: relative; overflow: hidden;
}
.cue__line::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
  background: #f6efe5; animation: drip 2.2s ease-in-out infinite;
}

/* 打ち出される字（拍ごとに1つずつ） */
.beat {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--b, 0) * 0.42s + 0.15s);
}
.hero__title .line.beat { display: block; }

@keyframes rise {
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes underline {
  to { background-size: 100% 100%; }
}
@keyframes drip {
  0% { top: -40%; }
  100% { top: 100%; }
}

/* 歯車の絵（動画）の上の暗さは、横の幅だけ（縦に細い時は下へ回す） */
@media (max-width: 860px) {
  .hero { display: block; min-height: 0; }
  .hero__video {
    position: relative; height: auto; aspect-ratio: 16 / 9;
    object-position: 60% 50%;
  }
  .hero__shade {
    position: absolute; inset: 0 0 auto 0; height: 56.25vw;
    background: linear-gradient(180deg, rgba(34, 23, 15, 0) 40%, rgba(34, 23, 15, 1) 100%);
  }
  .hero__copy { padding: 26px var(--gutter) 84px; max-width: none; }
  .hero__title { font-size: clamp(2rem, 9vw, 3.2rem); }
  .cue { display: none; }
}

/* ---------------------------------------------------------------- スクロールで進む章（stage） */
.stage { position: relative; height: 320vh; }
.stage__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: clamp(28px, 4vw, 72px);
  padding: 0 var(--gutter);
}
.stage__media canvas {
  width: 100%; height: auto; aspect-ratio: 16 / 9;
  border-radius: 6px; background: #e8dccb;
  box-shadow: 0 30px 60px -36px rgba(46, 33, 24, 0.5);
}
.caption { font-size: 0.78rem; color: var(--ink-2); margin-top: 0.7rem; }
.beats { display: grid; }
.beat-line {
  grid-area: 1 / 1;
  text-wrap: balance;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.7vw, 2.35rem);
  line-height: 1.6;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.beat-line.is-on { opacity: 1; transform: none; }
.beat-line:not(.is-on) { pointer-events: none; }
.stage__text .chapter { margin-bottom: 1.2rem; }

/* ---------------------------------------------------------------- 02 図面と現場 */
.field { position: relative; height: 230vh; background: var(--paper); }
.field__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
}
.field__grid {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(28px, 5vw, 80px); align-items: center;
}
.blueprint { position: relative; }
.blueprint__svg { width: 100%; height: auto; max-width: 460px; margin: 0 auto; }
.blueprint__svg .grid path { stroke: rgba(46, 33, 24, 0.09); stroke-width: 1; fill: none; }
.blueprint__svg .dims path { stroke: var(--ink-2); stroke-width: 1; fill: none; stroke-dasharray: 3 4; }
.blueprint__svg .outline {
  fill: transparent; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 1;
}
.blueprint__svg .bore { fill: transparent; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; }
.blueprint__svg .bore-mark { fill: var(--red); }
.blueprint__svg .body { fill: url(#brassFill); fill-opacity: 0; }
.blueprint__cap {
  text-align: center; margin-top: 0.4rem;
  font-size: 0.82rem; letter-spacing: 0.12em; color: var(--ink-2);
}
.blueprint__cap .now { color: var(--red); font-weight: 700; }
.field__text .big {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.5vw, 3.2rem);
  line-height: 1.6;
  font-weight: 600;
}
.field__text .lead { margin-top: 1.6rem; color: var(--ink-2); font-size: 1.05rem; }

/* ---------------------------------------------------------------- 03 転機（歯車がかみ合う） */
.turn { position: relative; height: 300vh; background: var(--paper-2); }
.turn__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; grid-template-columns: 1fr; align-content: center; justify-items: center; gap: 18px;
  padding: 0 var(--gutter);
}
.turn__sticky .chapter { justify-self: start; width: min(1000px, 100%); margin-bottom: 0; }
.train { width: min(1000px, 100%); height: auto; }
.train .gear-body { fill: url(#brassFill); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.train .gear-hub { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.4; }
.train .gear-mark { fill: var(--red); }
.turn__text { width: min(1000px, 100%); }
.turn__text .beat-line { font-size: clamp(1.3rem, 2.5vw, 2.15rem); }

/* ---------------------------------------------------------------- 04 道のり */
.route { padding: 20vh var(--gutter) 16vh; max-width: 880px; margin: 0 auto; }
.route__list { position: relative; padding-left: 44px; }
.route__list::before, .route__list::after {
  content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 2px;
}
.route__list::before { background: var(--line); }
.route__list::after {
  background: var(--red);
  transform-origin: 50% 0; transform: scaleY(var(--rp, 0));
}
.node { position: relative; padding: 0 0 56px; }
.node__dot {
  position: absolute; left: -44px; top: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink);
}
.node__year { font-size: 0.78rem; letter-spacing: 0.14em; color: var(--ink-2); }
.node__text { font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.6; }
.route__result {
  margin-top: 8px; font-family: var(--serif);
  font-size: clamp(1.45rem, 3vw, 2.4rem); line-height: 1.6;
}

/* ---------------------------------------------------------------- 05 作っているもの */
.apps { padding: 14vh var(--gutter) 16vh; background: var(--paper); }
.section-title {
  font-family: var(--serif); font-size: clamp(1.6rem, 3.2vw, 2.7rem); line-height: 1.5;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.apps__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 44px); align-items: start; }
.app { display: flex; flex-direction: column; gap: 22px; }
.phone {
  width: min(250px, 84%); aspect-ratio: 9 / 19.5; margin: 0 auto;
  padding: 9px; border-radius: 38px; background: #1d1410;
  box-shadow: 0 34px 60px -30px rgba(46, 33, 24, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; border-radius: 30px; }
.cards { padding: 0 6%; }
.cards img {
  width: 100%; height: auto; border-radius: 6px;
  transform: rotate(-1.6deg);
  box-shadow: 0 26px 50px -30px rgba(46, 33, 24, 0.5);
}
.soon {
  width: min(250px, 84%); aspect-ratio: 9 / 13; margin: 0 auto;
  border: 2px dashed rgba(46, 33, 24, 0.3); border-radius: 22px;
  display: grid; place-items: center; color: rgba(46, 33, 24, 0.35);
  font-family: var(--serif); font-size: 4rem;
}
.app__name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.app__tag { color: var(--red); font-weight: 700; margin-top: 0.2rem; }
.app__text { color: var(--ink-2); margin-top: 0.6rem; font-size: 0.95rem; }
.app__link { display: inline-block; margin-top: 0.8rem; font-size: 0.9rem; color: var(--ink); text-underline-offset: 4px; }

/* ---------------------------------------------------------------- 06 判断 */
.craft { padding: 14vh var(--gutter) 16vh; background: var(--paper-2); }
.craft__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 8px; }
.card {
  position: relative; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 32px 26px 30px;
}
.card__no { position: absolute; top: 18px; right: 22px; font-family: var(--serif); color: rgba(46, 33, 24, 0.3); font-size: 0.95rem; }
.card__icon { width: 56px; height: 56px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; margin-bottom: 18px; }
.card__icon .accent { stroke: var(--red); stroke-width: 2.4; }
.card h3 { font-family: var(--serif); font-size: 1.22rem; line-height: 1.6; font-weight: 600; margin-bottom: 0.6rem; }
.card p { font-size: 0.95rem; color: var(--ink-2); }

/* ---------------------------------------------------------------- 07 なぜ作るか */
.why { padding: 18vh var(--gutter) 14vh; background: var(--paper); }
.why__quote {
  text-wrap: balance;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.9vw, 3.3rem);
  line-height: 1.75;
  font-weight: 600;
  max-width: 24em;
}
.why__quote .ch { transition: opacity 0.35s ease, color 0.35s ease; opacity: 0.12; }
.why__quote .ch.lit { opacity: 1; }
.why__quote .q-red { color: var(--red); }
.pipeline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin-top: clamp(36px, 6vw, 64px);
  font-size: 0.95rem;
}
.pipeline span {
  padding: 9px 18px; border: 1px solid var(--ink); border-radius: 999px; background: var(--card);
}
.pipeline span.em { border-color: var(--red); }
.pipeline i { font-style: normal; color: var(--ink-2); }
.why__note { margin-top: 1.2rem; color: var(--ink-2); font-size: 0.95rem; }

/* ---------------------------------------------------------------- 08 ここから */
.end {
  position: relative; overflow: hidden;
  background: var(--dark); color: #f6efe5;
  padding: 18vh var(--gutter) 14vh; text-align: center;
}
.end__gear { width: min(300px, 70vw); margin: 0 auto 2.4rem; opacity: 0.95; }
.end__gear canvas { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.end__title { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.4; font-weight: 600; }
.end .em { color: #ff9a86; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; margin-top: 3rem; }
.links a { text-decoration: none; border-bottom: 1px solid rgba(246, 239, 229, 0.35); padding-bottom: 3px; font-size: 0.95rem; }
.links a:hover { border-color: #ff9a86; }

.foot {
  background: var(--dark); color: #b9a593;
  text-align: center; padding: 8px var(--gutter) 56px;
  font-size: 0.85rem;
}
.foot img { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 10px; }
.foot a { color: #e9d7c6; }
.foot__small { margin-top: 0.5rem; font-size: 0.78rem; opacity: 0.8; }

/* ---------------------------------------------------------------- 幅ごとの組み */
@media (max-width: 1000px) {
  .apps__grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
  .craft__list { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
}

@media (max-width: 760px) {
  .stage { height: 290vh; }
  .stage__sticky {
    grid-template-columns: 1fr; align-content: center; gap: 22px; padding: 64px var(--gutter) 24px;
  }
  .stage__media canvas { border-radius: 4px; }
  .beat-line { font-size: 1.3rem; line-height: 1.7; }
  .field { height: 200vh; }
  .field__grid { grid-template-columns: 1fr; gap: 22px; }
  .blueprint__svg { max-width: 280px; }
  .field__text .big { font-size: 1.5rem; }
  .turn__sticky { padding-top: 64px; gap: 14px; }
  .turn__sticky .chapter { margin-bottom: 0; }
  .turn__text .beat-line { font-size: 1.2rem; line-height: 1.7; }
  .route { padding-top: 14vh; }
  .apps, .craft, .why { padding-top: 12vh; padding-bottom: 12vh; }
  .end__gear { width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .beat { opacity: 1; transform: none; filter: none; }
  .hero__title .mark { background-size: 100% 100%; }
  .cue__line::after { animation: none; }
}
