/*
 * 平山ゆうや 様 ホームページ（A案：名前が主役・ゴシック）
 * 色はリーフレット「平山新聞」から拾った値（docs/design.md）
 */
:root {
  --enji: #941d3f;
  --green: #62b526;
  --green-deep: #2b7734;
  --red: #e60012;
  --orange: #ef7d00;
  --ink: #1a100d;
  --paper: #ffffff;
  --tint-green: #e9f3e0;
  --tint-yellow: #fffde4;
  --tint-pink: #fef1e9;
  --marker: #fbd5d2;
  --line: #d9d2c4;
  --font-head: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", Meiryo, sans-serif;
  --font-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", Meiryo, sans-serif;
  --font-latin: "Shippori Mincho B1", Georgia, "Hiragino Mincho ProN", serif;
  --gutter: clamp(20px, 5vw, 72px);
  --block: clamp(56px, 9vw, 128px);
  --measure: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-weight: 500; font-size: 17px;
  line-height: 1.9; line-break: strict; overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p, h1, h2, h3, ul, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--green-deep); outline-offset: 3px; }
mark { background: linear-gradient(transparent 62%, var(--marker) 62%); color: inherit; }
strong { font-weight: 700; }
section[id] { scroll-margin-top: 16px; }

/* ---- 上の帯 ---- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px;
  padding: 16px var(--gutter);
}
.top__name { font-family: var(--font-head); font-weight: 900; font-size: 20px; color: var(--enji); text-decoration: none; letter-spacing: .04em; }
.top__nav { display: flex; gap: clamp(16px, 2.4vw, 28px); font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.top__nav a { text-decoration: none; padding: 10px 0; border-bottom: 2px solid transparent; }
.top__nav a:hover { border-bottom-color: var(--enji); }

/* ---- 最初の画面 ---- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(8px, 2vw, 24px) var(--gutter) 0;
  display: grid; grid-template-columns: 1fr; align-items: end;
}
.hero__text { position: relative; z-index: 2; padding-bottom: clamp(24px, 5vw, 64px); }
.hero__lead {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(18px, 2.3vw, 30px); line-height: 1.5; letter-spacing: .02em;
}
.hero__lead b { font-weight: 900; font-size: 1.5em; color: var(--enji); margin-right: .04em; }
.hero__name {
  margin-top: clamp(6px, 1vw, 12px); color: var(--enji);
  font-family: var(--font-head); font-weight: 900; line-height: .98; letter-spacing: -.01em;
  font-size: clamp(88px, 24vw, 236px); font-feature-settings: "palt" 1;
}
.hero__name .line { display: block; }
.hero__name .ch { display: inline-block; }
.hero__name .kana { letter-spacing: -.04em; }
.hero__way {
  position: relative; display: inline-block; margin-top: clamp(18px, 2.4vw, 32px);
  padding: .28em 1.1em .34em; color: #fff;
  font-family: var(--font-head); font-weight: 900; font-size: clamp(24px, 3.6vw, 50px); line-height: 1.2; letter-spacing: .06em;
}
.hero__way svg { position: absolute; inset: -8% -3%; width: 106%; height: 116%; z-index: -1; overflow: visible; }
.hero__photo {
  position: relative; z-index: 1; justify-self: center; width: min(78vw, 360px); margin-top: -8px;
  mix-blend-mode: multiply; /* 写真の白い背景を、下の色になじませる（写真そのものには手を加えていない） */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}
.hero__photo img { width: 100%; }
.hero__ring {
  position: absolute; z-index: 0; right: -18vw; bottom: -30vw; width: 92vw; aspect-ratio: 1; border-radius: 50%;
  background: var(--tint-green);
}
@media (min-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); column-gap: 2vw; min-height: min(86vh, 860px); }
  .hero__name { font-size: clamp(120px, 15.5vw, 236px); }
  .hero__photo { justify-self: end; width: min(34vw, 500px); margin-top: 0; }
  .hero__ring { right: -6vw; bottom: -22vw; width: 52vw; }
}

/* ---- Think Local ---- */
.local { background: var(--tint-green); padding: clamp(48px, 8vw, 112px) var(--gutter); }
.local__inner { max-width: 1040px; margin: 0 auto; }
.local__mark { position: relative; width: fit-content; }
.local__mark span {
  font-family: var(--font-latin); font-weight: 500; color: var(--green);
  font-size: clamp(38px, 11.2vw, 132px); line-height: 1; letter-spacing: .09em; white-space: nowrap;
}
.local__mark svg { position: absolute; left: 4%; right: -6%; bottom: -.22em; width: 104%; height: clamp(16px, 2.6vw, 34px); overflow: visible; }
.local__body { display: grid; gap: clamp(20px, 4vw, 64px); margin-top: clamp(32px, 5vw, 60px); }
.local__call { font-family: var(--font-head); font-weight: 900; font-size: clamp(17px, 2vw, 24px); line-height: 1.6; }
.local__call span, .local__say span { display: block; }
.local__say { font-family: var(--font-head); font-weight: 900; font-size: clamp(24px, 3.4vw, 42px); line-height: 1.6; letter-spacing: .02em; }
@media (min-width: 860px) { .local__body { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; } }

/* ---- 文のまとまり（共通） ---- */
.block { padding: var(--block) var(--gutter); }
.block--yellow { background: var(--tint-yellow); }
.block--green { background: var(--tint-green); }
.block--pink { background: var(--tint-pink); }
.block__inner { max-width: 1040px; margin: 0 auto; }
.prose { max-width: var(--measure); }
.prose p { text-indent: 1em; }
.prose p + p { margin-top: 1.4em; }
.title {
  font-family: var(--font-head); font-weight: 900; color: var(--enji);
  font-size: clamp(26px, 3.4vw, 40px); line-height: 1.5; margin-bottom: 1.2em;
}
.title span { display: block; }
/* 見出しと大きい字は、言葉の切れ目で折り返し、行の長さをそろえる */
.title, .why__lead, .why__head, .belief__close, .decide__strong, .decide__close, .local__say, .hero__lead { text-wrap: balance; }
@supports (word-break: auto-phrase) {
  .title, .why__lead, .why__head, .belief__close, .decide__strong, .decide__close { word-break: auto-phrase; }
}
.title--step span + span { padding-left: 2.4em; }
.shot { justify-self: center; }
.shot img { border-radius: 4px; }

/* ---- ごあいさつ ---- */
.greet .block__inner { max-width: var(--measure); }

/* ---- 理由（2つ） ---- */
.why__lead { font-family: var(--font-head); font-weight: 900; font-size: clamp(22px, 2.9vw, 34px); line-height: 1.65; max-width: 22em; }
.why__item { margin-top: clamp(48px, 7vw, 96px); display: grid; gap: clamp(24px, 4vw, 56px); align-items: start; }
.prose .why__head { text-indent: 0; }
.why__head { font-family: var(--font-head); font-weight: 700; font-size: clamp(21px, 2.5vw, 30px); line-height: 1.7; margin-bottom: 1.1em; }
.why__head strong { font-weight: 900; color: var(--enji); }
.why__no {
  display: inline-block; text-indent: 0; margin-right: .2em; padding: 0 .75em; border-radius: 999px;
  background: var(--orange); color: #fff; font-weight: 900; line-height: 1.55; white-space: nowrap;
}
@media (min-width: 860px) {
  .why__item { grid-template-columns: minmax(0, 1fr) minmax(0, 385px); column-gap: clamp(40px, 6vw, 88px); }
  .why__item .shot { position: sticky; top: 24px; margin-top: 12px; }
}

/* ---- 政治理念 ---- */
.belief__grid { display: grid; gap: clamp(24px, 4vw, 56px); align-items: start; }
.belief__close { margin-top: 2em; font-family: var(--font-head); font-weight: 900; font-size: clamp(20px, 2.4vw, 28px); line-height: 1.7; }
.belief__close span { display: block; }
.belief__close span + span { padding-left: 4em; }
@media (min-width: 860px) { .belief__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 331px); column-gap: clamp(40px, 6vw, 88px); } .belief__grid .shot { margin-top: 12px; } }

/* ---- 決断 ---- */
.decide__grid { display: grid; gap: clamp(24px, 4vw, 56px); align-items: start; }
.decide__face {
  justify-self: center; width: min(78vw, 400px); mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 90%, transparent);
  mask-composite: intersect;
}
.paint { display: block; width: 100%; height: auto; }
.paint__stroke { stroke-dasharray: 1 1.5; stroke-dashoffset: 0; }
.decide .prose p { text-indent: 0; }
.decide__strong--turn { color: var(--enji); }
.decide__strong { font-family: var(--font-head); font-weight: 900; font-size: clamp(21px, 2.5vw, 30px); line-height: 1.6; margin-top: 1.6em; }
.decide__list { margin-top: 1.2em; display: grid; gap: .5em; }
.decide__list li { width: fit-content; background: linear-gradient(transparent 92%, #f69e9f 92%); padding-bottom: .1em; }
.decide__list + p { margin-top: 1.4em; }
.decide__close { margin-top: 2em; font-family: var(--font-head); font-weight: 900; font-size: clamp(22px, 2.7vw, 32px); line-height: 1.6; }
.decide__close span { display: block; }
@media (min-width: 860px) {
  .decide__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); column-gap: clamp(40px, 6vw, 88px); }
  .decide__face { position: sticky; top: 24px; }
}

/* ---- 自己紹介（略歴） ---- */
.profile__grid { display: grid; gap: clamp(28px, 5vw, 72px); }
.profile__title { font-family: var(--font-head); font-weight: 900; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.4; display: flex; align-items: baseline; gap: .3em; }
.profile__title::before { content: ""; width: .7em; height: .7em; background: var(--ink); flex: none; align-self: center; }
.profile__title small { font-size: .55em; font-weight: 700; }
.profile__facts { margin-top: 1.2em; font-family: var(--font-head); font-weight: 700; line-height: 1.9; }
.history { position: relative; padding-left: 30px; }
.history::before, .history::after { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 3px; border-radius: 3px; }
.history::before { background: var(--line); }
.history::after { background: var(--enji); transform-origin: top; transform: scaleY(var(--p, 1)); }
.history__item { position: relative; padding: clamp(20px, 3vw, 32px) 0; border-top: 1px solid var(--line); }
.history__item::before {
  content: ""; position: absolute; z-index: 1; left: -31px; top: calc(clamp(20px, 3vw, 32px) + .5em);
  width: 17px; height: 17px; border-radius: 50%; border: 3px solid var(--paper); background: var(--enji);
}
.history__item--now::before { background: var(--green-deep); }
.history__item:last-child { border-bottom: 1px solid var(--line); }
.history__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1em 1em; font-family: var(--font-head); line-height: 1.5; margin-bottom: .8em; }
.history__year { font-weight: 700; font-size: 16px; white-space: nowrap; }
.history__what { font-weight: 900; font-size: clamp(21px, 2.4vw, 27px); color: var(--enji); letter-spacing: .04em; }
.history__item--now .history__what { color: var(--green-deep); }
.history__item p + p { margin-top: .9em; }
.works { margin-top: 1.4em; }
.works__title { font-family: var(--font-head); font-weight: 900; }
.works li { font-family: var(--font-head); font-weight: 700; line-height: 1.7; padding-left: 1.2em; text-indent: -1.2em; margin-top: .5em; }
.works li span { display: block; font-weight: 500; text-indent: 0; }
.works__link { display: inline-block; margin-top: .4em; text-indent: 0; font-family: var(--font-body); font-weight: 500; font-size: 15px; line-height: 1.6; color: var(--green-deep); }
@media (min-width: 860px) {
  .profile__grid { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); align-items: start; }
  .profile__head { position: sticky; top: 24px; }
}

/* ---- いちばん下 ---- */
.foot { background: var(--enji); color: #fff; padding: clamp(40px, 6vw, 72px) var(--gutter); }
.foot__inner { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; }
.foot__name { font-family: var(--font-head); font-weight: 900; font-size: clamp(28px, 4vw, 44px); line-height: 1.3; letter-spacing: .02em; }
.foot__pub { font-family: var(--font-head); font-weight: 700; font-size: 15px; }

/* ==== 動き（2026-10-09）====
 * 意味のある所にだけ。画面に入るたびに動く（上から来ても、下から戻っても）。端末の「動きを減らす」設定のときは、動かさずに出す。
 * .js は motion.js が付ける印。motion.js が読めなかったときは付かないので、文は全部そのまま読める。
 */
/* すき間を線より長くしておく（同じ長さだと、引く前に、線の端に小さな点が出ることがある） */
.brush path { stroke-dasharray: 1 1.5; stroke-dashoffset: 0; }
.intro { display: none; }
:root { --hold: 0s; } /* 開いたときの画面が上がるまで、最初の画面の動きを待たせる時間 */

@media (prefers-reduced-motion: no-preference) {
  /* 0. 開いたときの画面（約2秒）：「Think Local」が現れ、赤い筆の線が引かれる → 白い紙、続いてえんじの紙が上へめくれる。
        CSS だけで動き、終わると自分で消える（押す・送るの邪魔はしない） */
  :root { --hold: 1.45s; }
  html.is-intro-done { --hold: 0s; } /* 2回目から（上へ戻ったとき）は、待たずに動かす。motion.js が付ける */
  .intro { display: block; position: fixed; inset: 0; z-index: 100; pointer-events: none; animation: intro-gone 0s linear 2.35s forwards; }
  .intro__sheet { position: absolute; inset: 0; }
  .intro__sheet--color { background: var(--enji); animation: sheet-up .7s cubic-bezier(.7, 0, .2, 1) 1.55s forwards; }
  .intro__sheet--paper { background: var(--paper); display: grid; place-items: center; animation: sheet-up .7s cubic-bezier(.7, 0, .2, 1) 1.4s forwards; }
  .intro__mark { position: relative; width: fit-content; }
  .intro__mark span {
    font-family: var(--font-latin); font-weight: 500; color: var(--green);
    font-size: clamp(40px, 11.6vw, 120px); line-height: 1; letter-spacing: .09em; white-space: nowrap;
    animation: mark-in .85s cubic-bezier(.5, .1, .2, 1) .2s backwards;
  }
  .intro__mark svg { position: absolute; left: 4%; bottom: -.22em; width: 104%; height: clamp(16px, 2.6vw, 30px); overflow: visible; }
  .intro__mark .brush path { animation: draw .6s cubic-bezier(.6, .1, .2, 1) .75s backwards; }
  @keyframes mark-in { from { clip-path: inset(-10% 100% -30% 0); } to { clip-path: inset(-10% -5% -30% 0); } }
  @keyframes sheet-up { to { transform: translateY(-101%); } }
  @keyframes intro-gone { to { visibility: hidden; } }

  /* 1. 最初の画面：開いたときの画面が上がるのに合わせて（名前 → 筆の帯 → 写真）。CSS だけで動く */
  .hero__lead { animation: rise .6s cubic-bezier(.2, .7, .2, 1) var(--hold) backwards; }
  .hero__name .line { overflow: hidden; padding-block: .08em; margin-block: -.08em; }
  .hero__name .ch { animation: ch-up .7s cubic-bezier(.2, .8, .2, 1) calc(var(--hold) + .15s + var(--i) * .07s) backwards; }
  .hero__way .brush path { animation: draw .7s cubic-bezier(.6, .1, .2, 1) calc(var(--hold) + .8s) backwards; }
  .hero__way-text { animation: fade .4s ease calc(var(--hold) + 1.1s) backwards; }
  .hero__photo { animation: photo-in .9s cubic-bezier(.2, .7, .2, 1) calc(var(--hold) + .45s) backwards; }
  @keyframes ch-up { from { transform: translateY(112%); } to { transform: none; } }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes photo-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

  /* 1の続き：いちど画面から出たら動きを止めておき、戻ってきたら最初からやり直す（motion.js が is-out を付け外しする） */
  .js .hero__text.is-out .hero__lead,
  .js .hero__text.is-out .hero__name .ch,
  .js .hero__text.is-out .hero__way .brush path,
  .js .hero__text.is-out .hero__way-text,
  .js .hero__photo.is-out { animation: none; }

  /* 2. Think Local：画面に入ったら、英字が左から現れ、赤い筆の線が引かれる */
  .js .local__mark span { clip-path: inset(-10% 100% -30% 0); transition: clip-path 1s cubic-bezier(.5, .1, .2, 1); }
  .js .local__mark.is-inview span { clip-path: inset(-10% -5% -30% 0); }
  .js .local__mark .brush path { stroke-dashoffset: 1; transition: stroke-dashoffset .8s cubic-bezier(.6, .1, .2, 1) .75s; }
  .js .local__mark.is-inview .brush path { stroke-dashoffset: 0; }

  /* 4. マーカー：その文が画面に入ったら、ペンで引くように左から */
  .js mark { background-repeat: no-repeat; background-size: 0% 100%; transition: background-size .8s cubic-bezier(.4, .1, .2, 1) .15s; }
  .js mark.is-inview { background-size: 100% 100%; }

  /* 8. 決断：文が1つずつ出る。「挑戦する道を選びました。」は、えんじ色に変わりながら出る。4つの下線は順に */
  .js .decide .prose > * { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
  .js .decide .prose > .is-inview { opacity: 1; transform: none; }
  .js .decide .prose > .decide__strong--turn {
    color: var(--ink); transform: translateY(10px) scale(.96); transform-origin: left center;
    transition: opacity .7s ease, transform .8s cubic-bezier(.2, .8, .2, 1), color .9s ease .35s;
  }
  .js .decide .prose > .decide__strong--turn.is-inview { color: var(--enji); transform: none; }
  .js .decide__list li { background-repeat: no-repeat; background-size: 0% 100%; transition: background-size .6s cubic-bezier(.4, .1, .2, 1) .3s; }
  .js .decide__list.is-inview li { background-size: 100% 100%; }
  .js .decide__list.is-inview li:nth-child(2) { transition-delay: .55s; }
  .js .decide__list.is-inview li:nth-child(3) { transition-delay: .8s; }
  .js .decide__list.is-inview li:nth-child(4) { transition-delay: 1.05s; }

  /* 9. 似顔絵：画面に入ったら、薄い下書き → 筆が往復して色が付く。進み具合は motion.js が入れる */
  .js [data-paint] .paint__sketch { opacity: 0; }
  .js [data-paint] .paint__stroke { stroke-dashoffset: 1; }
  .js [data-paint] .paint__wash { opacity: 0; }

  /* 10. 年表：線（道）が下へ伸び、項目ごとに点が灯る。伸びた長さは motion.js が --p に入れる */
  .js .history::after { transition: transform .2s linear; }
  .js .history__item::before { background: var(--line); transform: scale(.75); transition: background-color .3s ease, transform .45s cubic-bezier(.3, 1.7, .5, 1); }
  .js .history__item.is-on::before { background: var(--enji); transform: none; }
  .js .history__item--now.is-on::before { background: var(--green-deep); }
}
@media print { .js .decide .prose > * { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
