/* ============================================================
   Kinako AI — public website
   Editorial, quiet, whitespace-forward. Fixed left sidebar nav,
   numbered section markers, a voice "signal" hero motif.
   Ink + warm ivory, periwinkle accent.
   ============================================================ */

:root {
  /* Palette sampled from the Konpeito pitch deck — vivid violet + coral. */
  --ink: #1c1b18;
  --ink-soft: #4a463f;
  --ink-faint: #8f887c;
  --ivory: #f1f2ea;
  --paper: #efe8db;      /* card / recessed surface */
  --line: #ddd4c3;       /* hairline rules */
  --line-soft: #e6dece;
  --accent: #1c1b18;     /* neutral ink accent (no violet/coral) */
  --accent-deep: #4a463f;
  --coral: #1c1b18;      /* neutral emphasis */
  --coral-deep: #000000;
  --lilac: #e6dece;      /* soft neutral tint */
  --tint: #f9f9f5;       /* page base below the hero */

  /* Latin faces first; Japanese glyphs fall back to Hiragino Kaku Gothic
     (system font) so JA text renders in ヒラギノ角ゴ across the site. */
  /* Prefer the real 中ゴシックBBB (Morisawa GothicBBB-Medium — local/Adobe Fonts
     only), then a close web fallback, then system gothics. */
  --jp-sans: "中ゴシックBBB Pr6N", "中ゴシックBBB", "GothicBBB-Medium", "A-OTF 中ゴシックBBB Pr6N", "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  --f-display: "Besley", var(--jp-sans), sans-serif;
  --f-body: "Inter", system-ui, var(--jp-sans);
  --f-mono: "Besley", var(--jp-sans), serif;

  --nav-w: 15rem;        /* fixed sidebar width (desktop) */
  --maxw: 78rem;         /* content measure inside the shell */
  --gutter: clamp(1.5rem, 4vw, 4.5rem);
  --section-y: clamp(5rem, 11vw, 9.5rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}
body {
  margin: 0;
  background: var(--tint);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
img, svg { display: block; max-width: 100%; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 1rem; top: -3.5rem; z-index: 100;
  background: var(--ink); color: var(--ivory); padding: 0.6rem 1rem;
  border-radius: 0.4rem; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

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

.rosette path { fill: var(--ink); }
.rosette--sm { width: 24px; height: 24px; }

/* Mobile-only line break (shown at <=720px via the media query below). */
.br-m { display: none; }

/* Custom cursor: the konpeito mark follows the pointer (mouse only).
   mix-blend-mode keeps it visible on both light and dark surfaces. */
@media (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
}
.cursor {
  position: fixed; top: 0; left: 0; z-index: 300;
  width: 26px; height: 26px; margin: 0; pointer-events: none;
  opacity: 0;
  mix-blend-mode: difference;
  transition: opacity 0.3s var(--ease), width 0.2s var(--ease), height 0.2s var(--ease);
  will-change: transform;
}
.cursor svg { width: 100%; height: 100%; display: block; fill: #fff; }
.cursor.is-visible { opacity: 1; }
.cursor.is-hover { width: 42px; height: 42px; }   /* grows over links/buttons */
.cursor.is-down { width: 20px; height: 20px; }

/* Subtle film-grain / particle noise over the whole page */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.05;
  mix-blend-mode: multiply;
}

/* ============================================================
   Sidebar (fixed, left)
   ============================================================ */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--nav-w); height: 100vh; height: 100svh;
  display: flex; flex-direction: column;
  padding: 2rem 1.75rem;
  background: transparent;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; margin-bottom: 3.25rem; }
.brand-word { display: flex; align-items: baseline; gap: 0.28rem; line-height: 1; }
.brand-serif { font-family: var(--f-display); font-weight: 500; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand-sans { font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; transform: translateY(-0.14em); color: var(--ink); }

.site-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.site-nav a {
  position: relative;
  font-size: 0.98rem; color: var(--ink-soft);
  padding: 0.4rem 0 0.4rem 0.9rem;
  border-left: 1px solid var(--line);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.site-nav a::before {
  content: ""; position: absolute; left: -1px; top: 50%; height: 0;
  width: 2px; background: var(--accent); transform: translateY(-50%);
  transition: height 0.25s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-current { color: var(--ink); border-left-color: transparent; }
.site-nav a.is-current::before { height: 1.1rem; }

/* Contact CTA pinned directly below the sidebar TOC (sidebar is fixed). */
.sidebar-cta {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: flex-start;
  margin-top: 1.4rem;
  padding: 0.6rem 1.15rem;
  background: var(--ink); color: var(--ivory);
  font-size: 0.92rem; font-weight: 500;
  border-radius: 0;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.sidebar-cta:hover { background: var(--accent-deep); color: var(--ivory); }

.sidebar-foot { margin-top: auto; padding-top: 1.5rem; }

/* Language switch */
.lang-switch {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--f-mono); font-size: 0.76rem; letter-spacing: 0.04em;
}
.lang-opt {
  appearance: none; background: none; border: 0; padding: 0.1rem;
  font: inherit; color: var(--ink-faint); cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lang-opt:hover { color: var(--ink-soft); }
.lang-opt.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.lang-sep { color: var(--line); }

/* ============================================================
   Shell (content offset by the sidebar)
   ============================================================ */
.shell { margin-left: var(--nav-w); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-body); font-size: 0.96rem; font-weight: 500;
  padding: 0.82rem 1.55rem; border-radius: 0;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--ivory); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--ivory); }

/* ============================================================
   Section rhythm + numbered markers
   ============================================================ */
.section {
  position: relative;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: var(--section-y) var(--gutter);
}
/* Full-bleed alternating band: fills the content column edge-to-edge while
   the inner text stays aligned to the --maxw measure. */
.section--white {
  background: #fff;
  max-width: none;
  width: 100vw;
  margin-left: calc(-1 * var(--nav-w));
  padding-right: max(var(--gutter), calc((100vw - var(--nav-w) - var(--maxw)) / 2 + var(--gutter)));
  padding-left: calc(var(--nav-w) + max(var(--gutter), calc((100vw - var(--nav-w) - var(--maxw)) / 2 + var(--gutter))));
}
.marker {
  display: flex; align-items: center; gap: 0.9rem;
  margin-bottom: 2.4rem;
}
.marker-num {
  flex: none;
  width: 2.15rem; height: 2.15rem; border-radius: 50%;
  border: 1px solid var(--ink); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 0.82rem;
}
.marker-line { width: clamp(1.5rem, 5vw, 3.5rem); height: 1px; background: var(--line); }
.marker-label {
  font-family: var(--f-body); font-size: 0.8rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink);
}

.display { font-family: var(--f-display); font-weight: 400; line-height: 1.2; letter-spacing: -0.015em; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  /* Full-viewport ivory band that bleeds left under the transparent sidebar,
     while the content stays aligned to the (--maxw + 6rem) measure. */
  width: 100vw;
  max-width: none;
  margin-left: calc(-1 * var(--nav-w));
  background: var(--ivory);
  overflow: hidden;
  padding-top: clamp(6rem, 12vh, 9rem);
  padding-bottom: 3rem;
  padding-right: max(var(--gutter), calc((100vw - var(--nav-w) - (var(--maxw) + 6rem)) / 2 + var(--gutter)));
  padding-left: calc(var(--nav-w) + max(var(--gutter), calc((100vw - var(--nav-w) - (var(--maxw) + 6rem)) / 2 + var(--gutter))));
}

/* signal bars — the "many small signals" voice motif */
.hero-signal-wrap { width: 100%; margin-bottom: clamp(2rem, 5vh, 3.5rem); }
.signal {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 0;
  height: clamp(120px, 22vh, 210px); width: 100%;
}
.bar {
  flex: 0 0 auto; width: clamp(5px, 0.55vw, 8px); border-radius: 0;
  height: 22%; transform-origin: bottom;
  will-change: height, transform;
  /* film grain blended into each bar (JS sets background-color per frame) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70'%3E%3Cfilter id='bn'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23bn)' opacity='0.9'/%3E%3C/svg%3E");
  background-size: 70px 70px;
  background-repeat: repeat;
  background-blend-mode: overlay;
}

.eyebrow {
  font-family: var(--f-mono); font-size: 0.8rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink);
  display: inline-flex; align-items: center; gap: 0.7rem; margin-bottom: 1.3rem;
}
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: var(--accent); display: inline-block; }
.hero-title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.8rem, 2.4rem + 1.4vw, 3.4rem);
  line-height: 1.22; letter-spacing: -0.02em; margin-bottom: 1.7rem;
  color: var(--ink);
}
.hero-title span[data-line] { display: block; overflow: hidden; }
.hero-title em { font-style: italic; color: inherit; }
.hero-title .amp { font-family: var(--f-mono); font-weight: 400; font-size: 0.6em; color: inherit; vertical-align: 0.1em; }
.hero-lede {
  max-width: 42ch; color: var(--ink-soft);
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.24rem); margin-bottom: 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero-caption {
  margin-top: 2.4rem;
  font-family: var(--f-mono); font-size: 0.76rem; letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.hero-caption span:first-child { color: var(--ink-soft); }

/* faint drifting sugar grain */
.hero-grain {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle at 18% 30%, color-mix(in srgb, var(--accent) 20%, transparent) 0 1.4px, transparent 1.6px),
    radial-gradient(circle at 72% 22%, color-mix(in srgb, var(--accent) 14%, transparent) 0 1.2px, transparent 1.4px),
    radial-gradient(circle at 60% 78%, color-mix(in srgb, var(--ink) 9%, transparent) 0 1.2px, transparent 1.4px),
    radial-gradient(circle at 33% 82%, color-mix(in srgb, var(--accent) 16%, transparent) 0 1.1px, transparent 1.3px);
  opacity: 0.6;
  animation: grain-drift 26s ease-in-out infinite alternate;
}
@keyframes grain-drift { from { transform: translate3d(0,0,0); } to { transform: translate3d(-14px,-18px,0); } }
.hero-signal-wrap, .hero-copy { position: relative; z-index: 1; }

/* ============================================================
   The gap
   ============================================================ */
.gap-title { font-size: clamp(1.65rem, 3.2vw, 2.5rem); margin-bottom: 1.6rem; }
.gap-body { max-width: 54ch; color: var(--ink-soft); font-size: 18px; }
.signal-list {
  margin-top: 3rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0; border-top: 1px solid var(--line);
}
.signal-list li {
  font-family: var(--f-mono); font-size: 0.9rem;
  padding: 1.05rem 0.25rem 1.05rem 0;
  border-bottom: 1px solid var(--line); color: var(--ink-soft);
  display: flex; align-items: center; gap: 0.7rem;
}
.signal-list li::before { content: ""; width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); flex: none; }

/* ============================================================
   Offers: Data + Eval
   ============================================================ */
.offers-headline { font-size: clamp(1.65rem, 3.2vw, 2.5rem); margin-bottom: clamp(2rem, 4vw, 3rem); }
/* keep each sentence intact; wrapping happens only between sentences */
.nb { white-space: nowrap; }
.offer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.25rem, 3vw, 2.25rem); }
.offer {
  background: var(--ivory); border: 1px solid var(--line); border-radius: 1.1rem;
  padding: clamp(1.75rem, 3.2vw, 2.75rem);
  display: flex; flex-direction: column;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
.offer:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -32px color-mix(in srgb, var(--ink) 40%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.offer-tag { font-family: var(--f-mono); font-size: clamp(1.1rem, 1.6vw, 1.4rem); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); margin-bottom: 1rem; }
.offer-title { font-size: clamp(1.25rem, 2vw, 1.6rem); margin-bottom: 1rem; }
.offer-body { color: var(--ink-soft); margin-bottom: 1.7rem; }
.cap-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin-bottom: 1.9rem; }
.cap-list li {
  font-family: var(--f-mono); font-size: 0.8rem; color: var(--ink-soft);
  display: flex; align-items: center; gap: 1rem;
}
.cap-list li:not(:last-child)::after {
  content: ""; width: 3px; height: 3px; border-radius: 50%;
  background: var(--ink-faint); display: inline-block;
}
.offer-cta {
  margin-top: auto; align-self: flex-start; font-weight: 500; color: var(--ink);
  border-bottom: 1px solid var(--accent); padding-bottom: 3px;
  display: inline-flex; gap: 0.5rem; transition: color 0.25s var(--ease);
}
.offer-cta span:last-child { transition: transform 0.25s var(--ease); display: inline-block; }
.offer-cta:hover { color: var(--ink); }
.offer-cta:hover span:last-child { transform: translateX(4px); }

/* Our Service — a card: white content on the left, image filling the right
   edge-to-edge inside the card. Tabs at the bottom-left switch panel + media. */
.service {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: stretch;
  min-height: 64vh;
  background: #fff;
  overflow: hidden;
}
.service-main {
  display: flex; flex-direction: column;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 4vw, 4rem);
}
.service-panels { position: relative; display: grid; flex: 1 1 auto; }
.service-panel {
  grid-area: 1 / 1;
  display: flex; flex-direction: column; align-items: flex-start;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease);
}
.service-panel.is-active { opacity: 1; visibility: visible; }
.service-title { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.12; margin-bottom: 1.2rem; }
.service-title:empty { display: none; }  /* EN drops the catch heading; JA keeps it */
.service-body { color: var(--ink-soft); max-width: 42ch; margin-bottom: 1.6rem; }

.service-tabs {
  display: flex; flex-wrap: wrap; gap: clamp(1.75rem, 3.5vw, 3rem);
  margin-top: auto; padding-top: clamp(2rem, 5vh, 3.5rem);
}
.service-tab {
  appearance: none; background: none; cursor: pointer;
  font-family: var(--f-body); font-size: 0.85rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint);
  border: 0; padding: 0.35rem 0;
  position: relative;
  transition: color 0.2s var(--ease);
}
.service-tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.service-tab:hover { color: var(--ink-soft); }
.service-tab.is-active { color: var(--ink); }
.service-tab.is-active::after { transform: scaleX(1); }

.service-panel-img { display: none; }
.service-media { position: relative; min-height: 50vh; }
.service-figure {
  position: absolute; inset: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); border-radius: 0; overflow: hidden;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease);
}
.service-figure.is-active { opacity: 1; visibility: visible; }
.service-figure img { width: 100%; height: 100%; object-fit: cover; }
.rosette--service { width: 38%; }
.rosette--service path { fill: #fff; opacity: 0.9; }

/* ============================================================
   The loop
   ============================================================ */
.loop-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.loop-title { font-size: clamp(1.65rem, 3.2vw, 2.5rem); margin-bottom: 1.3rem; }
.loop-body { max-width: 44ch; color: var(--ink-soft); margin-bottom: 0; }
/* Circular loop diagram: a dashed circle with the four stages at 0/90/180/270°,
   and a dot orbiting clockwise to show the cycle. */
.loop-ring {
  position: relative;
  width: min(400px, 92%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.loop-ring::before {                       /* the dashed circle */
  content: ""; position: absolute; inset: 9%;
  border: 1.5px dashed var(--ink); border-radius: 50%;
  opacity: 0.5;
}
.loop-spin {                               /* rotating layer carrying the dot */
  position: absolute; inset: 9%; border-radius: 50%;
  animation: loop-orbit 9s linear infinite;
}
.loop-dot {
  position: absolute; top: -6px; left: 50%; margin-left: -6px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--ink);
}
@keyframes loop-orbit { to { transform: rotate(360deg); } }

.loop-point {
  position: absolute; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 0.5rem 1rem; text-align: center;
  background: #fff;                        /* matches the white band; cuts the dashed line */
}
.loop-point--n { top: 9%; left: 50%; transform: translate(-50%, -50%); }
.loop-point--e { top: 50%; right: 9%; transform: translate(50%, -50%); }
.loop-point--s { bottom: 9%; left: 50%; transform: translate(-50%, 50%); }
.loop-point--w { top: 50%; left: 9%; transform: translate(-50%, -50%); }
.loop-num { font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-faint); letter-spacing: 0.1em; }
.loop-label { font-family: var(--f-display); font-size: clamp(1.05rem, 1.9vw, 1.45rem); line-height: 1.05; white-space: nowrap; }

/* ============================================================
   Evaluation approach
   ============================================================ */
.approach-title { font-size: clamp(1.65rem, 3.2vw, 2.5rem); margin-bottom: 0; }

/* Section heading stays pinned while the arena steps scroll beneath it. */
.arena-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--tint);
  padding-top: clamp(1rem, 2.5vh, 1.6rem);
  padding-bottom: clamp(0.75rem, 2vh, 1.2rem);
  margin-bottom: 0;
}
.arena-head .marker { margin-bottom: 0.9rem; }

/* Voice Arena — scrollytelling: step list on the left, a sticky image on the
   right that swaps as each step scrolls past the viewport centre. */
.arena {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.arena-steps {
  display: flex; flex-direction: column;
  /* Leading + trailing spacer = (imageHeight - stepHeight) / 2, so the FIRST
     step's text sits at the image's vertical centre when the pin engages, and
     the LAST step's text sits there when it releases. */
  padding-top: 12vh;
  padding-bottom: 12vh;
}
.arena-step {
  min-height: 34vh;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0.3;
  transition: opacity 0.45s var(--ease);
}
.arena-step.is-active { opacity: 1; }
.arena-step .step-n {
  display: block; font-family: var(--f-mono); font-size: 0.76rem;
  letter-spacing: 0.1em; color: var(--ink-faint); margin-bottom: 0.75rem;
}
.arena-step .step-k {
  font-family: var(--f-display); font-style: normal; font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.12;
  margin-bottom: 0.7rem; color: var(--ink);
}
.arena-step p { color: var(--ink-soft); font-size: 18px; max-width: 32ch; }
.arena-inline-img { display: none; }

.arena-visual {
  position: sticky;
  top: 23vh;
  height: 58vh;
  display: flex; align-items: center; justify-content: center;
}
.arena-media { position: relative; margin: 0; width: 100%; height: 100%; }
.arena-media img {
  position: absolute; inset: 0; margin: auto;
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain;
  opacity: 0; transition: opacity 0.5s var(--ease);
}
.arena-media img.is-active { opacity: 1; }

.approach-note { margin-top: clamp(2rem, 6vh, 4rem); font-family: var(--f-mono); font-size: 0.82rem; letter-spacing: 0.04em; color: var(--ink-faint); }

/* ============================================================
   Contact
   ============================================================ */
.contact-title { font-size: clamp(1.6rem, 3.4vw, 2.6rem); margin-bottom: 1.3rem; }
.contact-lede { color: var(--ink-soft); font-size: 18px; margin-bottom: 2.2rem; }
.contact-actions { justify-content: flex-start; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem var(--gutter); max-width: var(--maxw); margin-inline: auto; }
.footer-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-line { font-family: var(--f-display); font-size: 1.05rem; }
.footer-meta { margin-left: auto; font-family: var(--f-mono); font-size: 0.76rem; color: var(--ink-faint); }

/* ============================================================
   Reveal states (JS adds .is-in). Fallback: visible.
   ============================================================ */
[data-reveal], [data-node] { will-change: transform, opacity; }
.js [data-reveal] { opacity: 0; transform: translateY(20px); }
.js [data-reveal].is-in { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js [data-node] { opacity: 0; transform: translateY(18px) scale(0.96); }
.js [data-node].is-in { opacity: 1; transform: none; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }

/* ============================================================
   Responsive — sidebar collapses to a top bar
   ============================================================ */
@media (max-width: 1000px) {
  :root { --section-y: clamp(4rem, 10vw, 7rem); }
  .sidebar {
    position: fixed; inset: 0 0 auto 0; width: auto; height: auto;
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: 0.9rem var(--gutter);
    border-right: none; border-bottom: none;
    background: #f1f2ea;
  }
  .brand { margin-bottom: 0; }
  /* Narrow top bar: drop the section-name TOC; keep only the Contact button. */
  .site-nav { display: none; }
  .sidebar-cta { align-self: center; margin: 0 0 0 auto; padding: 0.5rem 1.1rem; font-size: 0.9rem; }
  .sidebar-foot { margin: 0 0 0 1rem; padding-top: 0; }
  /* Offset content for the fixed top bar so nothing hides beneath it. */
  .shell { margin-left: 0; padding-top: 4rem; }
  /* Un-pin the arena heading: with a fixed top bar its sticky top:0 would
     pin it behind the bar. Let it scroll normally at this width. */
  .arena-head { position: static; background: transparent; padding-top: 0; padding-bottom: 0; margin-bottom: clamp(1.75rem, 7vw, 2.75rem); }
  /* Sidebar is a top bar here — drop the under-sidebar bleed. */
  .hero {
    min-height: auto; width: auto; margin-left: 0;
    padding-top: 1.5rem;
    padding-left: var(--gutter); padding-right: var(--gutter);
  }
  .offers-split { width: auto; margin-left: 0; }
  .service-main { padding-left: clamp(2rem, 4vw, 4.5rem); }
  .section--white {
    width: auto; margin-left: 0;
    padding-left: max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter)));
    padding-right: max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter)));
  }
}

@media (max-width: 720px) {
  /* Compact top-bar logo so it fits alongside the Contact button on small
     phones (e.g. iPhone SE). */
  .sidebar { padding: 0.75rem var(--gutter); }
  .brand { gap: 0.4rem; }
  .brand-serif { font-size: 1.05rem; }
  .brand-sans { font-size: 0.58rem; }
  .brand-mark .rosette--sm { width: 19px; height: 19px; }
  /* Enable mobile-only line breaks. */
  .br-m { display: inline; }
  /* Denser JA glyphs read large on phones — trim the hero title a touch. */
  html[lang="ja"] .hero-title { font-size: clamp(2rem, 6.4vw, 2.4rem); }
  .offer-grid { grid-template-columns: 1fr; }
  /* Phone: drop the tab UI — show both services as plain stacked cards. */
  .service { display: block; background: transparent; min-height: 0; overflow: visible; }
  .service-main { padding: 0; }
  .service-panels { display: flex; flex-direction: column; gap: 1.25rem; }
  .service-panel {
    position: static; opacity: 1; visibility: visible;
    background: #fff; border: 1px solid var(--line);
    padding: clamp(1.5rem, 6vw, 2rem);
  }
  .service-panel-img {
    display: block; width: 100%; aspect-ratio: 16 / 10;
    object-fit: cover; background: var(--ink); margin-bottom: 1.5rem;
  }
  .service-tabs { display: none; }
  .service-media { display: none; }
  .loop-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .loop-ring { width: min(320px, 86%); }
  .loop-label { font-size: 1.1rem; }
  .loop-point { padding: 0.4rem 0.6rem; }
  /* Phone: no scrollytelling — three plain stacked cards. */
  .arena { grid-template-columns: 1fr; gap: 1.25rem; }
  .arena-steps { padding: 0; display: flex; flex-direction: column; gap: 1.25rem; }
  .arena-visual { display: none; }
  .arena-step {
    min-height: 0; opacity: 1; margin: 0;
    background: #fff; border: none;
    padding: clamp(1.5rem, 6vw, 2rem);
  }
  .arena-inline-img { display: block; width: 100%; margin-top: 1.25rem; }
  .marker-num { width: 1.9rem; height: 1.9rem; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal], .js [data-node] { opacity: 1 !important; transform: none !important; }
  .hero-grain { animation: none; }
}
