/* =========================================================
   comesta design — design tokens & base
   モバイルファースト / タイポ中心 / 余白広め
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* Color */
  --color-main:   #111111;
  --color-bg:     #F7F5F2;
  --color-accent: #B7D66B;
  --color-sub:    #555555;   /* 補助テキスト（指示書外、編集感のため） */
  --color-line:   #E5E2DC;   /* 罫線（主張しない） */

  /* Font family */
  --ff-jp:        "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --ff-jp-display:"Zen Kaku Gothic New", "Noto Sans JP", sans-serif;
  --ff-en:        "neue-haas-grotesk-display-pr", "Helvetica Neue", Arial, sans-serif;

  /* Type scale (clampでfluid。モバイル→PCで自然に拡大) */
  --fs-xs:      0.75rem;                                  /* 12 */
  --fs-sm:      0.875rem;                                 /* 14 */
  --fs-base:    1rem;                                     /* 16 */
  --fs-md:      1.125rem;                                 /* 18 */
  --fs-lg:      1.25rem;                                  /* 20 */
  --fs-xl:      clamp(1.5rem,  2.5vw, 1.75rem);           /* 24-28 */
  --fs-2xl:     clamp(1.75rem, 3.5vw, 2.5rem);            /* 28-40 */
  --fs-3xl:     clamp(2rem,    5vw,   3.5rem);            /* 32-56 */
  --fs-display: clamp(2.5rem,  8vw,   6rem);              /* 40-96 */

  /* Line height */
  --lh-tight: 1.25;
  --lh-snug:  1.4;
  --lh-base:  1.75;
  --lh-loose: 1.9;

  /* Letter spacing */
  --ls-tight:  -0.01em;
  --ls-normal: 0;
  --ls-wide:   0.04em;
  --ls-en:     0.02em;

  /* Spacing scale (8base) */
  --space-1:  0.25rem;   /* 4  */
  --space-2:  0.5rem;    /* 8  */
  --space-3:  0.75rem;   /* 12 */
  --space-4:  1rem;      /* 16 */
  --space-5:  1.5rem;    /* 24 */
  --space-6:  2rem;      /* 32 */
  --space-8:  3rem;      /* 48 */
  --space-10: 4rem;      /* 64 */
  --space-12: 6rem;      /* 96 */
  --space-16: 8rem;      /* 128 */
  --space-20: 10rem;     /* 160 */
  --space-24: 12rem;     /* 192 */

  /* Section余白（モバイル基準。PCで広がる） */
  --section-y:    clamp(4rem, 12vw, 10rem);
  --section-x:    clamp(1.25rem, 5vw, 4rem);

  /* Layout */
  --container-max: 1280px;
  --content-max:   720px;   /* 本文の読みやすい幅 */

  /* Motion */
  --ease:        cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast:    160ms;
  --dur-base:    280ms;
  --dur-slow:    520ms;

  /* Border */
  --bw-hair:     1px;

  /* Z-index */
  --z-header:    50;
  --z-overlay:   100;
}

/* ---------- 2. Reset (minimal) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote {
  margin: 0;
  padding: 0;
}
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- 3. Base typography ---------- */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--ff-en), var(--ff-jp);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-main);
  background: var(--color-bg);
  font-weight: 500;                  /* Adobe Fontsの最軽量ウェイト */
  font-feature-settings: "palt" 1;   /* 日本語の詰め */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--ff-en), var(--ff-jp-display);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
}

p { line-height: var(--lh-base); }

/* 英数字のみ要素 */
.en {
  font-family: var(--ff-en);
  letter-spacing: var(--ls-en);
}

/* ---------- 4. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--section-x);
}

.section {
  padding-block: var(--section-y);
}

/* ---------- 5. Focus / a11y ---------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 6. Utilities (最小限) ---------- */
.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;
}

/* =========================================================
   Layout
   ========================================================= */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(247, 245, 242, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: var(--bw-hair) solid transparent;
  transition: border-color var(--dur-base) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--color-line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-block: var(--space-3);
}

.site-logo {
  font-family: var(--ff-en);
  font-weight: 500;
  font-size: var(--fs-md);
  letter-spacing: var(--ls-en);
}

/* ---------- Nav (mobile-first) ---------- */
.site-nav {
  position: fixed;
  inset: 64px 0 auto 0;
  background: var(--color-bg);
  border-top: var(--bw-hair) solid var(--color-line);
  transform: translateY(-110%);
  transition: transform var(--dur-base) var(--ease);
  pointer-events: none;
}
.site-nav.is-open {
  transform: translateY(0);
  pointer-events: auto;
}
.site-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-8) var(--section-x);
}
.site-nav__list a {
  font-size: var(--fs-xl);
  font-weight: 400;
}

.nav-toggle {
  width: 32px; height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  height: 1px;
  background: var(--color-main);
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-fast) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (min-width: 768px) {
  .site-nav {
    position: static;
    transform: none;
    background: transparent;
    border: 0;
    pointer-events: auto;
  }
  .site-nav__list {
    flex-direction: row;
    gap: var(--space-6);
    padding: 0;
  }
  .site-nav__list a {
    font-size: var(--fs-sm);
    letter-spacing: var(--ls-en);
  }
  .nav-toggle { display: none; }
}

/* ---------- Section共通 ---------- */
.section__eyebrow {
  font-family: var(--ff-en);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-sub);
  margin-bottom: var(--space-5);
}
.section__title {
  font-size: var(--fs-3xl);
  font-weight: 500;
  margin-bottom: var(--space-6);
}

/* ---------- FV ---------- */
.fv {
  position: relative;
  overflow: hidden;
  padding-block: clamp(6rem, 18vw, 14rem);
}
.fv .container {
  position: relative;
  z-index: 1;
}

/* 背景の流れるロゴタイポ（右→左にゆっくりスクロール） */
.fv__bg {
  position: absolute;
  top: clamp(80px, 12vh, 160px);
  left: 0;
  width: 100%;
  height: clamp(12rem, 33vw, 26rem);   /* 1.5倍に拡張 */
  display: flex;
  align-items: center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  overflow: hidden;
}
.fv__bg-track {
  display: flex;
  flex-shrink: 0;
  white-space: nowrap;
  animation: none;
  will-change: transform;
}
.fv__bg-text {
  font-family: var(--ff-en);
  font-weight: 700;
  font-size: clamp(9rem, 27vw, 24rem);  /* 1.5倍 */
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--color-main);
  opacity: 0.07;
  flex-shrink: 0;
}

@keyframes fv-bg-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .fv__bg-track,
  .works-slider__bg-track { animation: none; }
}
.fv__eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-sub);
  margin-bottom: var(--space-6);
}
.fv__headline {
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--space-6);
  max-width: 18ch;
}
.fv__sub {
  max-width: var(--content-max);
  color: var(--color-sub);
  margin-bottom: var(--space-8);
}
.fv__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .fv__cta {
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-wide);
  border: 1px solid var(--color-main);
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.btn:hover { background: var(--color-main); color: var(--color-bg); }

.btn--accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-main);
}
.btn--accent:hover {
  background: var(--color-main);
  color: var(--color-bg);
  border-color: var(--color-main);
}

.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  gap: var(--space-6);
}
.about__body p {
  max-width: var(--content-max);
  color: var(--color-sub);
}
@media (min-width: 768px) {
  .about__grid {
    grid-template-columns: 1fr 2fr;
    gap: var(--space-12);
    align-items: start;
  }
  .about .section__eyebrow { margin: 0; }
}

/* ---------- Services ---------- */
.service-list {
  display: grid;
  grid-template-columns: 1fr;
  border-top: var(--bw-hair) solid var(--color-line);
}
.service-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: baseline;
  gap: var(--space-5);
  padding-block: var(--space-6);
  border-bottom: var(--bw-hair) solid var(--color-line);
}
.service-item__num {
  font-size: var(--fs-xs);
  color: var(--color-sub);
  letter-spacing: var(--ls-wide);
}
.service-item__name {
  font-size: var(--fs-xl);
  font-weight: 500;
  margin-bottom: var(--space-2);
  grid-column: 2;
}
.service-item__desc {
  color: var(--color-sub);
  grid-column: 2;
}

@media (min-width: 768px) {
  .service-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .service-item {
    border-right: var(--bw-hair) solid var(--color-line);
    padding-inline: var(--space-6);
  }
  .service-item:nth-child(2n) { border-right: 0; }
}
@media (min-width: 1024px) {
  .service-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .service-item:nth-child(2n) { border-right: var(--bw-hair) solid var(--color-line); }
  .service-item:nth-child(3n) { border-right: 0; }
}

/* ---------- Works (horizontal slider) ---------- */
.works {
  position: relative;
  overflow: hidden;
}
.works__head {
  position: relative;
  z-index: 2;
  margin-bottom: var(--space-8);
}

.works-slider {
  position: relative;
  padding-block: var(--space-10) var(--space-6);
}

.works-slider__bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.works-slider__bg-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  will-change: transform;
  animation: none;
}
.works-slider__bg-text {
  flex-shrink: 0;
  font-family: var(--ff-en);
  font-weight: 700;
  font-size: clamp(10rem, 32vw, 26rem);
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--color-main);
  opacity: 0.08;
  padding-right: 4rem;
}

@keyframes works-bg-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* スライダートラック（ネイティブ横スクロール + scroll-snap） */
.works-slider__track {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--space-5);
  padding-inline: var(--section-x);
  padding-block: var(--space-4);   /* ホバー時のscaleはみ出しを吸収 */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--section-x);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.works-slider__track:active { cursor: grabbing; }
.works-slider__track::-webkit-scrollbar { display: none; }
.works-slider__track:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.work-card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(240px, 70vw, 360px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.work-card .work__tag {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: inline-block;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--color-main);
  color: var(--color-bg);
  padding: 3px 10px;
  z-index: 2;
}
.work-card .work__media {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, #ECE8E0 0%, #DAD4C8 100%);
  margin: 0;
  opacity: 0.78;             /* 透かしを入れて奥のロゴ文字をふんわり */
  mix-blend-mode: multiply;  /* 背景文字と画像をブレンド */
  transform-origin: center;
  transition:
    opacity var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease);
  cursor: pointer;
}
.work-card:hover .work__media,
.work-card:focus-within .work__media {
  opacity: 1;
  transform: scale(1.04);
  mix-blend-mode: normal;    /* ホバー中は透かし解除、画像100%表示 */
}
.work-card .work__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-2);
}
.work-card .work__title {
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: 0;
}
.work-card .work__year {
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  color: var(--color-sub);
  flex-shrink: 0;
}

/* prev/next ボタン */
.works-slider__nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-6);
}
.works-nav-btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-main);
  font-size: var(--fs-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.works-nav-btn:hover {
  background: var(--color-main);
  color: var(--color-bg);
}

@media (min-width: 768px) {
  .work-card {
    width: clamp(320px, 38vw, 420px);
  }
}

/* ---------- Flow ---------- */
.flow-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
.flow-step {
  padding-top: var(--space-5);
  border-top: var(--bw-hair) solid var(--color-line);
}
.flow-step__num {
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-sub);
  margin-bottom: var(--space-3);
}
.flow-step__name {
  font-size: var(--fs-xl);
  font-weight: 500;
  margin-bottom: var(--space-3);
}
.flow-step__desc {
  color: var(--color-sub);
}
@media (min-width: 768px) {
  .flow-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
}

/* ---------- Contact ---------- */
.contact__inner {
  text-align: center;
  max-width: 720px;
}
.contact__inner .section__eyebrow,
.contact__inner .section__title {
  text-align: center;
}
.contact__lead {
  color: var(--color-sub);
  margin-bottom: var(--space-8);
}
.contact__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .contact__cta {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-4);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: var(--bw-hair) solid var(--color-line);
  padding-block: var(--space-6);
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-en);
  color: var(--color-sub);
}
