/* ============================================
   MOTION ZEN TEMPLATE
   和モダン×静謐 — ゆったり動く和菓子舗サイト
============================================ */

:root {
  --bg: #f7f3ea;
  --bg-alt: #efe9db;
  --ink: #2b2823;
  --muted: #8a8171;
  --line: rgba(43, 40, 35, 0.14);
  --matcha: #6f7d54;
  --azuki: #96514d;
  --font-jp: "Shippori Mincho B1", serif;
  --font-jp-sub: "Zen Old Mincho", serif;
  --font-en: "Cormorant Garamond", serif;
  --container: 1120px;
  --header-h: 88px;
  /* ゆらぎのある、長めの余韻を残すイージング */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-slow: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-jp);
  background: var(--bg);
  color: var(--ink);
  line-height: 2.2;
  letter-spacing: 0.06em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

em {
  font-style: normal;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.pc-only {
  display: inline;
}

/* 小豆色のアクセント（見出しの差し色） */
.accent {
  color: var(--azuki);
}

/* ---------- スキップリンク／フォーカス ---------- */
.skip-link {
  position: fixed;
  top: -48px;
  left: 16px;
  z-index: 10001;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  font-size: 0.85rem;
  transition: top 0.2s;
}

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

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

/* ---------- 縦書きの英字ラベル ---------- */
.v-label {
  writing-mode: vertical-rl;
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  color: var(--muted);
}

/* ---------- ローディング（円相がゆっくり描かれる） ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  pointer-events: none;
  transition:
    opacity 1.2s var(--ease-slow) 0.2s,
    visibility 0s 1.5s;
}

.loader__enso {
  width: clamp(120px, 24vw, 180px);
  height: auto;
  transform: rotate(-100deg);
}

/* 墨の円相：pathLength=1 に正規化し、dashoffset で一筆描き */
.loader__enso-circle {
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ensoDraw 2s var(--ease-slow) 0.2s forwards;
}

@keyframes ensoDraw {
  to {
    /* 描き切らず、円相らしい「余白」をわずかに残す */
    stroke-dashoffset: 0.06;
  }
}

.loader__logo {
  position: absolute;
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  opacity: 0;
  animation: loaderLogo 1.4s var(--ease-slow) 1s forwards;
}

@keyframes loaderLogo {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.is-loaded .loader {
  opacity: 0;
  visibility: hidden;
}

.is-loaded .loader__enso-circle,
.is-loaded .loader__logo {
  /* fill-mode: forwards のアニメーションを打ち消してフェードに任せる */
  animation-play-state: paused;
}

/* ---------- 舞う花びら（canvas） ---------- */
.petals {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition:
    transform 0.6s var(--ease),
    background-color 0.5s,
    box-shadow 0.5s;
}

.header.is-scrolled {
  background: rgba(247, 243, 234, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}

.header.is-hidden {
  transform: translateY(-100%);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 clamp(24px, 4vw, 56px);
}

.header__logo {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.28em;
}

.header__logo-en {
  font-family: var(--font-en);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.nav__list {
  display: flex;
  gap: 34px;
  align-items: center;
}

.nav__link {
  font-size: 0.85rem;
  position: relative;
  padding: 6px 0;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 1px;
  background: var(--azuki);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}

.nav__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__link--cta {
  padding: 9px 26px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition:
    background-color 0.45s,
    color 0.45s;
}

.nav__link--cta::after {
  display: none;
}

.nav__link--cta:hover {
  background: var(--ink);
  color: var(--bg);
}

/* モバイルトグル */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 1001;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
}

.nav-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.5s var(--ease);
}

.nav-toggle span:nth-child(1) {
  transform: translate(-50%, calc(-50% - 4px));
}

.nav-toggle span:nth-child(2) {
  transform: translate(-50%, calc(-50% + 4px));
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 背景写真：超スローなKen Burns（ズーム＋パン） */
.hero__bg {
  position: absolute;
  inset: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 60% 40%;
  animation: kenburns 36s var(--ease-slow) infinite alternate;
}

@keyframes kenburns {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.12) translate(-2%, 1.5%);
  }
}

/* 生成りの薄靄を重ね、文字の可読性と静けさを両立させる */
.hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(247, 243, 234, 0.55),
    rgba(247, 243, 234, 0.28) 45%,
    rgba(247, 243, 234, 0.72)
  );
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(28px, 5vw, 64px);
  padding: calc(var(--header-h) + 20px) 28px 80px;
}

.hero__eyebrow {
  padding-top: 0.5em;
}

/* 縦書き見出し：上からゆっくりリビール */
.hero__title {
  writing-mode: vertical-rl;
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.9;
  letter-spacing: 0.22em;
}

.hero__title-line {
  display: inline-block;
}

/* 縦書きリビール：上から下へ幕が上がるように現れる */
.v-reveal {
  display: inline-block;
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  transition:
    clip-path 2s var(--ease-slow),
    opacity 1.4s;
}

.is-loaded .v-reveal {
  clip-path: inset(0 0 -5% 0);
  opacity: 1;
}

.is-loaded .hero__eyebrow .v-reveal {
  transition-delay: 1.1s;
}

.is-loaded .hero__title-line:nth-child(1) .v-reveal {
  transition-delay: 1.5s;
}

.is-loaded .hero__title-line:nth-child(2) .v-reveal {
  transition-delay: 1.9s;
}

.is-loaded .hero__lead .v-reveal {
  transition-delay: 2.4s;
}

.hero__lead {
  align-self: flex-end;
  max-width: 26em;
  font-size: clamp(0.85rem, 1.3vw, 0.95rem);
  color: var(--ink);
  padding-bottom: 0.5em;
}

/* スクロールキュー */
.hero__scroll {
  position: absolute;
  right: clamp(24px, 4vw, 56px);
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  writing-mode: vertical-rl;
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  color: var(--muted);
}

.hero__scroll i {
  width: 1px;
  height: 72px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.hero__scroll i::after {
  content: "";
  position: absolute;
  left: 0;
  top: -50%;
  width: 100%;
  height: 50%;
  background: var(--ink);
  animation: scrollLine 2.6s var(--ease-slow) infinite;
}

@keyframes scrollLine {
  to {
    top: 110%;
  }
}

/* ---------- ボタン ---------- */
.btn-line {
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
  font-size: 0.9rem;
}

.btn-line::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
}

.btn-line::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  height: 1px;
  background: var(--azuki);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.7s var(--ease);
}

.btn-line:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- 筆線（スクロールで描画されるセクション区切り） ---------- */
.brush {
  overflow: hidden;
  padding: clamp(10px, 2vw, 24px) 0;
}

.brush--flip .brush__svg {
  transform: scaleX(-1);
}

.brush__svg {
  display: block;
  width: min(90%, 980px);
  margin: 0 auto;
  height: auto;
}

/* pathLength=1 に正規化し、dashoffset で筆が走るように描く */
.brush__path {
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.45;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.4s var(--ease-slow);
}

.brush.is-visible .brush__path {
  stroke-dashoffset: 0;
}

/* ---------- セクション共通 ---------- */
.section {
  padding: clamp(96px, 14vw, 160px) 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__label {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.34em;
  color: var(--muted);
  margin-bottom: 22px;
}

.section__label-num {
  font-family: var(--font-jp-sub);
  font-size: 0.9rem;
  color: var(--azuki);
}

.section__label-line {
  flex: 0 0 56px;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s var(--ease-slow) 0.3s;
}

.section__label.is-visible .section__label-line {
  transform: scaleX(1);
}

.section__title {
  font-weight: 500;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  line-height: 1.8;
  letter-spacing: 0.14em;
  margin-bottom: 34px;
}

/* ふわり登場（既存motionより長く、静かに） */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1.3s,
    transform 1.6s var(--ease-slow);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 障子リビール（左右に開く画像表示） ----------
   画像の上に生成りの2枚のパネルを重ね、
   障子を左右へ引くように開いて中の写真を見せる */
.shoji-reveal {
  position: relative;
  overflow: hidden;
}

.shoji-reveal::before,
.shoji-reveal::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  z-index: 2;
  background: var(--bg-alt);
  transition: transform 1.8s var(--ease-slow);
}

.shoji-reveal::before {
  left: 0;
  border-right: 1px solid var(--line);
}

.shoji-reveal::after {
  right: 0;
  border-left: 1px solid var(--line);
}

.shoji-reveal.is-visible::before {
  transform: translateX(-101%);
}

.shoji-reveal.is-visible::after {
  transform: translateX(101%);
}

/* 開いた奥で写真がゆっくり据わる */
.shoji-reveal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 2.6s var(--ease-slow);
}

.shoji-reveal.is-visible img {
  transform: scale(1);
}

.shoji-reveal--delay::before,
.shoji-reveal--delay::after,
.shoji-reveal--delay img {
  transition-delay: 0.35s;
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(44px, 7vw, 96px);
  align-items: center;
}

.about__visual {
  position: relative;
  min-height: clamp(380px, 44vw, 540px);
}

.about__img {
  position: absolute;
  border-radius: 2px;
}

.about__img--main {
  left: 0;
  top: 0;
  width: 74%;
  aspect-ratio: 4 / 5;
}

.about__img--sub {
  right: 0;
  bottom: 0;
  width: 48%;
  aspect-ratio: 4 / 3;
  box-shadow: 0 26px 50px -30px rgba(43, 40, 35, 0.4);
}

.about__text {
  color: var(--muted);
  font-size: 0.93rem;
  margin-bottom: 24px;
}

.about__copy .btn-line {
  margin-top: 12px;
}

/* ---------- Menu（ゆっくり流れる横スクロール） ---------- */
.menu {
  overflow: hidden;
}

.menu__note {
  color: var(--muted);
  font-size: 0.84rem;
  margin: -14px 0 44px;
}

.gallery {
  overflow: hidden;
}

/* トラックには同じカード列を2周分並べ、-50%まで流して無限ループ */
.gallery__track {
  display: flex;
  gap: clamp(24px, 3.4vw, 44px);
  width: max-content;
  padding: 0 clamp(24px, 3.4vw, 44px);
  animation: galleryFlow 64s linear infinite;
}

/* hover／キーボードフォーカスで立ち止まる */
.gallery:hover .gallery__track,
.gallery:focus-within .gallery__track {
  animation-play-state: paused;
}

@keyframes galleryFlow {
  to {
    transform: translateX(-50%);
  }
}

.sweet-card {
  flex: 0 0 auto;
  width: clamp(220px, 24vw, 300px);
}

.sweet-card__img {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 5 / 6;
  margin-bottom: 16px;
}

.sweet-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 1.4s var(--ease-slow);
}

.sweet-card:hover .sweet-card__img img {
  transform: scale(1.07);
}

.sweet-card__meta {
  position: relative;
  padding-left: 44px;
}

/* 季節の印（抹茶色の丸判） */
.sweet-card__season {
  position: absolute;
  left: 0;
  top: 4px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--matcha);
  border-radius: 50%;
  font-size: 0.66rem;
  color: var(--matcha);
  letter-spacing: 0;
}

.sweet-card__meta h3 {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.1em;
}

.sweet-card__meta p {
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---------- Shop ---------- */
.shop__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(44px, 7vw, 96px);
  align-items: center;
}

.shop__text {
  color: var(--muted);
  font-size: 0.93rem;
  margin-bottom: 34px;
}

.shop__info {
  border-top: 1px solid var(--line);
}

.shop__info-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.shop__info-row dt {
  color: var(--muted);
}

.shop__info-row a {
  border-bottom: 1px solid var(--line);
  transition: color 0.4s;
}

.shop__info-row a:hover {
  color: var(--azuki);
}

.shop__visual {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

.shop__v-label {
  padding-top: 8px;
}

.shop__img {
  width: min(84%, 420px);
  aspect-ratio: 4 / 5;
  border-radius: 2px;
}

/* ---------- News ---------- */
.news__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.6fr;
  gap: clamp(30px, 5vw, 80px);
  align-items: start;
}

.news__list {
  border-top: 1px solid var(--line);
}

.news-item {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 2.4vw, 28px);
  padding: 24px 6px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.45s;
}

.news-item:hover {
  background: rgba(247, 243, 234, 0.9);
}

.news-item time {
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}

.news-item__tag {
  flex-shrink: 0;
  padding: 2px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.72rem;
  color: var(--matcha);
}

.news-item p {
  font-size: 0.9rem;
  line-height: 1.9;
  transition: color 0.35s;
}

.news-item:hover p {
  color: var(--azuki);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 52px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.footer__logo {
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.28em;
}

.footer__logo-en {
  font-family: var(--font-en);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.footer__nav ul {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.footer__nav a {
  font-size: 0.82rem;
  color: var(--muted);
  transition: color 0.35s;
}

.footer__nav a:hover {
  color: var(--ink);
}

.footer__copyright {
  font-family: var(--font-en);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 900px) {
  .pc-only {
    display: none;
  }

  /* ナビ→フルスクリーン */
  .nav {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(247, 243, 234, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.5s,
      visibility 0s 0.5s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s;
  }

  .nav__list {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }

  .nav__link {
    font-size: 1.15rem;
  }

  .nav-toggle {
    display: block;
  }

  /* Hero：縦書き見出しを横書きへフォールバック */
  .hero__inner {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 560px;
    gap: 26px;
  }

  .hero__eyebrow {
    writing-mode: horizontal-tb;
    padding-top: 0;
  }

  .hero__title {
    writing-mode: horizontal-tb;
    font-size: clamp(1.9rem, 8vw, 2.6rem);
    line-height: 1.8;
  }

  /* 横書き時は下から上へのリビールに切り替える */
  .v-reveal {
    clip-path: inset(100% 0 0 0);
  }

  .is-loaded .v-reveal {
    clip-path: inset(-5% 0 0 0);
  }

  .hero__lead {
    align-self: flex-start;
    padding-bottom: 0;
  }

  .hero__scroll {
    display: none;
  }

  /* About */
  .about__grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .about__visual {
    min-height: 0;
    height: clamp(320px, 74vw, 460px);
  }

  /* Menu：カードを小さくして流量を保つ */
  .sweet-card {
    width: min(56vw, 240px);
  }

  /* Shop */
  .shop__grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .shop__visual {
    justify-content: flex-start;
  }

  .shop__info-row {
    grid-template-columns: 88px 1fr;
  }

  /* News */
  .news__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .news-item {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .news-item p {
    width: 100%;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__brand {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .loader {
    display: none;
  }

  /* 花びらはJS側でも起動しないが、念のため隠す */
  .petals {
    display: none;
  }

  .v-reveal,
  [data-reveal] {
    opacity: 1 !important;
    clip-path: none !important;
    transform: none !important;
  }

  .hero__bg img {
    animation: none;
  }

  .shoji-reveal::before,
  .shoji-reveal::after {
    display: none;
  }

  .shoji-reveal img {
    transform: none !important;
  }

  .brush__path {
    stroke-dashoffset: 0 !important;
  }

  .section__label-line {
    transform: scaleX(1) !important;
  }

  /* ギャラリーは流さず、横スワイプ（スクロール）で見られるように */
  .gallery {
    overflow-x: auto;
  }

  .gallery__track {
    animation: none;
  }
}
