/* ==========================================================================
   TmSystem 株式会社 コーポレートサイト
   HANDOFF.md のデザイントークンとクラス設計に基づく本番用スタイル
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. トークン
   -------------------------------------------------------------------------- */
:root {
  --bg:        #F6F9F4;
  --surface:   #FFFFFF;
  --dark:      #11291F;
  --ink:       #10211A;
  --ink-2:     #3F4F47;
  --muted:     #4B5A52;
  --on-dark:   #F6F9F4;
  --on-dark-2: #C9D4CD;
  --on-dark-3: #B8C7BE;
  --lime:      #B6F04B;
  --lime-soft: #E4F8C2;
  --lime-text: #2F5A0B;
  --cyan:      #4FD6E8;
  --cyan-soft: #D6F4F8;
  --cyan-text: #0B5E6E;
  --line:      rgba(16, 33, 26, .12);

  --line-on-dark: rgba(246, 249, 244, .14);
  --shot-bg:      #EEF4EA;

  --font-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-en: "Manrope", "Zen Kaku Gothic New", sans-serif;

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --pad-x: clamp(20px, 5vw, 64px);
}

/* --------------------------------------------------------------------------
   2. ベース
   -------------------------------------------------------------------------- */
/* box-sizing は既定(content-box)のまま。参照デザインの寸法(コンテナ幅・ボタン高さ)と一致させるため */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: var(--lime-text);
}

a:hover {
  color: #1F3F05;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

h1, h2, h3, p, dl, dd, ul {
  margin: 0;
}

img,
svg {
  display: block;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.num {
  font-family: var(--font-en);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   3. タイポグラフィ
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lime-text);
}

.eyebrow--cyan {
  color: var(--cyan);
}

.h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: -.01em;
  text-wrap: pretty;
}

.h3 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.35;
  font-weight: 700;
  text-wrap: pretty;
}

.lead {
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--ink-2);
  text-wrap: pretty;
}

.muted {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   4. ボタン・ピル
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--lime {
  background: var(--lime);
  color: var(--ink);
}

.btn--lime:hover {
  background: #C9F26B;
  color: var(--ink);
}

.btn--ghost-dark {
  color: var(--on-dark);
  border-color: rgba(246, 249, 244, .35);
}

.btn--ghost-dark:hover {
  color: var(--on-dark);
  border-color: var(--on-dark);
}

.btn--sm {
  min-height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--lime-soft);
  color: var(--lime-text);
}

.pill--cyan {
  background: var(--cyan-soft);
  color: var(--cyan-text);
}

/* --------------------------------------------------------------------------
   5. ヘッダー
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--dark);
  color: var(--on-dark);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  min-height: 76px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--on-dark);
}

.brand:hover {
  color: var(--on-dark);
}

.brand__name {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.01em;
}

.brand__suffix {
  font-weight: 700;
  font-size: 14px;
  color: var(--on-dark-2);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}

.nav__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}

.nav__link {
  color: var(--on-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

.nav__link:hover {
  color: var(--lime);
}

@media (max-width: 760px) {
  .nav__links {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   6. ヒーロー
   -------------------------------------------------------------------------- */
.hero {
  background: var(--dark);
  color: var(--on-dark);
  padding: clamp(40px, 5vw, 64px) 0 clamp(48px, 6vw, 80px);
}

.hero__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr));
  gap: 40px 56px;
  align-items: center;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 620px;
}

.hero__title {
  font-size: clamp(34px, 4.6vw, 62px);
  line-height: 1.22;
  font-weight: 900;
  letter-spacing: -.01em;
  text-wrap: pretty;
}

.hero__lead {
  color: var(--on-dark-2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero__art {
  position: relative;
  min-height: 320px;
}

.hero__svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ネットワーク図: 既定は静止。動きを好む環境でのみ動かす */
.edge {
  stroke-dasharray: 6 10;
}

.dot {
  opacity: 0;
}

/* 3本柱 */
.pillars {
  margin-top: clamp(40px, 5vw, 64px);
}

.pillars__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 0 40px;
  border-top: 1px solid var(--line-on-dark);
}

.pillar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 0 12px;
  text-decoration: none;
  color: var(--on-dark);
}

.pillar:hover {
  color: var(--on-dark);
}

.pillar__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pillar__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(182, 240, 75, .12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.pillar__no {
  color: var(--lime);
  font-weight: 800;
  font-size: 14px;
}

.pillar__title {
  font-weight: 700;
  font-size: 20px;
}

.pillar__desc {
  color: var(--on-dark-3);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   7. セクション共通
   -------------------------------------------------------------------------- */
.section--white {
  background: var(--surface);
}

.section--dark {
  background: var(--dark);
  color: var(--on-dark);
}

.section__inner {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
}

/* --------------------------------------------------------------------------
   8. Services / Why(行形式)
   -------------------------------------------------------------------------- */
.services {
  padding: clamp(64px, 8vw, 112px) 0 clamp(56px, 7vw, 96px);
}

.why {
  padding: clamp(64px, 7.5vw, 104px) 0 clamp(64px, 8vw, 112px);
}

.service-list {
  display: flex;
  flex-direction: column;
}

.service {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: 32px 64px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.service--last {
  border-bottom: 1px solid var(--line);
}

.service__main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.service__no {
  color: var(--lime-text);
  font-weight: 800;
  font-size: 14px;
}

.service__desc {
  font-size: 16px;
}

.service__points {
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service__points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 16px;
}

.service__points svg {
  flex: none;
  margin-top: 6px;
}

.illus {
  width: 100%;
  max-width: 340px;
  height: auto;
}

.illus--wide {
  max-width: 560px;
}

/* --------------------------------------------------------------------------
   9. Works(実績カード)
   -------------------------------------------------------------------------- */
.works {
  padding: clamp(64px, 7.5vw, 104px) 0 clamp(64px, 8vw, 112px);
}

.works .section__inner {
  gap: 48px;
}

.works .section__head {
  max-width: 720px;
}

.cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
  gap: 28px;
}

.case {
  background: var(--surface);
  border: 1px solid rgba(16, 33, 26, .1);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: translate .25s ease, box-shadow .25s ease;
}

.case:hover {
  translate: 0 -6px;
  box-shadow: 0 18px 40px -22px rgba(16, 33, 26, .35);
}

.case--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  align-items: center;
}

.case__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 24px 28px;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.case__title {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
}

.case__desc {
  font-size: 15px;
}

/* 画面(スクリーンショット枠) */
.shot {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--shot-bg);
  border-bottom: 1px solid rgba(16, 33, 26, .1);
  overflow: hidden;
}

.shot--flat {
  border-bottom: none;
}

.shot__illus {
  width: 100%;
  height: 100%;
}

.shot__tag {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 33, 26, .72);
  color: var(--on-dark);
}

.shot img {
  filter: saturate(.7) brightness(.98) contrast(.96);
}

.pc {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 7%;
  bottom: -4%;
  background: var(--ink);
  border-radius: 12px;
  padding: 0 6px;
  box-shadow: 0 18px 36px -18px rgba(16, 33, 26, .45);
  overflow: hidden;
}

.pc--narrow {
  right: 14%;
}

.pc__bar {
  height: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
}

.pc__bar span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(246, 249, 244, .35);
}

.pc img {
  width: 100%;
  height: calc(100% - 20px);
  object-fit: contain;
  object-position: top center;
  border-radius: 6px 6px 0 0;
  background: var(--ink);
}

.phone {
  position: absolute;
  right: 4%;
  bottom: -8%;
  width: 22%;
  background: var(--ink);
  border-radius: 20px;
  padding: 6px;
  box-shadow: 0 16px 30px -14px rgba(16, 33, 26, .5);
}

.phone img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: var(--surface);
}

/* --------------------------------------------------------------------------
   10. Our Stance
   -------------------------------------------------------------------------- */
.stance {
  padding: clamp(64px, 7.5vw, 104px) 0;
}

.stance__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: 40px 80px;
  align-items: center;
}

.stance__copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stance__art {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   11. Company
   -------------------------------------------------------------------------- */
.company {
  padding: clamp(64px, 7.5vw, 104px) 0;
}

.company__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: 32px 80px;
  align-items: start;
}

.company__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.company__dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 16px 32px;
  font-size: 16px;
  align-content: start;
  padding-top: 8px;
}

.company__dl dt {
  color: var(--muted);
  font-weight: 500;
}

.company__contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.company__contact a {
  font-weight: 500;
  text-decoration: none;
}

.company__contact a:hover,
.company__contact a:focus-visible {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   12. For Companies
   -------------------------------------------------------------------------- */
.recruit {
  padding: clamp(56px, 6vw, 88px) 0;
}

.recruit__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px 48px;
}

.recruit__copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
}

.recruit__text {
  color: var(--on-dark-3);
  font-size: 17px;
}

/* --------------------------------------------------------------------------
   13. Contact
   -------------------------------------------------------------------------- */
.contact {
  padding: clamp(64px, 8vw, 112px) 0 clamp(72px, 8.5vw, 120px);
}

.contact__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: 820px;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 8px;
}

.contact__note {
  font-size: 15px;
}

.contact__note a {
  font-weight: 700;
  text-decoration: none;
}

.contact__note a:hover,
.contact__note a:focus-visible {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   14. フッター
   -------------------------------------------------------------------------- */
.footer {
  background: var(--dark);
  color: var(--on-dark-3);
  padding: 40px 0;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
  font-size: 14px;
}

.footer__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--on-dark);
}

.footer__brand .brand__name {
  font-size: 16px;
}

.footer__brand .brand__suffix {
  font-size: 13px;
  color: var(--on-dark-3);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer a {
  color: var(--on-dark-3);
  text-decoration: none;
}

.footer a:hover {
  color: var(--on-dark);
}

/* --------------------------------------------------------------------------
   15. モーション
   -------------------------------------------------------------------------- */

/* スクロール出現: JS が動いたときだけ初期非表示にする(JS無効なら常に表示) */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}

html.js .reveal.r2 {
  transition-delay: 80ms;
}

html.js .reveal.r3 {
  transition-delay: 160ms;
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* 実績カードは出現(transform)とホバー(translate)を別プロパティで持つ */
html.js .case.reveal {
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out),
              translate .25s ease, box-shadow .25s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .edge {
    animation: flow 3.2s linear infinite;
  }

  .edge.slow {
    animation-duration: 5s;
  }

  .node {
    animation: pulse 4.5s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
  }

  .node.n2 {
    animation-delay: -1.5s;
  }

  .node.n3 {
    animation-delay: -3s;
  }

  .dot {
    opacity: 1;
    animation: travel 7s linear infinite;
  }

  .d1 {
    offset-path: path("M80 120 L240 60 L420 110 L580 170");
  }

  .d2 {
    offset-path: path("M160 260 L330 250 L500 300 L600 400");
    animation-duration: 8.5s;
    animation-delay: -3s;
  }

  .d3 {
    offset-path: path("M100 420 L280 440 L460 460");
    animation-duration: 6s;
    animation-delay: -1.2s;
  }

  .d4 {
    offset-path: path("M240 60 L330 250 L280 440");
    animation-duration: 9s;
    animation-delay: -5s;
  }

  .hero__copy {
    animation: rise .9s var(--ease-out) both;
  }

  .hero__art {
    animation: fade 1.4s ease both;
  }
}

@keyframes flow {
  to { stroke-dashoffset: -32; }
}

@keyframes pulse {
  0%, 100% { opacity: .75; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.25); }
}

@keyframes travel {
  from { offset-distance: 0%; }
  to   { offset-distance: 100%; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 「視差効果を減らす」: すべての動きを止める */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .case,
  html.js .reveal,
  html.js .case.reveal {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }

  .case:hover {
    translate: none;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
  }

  .edge,
  .node,
  .dot,
  .hero__copy,
  .hero__art {
    animation: none;
  }
}
