/* ============================================================
   メットリフォーム — Design Tokens & Base
   ============================================================ */

:root {
  /* niwaya-inspired palette — quieter off-white + deep ink + subtle moss */
  --bg: #F6F4EE;          /* warm off-white */
  --bg-2: #EFEDE5;        /* subtle paper */
  --bg-3: #E2DED2;        /* sand */
  --bg-4: #C8C2B3;        /* deeper sand */
  --ink: #1B1F1C;         /* near-black with green undertone */
  --ink-2: #3A3F38;       /* deep moss */
  --ink-3: #707067;       /* mid grey */
  --ink-4: #A09F95;       /* soft grey */
  --line: rgba(27, 31, 28, 0.10);
  --line-2: rgba(27, 31, 28, 0.05);

  /* Dark section bg (used for "depth" sections like Numbers, BG-images) */
  --bg-dark: #14171A;
  --bg-dark-2: #1F2422;

  /* Accent — keep gold but more refined */
  --accent: #B08544;       /* refined gold */
  --accent-2: #8E6A37;     /* deep gold */
  --accent-ink: #F6F4EE;

  /* Type */
  --serif-jp: "Shippori Mincho", "Shippori Mincho B1", serif;
  --sans-jp: "Noto Sans JP", sans-serif;
  --serif-en: "Cormorant Garamond", Georgia, serif;
  --serif-num: "PT Serif", "Cormorant Garamond", Georgia, serif;

  /* Spacing scale (multiplied by --space-mult via Tweaks) */
  --space-mult: 1;
  --gutter: 6vw;

  /* Motion */
  --anim-speed: 1;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans-jp);
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--ink); color: var(--bg); }

/* ───────────────── Typography primitives ───────────────── */

.eyebrow {
  font-family: var(--serif-en);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  font-style: italic;
}

.eyebrow-num {
  font-family: var(--serif-en);
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  font-weight: 500;
}

.display {
  font-family: var(--serif-jp);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-wrap: pretty;
}

.h-xl {
  font-size: clamp(34px, 5.6vw, 68px);
}
.h-lg {
  font-size: clamp(28px, 4.2vw, 48px);
}
.h-md {
  font-size: clamp(22px, 2.8vw, 32px);
}

.body {
  font-family: var(--sans-jp);
  font-size: 15px;
  line-height: 2;
  color: var(--ink-2);
}

.body-lg {
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 2;
  color: var(--ink-2);
}

/* ───────────────── Layout ───────────────── */

.section {
  padding: calc(120px * var(--space-mult)) var(--gutter);
  position: relative;
}
.section-sm {
  padding: calc(80px * var(--space-mult)) var(--gutter);
}

.inner {
  max-width: 1320px;
  margin: 0 auto;
}

.inner-narrow {
  max-width: 1080px;
  margin: 0 auto;
}

.divider {
  width: 40px;
  height: 1px;
  background: var(--ink-3);
  border: 0;
  margin: 0;
}

.divider-v {
  width: 1px;
  height: 40px;
  background: var(--ink-3);
  margin: 0 auto;
}

/* ───────────────── Buttons ───────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  font-size: 14px;
  letter-spacing: 0.08em;
  font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: all calc(0.4s / var(--anim-speed)) var(--ease);
  position: relative;
  overflow: hidden;
  font-family: var(--sans-jp);
  min-height: 52px;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  transform: translateX(-101%);
  transition: transform calc(0.5s / var(--anim-speed)) var(--ease);
  z-index: 0;
}

.btn:hover::before { transform: translateX(0); }
.btn:hover { color: var(--ink); }

.btn > * { position: relative; z-index: 1; }

.btn .arrow {
  width: 20px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width calc(0.4s / var(--anim-speed)) 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 .arrow { width: 28px; }

.btn-outline {
  background: transparent;
  color: var(--ink);
}
.btn-outline::before { background: var(--ink); }
.btn-outline:hover { color: var(--bg); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 14px 22px;
  min-height: 46px;
}
.btn-ghost::before { background: var(--ink); }
.btn-ghost:hover { color: var(--bg); border-color: var(--ink); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  transition: gap calc(0.3s / var(--anim-speed)) var(--ease);
}
.text-link:hover { gap: 18px; }

/* ───────────────── Image placeholders ───────────────── */

.img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--bg-3);
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform calc(1.2s / var(--anim-speed)) var(--ease),
              filter calc(0.8s / var(--anim-speed)) var(--ease);
}

.img-zoom:hover img { transform: scale(1.06); }

/* Scroll reveals */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity calc(1.1s / var(--anim-speed)) var(--ease),
              transform calc(1.1s / var(--anim-speed)) var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-delay-1 { transition-delay: calc(0.08s / var(--anim-speed)); }
.reveal-delay-2 { transition-delay: calc(0.16s / var(--anim-speed)); }
.reveal-delay-3 { transition-delay: calc(0.24s / var(--anim-speed)); }
.reveal-delay-4 { transition-delay: calc(0.32s / var(--anim-speed)); }
.reveal-delay-5 { transition-delay: calc(0.40s / var(--anim-speed)); }

.reveal-up   { transform: translateY(48px); }
.reveal-right{ transform: translateX(-32px); }
.reveal-scale{ transform: scale(.96); }
.reveal.in.reveal-right { transform: translateX(0); }
.reveal.in.reveal-scale { transform: scale(1); }

/* Letter-by-letter reveal for hero lines */
.word-reveal { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word-reveal > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform calc(1.1s / var(--anim-speed)) cubic-bezier(.2,.8,.2,1);
}
.word-reveal.in > span { transform: translateY(0); }

/* Clip-path image reveal — niwaya-style curtain-up */
.reveal-clip {
  clip-path: inset(0 0 100% 0);
  transition: clip-path calc(1.4s / var(--anim-speed)) cubic-bezier(.65, .05, .25, 1);
}
.reveal-clip.in { clip-path: inset(0 0 0 0); }

/* ───────────── Niwaya-style vertical title ───────────── */
/* EN (italic Garamond) + JA (Shippori Mincho) stacked vertically with right-border lines */
.title-vt {
  display: flex;
  align-items: flex-start;
  gap: clamp(20px, 3.6vw, 60px);
}
.title-vt__en {
  display: inline-block;
  writing-mode: vertical-rl;
  -webkit-writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(13px, 1vw, 16px);
  letter-spacing: 0.18em;
  color: var(--ink-3);
  padding-top: 2px;
}
.title-vt__ja-wrap {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: clamp(14px, 1.4vw, 22px);
  font-family: var(--serif-jp);
  font-weight: 500;
  color: var(--ink);
}
.title-vt__ja {
  white-space: pre;
  writing-mode: vertical-rl;
  -webkit-writing-mode: vertical-rl;
  line-height: 1;
  letter-spacing: 0.16em;
  padding-right: clamp(12px, 1.2vw, 18px);
  border-right: 1px solid var(--ink-2);
  font-size: clamp(22px, 2.2vw, 32px);
}
.title-vt__ja--lead { font-size: clamp(26px, 2.8vw, 40px); }

/* Dark variant — for dark sections */
.title-vt--dark .title-vt__en { color: rgba(246, 244, 238, 0.55); }
.title-vt--dark .title-vt__ja-wrap { color: var(--bg); }
.title-vt--dark .title-vt__ja { border-right-color: rgba(246, 244, 238, 0.32); }

/* Mobile: switch to horizontal */
@media (max-width: 720px) {
  .title-vt {
    flex-direction: column;
    gap: 12px;
  }
  .title-vt__en {
    writing-mode: horizontal-tb;
    -webkit-writing-mode: horizontal-tb;
    font-size: 12px;
  }
  .title-vt__ja-wrap {
    flex-direction: column;
    gap: 4px;
  }
  .title-vt__ja {
    writing-mode: horizontal-tb;
    -webkit-writing-mode: horizontal-tb;
    border-right: none;
    border-left: 2px solid var(--accent);
    padding-right: 0;
    padding-left: 14px;
    line-height: 1.5;
    font-size: clamp(20px, 5.6vw, 28px);
  }
  .title-vt__ja--lead { font-size: clamp(24px, 6.6vw, 32px); }
  .title-vt--dark .title-vt__ja {
    border-left-color: var(--accent);
  }
}

/* ───────────── Scroll-down indicator ───────────── */
.scroll-down {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
}
.scroll-down__label {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--bg);
  text-transform: uppercase;
  opacity: 0.85;
}
.scroll-down__line {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, transparent, rgba(246, 244, 238, 0.85), transparent);
  background-size: 100% 200%;
  background-position: 0 0;
  animation: scrollLine 2.4s var(--ease) infinite;
}
@keyframes scrollLine {
  0%   { background-position: 0 -100%; }
  100% { background-position: 0 100%; }
}

/* ───────────── Arrow button (niwaya c-btn01 style) ───────────── */
.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px 14px 28px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.14em;
  transition: all calc(0.4s / var(--anim-speed)) var(--ease);
  cursor: pointer;
}
.btn-arrow__ja {
  font-family: var(--sans-jp);
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.btn-arrow__icon {
  width: 26px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width calc(0.4s / var(--anim-speed)) var(--ease);
}
.btn-arrow__icon::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-arrow:hover { background: var(--ink); color: var(--bg); }
.btn-arrow:hover .btn-arrow__icon { width: 38px; }

.btn-arrow--light {
  border-color: rgba(246, 244, 238, 0.6);
  color: var(--bg);
}
.btn-arrow--light:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* ───────────────── Header ───────────────── */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  transition: background calc(0.4s / var(--anim-speed)) var(--ease),
              backdrop-filter calc(0.4s / var(--anim-speed)) var(--ease),
              padding calc(0.4s / var(--anim-speed)) var(--ease),
              border calc(0.4s / var(--anim-speed)) var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  padding: 14px var(--gutter);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--serif-jp);
  font-weight: 500;
}

.brand .logo-mark {
  font-family: var(--serif-jp);
  font-size: 19px;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink);
}
.brand .logo-mark em {
  font-style: italic;
  color: var(--accent);
}

.brand .logo-jp {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.18em;
}

@media (max-width: 480px) {
  .brand .logo-mark { font-size: 16px; }
  .brand .logo-jp { display: none; }
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav a {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  position: relative;
  padding: 8px 0;
}
.nav a .nav-en {
  display: block;
  font-family: var(--serif-en);
  font-size: 11px;
  font-style: italic;
  color: var(--ink-4);
  letter-spacing: 0.12em;
  margin-bottom: 2px;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width calc(0.35s / var(--anim-speed)) var(--ease);
}
.nav a:hover::after { width: 100%; }

.header-cta {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-tel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity calc(0.3s / var(--anim-speed)) var(--ease);
}
.header-tel:hover { opacity: 0.7; }
.header-tel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--ink);
  flex-shrink: 0;
  opacity: 0.7;
}
.header-tel-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 2px;
}
.header-tel-num {
  font-family: var(--serif-num);
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.header-tel-hours {
  font-family: var(--serif-jp);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  letter-spacing: 0.1em;
  transition: all calc(0.35s / var(--anim-speed)) var(--ease);
}
.nav-cta:hover { background: var(--accent); }
.nav-cta::after { display: none !important; }

.burger {
  display: none;
  width: 44px; height: 44px;
  position: relative;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.burger span {
  position: absolute;
  left: 12px; right: 12px;
  height: 1px;
  background: var(--ink);
  top: 50%;
  transform-origin: center;
  transition: transform calc(0.3s / var(--anim-speed)) var(--ease),
              opacity calc(0.3s / var(--anim-speed)) var(--ease),
              background calc(0.3s / var(--anim-speed)) var(--ease);
}
.burger span:nth-child(1) { transform: translateY(calc(-50% - 6px)); }
.burger span:nth-child(2) { transform: translateY(-50%); }
.burger span:nth-child(3) { transform: translateY(calc(-50% + 6px)); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(-50%) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-50%) rotate(-45deg); }

/* ───────── Header — over hero (transparent state, light text) ───────── */
.site-header:not(.scrolled) .brand .logo-mark { color: var(--bg); }
.site-header:not(.scrolled) .brand .logo-jp { color: rgba(250, 247, 242, 0.72); }
.site-header:not(.scrolled) .nav a { color: rgba(250, 247, 242, 0.92); }
.site-header:not(.scrolled) .nav a .nav-en { color: rgba(250, 247, 242, 0.55); }
.site-header:not(.scrolled) .nav a::after { background: var(--bg); }
.site-header:not(.scrolled) .nav-cta {
  background: rgba(250, 247, 242, 0.95);
  color: var(--ink);
}
.site-header:not(.scrolled) .nav-cta:hover {
  background: var(--accent);
  color: var(--bg);
}
.site-header:not(.scrolled) .burger { border-color: rgba(250, 247, 242, 0.45); }
.site-header:not(.scrolled) .burger span { background: var(--bg); }
.site-header:not(.scrolled) .header-tel-icon { color: var(--bg); }
.site-header:not(.scrolled) .header-tel-num { color: var(--bg); }
.site-header:not(.scrolled) .header-tel-hours { color: rgba(250, 247, 242, 0.6); }

.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 90;
  padding: 88px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity calc(0.4s / var(--anim-speed)) var(--ease),
              transform calc(0.4s / var(--anim-speed)) var(--ease);
}
.mobile-nav.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.mobile-nav a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif-jp);
  font-size: 18px;
}
.mobile-nav a .en {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
}

@media (max-width: 1280px) {
  .header-tel { display: none; }
}
@media (max-width: 1180px) {
  .nav { gap: 18px; }
  .nav a { font-size: 11.5px; letter-spacing: 0.03em; }
  .nav a .nav-en { display: none; }
  .nav-cta { padding: 10px 16px; font-size: 11.5px; }
}
@media (max-width: 1080px) {
  .brand .logo-jp { display: none; }
  .nav { gap: 14px; }
  .nav a { font-size: 11px; }
  .header-cta { gap: 12px; }
}
@media (max-width: 980px) {
  .brand .logo-mark { font-size: 17px; }
  .nav { gap: 12px; }
  .nav a { font-size: 10.5px; letter-spacing: 0.02em; }
  .nav-cta { padding: 9px 14px; font-size: 10.5px; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .header-cta { display: none; }
  .burger { display: block; }
  :root { --gutter: 5vw; }
  .section { padding: calc(80px * var(--space-mult)) var(--gutter); }
}

/* ───────────────── Floating mobile CTA ───────────────── */

.floating-cta {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 80;
  display: none;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity calc(0.4s / var(--anim-speed)) var(--ease),
              transform calc(0.4s / var(--anim-speed)) var(--ease);
}
.floating-cta.visible { opacity: 1; transform: translateY(0); }

.floating-cta.bar {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: rgba(42, 36, 32, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(42, 36, 32, 0.25);
}
.floating-cta.bar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  color: var(--bg);
  font-size: 13px;
  letter-spacing: 0.08em;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
}
.floating-cta.bar a.primary {
  background: var(--bg);
  color: var(--ink);
  font-weight: 500;
  border-color: var(--bg);
}

.floating-cta.pill {
  display: flex;
  justify-content: center;
}
.floating-cta.pill a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(42, 36, 32, 0.3);
  font-size: 14px;
  letter-spacing: 0.06em;
}

@media (min-width: 901px) {
  .floating-cta { display: none !important; }
}

/* ───────────────── Footer ───────────────── */

.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 100px var(--gutter) 40px;
  position: relative;
}
.site-footer .eyebrow { color: var(--ink-4); }
.site-footer hr { border: 0; border-top: 1px solid rgba(250,247,242,.12); margin: 60px 0 30px; }
.site-footer .copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  flex-wrap: wrap;
  gap: 16px;
}
