/* ===========================================================================
   afbl.jp — editorial renewal
   Type system, tokens, layout primitives
   =========================================================================== */

:root {
  /* paper / ink palette ---------------------------------------------------- */
  --paper: #f5f3ee;
  --paper-2: #ece8df;
  --paper-3: #e0dccf;
  --ink: #1a1a1a;
  --ink-2: #2b2925;
  --ink-mute: #6b6862;
  --ink-faint: #a8a39a;
  --hair: rgba(26, 26, 26, 0.14);
  --hair-strong: rgba(26, 26, 26, 0.32);

  /* type ------------------------------------------------------------------- */
  --f-jp-display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-jp-body: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-en-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --f-en-body: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --f-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* scale ------------------------------------------------------------------ */
  --fs-mega: clamp(36px, 5vw, 76px);
  --fs-display: clamp(34px, 4.4vw, 68px);
  --fs-h1: clamp(28px, 3.2vw, 48px);
  --fs-h2: clamp(22px, 2.4vw, 36px);
  --fs-h3: clamp(20px, 1.8vw, 28px);
  --fs-lead: clamp(17px, 1.25vw, 21px);
  --fs-body: 16px;
  --fs-small: 13px;
  --fs-micro: 11px;

  /* rhythm ----------------------------------------------------------------- */
  --container: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
  --rule: 1px solid var(--hair);
}

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

html, body { background: var(--paper); color: var(--ink); }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--f-jp-body);
  font-size: var(--fs-body);
  line-height: 1.85;
  font-feature-settings: "palt" 1;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

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

/* ----- type primitives ----- */
.t-mega { font-family: var(--f-jp-display); font-weight: 400; font-size: var(--fs-mega); line-height: 1.1; letter-spacing: -0.01em; }
.t-display { font-family: var(--f-jp-display); font-weight: 400; font-size: var(--fs-display); line-height: 1.18; letter-spacing: 0; }
.t-h1 { font-family: var(--f-jp-display); font-weight: 400; font-size: var(--fs-h1); line-height: 1.3; }
.t-h2 { font-family: var(--f-jp-display); font-weight: 400; font-size: var(--fs-h2); line-height: 1.45; }
.t-h3 { font-family: var(--f-jp-display); font-weight: 500; font-size: var(--fs-h3); line-height: 1.5; }
.t-lead { font-family: var(--f-jp-body); font-size: var(--fs-lead); line-height: 2; letter-spacing: 0.04em; }
.t-body { font-family: var(--f-jp-body); font-size: var(--fs-body); line-height: 2; letter-spacing: 0.04em; }
.t-small { font-family: var(--f-jp-body); font-size: var(--fs-small); line-height: 1.8; letter-spacing: 0.06em; color: var(--ink-mute); }

.t-en { font-family: var(--f-en-display); font-style: italic; font-weight: 400; }
.t-en-r { font-family: var(--f-en-display); font-style: normal; font-weight: 400; }
.t-en-caps { font-family: var(--f-en-body); font-style: normal; font-weight: 500; font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-mute); }

.t-num { font-family: var(--f-en-display); font-style: normal; font-variant-numeric: lining-nums; }

/* underline link */
.u-link { position: relative; display: inline-block; }
.u-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink); transform-origin: right center;
  transform: scaleX(1); transition: transform 0.6s cubic-bezier(0.7, 0, 0.2, 1);
}
.u-link:hover::after { transform-origin: left center; transform: scaleX(0); animation: u-link-in 0.6s 0.6s cubic-bezier(0.7, 0, 0.2, 1) forwards; }
@keyframes u-link-in { from { transform: scaleX(0); transform-origin: left center; } to { transform: scaleX(1); transform-origin: left center; } }

/* layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-wide { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 var(--gutter); }
.rule { border-top: var(--rule); }
.rule-b { border-bottom: var(--rule); }

/* section label (tiny, sequential numbers) */
.section-mark {
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--f-en-body); font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ink-mute);
}
.section-mark .num { font-style: italic; font-family: var(--f-en-display); font-size: 13px; letter-spacing: 0; color: var(--ink); }
.section-mark .bar { flex: 1; height: 1px; background: var(--hair); min-width: 30px; max-width: 80px; }

/* image placeholder — striped, monospace caption */
.imgph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      rgba(26,26,26,0.04) 0 1px,
      transparent 1px 14px),
    var(--paper-2);
  color: var(--ink-mute);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.imgph::before { content: ""; position: absolute; inset: 0; border: 1px solid var(--hair); pointer-events: none; }
.imgph .imgph-cap {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-mute); max-width: 60%;
}
.imgph.dark {
  background:
    repeating-linear-gradient(135deg,
      rgba(245,243,238,0.06) 0 1px,
      transparent 1px 14px),
    #1d1c19;
  color: #b9b4a7;
}
.imgph.dark::before { border-color: rgba(245,243,238,0.08); }

/* fade-on-enter */
.fade-in { opacity: 0; transform: translateY(14px); transition: opacity 1.2s cubic-bezier(0.2,0.7,0.2,1), transform 1.2s cubic-bezier(0.2,0.7,0.2,1); }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* split-line type — words slide up on enter */
.lift-line { display: block; overflow: hidden; }
.lift-line > span {
  display: inline-block; transform: translateY(110%);
  transition: transform 1.1s cubic-bezier(0.7, 0, 0.2, 1);
}
.lift-line.visible > span { transform: translateY(0); }
.lift-line.d1 > span { transition-delay: 0.05s; }
.lift-line.d2 > span { transition-delay: 0.18s; }
.lift-line.d3 > span { transition-delay: 0.31s; }
.lift-line.d4 > span { transition-delay: 0.44s; }
.lift-line.d5 > span { transition-delay: 0.57s; }

/* header / nav */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 22px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(245,243,238,0.92), rgba(245,243,238,0.0));
  backdrop-filter: saturate(110%) blur(8px);
  -webkit-backdrop-filter: saturate(110%) blur(8px);
  transition: background 0.5s ease, padding 0.4s ease;
}
.header.scrolled {
  background: rgba(245,243,238,0.96);
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--hair);
}
.header .brand { display: flex; align-items: center; gap: 14px; }
.header .brand img { transition: opacity 0.3s ease; }
.header .brand:hover img { opacity: 0.7; }

/* image figure */
.afbl-img { position: relative; overflow: hidden; margin: 0; background: var(--paper-2); }
.afbl-img::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(26,26,26,0.06); }
.afbl-img.is-dark { background: #1d1c19; }
.afbl-img img { transition: transform 1.6s cubic-bezier(0.2,0.7,0.2,1), filter 0.8s ease; }
a:hover .afbl-img img, .afbl-img:hover img { transform: scale(1.035); }
.header .nav { display: flex; gap: 38px; align-items: center; }
.header .nav a { font-family: var(--f-en-display); font-style: italic; font-size: 17px; position: relative; padding: 4px 0; }
.header .nav a .jp { font-family: var(--f-jp-body); font-style: normal; font-size: 11px; letter-spacing: 0.22em; color: var(--ink-mute); display: block; line-height: 1; margin-top: 2px; }
.header .nav a.is-current { font-style: italic; }
.header .nav a.is-current::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: -6px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink);
}

/* mobile nav button — hidden on desktop; nav collapses below 880px */
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .header .nav { display: none; }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px;
    width: 26px; cursor: pointer;
  }
  .nav-toggle span { height: 1px; background: var(--ink); display: block; }
  .nav-toggle span:nth-child(2) { width: 70%; align-self: flex-end; }
}

/* footer */
.footer {
  margin-top: 160px;
  padding: 80px var(--gutter) 40px;
  border-top: 1px solid var(--ink);
  background: var(--paper);
}
.footer .footer-top {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 60px;
  align-items: start;
}
.footer .footer-bottom {
  margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; letter-spacing: 0.18em; color: var(--ink-mute); text-transform: uppercase; font-family: var(--f-en-body);
}
@media (max-width: 760px) {
  .footer .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
}

/* page-fade transition */
.page { opacity: 0; transform: translateY(8px); animation: page-in 0.7s cubic-bezier(0.2,0.7,0.2,1) forwards; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* scroll indicator */
.scroll-hint {
  position: absolute; left: var(--gutter); bottom: 32px;
  font-family: var(--f-en-body); font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-mute);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  writing-mode: vertical-rl; transform: rotate(180deg);
}
.scroll-hint::after {
  content: ""; width: 1px; height: 60px; background: linear-gradient(to bottom, var(--ink) 30%, transparent 30%);
  background-size: 100% 8px;
  animation: scroll-line 2.4s linear infinite;
}
@keyframes scroll-line {
  0% { background-position: 0 0; }
  100% { background-position: 0 16px; }
}

/* arrow button (cta) */
.arrow-btn {
  display: inline-flex; align-items: center; gap: 18px;
  font-family: var(--f-jp-display); font-size: 18px; letter-spacing: 0.06em;
  padding: 18px 0; border-bottom: 1px solid var(--ink);
  position: relative; transition: padding-right 0.5s cubic-bezier(0.7,0,0.2,1);
}
.arrow-btn .arrow { width: 50px; height: 1px; background: var(--ink); position: relative; transition: width 0.5s cubic-bezier(0.7,0,0.2,1); }
.arrow-btn .arrow::after {
  content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 7px; height: 7px; border-right: 1px solid var(--ink); border-top: 1px solid var(--ink);
}
.arrow-btn:hover .arrow { width: 86px; }

/* simple bordered tag */
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--f-en-body); font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink-mute); padding: 6px 12px; border: 1px solid var(--hair); border-radius: 999px;
}

/* big number plate */
.big-num {
  font-family: var(--f-en-display); font-style: italic; font-weight: 400;
  font-size: clamp(60px, 8vw, 124px); line-height: 1; color: var(--ink);
}

/* light hairline grid (for editorial flair on some sections) */
.col-rule { border-left: 1px solid var(--hair); padding-left: 28px; }

/* form input (Contact) */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--f-en-body); font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-mute); }
.field label .req { color: var(--ink); margin-left: 6px; }
.field input, .field textarea, .field select {
  background: transparent; border: none; border-bottom: 1px solid var(--ink);
  padding: 12px 0; font-family: var(--f-jp-body); font-size: 16px; color: var(--ink);
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-bottom-color: var(--ink); background: rgba(26,26,26,0.02); }
.field textarea { resize: vertical; min-height: 120px; }

/* page intro hero */
.page-hero {
  padding: 200px var(--gutter) 100px;
  border-bottom: 1px solid var(--hair);
}
.page-hero .crumb { font-family: var(--f-en-body); font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 28px; }
.page-hero .title-en { font-family: var(--f-en-display); font-style: italic; font-size: clamp(44px, 7.5vw, 108px); line-height: 1; }
.page-hero .title-jp { font-family: var(--f-jp-display); font-size: clamp(22px, 2vw, 30px); margin-top: 26px; }
.page-hero .lead { max-width: 640px; margin-top: 48px; }

/* utility */
.mt-xs { margin-top: 12px; } .mt-s { margin-top: 24px; } .mt-m { margin-top: 48px; } .mt-l { margin-top: 80px; } .mt-xl { margin-top: 140px; }
.mb-xs { margin-bottom: 12px; } .mb-s { margin-bottom: 24px; } .mb-m { margin-bottom: 48px; } .mb-l { margin-bottom: 80px; }
.txt-mute { color: var(--ink-mute); }
.italic { font-style: italic; }
.flex-row { display: flex; }
.gap-l { gap: 60px; }
