/* ============================================================
   base.css — リセット / タイポ / 共通コンポーネント
   ここに定義したコンポーネントはログイン後画面でも再利用する。
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  font-feature-settings: "palt" 1;
  overflow-x: hidden;
}

::selection { background: var(--forest); color: #fff; }

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

/* ---------- Layout ---------- */
.container { width: var(--container); margin-inline: auto; }
.section { padding-block: var(--sec-y); position: relative; }
.section--warm { background: var(--paper-warm); }
.section--mist { background: var(--mist); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: 12px 20px;
}
.skip-link:focus { left: 0; }

/* ---------- Typography ---------- */
.label {
  font-family: var(--font-latin);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-45);
  line-height: 1;
  display: inline-flex; align-items: center; gap: .8em;
}
.label::before {
  content: ""; width: 34px; height: 1px; background: currentColor; opacity: .55;
}
.label--plain::before { display: none; }

.h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: var(--lh-head);
  letter-spacing: var(--ls-head);
}
.h3 {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: var(--ls-head);
}
.lead {
  font-size: var(--fs-lead);
  line-height: 1.95;
  color: var(--ink-70);
  max-width: var(--measure);
}
.body { color: var(--ink-70); max-width: var(--measure); }
.small { font-size: var(--fs-small); color: var(--ink-45); line-height: 1.9; }
.serif { font-family: var(--font-serif); }
.num { font-family: var(--font-latin); font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Button ---------- */
.btn {
  --btn-bg: var(--forest);
  --btn-fg: #fff;
  --btn-bd: var(--forest);
  display: inline-flex; align-items: center; justify-content: center; gap: 1em;
  min-height: 62px;
  padding: 0 2.4em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  font-size: var(--fs-small);
  letter-spacing: .12em;
  white-space: nowrap;
  transition: background .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease);
}
.btn:hover { --btn-bg: var(--ink); --btn-bd: var(--ink); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line); }
.btn--ghost:hover { --btn-bg: transparent; --btn-fg: var(--forest); --btn-bd: var(--forest); }
.btn--light { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.4); }
.btn--light:hover { --btn-bg: #fff; --btn-fg: var(--forest-deep); --btn-bd: #fff; }
.btn--lg { min-height: 72px; padding: 0 3.2em; font-size: var(--fs-body); }
.btn__arrow { width: 18px; height: 1px; background: currentColor; position: relative; transition: transform .5s var(--ease); }
.btn__arrow::after {
  content: ""; position: absolute; right: 0; top: 50%;
  width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}
.btn:hover .btn__arrow { transform: translateX(5px); }

/* テキストリンク（罫が伸縮する） */
.link {
  display: inline-flex; align-items: center; gap: .7em;
  font-size: var(--fs-small); letter-spacing: .1em; color: var(--forest);
  padding-bottom: .4em; position: relative;
}
.link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform-origin: right; transform: scaleX(1);
  transition: transform .5s var(--ease);
}
.link:hover::after { transform-origin: left; transform: scaleX(.35); }
.link--light { color: rgba(255,255,255,.86); }

/* ---------- Media（写真枠：--img を差すだけで実写に切替） ---------- */
.media {
  position: relative;
  overflow: hidden;
  background-image: var(--img, var(--placeholder));
  background-size: cover;
  background-position: center;
  background-color: var(--mist);
}
/* フィルムグレイン：プレースホルダ状態でも質感を保つ */
.media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: .45; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22140%22 height=%22140%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%22.85%22 numOctaves=%223%22/%3E%3C/filter%3E%3Crect width=%22140%22 height=%22140%22 filter=%22url(%23n)%22 opacity=%22.22%22/%3E%3C/svg%3E");
}
.media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Badge ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .5em 1.1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .75rem; letter-spacing: .1em; line-height: 1.4;
  color: var(--ink-70);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(6px);
}
.badge--limited { color: var(--amber); border-color: rgba(156,107,36,.42); }
.badge--member  { color: var(--forest); border-color: rgba(44,70,54,.36); }
.badge--count   { font-feature-settings: "tnum" 1; }
.badge__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------- Locked（ログイン前は情報を伏せる） ---------- */
.locked {
  display: flex; align-items: center; gap: .75em;
  padding-top: 1.1em; margin-top: 1.4em;
  border-top: 1px solid var(--line);
  font-size: var(--fs-small); color: var(--ink-45); letter-spacing: .06em;
}
.locked__key {
  width: 26px; height: 26px; flex: none;
  border: 1px solid var(--line); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.locked__key::before {
  content: ""; width: 8px; height: 5px; border: 1px solid var(--ink-45); border-bottom: 0;
  border-radius: 4px 4px 0 0; margin-bottom: -1px;
}
.locked__key::after { content: ""; width: 11px; height: 8px; background: var(--ink-45); border-radius: 1px; }
.locked--light { border-top-color: rgba(255,255,255,.22); color: rgba(255,255,255,.66); }
.locked--light .locked__key { border-color: rgba(255,255,255,.3); }
.locked--light .locked__key::before { border-color: rgba(255,255,255,.66); }
.locked--light .locked__key::after { background: rgba(255,255,255,.66); }

/* ---------- Ingredient Card（ログイン後の一覧でも同一クラスを再利用） ---------- */
.ingredient-card { display: block; position: relative; }
.ingredient-card .media { aspect-ratio: 4 / 5; transition: transform 1.1s var(--ease); }
.ingredient-card:hover .media { transform: scale(1.02); }
.ingredient-card__badges { position: absolute; top: 16px; left: 16px; z-index: 2; max-width: calc(100% - 32px); }
.ingredient-card__body { padding-top: 26px; }
.ingredient-card__origin { font-size: var(--fs-label); letter-spacing: .14em; color: var(--ink-45); }
.ingredient-card__name { margin-top: .5em; }
.ingredient-card__note { margin-top: .9em; color: var(--ink-70); font-size: var(--fs-small); line-height: 1.9; }

/* ---------- Motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity var(--dur-rise) var(--ease), transform var(--dur-rise) var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

[data-reveal-media] { clip-path: inset(12% 0 12% 0); transition: clip-path var(--dur-reveal) var(--ease); }
[data-reveal-media].is-in { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  [data-reveal-media] { clip-path: none; }
}
