/* =========================================================
   wakoyu 公式サイト（β版）
   スマホ（375px）を基準に作り、広い画面では本文幅を抑える
   ========================================================= */

/* ---------- 色・文字の基本値 ---------- */
:root {
  /* 色 */
  --indigo: #2B2F5C;        /* 夜の藍：Hero の下部、Contact、フッター */
  --indigo-deep: #1B1D3A;   /* 藍の上に置く濃い文字 */
  --mist: #EEEAF6;          /* 霞の薄紫：本文の地 */
  --mist-soft: #F8F6FC;     /* 強調する面 */
  --sea: #7CC7C2;           /* 波の青緑：藍の上の主ボタン */
  --sea-deep: #2E6E6F;      /* 波の青緑（濃）：明るい地の上のリンク・ラベル */
  --lantern: #F2C46D;       /* 灯りの金：ごく少量 */
  --ink: #22233A;           /* 本文の文字 */
  --ink-muted: #5B5A85;     /* 補足の文字 */
  --line: #D6D0E6;          /* 区切り線 */
  --on-dark: #F4F1FA;       /* 藍の上の文字 */
  --on-dark-muted: #C9C4E0; /* 藍の上の補足の文字 */
  --poem-gold: #F3D157;     /* Hero の詩的コピー */
  --cream: #FBF5E6;         /* Hero の説明文・名前（淡いクリーム） */
  --cream-muted: #E2D9C3;   /* Hero の英文 */

  /* Hero の写真の切り抜き位置（横 縦）。スマホと PC で別々に調整する */
  --hero-photo-pos: 50% 100%;

  /* About の帯の高さと切り抜き位置 */
  --band-height: 200px;
  --band-photo-pos: 50% 32%;

  /* 空のグラデーション（夕暮れから夜へ） */
  --sky: linear-gradient(180deg, #CDB9DB 0%, #8C82BF 38%, #4B4D8E 72%, var(--indigo) 100%);

  /* 書体 */
  --font-poem: "Klee One", "Hiragino Mincho ProN", serif;
  --font-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;

  /* 文字の大きさ */
  --fs-small: 0.875rem;   /* 14px */
  --fs-body: 1rem;        /* 16px */
  --fs-lead: 1.0625rem;   /* 17px */
  --fs-h3: 1.25rem;       /* 20px */
  --fs-h2: 2rem;          /* 32px */
  --fs-poem: 1.5rem;      /* 24px */

  /* 余白 */
  --gutter: 20px;
  --space-s: 12px;
  --space-m: 24px;
  --space-l: 48px;
  --space-xl: 80px;

  /* 本文の幅 */
  --measure: 36rem;
}

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

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.9;
  letter-spacing: 0.02em;
  line-break: strict;
  word-break: auto-phrase;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, dl, dd, ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--sea-deep);
  text-underline-offset: 0.2em;
}

/* キーボード操作時の枠 */
:focus-visible {
  outline: 3px solid var(--sea-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.hero :focus-visible,
.section--contact :focus-visible {
  outline-color: var(--lantern);
}

/* 途中で折り返さないまとまり */
.nowrap {
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--on-dark);
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px var(--gutter);
}

.site-header__name {
  font-family: var(--font-poem);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--cream);
  text-shadow: 0 1px 8px rgba(27, 29, 58, 0.5);
}

.beta-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.6;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--indigo);
  color: var(--cream);
}

/* 写真の面：画面の高さより少し低くし、下端に名前と英文がのぞくようにする */
.hero__sky {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 120px);
  min-height: calc(100svh - 120px);
  padding: clamp(112px, 20svh, 168px) var(--gutter) var(--space-l);
  background: var(--sky); /* 写真の読み込みが遅いときの下地 */
  overflow: hidden;
}

.hero__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-photo-pos);
  filter: saturate(0.85);
}

/* 重ねる色：上はヘッダーと詩のために暗く、下端は藍の地へ溶かす。全体に薄紫を少し重ねる */
/* 1 層目は詩の後ろだけを 15% 濃くする帯（稜線のある下側にはかけない） */
.hero__sky::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(27, 29, 58, 0.15) 0%, rgba(27, 29, 58, 0.15) 64%, rgba(27, 29, 58, 0) 76%),
    linear-gradient(180deg,
      rgba(27, 29, 58, 0.62) 0%,
      rgba(27, 29, 58, 0.42) 22%,
      rgba(27, 29, 58, 0.34) 52%,
      rgba(27, 29, 58, 0) 70%,
      rgba(43, 47, 92, 0) 90%,
      var(--indigo) 100%),
    rgba(140, 130, 191, 0.12);
  pointer-events: none;
}

/* 波の輪 */
.hero__ripple {
  position: absolute;
  top: 14%;
  right: -22%;
  width: 92vw;
  max-width: 520px;
  height: auto;
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
  pointer-events: none;
}

.hero__ripple circle:nth-child(2) {
  stroke: rgba(243, 209, 87, 0.28);
}

.hero__poem {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  font-family: var(--font-poem);
  font-size: var(--fs-poem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: var(--poem-gold);
  text-shadow: 0 1px 14px rgba(27, 29, 58, 0.6);
}

.hero__line {
  display: block;
}

/* 最後の一行（つながる場所へ）は、少し間をあける */
.hero__line:last-child {
  margin-top: 0.6em;
}

.hero__intro {
  padding: var(--space-m) var(--gutter) var(--space-xl);
}

.hero__name {
  font-family: var(--font-poem);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.hero__en {
  margin-top: 4px;
  color: var(--cream-muted);
  font-size: var(--fs-small);
  letter-spacing: 0.01em;
}

.hero__lead {
  margin-top: var(--space-s);
  font-size: var(--fs-lead);
  line-height: 1.9;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  margin-top: var(--space-m);
}

/* ---------- ボタン ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 28px;
  border-radius: 999px;
  font-size: var(--fs-body);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button--primary {
  background: var(--sea);
  color: var(--indigo-deep);
  border: 1px solid var(--sea);
}

.button--primary:hover {
  background: #9AD7D3;
  border-color: #9AD7D3;
}

.button--secondary {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(251, 245, 230, 0.55);
  font-weight: 500;
}

.button--secondary:hover {
  border-color: var(--cream);
}

/* ---------- セクション共通 ---------- */
.section {
  padding: 64px var(--gutter);
}

.section > * {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.section__head {
  margin-bottom: var(--space-m);
}

/* セクション冒頭の写真の帯：本文幅の制限を外し、上の余白を打ち消して端から端まで広げる */
.section > .section__band {
  position: relative;
  max-width: none;
  height: var(--band-height);
  margin: -64px calc(var(--gutter) * -1) 40px;
  overflow: hidden;
}

.section__band img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--band-photo-pos);
  filter: saturate(0.8); /* 黄緑がかった色味を抑え、サイトの配色になじませる */
}

/* 上端は Hero の藍から、下端は本文の薄紫へ溶かす */
.section__band::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      var(--indigo) 0%,
      rgba(43, 47, 92, 0) 28%,
      rgba(238, 234, 246, 0) 62%,
      var(--mist) 100%);
  pointer-events: none;
}

.section__title {
  font-family: var(--font-poem);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

.section__world {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: var(--fs-small);
}

.prose p + p {
  margin-top: 1.1em;
}

.block + .block,
.work--feature + .block {
  margin-top: var(--space-l);
}

.block__title {
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: var(--space-s);
}

.block__lead {
  margin-bottom: var(--space-m);
}

.note {
  margin-top: var(--space-s);
  color: var(--ink-muted);
  font-size: var(--fs-small);
  line-height: 1.8;
}

/* ---------- What I Do：ツールの使い分け ---------- */
.tools__group {
  padding: var(--space-s) 0;
  border-top: 1px solid var(--line);
}

.tools__group:last-child {
  border-bottom: 1px solid var(--line);
}

.tools dt {
  color: var(--sea-deep);
  font-size: var(--fs-small);
  font-weight: 700;
}

.tools dd {
  margin-top: 6px;
  line-height: 1.7;
}

.tools dd b {
  display: block;
  font-weight: 700;
}

/* ---------- What I Do：関心のある領域 ---------- */
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interests li {
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist-soft);
  font-size: var(--fs-small);
}

/* ---------- Projects ---------- */
.work {
  padding: var(--space-m) 0;
  border-top: 1px solid var(--line);
}

.work:last-child {
  border-bottom: 1px solid var(--line);
}

.work--feature {
  padding: var(--space-m) 20px;
  border: none;
  border-left: 3px solid var(--lantern);
  border-radius: 0 16px 16px 0;
  background: var(--mist-soft);
}

.work__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: var(--space-s);
}

h4.work__title {
  font-size: 1.125rem;
}

.work__status {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--lantern);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
}

.work__facts > div + div {
  margin-top: var(--space-s);
}

.work__facts dt {
  color: var(--sea-deep);
  font-size: var(--fs-small);
  font-weight: 700;
}

.work__facts dd {
  line-height: 1.8;
}

/* ---------- FAQ ---------- */
.faq__item {
  border-top: 1px solid var(--line);
}

.faq__item:last-child {
  border-bottom: 1px solid var(--line);
}

.faq__item summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 12px 40px 12px 0;
  font-weight: 700;
  line-height: 1.6;
  cursor: pointer;
  list-style: none;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

/* 開閉の印（＋ → ×） */
.faq__item summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background:
    linear-gradient(var(--sea-deep), var(--sea-deep)) center / 14px 2px no-repeat,
    linear-gradient(var(--sea-deep), var(--sea-deep)) center / 2px 14px no-repeat;
  transition: transform 0.25s ease;
}

.faq__item[open] summary::after {
  transform: rotate(45deg);
}

.faq__answer {
  padding: 0 0 var(--space-m);
}

.faq__answer p + p {
  margin-top: 0.8em;
}

/* ---------- Contact ---------- */
.section--contact {
  background: var(--indigo);
  color: var(--on-dark);
}

.section--contact .section__world {
  color: var(--on-dark-muted);
}

.section--contact a {
  color: var(--sea);
}

.contact-fallback {
  margin-top: var(--space-m);
  padding: var(--space-m) 20px;
  border: 1px solid rgba(244, 241, 250, 0.3);
  border-radius: 16px;
  line-height: 1.8;
}

/* ---------- フッター ---------- */
.site-footer {
  padding: var(--space-m) var(--gutter) var(--space-l);
  background: var(--indigo);
  color: var(--on-dark-muted);
  font-size: var(--fs-small);
  text-align: center;
  border-top: 1px solid rgba(244, 241, 250, 0.15);
}

/* ---------- Hero の演出（main.js が html に .motion-ok を付けたときだけ動く） ---------- */
@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes ripple-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.motion-ok .hero__line {
  opacity: 0;
  animation: line-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.motion-ok .hero__line:nth-child(1) { animation-delay: 0.2s; }
.motion-ok .hero__line:nth-child(2) { animation-delay: 0.6s; }
.motion-ok .hero__line:nth-child(3) { animation-delay: 1.0s; }
.motion-ok .hero__line:nth-child(4) { animation-delay: 1.4s; }
.motion-ok .hero__line:nth-child(5) { animation-delay: 2.0s; }

.motion-ok .hero__ripple circle {
  opacity: 0;
  transform-origin: 200px 200px;
  animation: ripple-in 1.6s ease-out forwards;
}

.motion-ok .hero__ripple circle:nth-child(1) { animation-delay: 1.4s; }
.motion-ok .hero__ripple circle:nth-child(2) { animation-delay: 1.7s; }
.motion-ok .hero__ripple circle:nth-child(3) { animation-delay: 2.0s; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .motion-ok .hero__line,
  .motion-ok .hero__ripple circle {
    opacity: 1;
  }
}

/* ---------- 広い画面 ---------- */
@media (min-width: 640px) {
  :root {
    --gutter: 40px;
    --fs-poem: 2.125rem;
    --fs-h2: 2.5rem;
    --hero-photo-pos: 50% 100%;
  }

  /* PC：文字のある左側だけ少し暗くする */
  .hero__sky::after {
    background:
      linear-gradient(180deg, rgba(27, 29, 58, 0.15) 0%, rgba(27, 29, 58, 0.15) 64%, rgba(27, 29, 58, 0) 76%),
      linear-gradient(90deg, rgba(27, 29, 58, 0.35) 0%, rgba(27, 29, 58, 0) 60%),
      linear-gradient(180deg,
        rgba(27, 29, 58, 0.62) 0%,
        rgba(27, 29, 58, 0.42) 22%,
        rgba(27, 29, 58, 0.34) 52%,
        rgba(27, 29, 58, 0) 70%,
        rgba(43, 47, 92, 0) 90%,
        var(--indigo) 100%),
      rgba(140, 130, 191, 0.12);
  }

  .hero__sky {
    padding-bottom: var(--space-xl);
  }

  .section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }

  :root {
    --band-height: 320px;
    --band-photo-pos: 50% 35%;
  }

  .section > .section__band {
    margin-top: calc(var(--space-xl) * -1);
  }

  .hero__poem,
  .hero__intro > * {
    max-width: var(--measure);
  }

  .hero__sky,
  .hero__intro {
    padding-left: max(var(--gutter), calc((100% - 44rem) / 2));
    padding-right: max(var(--gutter), calc((100% - 44rem) / 2));
  }

  .hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .tools__group {
    display: grid;
    grid-template-columns: 9rem 1fr;
    column-gap: var(--space-m);
  }

  .tools dt {
    padding-top: 2px;
  }

  .tools dd {
    grid-column: 2;
  }

  .tools dd:first-of-type {
    margin-top: 0;
  }
}
