/* =========================================================
   backslash tokyo — style
   blue    : #008AF1
   magenta : #FF4AFA
   bg      : #EBFFFE -> #CFFBFC -> #FFFFFF
   display : Cormorant Garamond SemiBold (+Italic)
   body jp : Noto Serif JP Light
========================================================= */

:root {
  --blue: #008AF1;
  --magenta: #FF4AFA;
  --bg-top: #EBFFFE;
  --bg-mid: #CFFBFC;
  --serif-en: "Cormorant Garamond", "Times New Roman", serif;
  --serif-jp: "Noto Serif JP Palt", "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --pad-x: clamp(20px, 6.8vw, 98px);
  /* Illustratorの文字パネル「垂直/水平比率」に合わせた文字の横幅比率 */
  --hs-jp: 0.77;
  --hs-en: 0.79;
}

/* palt(約物・かな詰め)を保持した自前サブセット。
   Google Fonts版はpaltが削除されているため、詰め組み用に先頭へ。 */
@font-face {
  font-family: "Noto Serif JP Palt";
  src: url("../fonts/NotoSerifJP-Light-palt.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif-jp);
  font-weight: 300;
  color: var(--blue);
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* デザインは約物・かな詰め(プロポーショナルメトリクス) */
  font-feature-settings: "palt" 1;
}

/* 水色グラデーションはHero〜Culture Collectionの範囲だけで完結させる。
   (bodyの高さに対する%指定だと投稿数で境界がずれてしまうため、
   このラッパーの実高さを基準にする) */
.tint-zone {
  background: linear-gradient(180deg,
    var(--bg-top) 0%,
    #DFFCFD 38%,
    var(--bg-mid) 70%,
    #FFFFFF 100%);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--pad-x) 10px;
  border-bottom: 1px solid var(--blue);
  background: rgba(235, 255, 254, 0.82);
  backdrop-filter: blur(6px);
}
.header-logo img { height: 28px; width: auto; }
.header-nav {
  display: contents;
}
.header-nav a,
.header-nav button {
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: 18px;
  color: var(--blue);
  letter-spacing: 0.02em;
  display: inline-block;
  transform: scaleX(var(--hs-en));
  transform-origin: center;
}
.header-nav .nav-about { position: absolute; left: 50%; transform: translateX(-50%) scaleX(var(--hs-en)); }
.nav-contact:hover, .nav-about:hover { opacity: 0.65; }

/* ===== Hero ===== */
.hero {
  padding: clamp(28px, 5vw, 64px) var(--pad-x) 0;
  position: relative;
  /* デザイン実測: ヘッダー下端〜Culture Collection見出しまでの高さ ≈ 64vw。
     バルーンは絶対配置で通常フローに寄与しないため、min-heightで確保する */
  min-height: clamp(460px, 64vw, 980px);
}
.hero-inner {
  max-width: 46%;
}
.hero-logo { margin-top: clamp(4px, 1vw, 16px); }
.hero-wordmark { width: clamp(260px, 32vw, 470px); height: auto; }
.hero-en {
  margin-top: clamp(28px, 4vw, 56px);
  font-family: var(--serif-en);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(11px, 1vw, 14px);
  line-height: 1.75;
  letter-spacing: 0.01em;
  transform: scaleX(var(--hs-en));
  transform-origin: left;
}
.hero-jp {
  margin-top: clamp(20px, 2.4vw, 34px);
  font-size: clamp(14px, 1.35vw, 19px);
  letter-spacing: 0.06em;
  transform: scaleX(var(--hs-jp));
  transform-origin: left;
}
.hero-balloon {
  /* デザイン実測: 幅26.6vw、中心は画面幅の50.2%(ほぼ完全中央)、
     天面はロゴ天面からわずかに下(約1vw)。テキストと独立させ絶対配置で中央固定する */
  position: absolute;
  left: 50%;
  top: clamp(60px, 8.9vw, 128px);
  transform: translateX(-50%);
  width: clamp(220px, 26.6vw, 400px);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 2; }
.hero-balloon-float { will-change: transform; }
.hero-arrow {
  display: none;
  text-align: center;
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: 34px;
  margin: 18px 0 6px;
  animation: arrowNudge 2.6s ease-in-out infinite;
}
@keyframes arrowNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

/* ===== Culture Collection ===== */
.collection { padding: clamp(56px, 8vw, 120px) var(--pad-x) clamp(40px, 6vw, 90px); }
.collection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.collection-title {
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: clamp(38px, 5.7vw, 82px);
  letter-spacing: normal;
  line-height: 1.05;
  display: inline-block;
  transform: scaleX(var(--hs-en));
  transform-origin: left;
}
.title-toggle { display: flex; align-items: center; gap: 12px; }
.title-toggle-label {
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: clamp(15px, 1.4vw, 21px);
  display: inline-block;
  transform: scaleX(var(--hs-en));
  transform-origin: left;
}
.toggle-pill {
  position: relative;
  width: 46px;
  height: 22px;
  background: var(--blue);
  transition: background 0.25s ease;
}
.toggle-knob {
  position: absolute;
  top: 3px;
  right: 3px;
  left: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s ease;
}
.toggle-pill.is-on { background: var(--magenta); }
.toggle-pill.is-on .toggle-knob { transform: translateX(-24px); }

.filters { display: flex; gap: clamp(26px, 6vw, 96px); margin-top: clamp(14px, 1.6vw, 22px); }
.filter-btn {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  height: clamp(28px, 2.7vw, 39px);
}
.filter-btn img { height: 100%; width: auto; display: block; }
.filter-btn .btn-on { display: none; }
.filter-btn.is-active .btn-off { display: none; }
.filter-btn.is-active .btn-on { display: block; }

/* --- Grid --- */
.collection-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: clamp(16px, 3vw, 56px);
  row-gap: clamp(64px, 7vw, 120px);
  margin-top: clamp(56px, 6vw, 96px);
  padding-bottom: 40px;
}
.card {
  position: relative;
  transform: translateY(var(--ty, 0px)) scale(var(--sc, 1));
  opacity: var(--op, 1);
  transition: opacity 0.38s cubic-bezier(.2,.7,.2,1), transform 0.38s cubic-bezier(.2,.7,.2,1);
}
/* scattered rhythm: middle column floats higher, sides lower */
.card:nth-child(3n+1) { --ty-base: clamp(30px, 4vw, 70px); }
.card:nth-child(3n+2) { --ty-base: 0px; }
.card:nth-child(3n)   { --ty-base: clamp(44px, 5.4vw, 96px); }
.card { --ty: var(--ty-base, 0px); }
/* フィルター切り替え/読み込み時のふわっとした出入り */
.card.is-enter { --op: 0; --ty: calc(var(--ty-base, 0px) + 16px); --sc: 0.97; }

.card-link { display: block; }
.card-obj {
  position: relative;
  width: clamp(150px, 17vw, 250px);
  margin: 0 auto;
  will-change: transform;
}
.card-obj img { width: 100%; height: auto; transition: transform 0.45s cubic-bezier(.2,.7,.2,1); }
.card-link:hover .card-obj img { transform: scale(1.06) rotate(-2deg); }

.card-chip {
  display: block;
  height: clamp(22px, 1.85vw, 27px);
  width: auto;
  margin-bottom: 10px;
}

.card-meta { margin-top: 12px; }
.card-title {
  font-size: clamp(14px, 2.05vw, 30px);
  letter-spacing: 0.01em;
  transform: scaleX(var(--hs-jp));
  transform-origin: left;
}
.card-date {
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: clamp(12px, 1.28vw, 18.5px);
  margin-top: 2px;
  transform: scaleX(var(--hs-en));
  transform-origin: left;
}

.card-new {
  font-family: var(--serif-en);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(18px, 1.9vw, 27px);
  color: var(--magenta);
  line-height: 1;
  transform: scaleX(var(--hs-en));
  transform-origin: center;
}
.card-num {
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: clamp(17px, 1.7vw, 24px);
  line-height: 1.2;
  transform: scaleX(var(--hs-en));
  transform-origin: center;
}
.card-tag {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
/* PC 3列グリッド: 左列=左上 / 中央列=右上 / 右列=右下(NEWは常に数字と中央揃え) */
.card:nth-child(3n+1) .card-tag--num { top: -6%; left: -6%; }
.card:nth-child(3n+2) .card-tag--num { top: -6%; right: -6%; }
.card:nth-child(3n)   .card-tag--num { bottom: -6%; right: -6%; flex-direction: column-reverse; }
.card-tag--chip { left: 0; top: -6%; }

/* title-mode vs number-mode visibility (PC) */
.collection.titles-off .card-chip,
.collection.titles-off .card-meta { display: none; }
.collection.titles-on .card-tag--num { display: none; }

.grid-sentinel { height: 2px; }

/* 投稿が無いときの表示 */
.grid-empty {
  font-family: var(--serif-en);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(30px, 3.6vw, 52px);
  color: var(--blue);
  text-align: center;
  padding: clamp(70px, 9vw, 140px) 0 clamp(50px, 7vw, 110px);
  animation: floatBreath 7s ease-in-out infinite;
  opacity: 1;
  max-height: 600px;
  overflow: hidden;
  transition: opacity 0.45s cubic-bezier(.2,.7,.2,1), max-height 0.45s ease, padding 0.45s ease;
}
.grid-empty[hidden] { display: block; opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; pointer-events: none; }
.grid-empty::after { content: ""; }
.grid-empty-text { display: inline-block; transform: scaleX(var(--hs-en)); }

/* ===== About ===== */
.about {
  /* tint-zoneの終わり(=白背景の開始)を基準に、タイトル上と本文下の余白を均等にする */
  padding: clamp(75px, 9.5vw, 155px) var(--pad-x);
}
.about-title {
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: clamp(44px, 5.7vw, 82px);
  letter-spacing: normal;
  display: inline-block;
  transform: scaleX(var(--hs-en));
  transform-origin: left;
}
.about-body {
  /* 設計実測: 本文はfs比 約4.5vw(SP)、行送り1.6、字間ほぼゼロ+palt */
  margin: clamp(56px, 5vw, 76px) auto 0;
  max-width: 680px;
  text-align: left;
  font-size: clamp(17px, 1.28vw, 18.5px);
  line-height: 1.9;
  letter-spacing: 0.01em;
}
.about-body p {
  transform: scaleX(var(--hs-jp));
  transform-origin: left;
}
.about-body p + p { margin-top: 1.55em; }

/* ===== Footer ===== */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px var(--pad-x) 40px;
  background: #fff;
}
.footer-tbwa { height: clamp(11px, 1.05vw, 16px); width: auto; }
.back-to-top img { height: 19px; width: auto; }
.back-to-top:hover { opacity: 0.65; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 10px 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 99;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Floating / breathing ===== */
.float-obj { animation: floatBreath var(--dur, 8s) ease-in-out var(--del, 0s) infinite; }
@keyframes floatBreath {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  30%      { transform: translate3d(4px, -12px, 0) rotate(1.6deg) scale(1.015); }
  62%      { transform: translate3d(-5px, 7px, 0) rotate(-1.4deg) scale(0.99); }
}
@media (prefers-reduced-motion: reduce) {
  .float-obj, .hero-arrow { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ===== SP ===== */
@media (max-width: 760px) {
  .header-nav a, .header-nav button { font-size: 15px; }
  .header-logo img { height: 12px; }

  .hero { min-height: 0; padding-bottom: clamp(40px, 9vw, 70px); }
  .hero-inner { max-width: none; }
  .hero-wordmark { width: min(76vw, 340px); }
  .hero-en { font-size: 10.5px; margin-top: 26px; }
  .hero-jp { font-size: 14px; }
  /* SPはデザイン通り「テキスト→バルーン→↓アイコン」の通常フロー(PCのような背面配置はしない) */
  .hero-balloon {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    display: block;
    width: min(51.8vw, 260px);
    margin: 5.2vw auto 0;
    z-index: auto;
  }
  .hero-arrow { display: block; margin: 6.5vw 0 6px; }
  .footer-tbwa { height: clamp(8px, 2.35vw, 12px); }

  .collection-head { justify-content: center; }
  .collection-title { text-align: center; transform-origin: center; }
  .title-toggle { display: none; } /* SPは常時タイトル表示 */
  .filters { justify-content: center; gap: 7vw; }

  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 6vw;
    row-gap: 72px;
  }
  .card:nth-child(n) { --ty-base: 0px; }
  .card:nth-child(2n)   { --ty-base: -34px; }
  .card:nth-child(2n+1) { --ty-base: 0px; }
  .card-obj { width: min(38vw, 200px); }
  .card-title { font-size: 13px; }
  .card-date { font-size: 11.5px; }
  /* SP always titles-on */
  .collection.titles-off .card-meta { display: block; }
  .collection.titles-off .card-chip { display: block; }
  .collection .card-tag--num { display: none; }
  .card-chip { height: 20px; margin-bottom: 8px; }

  .about { padding-left: 14px; padding-right: 14px; }
  .about-title { display: block; text-align: center; font-size: 10.9vw; letter-spacing: normal; transform-origin: center; }
  .about-body {
    text-align: center;
    font-size: 3.55vw;          /* 設計の改行位置が保たれる最大サイズ */
    line-height: 2.0;           /* 行送り 28px@390(設計実測72px相当) */
    max-width: none;
  }
  .about-body p { letter-spacing: normal; transform-origin: center; }
  .about-body p + p { margin-top: 1.95em; }
}
