/* 合同会社YKP コーポレートサイト
   色は白・黒・朱の3色（2026-09-28 角井さん決定。墨・夜の案は docs/LOG.md 第2ラウンド）。
   動きは js/site.js。JS が動かない・動きを減らす設定の時は、動かない最終形で表示する。 */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f4f1;
  --ink: #121212;
  --sub: #6a6a66;
  --line: #e3e2de;
  --accent: #ff4b1f;
  --on-accent: #ffffff;
  --band-1: #ff4b1f;
  --band-2: #121212;
}

:root {
  --font-en: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --font-ja: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  /* ロゴの K の斜め線の角度（約 42 度）。帯・ホバーの斜めをこれに揃える */
  --slant: 42deg;
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ja);
  font-feature-settings: "palt";
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s, color 0.4s;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
svg { display: block; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- ヘッダー ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
  pointer-events: none;
}
.header > * { pointer-events: auto; }

.header__brand { display: block; transition: opacity 0.4s var(--ease), transform 0.6s var(--ease); }
.header__logo { width: 64px; height: auto; color: var(--ink); }

.header__nav {
  display: flex;
  gap: 32px;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease);
}
.header__nav a { position: relative; padding: 4px 0; }
.header__nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.header__nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* スクロールすると、ロゴとメニューが丸いボタンに縮む */
.pill {
  position: absolute;
  top: 18px;
  left: var(--gutter);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 600 13px/1 var(--font-en);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px) scale(0.9);
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease), visibility 0s linear 0.4s;
}
.pill__logo { width: 34px; height: auto; color: var(--bg); }

.is-compact .header__brand,
.is-compact .header__nav { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.is-compact .pill {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease), visibility 0s;
}

/* ---------- メニュー（丸いボタンから開く） ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  clip-path: circle(0% at 46px 40px);
  transition: clip-path 0.8s var(--ease);
}
.menu[hidden] { display: grid; visibility: hidden; }
.menu.is-open { clip-path: circle(150% at 46px 40px); visibility: visible; }
.menu__nav { display: grid; gap: 12px; text-align: center; }
.menu__nav a { display: grid; gap: 2px; padding: 8px 24px; }
.menu__nav .en { font: 700 clamp(40px, 8vw, 72px)/1 var(--font-en); letter-spacing: -0.02em; }
.menu__nav .ja { font-size: 13px; color: color-mix(in srgb, var(--bg) 60%, transparent); }
.is-menu-open .pill { background: var(--bg); color: var(--ink); }
.is-menu-open .pill__logo { color: var(--ink); }

/* ---------- 最初の画面 ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero__title {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 28px;
  margin: 0;
  font-weight: 400;
}
.hero__logo {
  width: min(64vw, 720px);
  height: auto;
  color: var(--ink);
  overflow: visible;
}
.hero__name {
  font-size: clamp(12px, 1.1vw, 14px);
  letter-spacing: 0.4em;
  color: var(--sub);
  padding-left: 0.4em;
}

/* ロゴの斜めと同じ角度の太い帯。スクロールで画面を横切る */
.bands {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
/* 帯は画面の中心に置き、js が斜めの向きに沿って画面の外から外へ動かす */
.band {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150vmax;
  height: 15vmax;
  margin: -7.5vmax 0 0 -75vmax;
  border-radius: 1.4vmax;
  opacity: 0;
  will-change: transform;
}
.band--1 { background: var(--band-1); }
.band--2 { background: var(--band-2); }

.scroll-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 28px;
  width: 1px;
  height: 56px;
  background: var(--line);
  overflow: hidden;
  transform: translateX(-50%);
}
.scroll-cue span {
  position: absolute;
  inset: 0;
  background: var(--ink);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue {
  0% { transform: translateY(-100%); }
  60% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* ---------- 区画の共通 ---------- */
.section { position: relative; padding: clamp(96px, 14vw, 180px) 0; }
.section__head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.section__en {
  margin: 0;
  font: 700 clamp(56px, 11vw, 160px)/0.9 var(--font-en);
  letter-spacing: -0.045em;
}
.section__ja { margin: 0; font-size: 14px; color: var(--sub); letter-spacing: 0.1em; }

/* 1文字ずつ出すための箱（js が文字を包む） */
.char-mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.char { display: inline-block; will-change: transform; }

/* ---------- 事業内容 ---------- */
.biz { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.biz__item { border-bottom: 1px solid var(--line); }
.biz__link {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr 56px;
  align-items: start;
  gap: 24px;
  padding: clamp(28px, 4vw, 48px) 8px;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.5s var(--ease);
}
/* ホバーで斜めに塗りが走る */
.biz__link::before {
  content: "";
  position: absolute;
  inset: -2px -20%;
  z-index: -1;
  background: var(--accent);
  transform: translateX(-135%) skewX(calc(-1 * (90deg - var(--slant))));
  transition: transform 0.7s var(--ease);
}
.biz__link:focus-visible { color: var(--on-accent); }
.biz__link:focus-visible::before { transform: translateX(0) skewX(calc(-1 * (90deg - var(--slant)))); }
/* 塗りはマウスのある端末だけ（スマホでタップ後に塗りが残らないように）。
   縦に長い行では斜めのずれが大きく、待機位置の角が行の中に届くので、マウスのない端末では塗り自体を出さない */
@media (hover: none) {
  .biz__link::before { display: none; }
  .biz__link:focus-visible { color: inherit; }
}
@media (hover: hover) {
  .biz__link:hover { color: var(--on-accent); }
  .biz__link:hover::before { transform: translateX(0) skewX(calc(-1 * (90deg - var(--slant)))); }
}
.biz__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.biz__no { padding-top: 0.9em; font: 600 14px/1 var(--font-en); letter-spacing: 0.08em; opacity: 0.6; }
.biz__body { display: grid; gap: 6px; min-width: 0; }
.biz__name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.3;
}
.biz__name small { font: 600 14px/1 var(--font-en); letter-spacing: 0.04em; opacity: 0.6; }
.biz__name small:not(:only-child) { font-family: var(--font-ja); }
.biz__kind { font: 600 12px/1.4 var(--font-en); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.6; }
.biz__text { max-width: 40em; font-size: 15px; line-height: 1.9; margin-top: 6px; }
.biz__scope {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px 32px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.biz__scope li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.75;
}
/* 印はロゴの斜めと同じ向きの短い線 */
.biz__scope li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.85em;
  width: 10px;
  height: 2px;
  background: var(--accent);
  transform: rotate(calc(-1 * var(--slant)));
  transition: background-color 0.5s var(--ease);
}
.biz__scope b { font-weight: 700; }
.biz__scope span { display: block; font-size: 13px; opacity: 0.75; }
@media (hover: hover) {
  .biz__link:hover .biz__scope li::before { background: var(--on-accent); }
}
.biz__note { margin-top: 14px; font-size: 13px; opacity: 0.75; }
.biz__link--visual { grid-template-columns: 72px minmax(0, 1fr) minmax(0, 440px) 56px; }
.biz__visual {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 1px 0 var(--line), 0 12px 32px rgba(18, 18, 18, 0.10);
  aspect-ratio: 1200 / 630;
}
.biz__visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
@media (hover: hover) {
  .biz__link:hover .biz__visual img { transform: scale(1.04); }
}
.biz__go {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid currentColor;
  transition: transform 0.6s var(--ease);
}
.biz__go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
@media (hover: hover) {
  .biz__link:hover .biz__go { transform: rotate(45deg); }
  .biz__link[href^="mailto:"]:hover .biz__go { transform: translateX(6px); }
}

/* ---------- 会社概要 ---------- */
.company { background: var(--bg-alt); }
.table { margin: 0; border-top: 1px solid var(--line); }
.table__row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 24px 8px;
  border-bottom: 1px solid var(--line);
}
.table dt { font-size: 14px; color: var(--sub); }
.table dd { margin: 0; font-size: 16px; }

/* ---------- お問い合わせ ---------- */
.contact__lead { margin: 0 0 32px; font-size: 15px; color: var(--sub); }
.contact__link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }

/* 動きが使える時は、ロゴを隠して始める（js が組み上げる。3秒で始まらなければ head の script が戻す） */
.motion .hero .logo-part,
.motion .hero__name { opacity: 0; }
.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  max-width: 100%;
}
.contact__addr {
  position: relative;
  font: 600 clamp(28px, 6.4vw, 88px)/1.1 var(--font-en);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.contact__addr::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0.12);
  transform-origin: left;
  transition: transform 0.8s var(--ease);
}
.contact__mail:hover .contact__addr::after { transform: scaleX(1); }
.contact__arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(48px, 6vw, 80px);
  height: clamp(48px, 6vw, 80px);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  transition: transform 0.6s var(--ease);
}
.contact__arrow svg { width: 40%; height: 40%; fill: none; stroke: currentColor; stroke-width: 1.8; }
.contact__mail:hover .contact__arrow { transform: translateX(8px); }

/* ---------- フッター ---------- */
.footer { padding: 40px 0 48px; border-top: 1px solid var(--line); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer__logo { width: 56px; height: auto; color: var(--ink); }
.footer small { font-size: 12px; color: var(--sub); }

/* ---------- スマホ ---------- */
@media (max-width: 760px) {
  .header { padding: 16px var(--gutter); }
  .header__logo { width: 52px; }
  .header__nav { gap: 18px; font-size: 13px; }
  .pill { top: 12px; }
  .hero__logo { width: 78vw; }
  .band { width: 90vmax; height: 22vmax; }
  .section__head { flex-direction: column; gap: 8px; }
  .biz__link { grid-template-columns: 1fr 44px; gap: 12px 16px; padding: 28px 4px; }
  .biz__no { grid-column: 1 / -1; padding-top: 0; }
  .biz__go { width: 44px; height: 44px; align-self: start; grid-row: 2; grid-column: 2; }
  .biz__body { grid-row: 2; grid-column: 1; }
  .biz__link--visual { grid-template-columns: 1fr 44px; }
  .biz__visual { grid-row: 3; grid-column: 1 / -1; margin-top: 8px; }
  .biz__text { font-size: 14px; }
  .table__row { grid-template-columns: 1fr; gap: 4px; padding: 18px 4px; }
}

/* 動きを減らす設定の人には動かさない */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
