/* =========================================================
   TAKANE COFFEE デモ
   色・余白・速度はここ（:root）でまとめて調整できます
   ========================================================= */
:root {
  --ink: #1d1f1e;          /* 文字の基本色 */
  --ink-soft: #5c5f5d;
  --line: #c4c6c4;         /* 細い罫線 */
  --pill-off: #dcdcd9;     /* 味メーターの空き */
  --paper: #ffffff;        /* 背景（KVのフェード先） */
  --photo-bg: #e7e6e3;     /* 商品写真の地 */
  --sky: #3b8cd6;          /* KVの地色（画像の読み込み前に見える色） */

  --pad: clamp(20px, 6vw, 72px);     /* 左右の余白 */
  --maxw: 1040px;

  --font-en: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;

  --ease: cubic-bezier(.22, .61, .2, 1);
  --slide-ms: 4500ms;      /* スライダーの切り替え間隔（JSも同じ値を読む） */
  --hero-length: 100vh;    /* KVの長さ。大きいほど演出がゆっくり進む */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ja);
  font-weight: 500;
  line-height: 1.8;
  font-feature-settings: "palt";
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.wrap { max-width: calc(var(--maxw) + var(--pad) * 2); margin-inline: auto; padding-inline: var(--pad); }

/* ---------- 下線（左から伸びる） ---------- */
.u {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  padding-bottom: .08em;
  transition: background-size 1.1s var(--ease) var(--d, 0s);
}
.is-in .u, .u.is-in { background-size: 100% 2px; }

/* ---------- ヘッダー ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) var(--pad) 18px;
  color: #fff;
  font-family: var(--font-en); font-weight: 600; font-stretch: 105%;
  font-size: clamp(17px, 2vw, 20px); letter-spacing: .02em;
  transition: color .5s var(--ease), background-color .5s var(--ease);
}
.header.is-dark { color: var(--ink); }
.header.is-solid { background: rgba(255,255,255,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.header__logo { display: flex; align-items: center; height: 28px; }
.header__logo svg { width: 56px; height: 25px; }
.header__menu { height: 28px; font-family: inherit; font-weight: inherit; letter-spacing: inherit; }

/* ---------- メニュー ---------- */
.menu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--paper); color: var(--ink);
  padding: calc(env(safe-area-inset-top, 0px) + 22px) var(--pad) 40px;
  overflow-y: auto;
  opacity: 0; transition: opacity .4s var(--ease);
}
.menu.is-open { opacity: 1; }
.menu__close { display: block; margin: 0 0 8vh auto; height: 28px; font-family: var(--font-en); font-weight: 600; font-stretch: 105%; font-size: clamp(17px, 2vw, 20px); letter-spacing: .02em; }

.nav-big { list-style: none; margin: 0; padding: 0; }
.nav-big a {
  display: block; padding: .18em 0;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-en); font-weight: 700; font-stretch: 110%;
  font-size: clamp(36px, 8vw, 64px); line-height: 1.35;
}
.nav-big li:first-child a { border-bottom: 1px solid var(--line); }
.nav-big a[aria-current="page"] { color: #b4b6b4; }
.nav-small { list-style: none; margin: 9vh 0 10vh; padding: 0; font-weight: 700; font-size: 15px; line-height: 2.4; }

/* =========================================================
   KV（ヒーロー）
   JSが --p（0→1）などを入れて、各レイヤーを動かします
   ========================================================= */
.hero { position: relative; height: var(--hero-length); background: var(--paper); }
.hero__sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
}
/* 背景：風景（静止画）。少し縦長にしてパララックスの逃げを作る */
.hero__bg { position: absolute; inset: 0; background: #a3363a; will-change: opacity; }
.hero__bg img {
  position: absolute; left: 0; top: 0;
  width: 100%; height:auto; object-fit: cover; object-position: center 70%;
  will-change: transform;
}
/* 前面：商品写真 */
.hero__product {
  position: absolute; margin: 0;
  left: 50%; top: 14%;
  width: min(78vw, 50vh); aspect-ratio: 3 / 4;
  transform: translateX(-50%);
  will-change: opacity, transform;
}
.hero__product img { width: 100%; height: 100%; object-fit: cover; }

.hero__lead {
  position: absolute; left: var(--pad); top: 33%; margin: 0; z-index: 2;
  color: #fff; font-weight: 500;
  font-size: clamp(19px, 2.6vw, 30px); line-height: 1.75; letter-spacing: .02em;
}
.hero__name { position: absolute; left: var(--pad); right: var(--pad); bottom: 18%; color: #fff; z-index: 2; }
.hero__title {
  margin: 0; white-space: nowrap;
  font-family: var(--font-en); font-weight: 800; font-stretch: 112%;
  line-height: .82; letter-spacing: -.005em;
}
.hero__sub { margin: .55em 0 0; font-weight: 700; font-size: clamp(17px, 2.2vw, 24px); }

.hero__scroll {
  position: absolute; right: var(--pad); bottom: 10%; z-index: 2;
  color: #fff; font-family: var(--font-en); font-weight: 600; font-size: 14px; letter-spacing: .04em;
  display: grid; gap: 8px; justify-items: end;
}
.hero__bar { display: block; width: 120px; height: 3px; background: rgba(255,255,255,.35); overflow: hidden; }
.hero__bar i { display: block; height: 100%; background: #fff; animation: bar 2.4s var(--ease) infinite; transform-origin: left; }
@keyframes bar { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }

/* スクロール後に出るコピー。色は白→墨にJSで補間 */
.hero__tagline {
  position: absolute; left: var(--pad); right: var(--pad); bottom: 14%; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  color: var(--tagline-color, #fff);
  opacity: 0; will-change: opacity, transform;
}
.tagline { margin: 0; font-size: clamp(21px, 5.4vw, 40px); line-height: 1.6; font-weight: 500; letter-spacing: .02em; }
.tagline .u { font-weight: 700; }
.tagline__brand { position: absolute; right: 0; top: -2.4em; margin: 0; font-family: var(--font-en); font-weight: 700; font-size: clamp(13px, 1.4vw, 16px); white-space: nowrap; }

/* ---------- 産地の帯 ---------- */
.origin {
  display: grid; grid-template-columns: 1fr minmax(0, 1.15fr); align-items: end; gap: 24px;
  padding: 2vh var(--pad) 18vh; max-width: calc(var(--maxw) + var(--pad) * 2); margin-inline: auto;
}
.origin__mark { width: 22px; fill: var(--ink); margin-bottom: 4px; }
.marquee { overflow: hidden; }
.marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee__track--slow { animation-duration: 55s; }
.marquee__track img { flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }
.origin__strip img { height: clamp(120px, 18vw, 220px); width: auto; }

/* =========================================================
   商品カード
   ========================================================= */
.products { display: grid; gap: 22vh; padding-bottom: 22vh; }
.card { width: 50%; container-type: inline-size; transition: width 1.1s var(--ease); }
.card.is-in { width: 100%; }
.card__link { display: block; }

/* 太い線＋短い線の二重罫 */
.rule2 { display: flex; gap: 6px; height: 6px; margin-bottom: 18px; }
.rule2 i { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease); }
.rule2 i:first-child { flex: 1; }
.rule2 i:last-child { width: 9%; min-width: 34px; transition-delay: .25s; }
.is-in .rule2 i, .is-in.rule2 i { transform: none; }

.card__head { position: relative; display: grid; grid-template-columns: 1fr auto; column-gap: 16px; }
.card__head .rule2 { grid-column: 1 / -1; }
.card__title {
  margin: 0; font-family: var(--font-en); font-weight: 700; font-stretch: 104%;
  font-size: clamp(22px, 10cqi, 72px); line-height: .98; letter-spacing: -.01em;
  min-width: 0;
}
/* 丸アイコン：表示前は「・」、表示後は「▶」 */
.card__icon {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid #9d9f9d; align-self: start; margin-top: 4px;
}
.card__icon::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink);
  transform: translate(-50%, -50%);
  transition: all .5s var(--ease) .5s;
}
.is-in .card__icon::after {
  width: 0; height: 0; border-radius: 0; background: none;
  border-left: 8px solid var(--ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  transform: translate(-35%, -50%);
}

/* 三角ドットの地模様：表示時に一瞬出て左から消える */
.card__head::before {
  content: ""; position: absolute; inset: -14px -10px -30px; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M8 6 L10 9.5 H6Z' fill='%23c9cbc9'/%3E%3C/svg%3E");
  opacity: 0; clip-path: inset(0 0 0 0);
}
.card--pattern.is-in .card__head::before { animation: pattern 1.8s var(--ease) .3s both; }
@keyframes pattern {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); }
  35% { opacity: 1; clip-path: inset(0 0 0 0); }
  70% { opacity: 1; clip-path: inset(0 0 0 0); }
  100% { opacity: 0; clip-path: inset(0 0 0 100%); }
}

.card__catch { margin: 1.4em 0 0; font-weight: 700; font-size: clamp(15px, 1.7vw, 18px); line-height: 1.7; }
.card__dots { margin: 2.4em 0 .6em; font-family: var(--font-en); font-weight: 800; letter-spacing: .1em; line-height: 1; }

/* スライダー */
.slider { position: relative; aspect-ratio: 1; background: var(--photo-bg); overflow: hidden; }
.slider img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .9s var(--ease);
}
.slider img.is-active { opacity: 1; }
.tag {
  position: absolute; left: 5%; top: 5%; z-index: 2;
  background: #fff; padding: .45em .9em; font-weight: 700; font-size: clamp(13px, 1.5vw, 16px); line-height: 1.2;
}
.slider__nav { position: absolute; left: 0; right: 0; bottom: 5%; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.slider__pip { width: 9px; height: 9px; border-radius: 5px; background: #c5c5c2; overflow: hidden; transition: width .6s var(--ease); }
.slider__pip.is-active { width: 72px; }
.slider__pip i { display: block; height: 100%; width: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.slider__pip.is-active i { animation: pip var(--slide-ms) linear forwards; }
@keyframes pip { to { transform: scaleX(1); } }

/* 味のメーター */
.meter {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin: 18px 0 0; padding-bottom: 18px; border-bottom: 1.5px solid var(--line);
  font-weight: 700; font-size: clamp(14px, 1.7vw, 18px);
}
.meter div { display: flex; align-items: center; gap: 8px; }
.meter div + div::before { content: "▾"; font-size: .6em; margin-right: 6px; color: var(--ink); }
.meter dt, .meter dd { margin: 0; }
.meter dd { display: flex; gap: 2px; }
.meter dd i { display: block; width: clamp(10px, 1.4vw, 14px); height: clamp(18px, 2.2vw, 22px); border-radius: 8px 8px 4px 4px; background: var(--pill-off); }
.meter dd i.on { background: var(--ink); }

.card__desc { margin: 1.2em 0 0; font-weight: 700; font-size: clamp(15px, 1.7vw, 18px); line-height: 2.1; letter-spacing: .04em; }
.card__price {
  margin: 2em 0 0; padding-bottom: .5em; border-bottom: 1.5px solid var(--line);
  font-family: var(--font-en); font-weight: 700; font-size: clamp(26px, 3.4vw, 36px);
}
.card__price small { font-family: var(--font-ja); font-size: .5em; }

/* ---------- すべての珈琲 ---------- */
.lineup { padding-bottom: 22vh; }
.lineup__bags { margin-bottom: 10vh; }
.lineup__bags img { height: clamp(220px, 34vw, 380px); width: auto; margin-right: -2vw; }

.block { display: block; }
.block + .block { margin-top: 22vh; }
.block__row { display: flex; justify-content: space-between; gap: 16px; }
.block__title { font-weight: 700; font-size: clamp(26px, 4.4vw, 46px); line-height: 1.35; }
.block__label {
  display: flex; align-items: center; gap: .6em;
  margin-top: 2.2em; padding-bottom: .5em; border-bottom: 1.5px solid var(--line);
  font-family: var(--font-en); font-weight: 600; font-size: clamp(22px, 3vw, 30px); line-height: 1.3;
}
.about .block__label { border-bottom: 0; padding-bottom: .3em; }
.block__label .sep { width: 1.5px; height: 1em; background: var(--ink-soft); }
.block__img { width: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
.block__text { display: block; margin-top: 1.2em; padding-bottom: 2em; border-bottom: 1.5px solid var(--line); font-weight: 700; font-size: clamp(15px, 1.7vw, 18px); line-height: 2.1; }
.about { padding-bottom: 22vh; }

/* ---------- 詩 ---------- */
.poem { padding-bottom: 24vh; }
.poem__img { width: 100%; aspect-ratio: 5 / 3; object-fit: cover; margin-bottom: 8vh; }
.poem__text { margin: 0; font-size: clamp(17px, 2.2vw, 22px); line-height: 2.2; letter-spacing: .06em; }
.poem__line { display: block; opacity: 0; transform: translateY(10px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.poem.is-in .poem__line { opacity: 1; transform: none; }

/* ---------- 締め ---------- */
.closing { padding-bottom: 18vh; }
.closing__frame { position: relative; }
.closing__frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; max-height: 90vh; }
.closing__copy {
  position: absolute; left: 0; right: 0; top: 14%; margin: 0;
  text-align: center; color: #fff; font-size: clamp(20px, 3vw, 32px); line-height: 1.9; letter-spacing: .04em;
}
.closing__copy .u { font-weight: 700; }

/* ---------- 三角つきの細い罫線 ---------- */
.tri-rule { position: relative; height: 1.5px; background: var(--line); }
.tri-rule::before, .tri-rule::after {
  content: ""; position: absolute; top: -6px;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 6px solid var(--line);
}
.tri-rule::before { left: 0; }
.tri-rule::after { right: 0; }
.tri-rule--mid { background-image: linear-gradient(var(--line), var(--line)); }

/* ---------- フッター ---------- */
.footer { padding-top: 6vh; }
.footer .tri-rule:first-child { margin-bottom: 7vh; }
.footer__link { display: block; margin-top: 4vh; }
.footer__link .block__row { font-weight: 700; font-size: clamp(20px, 2.8vw, 28px); line-height: 1.5; }
.footer__link .card__icon { width: 40px; height: 40px; }
.footer__link .card__icon::after { width: 6px; height: 6px; }
.footer__link .rule2 { height: 2px; margin-bottom: 18px; }
.footer__link .rule2 i { transform: none; }
.footer__note { display: block; margin-top: .9em; font-weight: 400; font-size: 15px; line-height: 1.9; }

/* パッケージが罫線の手前にせり上がる */
.footer__stage { position: relative; margin-top: 30vh; }
.footer__bag {
  position: absolute; left: 50%; bottom: calc(100% - 70px); z-index: 2;
  width: min(42vw, 300px);
  transform: translate(-50%, 45%); opacity: 0;
  transition: transform 1.4s var(--ease), opacity 1s var(--ease);
  filter: drop-shadow(0 18px 18px rgba(0,0,0,.12));
}
.footer__stage.is-in .footer__bag { transform: translate(-50%, 0); opacity: 1; }
.footer__sns { display: flex; gap: 2em; align-items: center; padding: 2.2em .4em; font-weight: 700; font-size: 16px; }
.footer__sns a { font-family: var(--font-en); }
.footer__sns span { margin-right: 1.4em; }

.footer__brand { display: grid; grid-template-columns: 30% 1fr; align-items: center; padding: 3em 0; font-weight: 700; font-size: clamp(26px, 4vw, 40px); }
.footer__brand svg { width: 76px; height: 34px; justify-self: center; }
.footer__brand span { justify-self: center; }
.footer__word {
  margin: 5vh 0 0; white-space: nowrap; text-align: center;
  font-family: var(--font-en); font-weight: 800; font-stretch: 112%; line-height: .9;
}
.footer__copy { text-align: center; color: var(--ink-soft); padding: 4vh 0 6vh; margin: 0; }

/* ---------- 広い画面 ---------- */
@media (min-width: 900px) {
  .card { width: 60%; }
  .card.is-in { width: 100%; }
  .card__link { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; align-items: start; }
  .card__link > .card__head, .card__link > .card__catch, .card__link > .card__dots { grid-column: 1 / -1; }
  .card__link > .slider { grid-row: span 4; }
  .card__link > .meter { margin-top: 0; }
  .about { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
  .about .block + .block { margin-top: 0; }
  .poem { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: center; }
  .poem__img { margin-bottom: 0; }
  .closing__frame img { aspect-ratio: 16 / 9; }
}

/* ---------- 動きを減らす設定の人には演出を止める ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card { width: 100%; }
  .poem__line, .footer__bag { opacity: 1; transform: none; }
  .footer__bag { transform: translate(-50%, 0); }
  .u { background-size: 100% 2px; }
  .rule2 i { transform: none; }
}
