/* ==========================================================================
   BASEROOM TOP (Figma: 0918 / TOP_B, 1440 x 6677)
   Vector assets are exported from Figma as SVG (inline sprite + assets/*.svg)
   ========================================================================== */

:root {
  --color-red: #bb2d29;
  --color-red-deep: #87211e;
  --color-bg: #f1eded;
  --color-bg-light: #f9f6f6;
  --color-light: #f9ecec;
  --color-white: #f6f6f6;
  --color-tag: #e9e3e2;

  /* Windows exposes the bold face only through the family name "Yu Gothic" / "游ゴシック" (+ font-weight: bold);
     macOS uses YuGothic / 游ゴシック体. Phones have neither and fall back to Noto Sans JP. */
  --font-ja: "Yu Gothic Bold", "游ゴシック Bold", "Yu Gothic", "游ゴシック", YuGothic, "游ゴシック体", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  /* every English text is Bricolage Grotesque (Figma); --font-display is kept as an alias for existing rules */
  --font-en: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-en);
  --page-scale: 1;

  --design-w: 1440px;
  --gutter: 120px;
  --radius-section: 40px;
  --radius-card: 14px;
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --breath-cycle: 16s;
  --marker-duration: 0.7s;
  --reveal-duration: 0.45s;
  --reveal-step: 0.07s;
  --emerge-duration: 0.7s;
  --how-sheet-lag: 200px;
  --nav2-skew: 34deg;           /* 所属タレント hover: reverses the ellipses' lean */
  --footer-card-shrink: 16;   /* px, unitless so it can build scale factors */
  --how-text-drift: 70px;
  --how-diagram-drift: 40px;
  --glass-blur: 14px;
  --glass-fade: 160px;
  --marker-delay: 0s;
  --ease-marker: cubic-bezier(0.65, 0, 0.35, 1);
  --sway-cycle: 11s;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-red);
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.05em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; }
mark { background: none; color: inherit; }

/* 1440px の固定デザインを画面幅に比例拡大する（--page-scale は index.html の inline script が更新） */
.page {
  position: relative;
  width: var(--design-w);
  margin: 0 auto;
  background: var(--color-bg);
  /* clip (not hidden) so position: sticky inside the page keeps working */
  overflow: hidden;
  overflow: clip;
  zoom: var(--page-scale);
}
@supports not (zoom: 1) {
  .page {
    transform: scale(var(--page-scale));
    transform-origin: top left;
  }
}

/* ---------- shared ---------- */

/* Custom hand pointer for anything clickable. Hotspot = fingertip (4px, 1px); falls back to the system pointer. */
a[href],
button:not(:disabled),
[role="button"],
label[for],
summary {
  cursor: url("../assets/cursor-pointer.svg") 3 1, pointer;
}

.label {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.01em;
}

.h2 {
  font-size: 40px;
  line-height: 52px;
  letter-spacing: -0.04em;
}

.lead {
  font-size: 16px;
  line-height: 26px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.01em;
}
.link-arrow:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.link-arrow__icon {
  width: 26px;
  height: 26px;
  flex: none;
  color: currentColor;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}
.link-arrow:hover .link-arrow__icon { transform: translateX(4px); }
.link-arrow--white { color: var(--color-light); }

/* ---------- header ---------- */

.site-header {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 140px;
  z-index: 10;
  color: var(--color-red);
}

.site-header__logo {
  position: absolute;
  left: 40px; top: 43px;
  width: 50px; height: 50px;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}
.site-header__logo:hover { transform: rotate(-8deg); }

.site-nav__item {
  position: absolute;
  top: 43px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1px;
  color: var(--color-white);
  font-size: 14px;
  letter-spacing: -0.03em;
}
.site-nav__shape {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  color: var(--color-red);
  overflow: visible;
  transform-origin: 50% 50%;
}
.site-nav__item span { position: relative; }

/* 事業内容: corners swap — driven by js/nav.js */

/* 所属タレント: the three slanted ellipses lean the other way (shear the shape, text stays) */
.site-nav__item--2 .site-nav__shape { transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1); }
.site-nav__item--2:hover .site-nav__shape,
.site-nav__item--2:focus-visible .site-nav__shape { transform: skewX(var(--nav2-skew)); }

/* 会社概要: stretches vertically, then settles back */
.site-nav__item--3:hover .site-nav__shape,
.site-nav__item--3:focus-visible .site-nav__shape { animation: nav-stretch 0.6s cubic-bezier(0.34, 1.3, 0.64, 1); }
@keyframes nav-stretch {
  0%   { transform: scaleY(1); }
  35%  { transform: scaleY(1.28); }
  65%  { transform: scaleY(0.92); }
  100% { transform: scaleY(1); }
}
.site-nav__item:focus-visible { outline: 2px solid var(--color-red); outline-offset: 3px; }
.site-nav__item--1 { left: 546px; width: 104px; padding-right: 2px; }
.site-nav__item--2 { left: 654px; width: 132px; }
.site-nav__item--3 { left: 790px; top: 38px; width: 104px; height: 60px; padding-right: 2px; }

.btn-contact {
  position: absolute;
  left: 1220px; top: 40px;
  width: 180px; height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--color-white);
  font-size: 14px;
  letter-spacing: -0.03em;
}
.btn-contact__shape {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  color: var(--color-red);
}
.btn-contact span, .btn-contact__icon { position: relative; }
/* ご相談はこちら: the paper plane flies off to the top-right and glides back in from the bottom-left */
.btn-contact:hover .btn-contact__icon,
.btn-contact:focus-visible .btn-contact__icon { animation: plane-fly 0.9s cubic-bezier(0.45, 0, 0.3, 1); }
@keyframes plane-fly {
  0%   { transform: translate(0, 0); opacity: 1; }
  40%  { transform: translate(18px, -16px) scale(0.7); opacity: 0; }
  41%  { transform: translate(-14px, 12px) scale(0.7); opacity: 0; }
  100% { transform: translate(0, 0); opacity: 1; }
}
.btn-contact:focus-visible { outline: 2px solid var(--color-red); outline-offset: 3px; }
.btn-contact__icon { flex: none; }

/* ---------- KV ---------- */

.kv {
  position: relative;
  height: 920px;
}

.kv__flame {
  position: absolute;
  left: 450px; top: 70px;
  width: 540px; height: 640px;
  pointer-events: none;
  /*
   * Human-like breathing:
   * - 3 breaths per cycle with different depth and length, so it never feels looped
   * - inhale is quicker than exhale, with a short rest after each exhale
   * - the last breath is a deep sigh with a small catch on the way in
   * - a slow, independent sway (different period) keeps the rhythm from lining up
   * Exhaled size is always the original size (scale 1).
   */
  transform-origin: 50% 85%;
  animation:
    flame-breathe var(--breath-cycle) linear infinite,
    flame-sway var(--sway-cycle) ease-in-out infinite;
  will-change: scale, rotate;
}

@keyframes flame-breathe {
  /* easing is written inline: custom properties are not resolved inside keyframes */
  /* breath 1: normal */
  0%   { scale: 1;           animation-timing-function: cubic-bezier(0.3, 0.1, 0.4, 1); }
  12%  { scale: 1.1 1.17;    animation-timing-function: linear; }
  14%  { scale: 1.1 1.17;    animation-timing-function: cubic-bezier(0.45, 0, 0.6, 1); }
  31%  { scale: 1;           animation-timing-function: linear; }
  /* breath 2: shallower, a little quicker */
  35%  { scale: 1;           animation-timing-function: cubic-bezier(0.3, 0.1, 0.4, 1); }
  44%  { scale: 1.07 1.12;   animation-timing-function: cubic-bezier(0.45, 0, 0.6, 1); }
  58%  { scale: 1;           animation-timing-function: linear; }
  /* breath 3: deep sigh with a small catch while inhaling */
  61%  { scale: 1;           animation-timing-function: cubic-bezier(0.3, 0.1, 0.4, 1); }
  69%  { scale: 1.09 1.15;   animation-timing-function: linear; }
  70%  { scale: 1.09 1.15;   animation-timing-function: cubic-bezier(0.3, 0.1, 0.4, 1); }
  76%  { scale: 1.13 1.21;   animation-timing-function: linear; }
  79%  { scale: 1.13 1.21;   animation-timing-function: cubic-bezier(0.45, 0, 0.6, 1); }
  97%  { scale: 1;           animation-timing-function: linear; }
  100% { scale: 1; }
}

@keyframes flame-sway {
  0%, 100% { rotate: -0.6deg; }
  50%      { rotate: 0.8deg; }
}

.kv__copy {
  position: absolute;
  left: 0; right: 0;
  top: 383px;
  text-align: center;
  color: var(--color-light);
  font-size: 14px;
  line-height: 28px;
  letter-spacing: -0.04em;
}

.kv__logotype {
  position: absolute;
  left: 28px; top: 710px;
  width: 1385.6px; height: 190px;
  margin: 0;
  color: var(--color-red);
}
.kv__logotype svg { width: 100%; height: 100%; }

/* ---------- Statement ---------- */

.statement {
  position: relative;
  height: 742px;
  padding: 88px var(--gutter) 0;
}

.statement__label { position: absolute; left: var(--gutter); top: 88px; font-size: 16px; }

.statement__title {
  position: absolute;
  left: var(--gutter); top: 130px;
  font-size: 56px;
  line-height: 84px;
  letter-spacing: -0.04em;
}

.statement__body {
  position: absolute;
  left: 660px; top: 131px;
  width: 700px;
  font-size: 16px;
  line-height: 35px;
}
.statement__body p + p { margin-top: 35px; }
.statement__body mark {
  position: relative;
  isolation: isolate;
  padding: 3px 6px;
  color: var(--color-light);
}
/* a mark right after 、 sits in the punctuation's blank half (Figma) */
.statement__body mark.is-after-punct { margin-left: -7px; }
/* the marker ink: a red bar drawn left → right with scaleX (compositor-only) */
.statement__body mark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-red);
  transform-origin: left center;
}

/*
 * Only hide the ink when JS is present to reveal it again.
 * The text is painted with a two-colour gradient (light | red) clipped to the glyphs;
 * sliding it in sync with the ink makes each character turn light exactly when the pen reaches it.
 */
.js .statement__body mark {
  color: transparent;
  background: linear-gradient(90deg, var(--color-light) 0 50%, var(--color-red) 50% 100%) 100% 0 / 200% 100% no-repeat;
  -webkit-background-clip: text;
          background-clip: text;
  transition: background-position var(--marker-duration) var(--ease-marker) var(--marker-delay);
}
.js .statement__body mark::before {
  transform: scaleX(0);
  transition: transform var(--marker-duration) var(--ease-marker) var(--marker-delay);
}
.js .statement__body.is-marked mark { background-position: 0 0; }
.js .statement__body.is-marked mark::before { transform: scaleX(1); }
.statement__link { margin-top: 40px; }

/* ---------- How we do ---------- */

.how {
  position: relative;
  z-index: 2;
  height: 1140px;
  padding: 119px var(--gutter) 0;
  background: var(--color-bg-light);
  border-radius: var(--radius-section);
}
.how .h2 { margin-top: 25px; }
.how .lead { margin-top: 24px; }

.how__compare {
  position: absolute;
  left: var(--gutter); top: 400px;
  width: 1200px; height: 580px;
}

.how__old {
  position: absolute;
  left: 0; top: 86px;
  width: 420px; height: 408px;
  border: 2px solid var(--color-red);
  border-radius: var(--radius-card);
}

.how__box-title {
  position: absolute;
  left: 0; right: 0;
  top: 43px;
  text-align: center;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.04em;
}

.how__chain {
  position: absolute;
  left: 41px; top: 108px;
  width: 198px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.how__pill {
  width: 198px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--color-red);
  color: var(--color-light);
  font-size: 16px;
  letter-spacing: 0.05em;
}
.how__pill--narrow { width: 115px; }
.how__vline {
  height: 64px;
  display: flex;
  align-items: center;
  color: var(--color-red);
}

.how__issues {
  position: absolute;
  left: 274px; top: 121px;
  font-size: 14px;
  line-height: 1;
}
.how__issues li {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 20px;
}
.how__issues li:nth-child(2) { margin-top: 84px; }
.how__issues li:nth-child(3) { margin-top: 86px; }
.x {
  width: 20px; height: 20px;
  flex: none;
}

.how__arrow {
  position: absolute;
  left: 478px; top: 265px;
  width: 64px; height: 50px;
}

.how__new {
  position: absolute;
  left: 600px; top: 0;
  width: 600px; height: 580px;
  border-radius: var(--radius-card);
  background: var(--color-red);
  color: var(--color-light);
  overflow: hidden;
}
.how__layer {
  position: absolute;
  inset: 0;
  width: 600px; height: 580px;
  max-width: none;
  pointer-events: none;
}
.how__new .how__box-title { top: 49px; }
.how__note {
  position: absolute;
  left: 0; right: 0;
  top: 98px;
  text-align: center;
  font-size: 14px;
  line-height: 22px;
}
.how__center,
.how__role {
  position: absolute;
  --reveal-base: translateX(-50%);
  transform: var(--reveal-base);
  text-align: center;
  white-space: nowrap;
  color: #fff;
}
.how__center {
  left: 301px; top: 331px;
  font-size: 16px;
  line-height: 25px;
  letter-spacing: 0.05em;
}
.how__role strong {
  display: block;
  font-size: 16px;
  line-height: 26px;
  letter-spacing: 0.05em;
}
.how__role span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 19px;
  letter-spacing: 0.05em;
}
.how__role--brand { left: 144px; top: 224px; }
.how__role--kol   { left: 462px; top: 204px; }
.how__role--make  { left: 156px; top: 427px; }
.how__role--biz   { left: 453px; top: 423px; }

/* How we do: the whole section behaves like a sheet sliding over the page.
 * - the sheet rises a little later than the scroll (lags, then catches up)
 * - inside it, the heading block drifts slower than the diagram for depth
 * Uses the standalone translate property so it never fights the reveal transforms. */
.how { view-timeline: --how block; }
@supports (animation-timeline: view()) {
  .how {
    animation: how-sheet-rise linear both;
    animation-timeline: --how;
    animation-range: entry 0% entry 100%;
  }
  .how > .label,
  .how > .h2,
  .how > .lead {
    animation: how-text-drift linear both;
    animation-timeline: --how;
    animation-range: cover 0% cover 100%;
  }
  .how__compare {
    animation: how-diagram-drift linear both;
    animation-timeline: --how;
    animation-range: cover 0% cover 100%;
  }
  @keyframes how-sheet-rise {
    from { translate: 0 var(--how-sheet-lag); }
    to   { translate: 0 0; }
  }
  /* text sinks (moves slower than the page), diagram rises (moves faster):
     they separate while entering, so the lead copy never runs into the diagram */
  @keyframes how-text-drift {
    from { translate: 0 calc(var(--how-text-drift) * -1); }
    to   { translate: 0 var(--how-text-drift); }
  }
  @keyframes how-diagram-drift {
    from { translate: 0 var(--how-diagram-drift); }
    to   { translate: 0 calc(var(--how-diagram-drift) * -1); }
  }
}

/* ---------- Pinned stage (parallax) ----------
 * The team photo is pinned (sticky) for the whole rest of the page:
 * the "BASEROOM Entertainment" glass band, Study Cases and Projects all scroll over it.
 */

.stage {
  position: relative;
  margin-top: -40px;
  timeline-scope: --company;
}
.stage__photo {
  position: sticky;
  top: 0;
  z-index: 0;
  width: 100%;
  /* at least the design height, and never shorter than the visible viewport */
  --stage-photo-h: max(930px, calc(100vh / var(--page-scale)));
  height: var(--stage-photo-h);
  /* keep the following content at its design position even when the photo grows */
  margin-bottom: calc(930px - var(--stage-photo-h));
  overflow: hidden;
}
.stage__photo img {
  position: absolute;
  left: -59px; top: -54px;
  width: 1558px;
  height: max(1039px, calc(100% + 54px));
  max-width: none;
  object-fit: cover;
  object-position: center top;
}

.company {
  position: relative;
  z-index: 1;
  height: 850px;
  view-timeline: --company block;
}
.company__band {
  position: relative;
  width: 100%; height: 890px;
  padding-top: 205px;
  text-align: center;
  color: #fff;
  /* Figma: #383838 0 → 30% → 0 at 30% layer opacity, plus frosted-glass blur over the photo */
  background: linear-gradient(180deg, rgb(56 56 56 / 0) 0%, rgb(56 56 56 / 0.09) 50%, rgb(56 56 56 / 0) 100%);
  -webkit-backdrop-filter: blur(var(--glass-blur));
          backdrop-filter: blur(var(--glass-blur));
  /* fade the glass in at the top edge so the blur has no hard seam */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 var(--glass-fade));
          mask-image: linear-gradient(180deg, transparent 0, #000 var(--glass-fade));
}

/* subtle depth: the pinned photo eases from a slight zoom back to 1 while the band passes */
@supports (animation-timeline: view()) {
  .stage__photo img {
    animation: company-photo-settle linear both;
    animation-timeline: --company;
    animation-range: entry 0% exit 20%;
  }
  @keyframes company-photo-settle {
    from { transform: scale(1.08); }
    to   { transform: scale(1); }
  }
}

.company__title {
  font-size: 40px;
  line-height: 60px;
  letter-spacing: -0.04em;
}
.company__title-en { font-family: var(--font-en); letter-spacing: 0.02em; }
.company__body {
  margin-top: 26px;
  font-size: 16px;
  line-height: 26px;
}
.company__body p + p { margin-top: 26px; }
.company__link {
  margin-top: 82px;
  color: #fff;
  font-size: 16px;
}

/* ---------- Study Cases ---------- */

.cases {
  position: relative;
  z-index: 3;
  height: 1126px;
  background: var(--color-bg);
  border-radius: var(--radius-section);
  overflow: hidden;
}
.cases__marquee {
  position: absolute;
  left: -6px; top: 41px;
  width: 200%;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 238px;
  line-height: 1;
  letter-spacing: 3px;
  word-spacing: -18px;
  color: var(--color-red);
}
.cases__marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.cases__marquee-track span {
  display: block;
  padding-right: 0.28em;   /* space between repeats */
}
.cases__title {
  position: absolute;
  left: var(--gutter); top: 300px;
  line-height: 52px;
}
.cases__list {
  position: absolute;
  left: var(--gutter); top: 446px;
  display: flex;
  align-items: flex-start;
  gap: 40px;
}
.case {
  position: relative;
  flex: none;
  width: 580px; height: 558px;
  padding: 32px 32px 0 33px;
  border: 2px solid var(--color-red);
  border-radius: 20px;
}
.case--2 { height: 562px; margin-top: -2px; }
.case--2 .flow:first-of-type { row-gap: 16px; }
.case__head {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.case__num { font-family: var(--font-en); font-weight: 700; font-size: 16px; letter-spacing: 0.01em; }
.case__title {
  margin-top: 33px;
  font-size: 24px;
  line-height: 31px;
  letter-spacing: -0.04em;
}
.case__meta {
  margin-top: 15px;
  font-size: 14px;
  line-height: 22px;
}
.case__meta-gap { display: inline-block; width: 28px; }
.case__desc {
  font-size: 14px;
  line-height: 22px;
}
.case__cat {
  margin-top: 32px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.flow + .case__cat { margin-top: 30px; }
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 14px;
  font-size: 16px;
  letter-spacing: -0.03em;
}
.flow__step {
  height: 48px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  background: var(--color-red);
  color: var(--color-light);
}
.flow__arrow {
  display: flex;
  align-items: center;
  height: 48px;
  color: var(--color-red);
}
.flow__arrow svg { width: 16px; height: 12.25px; }

/* ---------- Projects ---------- */

.projects {
  position: relative;
  z-index: 1;
  margin-top: -114px;
  /* 986px in the design; grows when a card's description runs long */
  min-height: 986px;
  padding: 252px 0 160px;
  background: var(--color-bg-light);
}
.projects__head {
  position: absolute;
  left: var(--gutter); top: 162px;
  width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.projects__title {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: -0.04em;
}
.projects__title span {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  line-height: 1;
}
.projects__nav {
  display: flex;
  gap: 40px;
  margin-right: 80px;
}

.arrow-btn {
  display: block;
  width: 40px; height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-light);
  cursor: pointer;
  transition: opacity var(--duration-fast) ease;
}
.arrow-btn svg { display: block; width: 40px; height: 40px; overflow: visible; }
.arrow-btn circle {
  fill: var(--color-red);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--duration-fast) var(--ease-out-expo);
}
/* Figma hover: circle r 20 → 18, glyph unchanged */
.arrow-btn:not(:disabled):hover circle { transform: scale(0.9); }
/* nothing more to scroll that way */
.arrow-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.arrow-btn:focus-visible { outline: 2px solid var(--color-red); outline-offset: 3px; border-radius: 50%; }
.arrow-btn--prev svg use { transform: rotate(180deg); transform-origin: 20px 20px; }

/* Full-bleed track: two cards sit 80px in from each edge, so 40px of the previous / next card peeks in. */
.projects__track {
  --projects-inset: 80px;
  width: 100%;
  display: flex;
  gap: 40px;
  padding: 0 var(--projects-inset);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--projects-inset);
  scrollbar-width: none;
}
.projects__track::-webkit-scrollbar { display: none; }

.project {
  position: relative;
  flex: none;
  /* cards in a row share the tallest height; the scope block is pushed to the bottom */
  display: flex;
  flex-direction: column;
  width: 620px; min-height: 574px;
  padding: 22px;
  border: 2px solid transparent;
  border-radius: 20px;
  background: var(--color-bg);
  scroll-snap-align: start;
  transition: border-color var(--duration-fast) ease;
}
.project:hover,
.project:focus-within { border-color: var(--color-red); }
.project__link { display: block; flex: none; padding-bottom: 16px; color: inherit; }
.project__link:focus-visible { outline: none; }
.project__img {
  width: 572px; height: 334px;
  border-radius: 12px;
  object-fit: cover;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}
/* Figma hover: image 572x334 → 560x327 */
.project:hover .project__img { transform: translateY(3px) scale(0.979); }
.project__name {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 22px;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: 0;
}
/* hover underline is drawn left → right (same motion as the links on the About page) */
.project__name span {
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 3px) / 0 2px no-repeat;
  transition: background-size var(--duration-normal) var(--ease-out-expo);
}
.project:hover .project__name span,
.project:focus-within .project__name span { background-size: 100% 2px; }
.project__ext { width: 19.5px; height: 19.9px; flex: none; }
.project__desc {
  margin-top: 1px;
  font-size: 16px;
  line-height: 26px;
  letter-spacing: 0.05em;
}
.project__scope {
  flex: none;
  margin-top: auto;
  display: flex;
  align-items: center;
  min-height: 48px;
}
.project__scope-label {
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 395px;
  margin-left: 10px;
  padding-left: 8px;
  border-left: 1px solid var(--color-red);
}
.project__tags li {
  height: 22px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* ---------- Sequenced reveal (left → right) ----------
 * Items inside [data-reveal] appear in order of --seq once the block scrolls into view.
 * Hidden state applies only when JS is running (html.js), so content is never lost.
 */
.js [data-reveal] .reveal {
  opacity: 0;
  transform: var(--reveal-base, ) translateY(14px);
  transition:
    opacity var(--reveal-duration) ease,
    transform var(--reveal-duration) var(--ease-out-expo);
  transition-delay: calc(var(--seq, 0) * var(--reveal-step));
}
.js [data-reveal] .reveal--pop  { transform: var(--reveal-base, ) scale(0.85); }
.js [data-reveal] .reveal--grow { transform: scaleY(0); transform-origin: center; }
.js [data-reveal] .reveal--slide { transform: translateX(-24px); }
/* hand-drawn ellipse: wipes in left → right like a pen stroke */
.js [data-reveal] .reveal--draw {
  opacity: 1;
  transform: none;
  clip-path: inset(0 100% 0 0);
  transition: clip-path calc(var(--reveal-duration) * 1.4) var(--ease-marker);
  transition-delay: calc(var(--seq, 0) * var(--reveal-step));
}
.js [data-reveal].is-revealed .reveal {
  opacity: 1;
  transform: var(--reveal-base, );
}
.js [data-reveal].is-revealed .reveal--draw { clip-path: inset(0 0 0 0); }

/* card: comes from the back (small, soft) and pops slightly toward the viewer before settling */
.js [data-reveal] .reveal--emerge {
  opacity: 0;
  transform: perspective(1000px) translate3d(0, 24px, -260px);
  filter: blur(6px);
  transition: none;
}
.js [data-reveal].is-revealed .reveal--emerge {
  animation: card-emerge var(--emerge-duration) cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--seq, 0) * var(--reveal-step));
}
@keyframes card-emerge {
  0%   { opacity: 0; transform: perspective(1000px) translate3d(0, 24px, -260px); filter: blur(6px); }
  55%  { opacity: 1; transform: perspective(1000px) translate3d(0, 0, 36px);     filter: blur(0); }
  100% { opacity: 1; transform: perspective(1000px) translate3d(0, 0, 0);        filter: none; }
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 2;
  margin-top: -40px;
  height: 764px;
  background: var(--color-red);
  color: var(--color-light);
  border-radius: var(--radius-section) var(--radius-section) 0 0;
  overflow: hidden;
}
.footer-nav {
  position: absolute;
  left: 60px; top: 60px;
  width: 1320px;
  display: flex;
  align-items: center;
  padding-top: 12px;
  border-top: 2px solid var(--color-red-deep);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.footer-nav a {
  position: relative;
  padding: 4px 13px;
}
.footer-nav a:first-child { padding-left: 0; }
.footer-nav a + a::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 1px; height: 12px;
  background: var(--color-red-deep);
  transform: translateY(-50%);
}
.footer-nav a[aria-current="page"] { color: var(--color-red-deep); }

.site-footer__glow {
  position: absolute;
  left: 379px; top: 135px;
  width: 682px; height: 774px;
  max-width: none;
  pointer-events: none;
  /* same breathing + sway as the KV flame (.kv__flame); grows upward from the footer's bottom edge */
  transform-origin: 50% 85%;
  animation:
    flame-breathe var(--breath-cycle) linear infinite,
    flame-sway var(--sway-cycle) ease-in-out infinite;
  will-change: scale, rotate;
}

.footer-cards {
  position: absolute;
  left: var(--gutter); top: 180px;
  display: flex;
  gap: 60px;
}
.footer-card {
  position: relative;
  isolation: isolate;
  width: 570px; height: 287px;
  padding: 60px 61px 0;
  color: var(--color-red);
}
/* The white surface lives on a pseudo-element so hover can shrink only the padding area
   while text and links keep their size. It is scaled with transform (stable, compositor-only;
   animating clip-path glitched on the first hover in Chrome). X/Y scales are computed so every
   edge moves in by the same --footer-card-shrink (card is 570 x 287). */
.footer-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 12px;
  background: var(--color-white);
  transform: scale(1);
  transition: transform var(--duration-normal) var(--ease-out-expo);
  will-change: transform;
}
.footer-card:hover::before,
.footer-card:focus-within::before {
  transform: scale(
    calc(1 - var(--footer-card-shrink) * 2 / var(--fc-w, 570)),
    calc(1 - var(--footer-card-shrink) * 2 / var(--fc-h, 287))
  );
}
.footer-card__title {
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.04em;
}
.footer-card__desc {
  margin-top: 19px;
  font-size: 16px;
  line-height: 26px;
  margin-right: -6px;
}
.footer-card__link {
  --fc-link-x: 61px;
  --fc-link-y: 198px;
  position: absolute;
  left: var(--fc-link-x); top: var(--fc-link-y);
  font-size: 16px;
}
/* The whole card is the link's hit area, so it gets the link cursor and is clickable anywhere. */
.footer-card__link::after {
  content: "";
  position: absolute;
  left: calc(var(--fc-link-x) * -1); top: calc(var(--fc-link-y) * -1);
  width: calc(var(--fc-w, 570) * 1px); height: calc(var(--fc-h, 287) * 1px);
}

.site-footer__logotype {
  position: absolute;
  left: 24px; top: 587px;
  width: 1392px; height: 191px;
  margin: 0;
  color: var(--color-white);
}
.site-footer__logotype svg { width: 100%; height: 100%; }

/* ---------- grain ---------- */

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  z-index: 20;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
  .kv__flame, .site-footer__glow { animation: none; will-change: auto; }
  .js .statement__body mark,
  .js .statement__body mark::before { transition: none; }
  .js [data-reveal] .reveal,
  .js [data-reveal] .reveal--draw { transition: none; }
  .js [data-reveal] .reveal--emerge { animation: none; opacity: 1; transform: none; filter: none; }
  .how, .how > .label, .how > .h2, .how > .lead, .how__compare { animation: none; }
  .stage__photo img { animation: none; }
  .site-nav__shape, .btn-contact__icon, .menu-btn__shape, .fab-contact { animation: none !important; transition: none !important; }
}

/* ---------- fallback (WordPress pages without a dedicated design) ---------- */
.fallback { padding: 200px var(--gutter) 160px; min-height: 60vh; }
.fallback__title { font-size: 34px; line-height: 1.5; letter-spacing: 0.06em; }
.fallback__content { margin-top: 32px; max-width: 800px; font-size: 15px; line-height: 2; font-weight: 500; }
.fallback__content p + p { margin-top: 1em; }

/* ---------- SP-only elements (shown by css/sp.css on pages with an SP design) ---------- */
.menu-btn,
.sp-menu,
.fab-contact,
.kv__logotype-sp,
.how__layer--sp,
.how__arrow-sp,
.page br.sp-only { display: none; }
