/* ==========================================================================
   me / Personal Site
   Base: muji DESIGN.md → Editorial × Kinetic + Earth Color
   See me/DESIGN.md for the source of truth
   ========================================================================== */

:root {
  /* Colors */
  --bg-kinari: #f4eede;
  --bg-paper: #fbf8f0;
  --bg-paper-bright: #ffffff;
  --border: #dbd5c5;
  --border-strong: #a89e88;

  --ink: #262624;
  --ink-soft: #5a5a55;
  --ink-muted: #8a857a;

  --green-deep: #1f3a2e;
  --green-deeper: #15291f;
  --green-olive: #5a6a4d;

  --terracotta: #b85c3a;
  --terracotta-soft: #d99478;

  --success: #5a6a4d;
  --danger: #a13a2c;

  /* Typography */
  --font-display: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho",
                  "YuMincho", "MS PMincho", serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
               "BIZ UDPGothic", "Yu Gothic", "Meiryo", sans-serif;
  --font-latin: "DM Sans", "Helvetica Neue", "Arial", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 144px;
  --s-11: 200px;

  /* Container */
  --container-max: 1280px;
  --container-narrow: 760px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 200ms;
  --dur-base: 600ms;
  --dur-slow: 1200ms;
  --dur-glacial: 2000ms;

  /* Layout helpers */
  --pad-x: 24px;
  --header-h: 64px;
}

@media (min-width: 768px) {
  :root { --pad-x: 48px; --header-h: 72px; }
}
@media (min-width: 1024px) {
  :root { --pad-x: 80px; }
}

/* --------------------------------------------------------------------------
   Reset / Base
   -------------------------------------------------------------------------- */

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

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

/* On anchor jump, land the section's content (after padding-top)
   ~24px below the fixed header. We subtract the section's own padding-top
   so the eyebrow + h2 sit just under the nav. Negative values are valid. */
section[id] {
  scroll-margin-top: calc(var(--header-h) + 24px - var(--s-7));
}
@media (min-width: 1024px) {
  section[id] {
    scroll-margin-top: calc(var(--header-h) + 24px - var(--s-8));
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.9;
  color: var(--ink);
  background: var(--bg-kinari);
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

img, svg { display: block; max-width: 100%; height: auto; }

a {
  color: var(--green-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--green-deeper); }

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; cursor: pointer; }

/* Numbers always use tabular lining figures */
em, .num, time, .work__cat, .service__num, .process__num, .eyebrow {
  font-variant-numeric: tabular-nums lining-nums;
}

::selection {
  background: var(--green-deep);
  color: var(--bg-kinari);
}

:focus-visible {
  outline: 2px solid var(--green-deep);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Grain overlay (paper texture)
   -------------------------------------------------------------------------- */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.15 0 0 0 0 0.15 0 0 0 0 0.14 0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(31, 58, 46, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-header[data-scrolled="true"] {
  background: rgba(21, 41, 31, 0.92);
  border-bottom-color: rgba(244, 238, 222, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--bg-kinari);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand:hover { color: var(--bg-kinari); }
.brand__mark {
  display: inline-flex;
  align-items: center;
  color: var(--bg-kinari);
}
.brand__mark svg {
  height: 22px;
  width: auto;
  display: block;
}
.brand__name { font-family: var(--font-latin); font-size: 15px; }

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  font-family: var(--font-latin);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.nav a {
  color: var(--bg-kinari);
  text-decoration: none;
  position: relative;
  padding: 8px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 4px;
  height: 1px; width: 0;
  background: var(--bg-kinari);
  transition: width var(--dur-base) var(--ease-out);
}
.nav a:hover::after { width: 100%; }
.nav__cta {
  color: var(--green-deep) !important;
  background: var(--bg-kinari);
  padding: 10px 18px !important;
  border-radius: 4px;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.nav__cta:hover { background: #ffffff; color: var(--green-deeper) !important; }
.nav__cta::after { display: none; }

/* Lab を足してナビが 7 項目になったぶん、タブレット幅では間隔を詰める。
   1024px 以上は --pad-x が広がっても収まるので既定のままでよい */
@media (min-width: 641px) and (max-width: 1023px) {
  .nav { gap: var(--s-5); }
}

/* Hamburger toggle — hidden on desktop, shown on SP */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 101;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bg-kinari);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle__box {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out);
}
/* Scrim behind the open panel */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(9, 20, 15, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-out),
    visibility var(--dur-fast) var(--ease-out);
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }

  /* Turn the nav into a dropdown panel under the header */
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    z-index: 100;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--s-4) var(--pad-x) var(--s-5);
    background: rgba(21, 41, 31, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(244, 238, 222, 0.12);
    font-size: 16px;
    /* Hidden by default; revealed when the header carries data-nav-open */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease-out),
      transform var(--dur-fast) var(--ease-out),
      visibility var(--dur-fast) var(--ease-out);
  }
  .nav a {
    padding: 14px 2px;
    border-bottom: 1px solid rgba(244, 238, 222, 0.1);
  }
  .nav a::after { display: none; }
  .nav__cta {
    margin-top: var(--s-4);
    padding: 14px 18px !important;
    text-align: center;
    border-bottom: 0;
  }

  .site-header[data-nav-open="true"] .nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .site-header[data-nav-open="true"] ~ .nav-scrim {
    opacity: 1;
    visibility: visible;
  }

  /* Animate the icon into an X */
  .site-header[data-nav-open="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .site-header[data-nav-open="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .site-header[data-nav-open="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* Lock background scroll while the menu is open */
html.is-nav-open,
html.is-nav-open body {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Generic section / typography
   -------------------------------------------------------------------------- */

.section {
  padding: var(--s-7) var(--pad-x);
  max-width: var(--container-max);
  margin: 0 auto;
}
@media (min-width: 768px) {
  .section { padding-block: var(--s-8); }
}
@media (min-width: 1024px) {
  .section { padding-block: var(--s-8); }
}

/* Section main content centering on wide screens
   (titles/eyebrows stay at content-area left, body blocks center) */
.section__body,
.about__body,
.services__list,
.process__list,
.works__timeline,
.skills__grid,
.contact__form {
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: var(--s-5);
}

.h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-7);
  font-feature-settings: "palt" 1;
  max-width: 24ch;
}

/* Each phrase is its own line; consistent across all sections.
   Prevents Japanese text from wrapping mid-phrase awkwardly. */
.h2__phrase {
  display: block;
}

.section__lead {
  max-width: 60ch;
  color: var(--ink-soft);
  margin-bottom: var(--s-8);
  font-size: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-family: var(--font-body);
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  cursor: pointer;
}
.btn--primary {
  background: var(--green-deep);
  color: var(--bg-kinari);
}
.btn--primary:hover {
  background: var(--green-deeper);
  color: var(--bg-kinari);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--bg-kinari); }
.btn--full { width: 100%; }
/* 公式LINE導線。LINEブランドグリーンでチャネルを一目で伝える */
.btn--line {
  background: #06c755;
  color: #fff;
  border-color: #06c755;
}
.btn--line:hover {
  background: #05b249;
  border-color: #05b249;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Hero — Centered display, mask-reveal per character
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  padding: calc(var(--header-h) + var(--s-7)) var(--pad-x) var(--s-9);
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-6);
  width: 100%;
  max-width: 920px;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 80px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-feature-settings: "palt" 1;
}
.hero__line {
  display: block;
}
/* Character mask reveal: outer clips, inner translates */
.hero__title .char {
  display: inline-block;
  vertical-align: baseline;
  line-height: 1;
  overflow: hidden;
  padding-bottom: 0.18em;
  margin-bottom: -0.18em;
}
.hero__title .char__inner {
  display: inline-block;
  line-height: 1;
  will-change: transform;
}
/* Final period: olive-green accent */
.hero__line:last-child .char:last-child .char__inner {
  color: var(--green-deep);
}

.hero__meta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.hero__sep {
  width: 28px;
  height: 1px;
  background: var(--border-strong);
}
.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-deep);
}
.hero__status-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-deep);
  flex-shrink: 0;
}
.hero__status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--green-deep);
  animation: heroDotPulse 2.4s var(--ease-in-out) infinite;
}
@keyframes heroDotPulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50%      { transform: scale(1.8); opacity: 0; }
}

/* Scroll affordance */
.hero__scroll {
  position: absolute;
  bottom: var(--s-6);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.hero__scroll:hover { color: var(--ink); }
.hero__scroll-line {
  position: relative;
  width: 1px;
  height: 56px;
  background: var(--border-strong);
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 35%;
  background: var(--ink);
  animation: heroScrollLine 2.6s var(--ease-in-out) infinite;
}
@keyframes heroScrollLine {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(330%); }
}

/* Responsive */
@media (max-width: 640px) {
  .hero { padding-bottom: var(--s-8); }
  .hero__inner { gap: var(--s-5); }
  .hero__meta { flex-wrap: wrap; justify-content: center; row-gap: var(--s-2); font-size: 10px; letter-spacing: 0.14em; }
  .hero__sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__status-dot::after,
  .hero__scroll-line::after { animation: none; }
}

/* --------------------------------------------------------------------------
   Section divider — engineering colophon between hero and next section.
   Echoes .hero__spec's mono / tabular voice, then renders a draughtsman's
   ruler (hairline + tick marks) flanked by section index and next label.
   -------------------------------------------------------------------------- */

.section-divider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-5);
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding: var(--s-6) var(--pad-x);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums lining-nums;
  user-select: none;
}

.section-divider__index {
  color: var(--ink-soft);
  white-space: nowrap;
}

.section-divider__rule {
  position: relative;
  display: block;
  height: 10px;
}

/* Baseline hairline */
.section-divider__rule::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
  transform: translateY(-0.5px);
}

/* Tick marks: short every 8px, tall every 40px — like a draughtsman's ruler.
   Built with two layered linear-gradients on a single span so the marks
   sit *above* the baseline hairline. */
.section-divider__ticks {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border-strong) 1px, transparent 1px),
    linear-gradient(to right, var(--border) 1px, transparent 1px);
  background-size: 40px 100%, 8px 60%;
  background-position: 0 0, 0 50%;
  background-repeat: repeat-x, repeat-x;
  /* Fade tick marks at both edges so the ruler doesn't fight the index/label */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.section-divider__label {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--green-deep);
  white-space: nowrap;
}

.section-divider__caret {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .section-divider {
    gap: var(--s-3);
    padding-block: var(--s-5);
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .section-divider__rule { height: 8px; }
  .section-divider__ticks {
    background-size: 32px 100%, 8px 55%;
  }
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about__body {
  max-width: var(--container-narrow);
}
.about__body p {
  font-size: 17px;
  line-height: 2;
  margin-bottom: var(--s-6);
}

.about__meta {
  margin-top: var(--s-8);
  display: grid;
  gap: var(--s-5);
  border-top: 1px solid var(--border);
  padding-top: var(--s-7);
}
.about__meta > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--s-4);
  align-items: baseline;
}
.about__meta dt {
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}
.about__meta dd {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

@media (max-width: 640px) {
  .about__meta > div { grid-template-columns: 80px 1fr; }
}

/* --------------------------------------------------------------------------
   Services
   -------------------------------------------------------------------------- */

/* All 3 services equal-size and visible at a glance.
   Hover gently scales the targeted card and reveals lead + tags.
   Non-hovered cards stay exactly the same size (no flex shifts). */
.services__list {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  max-width: 1080px;
}
@media (min-width: 768px) {
  .services__list {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--s-4);
    /* 高さは固定しない。ホバーでカードが開くと行の高さが伸び、
       下の要素（目玉カード）が押し下げられて開く自然なフローにする。 */
    overflow: visible;
  }
}

/* かつては #process への食い込み防止に大きな下余白を確保していたが、
   ホバーは scale(1.04) の微小な拡大のみで、下には目玉カードが入ったため、
   標準セクション余白に揃える（Works とのギャップを他セクションと統一）。 */
@media (min-width: 768px) {
  .section.services { padding-bottom: var(--s-8); }
}

.service {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-paper);
  padding: var(--s-7) var(--s-6);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  min-width: 0;
  transform-origin: center center;
  will-change: transform;
  transition:
    transform 800ms cubic-bezier(0.22, 1, 0.36, 1),
    background 700ms var(--ease-out),
    border-color 700ms var(--ease-out),
    box-shadow 700ms var(--ease-out);
}

@media (min-width: 768px) {
  .service { flex: 1 1 0; }
  .service:hover {
    transform: scale(1.04);
    z-index: 2;
    background: var(--bg-paper-bright);
    border-color: var(--green-deep);
  }
}

.service__num {
  font-family: var(--font-display);
  font-size: clamp(36px, 3.4vw, 52px);
  font-weight: 700;
  line-height: 1;
  color: var(--green-deep);
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: var(--s-5);
}

.service__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.service__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.9vw, 26px);
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  letter-spacing: -0.01em;
  font-feature-settings: "palt" 1;
  color: var(--ink);
  position: relative;
  padding-bottom: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.service__title-en {
  font-family: var(--font-latin);
  font-size: 0.5em;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
  font-feature-settings: "palt" 0;
}
.service__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  background: var(--green-deep);
  transition: width var(--dur-base) var(--ease-out);
}
.service:hover .service__title::after { width: 56px; }

/* Lead + tags: visible by default on mobile. On tablet+, hidden until hover. */
.service__lead {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink);
  margin: var(--s-5) 0 0;
  font-weight: 400;
}

.service__bullets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-5);
}
.service__bullets li {
  font-family: var(--font-latin);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--green-deep);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px 12px;
  line-height: 1.4;
  white-space: nowrap;
  font-feature-settings: "palt" 0;
}

/* Desktop: hover smoothly grows the card with max-height reveal.
   行の高さは固定していないので、開いた分だけ下の要素が押し下がる（フロー展開）。 */
@media (min-width: 768px) {
  .service { align-self: start; }

  .service__lead,
  .service__bullets {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    transform: translateY(6px);
    transition:
      opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
      max-height 800ms cubic-bezier(0.22, 1, 0.36, 1),
      margin-top 800ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .service:hover .service__lead {
    opacity: 1;
    max-height: 200px;
    margin-top: var(--s-5);
    transform: translateY(0);
    transition-delay: 120ms;
  }
  .service:hover .service__bullets {
    opacity: 1;
    max-height: 80px;
    margin-top: var(--s-5);
    transform: translateY(0);
    transition-delay: 200ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .services__list { height: auto !important; }
  .section.services { padding-bottom: var(--s-9) !important; }
  .service:hover { transform: none; }
  .service__lead, .service__bullets {
    opacity: 1; max-height: none; transform: none;
    margin-top: var(--s-5);
  }
}

/* --------------------------------------------------------------------------
   Process
   -------------------------------------------------------------------------- */

.process {
  background: var(--bg-paper);
  max-width: 100%;
  border-block: 1px solid var(--border);
}
.process > .eyebrow,
.process > .h2 {
  max-width: var(--container-max);
  margin-inline: auto;
}

.process__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
  max-width: 1080px;
}
@media (min-width: 768px) {
  .process__list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-8) var(--s-7);
  }
}
@media (min-width: 1024px) {
  .process__list {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s-7);
  }
}

.process__step {
  border-top: 1px solid var(--border-strong);
  padding-top: var(--s-5);
}
.process__step h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  margin: var(--s-3) 0 var(--s-4);
}
.process__step p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.process__num {
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--green-deep);
  text-transform: uppercase;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Works
   -------------------------------------------------------------------------- */

/* ─── Works: vertical timeline (年表). hairline rail + period rail on the left ─── */
.works__timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 860px;
}

/* body holds the continuous hairline rail + the node dot */
.tl-item__body {
  position: relative;
  border-left: 1px solid var(--border);
  padding: 0 0 var(--s-9) var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.tl-item:last-child .tl-item__body {
  padding-bottom: 0;
}
.tl-item__body::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-deep);
  box-shadow: 0 0 0 4px var(--bg-kinari);
}

/* period: single inline range label (no vertical flow → no clash with the
   descending list order) */
.tl-item__period {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
}
.tl-item__period time {
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums lining-nums;
}
.tl-item__period .tl-item__dash {
  color: var(--ink-muted);
}
.tl-item__period .tl-item__now {
  color: var(--green-deep);
  font-weight: 600;
}
.tl-item__period .tl-item__note {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--terracotta);
}

.work__cat {
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--green-deep);
  text-transform: uppercase;
  font-weight: 500;
}
.work__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  margin: 0;
  font-feature-settings: "palt" 1;
}
.work__summary {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-soft);
}
.work__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  margin: 0;
  padding: 0;
}
.work__tags li {
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--green-olive);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
}
.work__metrics {
  margin-top: var(--s-1);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums lining-nums;
}

/* --------------------------------------------------------------------------
   Tech / Stack
   -------------------------------------------------------------------------- */

/* ─── Skills section: editorial skill cards with animated proficiency bars ─── */

.skills__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  max-width: 1080px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-6);
  }
}

.skill-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: var(--s-7);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  position: relative;
  overflow: hidden;
  transition:
    background var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
/* Faint elliptical "sun" in the upper right of each card.
   Reveals the earth-color personality without using a shadow. */
.skill-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -25%;
  width: 60%;
  aspect-ratio: 1;
  background: radial-gradient(
    closest-side,
    rgba(31, 58, 46, 0.06),
    rgba(31, 58, 46, 0) 70%
  );
  pointer-events: none;
  transition: transform 1200ms var(--ease-out), opacity var(--dur-slow) var(--ease-out);
  opacity: 0.7;
}
.skill-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.skill-card__icon {
  width: 26px;
  height: 26px;
  color: var(--green-deep);
  flex-shrink: 0;
}
.skill-card__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  font-feature-settings: "palt" 1;
}
.skill-card__desc {
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0;
}

.skill-card__list {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin-top: auto;
}

.skill-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--s-3);
  align-items: center;
}
.skill-row__name {
  font-family: var(--font-latin);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.skill-row__years {
  font-family: var(--font-latin);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  text-transform: uppercase;
  min-width: 24px;
  text-align: right;
}

/* Stars: 5 filled-style icons, with `data-filled=N` controlling color */
.skill-row__stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.skill-row__star {
  width: 14px;
  height: 14px;
  fill: var(--border-strong);
  flex-shrink: 0;
  /* Hidden state for entrance animation */
  opacity: 0;
  transform: scale(0.6) rotate(-12deg);
  transform-origin: center;
  transition:
    opacity 500ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
    fill 500ms var(--ease-out);
}

/* Pop-in animation when the parent card cascades into view */
.skill-card[data-anim="rise"].is-in .skill-row__star {
  opacity: 1;
  transform: scale(1) rotate(0);
  transition-delay: calc(var(--d, 0ms) + 280ms + var(--i, 0) * 90ms);
}

/* Filled-star coloring per data-filled level. Color transition slightly
   delayed after pop-in so the green sweep reads as a separate beat. */
.skill-card[data-anim="rise"].is-in .skill-row__stars[data-filled="5"] > .skill-row__star:nth-child(-n+5),
.skill-card[data-anim="rise"].is-in .skill-row__stars[data-filled="4"] > .skill-row__star:nth-child(-n+4),
.skill-card[data-anim="rise"].is-in .skill-row__stars[data-filled="3"] > .skill-row__star:nth-child(-n+3),
.skill-card[data-anim="rise"].is-in .skill-row__stars[data-filled="2"] > .skill-row__star:nth-child(-n+2),
.skill-card[data-anim="rise"].is-in .skill-row__stars[data-filled="1"] > .skill-row__star:nth-child(-n+1) {
  fill: var(--green-deep);
}

@media (prefers-reduced-motion: reduce) {
  .skill-card[data-anim="rise"] .skill-row__star {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .skill-card::before { display: none; }
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact__channels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin-top: var(--s-7);
}

.contact__form {
  display: grid;
  gap: var(--s-5);
  max-width: var(--container-narrow);
  margin-top: var(--s-7);
}

.field {
  display: grid;
  gap: var(--s-2);
}
.field label {
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
select,
textarea {
  background: var(--bg-paper-bright);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 16px;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out);
  width: 100%;
}
input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--green-deep);
  outline: none;
}
textarea {
  resize: vertical;
  line-height: 1.85;
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23262624' stroke-width='1.5'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
  padding-right: 48px;
  cursor: pointer;
}

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

.site-footer {
  background: var(--ink);
  color: var(--bg-kinari);
  margin-top: var(--s-10);
}
.site-footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--s-9) var(--pad-x);
  display: grid;
  gap: var(--s-3);
}
.site-footer__name {
  font-family: var(--font-latin);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.site-footer__role {
  color: var(--ink-muted);
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.06em;
}
.site-footer__links {
  display: flex;
  gap: var(--s-5);
  flex-wrap: wrap;
  margin-top: var(--s-6);
  font-family: var(--font-latin);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.site-footer__links a {
  color: var(--bg-kinari);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.site-footer__links a:hover { opacity: 1; }
.site-footer__copy {
  color: var(--ink-muted);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 300;
  margin-top: var(--s-5);
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Animation utilities
   -------------------------------------------------------------------------- */

[data-anim="rise"] {
  opacity: 0;
  transform: translateY(28px);
  will-change: transform, opacity;
}
[data-anim="rise"].is-in {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 900ms var(--ease-out),
    transform 1000ms var(--ease-out);
}

/* OS の「視差を減らす」設定を既定で尊重する。
   ただし Lab は動きそのものが中身なので、訪問者がそこで「再生する」を
   選んだときだけ html[data-motion="on"] が立ち、この抑制が外れる。
   data-motion は Lab のページ以外では決してセットされない */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="on"]),
  html:not([data-motion="on"]) :is(*, *::before, *::after) {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html:not([data-motion="on"]) [data-anim="rise"] { opacity: 1; transform: none; }
}

/* ============== SERVICES: 目玉プロダクトカード ============== */
.service-featured {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--s-7);
  /* 下のサービスカード3つの並び（.services__list）と横幅・中央寄せを揃える */
  max-width: 1080px;
  margin-top: var(--s-4);
  margin-bottom: var(--s-6);
  margin-inline: auto;
  padding: var(--s-7);
  border-radius: 20px;
  background: var(--green-deep);
  color: #fff;
  text-decoration: none;
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.service-featured__text { display: block; }
@media (max-width: 760px) {
  .service-featured { grid-template-columns: 1fr; gap: var(--s-5); }
  .service-featured__cta { justify-self: start; }
}
.service-featured:hover {
  box-shadow: 0 16px 38px -26px rgba(16, 43, 33, 0.5);
}
.service-featured__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta-soft);
  margin-bottom: var(--s-3);
}
.service-featured__title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.35;
  margin-bottom: var(--s-3);
  color: #fff;
}
.service-featured__lead {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.9;
  max-width: none;
  margin-bottom: 0;
}
.service-featured__cta {
  display: inline-flex;
  align-items: center;
  align-self: end;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-kinari);
  color: var(--green-deeper);
  padding: 11px 20px;
  border-radius: 999px;
}
@media (max-width: 760px) {
  /* SP: 押しやすい全幅ボタンにする */
  .service-featured__cta {
    align-self: stretch;
    justify-content: center;
    width: 100%;
    padding: 15px 20px;
    font-size: 15px;
  }
}
/* 3カラムの上に置く導入文。直後の目玉カードに寄せる。 */
.services__product-lead { margin-top: var(--s-4); margin-bottom: var(--s-3); }
/* PCでは指定文を改行させない（狭い画面では通常折り返し） */
.nowrap-pc { white-space: nowrap; }
@media (max-width: 640px) { .nowrap-pc { white-space: normal; } }

/* ============== SERVICES: 導入事例カード ============== */
.cases {
  max-width: 1080px;
  margin: var(--s-7) auto 0;
}
.cases__lead { margin-bottom: var(--s-4); }
.cases__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
@media (max-width: 760px) {
  .cases__list { grid-template-columns: 1fr; }
}
.case-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-paper);
  color: var(--ink);
  text-decoration: none;
  transition:
    background 700ms var(--ease-out),
    border-color 700ms var(--ease-out);
}
.case-card:hover {
  background: var(--bg-paper-bright);
  border-color: var(--green-deep);
}
.case-card__tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: var(--s-3);
}
.case-card__title {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 700;
  line-height: 1.45;
  font-feature-settings: "palt" 1;
  margin-bottom: var(--s-3);
}
.case-card__lead {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-soft);
}
.case-card__metric {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  font-weight: 700;
  color: var(--green-deep);
}
.case-card__stack {
  margin-top: var(--s-2);
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.case-card__cta {
  margin-top: auto;
  padding-top: var(--s-5);
  font-weight: 600;
  color: var(--green-deep);
}
