/* =============================================================
   style.css — 全ページ共通のデザイン
   方針：主張しない。小さなロゴ、広い余白、1書体、静かな灰色。
   ============================================================= */

/* ---------- 色（OKLCH：明るさ L・彩度 C・色相 H） ----------
   白地に、ほんの少しだけ青みのあるグレー（色相250・彩度ほぼ0）で統一。
   ダークモードには切り替えず、常に白地で表示する。
   コントラスト比（WCAG）：文字/背景 15.1:1、補足文字/背景 6.0:1、補足文字/帯 5.5:1 */
:root {
  color-scheme: only light;           /* ブラウザの自動ダーク化も止める */
  --bg:     oklch(1 0 0);              /* #ffffff 背景 */
  --band:   oklch(0.968 0.004 250);    /* #f2f5f7 帯（About など） */
  --ink:    oklch(0.27 0.008 250);     /* #24272a 文字 */
  --muted:  oklch(0.5 0.01 250);       /* #5f6469 補足の文字 */
  --rule:   oklch(0.915 0.005 250);    /* #e0e3e6 罫線 */
  --bubble: oklch(1 0 0);              /* 吹き出し */

  /* 文字サイズの段階（これ以外は使わない） */
  --fs-caption: 0.75rem;   /* 12px 注記・ドメイン */
  --fs-ui: 0.8125rem;      /* 13px ナビ・ボタン */
  --fs-body: 0.9375rem;    /* 15px 本文 */
  --fs-lead: 1.0625rem;    /* 17px リード・アプリ名 */
  --fs-title: 1.375rem;    /* 22px ページ見出し */

  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --gutter: clamp(20px, 5vw, 48px);
  --max: 960px;
}
/* ---------- 土台 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-body); font-weight: 400;
  line-height: 1.9;              /* 日本語本文は少し広め */
  letter-spacing: 0.04em;        /* ほんの少し字間を空けて、静かに */
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100svh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.3em; text-decoration-skip-ink: auto; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
::selection { background: var(--band); }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- ヘッダー ---------- */
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 88px;
}
.logo {
  font-size: 0.9375rem; font-weight: 500; letter-spacing: 0.14em;
  text-decoration: none; white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 36px); }
.site-nav a {
  font-size: var(--fs-ui); letter-spacing: 0.08em; text-decoration: none; color: var(--ink);
  padding-block: 6px;
}
.site-nav a:hover { color: var(--muted); }
.site-nav a[aria-current="page"] { text-decoration: underline; }
.lang { display: flex; gap: 4px; font-size: var(--fs-caption); letter-spacing: 0.08em; }
.lang button {
  border: 0; background: none; color: var(--muted); font: inherit; letter-spacing: inherit;
  padding: 6px 4px; cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--ink); }

/* ---------- ページ見出し（About / Works / Contact） ---------- */
.page-head { padding-block: clamp(32px, 7vw, 72px) clamp(24px, 4vw, 40px); }
.page-title { margin: 0; font-size: var(--fs-title); font-weight: 400; letter-spacing: 0.12em; line-height: 1.3; }
.page-sub { margin: 6px 0 0; font-size: var(--fs-ui); color: var(--muted); }

/* ---------- トップ：正方形の Welcome ---------- */
.home { display: grid; place-items: center; padding: 24px var(--gutter) 64px; min-height: calc(100svh - 88px - 80px); }
.square {
  width: min(100%, 400px); aspect-ratio: 1;
  border: 1px solid var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 32px; text-align: center;
}
.square .avatar { width: 112px; height: 112px; border-radius: 50%; display: block; }
.welcome { margin: 0; font-size: var(--fs-lead); font-weight: 400; letter-spacing: 0.3em; line-height: 1.3; padding-left: 0.3em; }
.square p { margin: 0; font-size: var(--fs-ui); color: var(--muted); line-height: 1.8; text-wrap: balance; }
.sns { display: flex; gap: 20px; }
.sns a { display: grid; place-items: center; width: 36px; height: 36px; color: var(--ink); }
.sns a:hover { color: var(--muted); }
.icon { width: 18px; height: 18px; display: block; flex-shrink: 0; }   /* SNSロゴ（HTMLに埋め込んだSVG。文字色で塗られる） */
/* トップの唯一の動き：イントロ後に正方形がふわっと現れる */
.home .square { opacity: 0; transform: translateY(8px); }
.ready .home .square { opacity: 1; transform: none; transition: opacity 0.9s ease, transform 0.9s ease; }

/* ---------- About：灰色の帯＋吹き出し＋イラスト ---------- */
.band { background: var(--band); }
.about-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 5vw, 64px);
  padding-block: clamp(40px, 7vw, 72px);
}
.bubble {
  position: relative; background: var(--bubble);
  border-radius: 56% 44% 52% 48% / 48% 54% 46% 52%;   /* 丸みのある不定形 */
  padding: clamp(36px, 6vw, 64px) clamp(32px, 6vw, 72px);
  max-width: 560px;
}
.bubble::after {        /* 右（イラスト側）へ向くしっぽ */
  content: ""; position: absolute; right: -18px; top: 48%;
  border-left: 34px solid var(--bubble); border-top: 14px solid transparent; border-bottom: 14px solid transparent;
}
.bubble p { margin: 0 0 0.9em; font-size: var(--fs-ui); letter-spacing: 0.1em; line-height: 2.1; }
.bubble p:last-child { margin-bottom: 0; }
.about-figure { margin: 0; width: clamp(140px, 22vw, 220px); }
.about-figure img { width: 100%; height: auto; display: block; border-radius: 50%; }

.values { padding-block: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; }
.values h2, .works-group h2, .notice h2 {
  margin: 0; font-size: var(--fs-ui); font-weight: 500; letter-spacing: 0.12em; color: var(--muted); line-height: 1.9;
}
.values ul { list-style: none; margin: 0; padding: 0; }
.values li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.values li:first-child { padding-top: 0; }
.tech { margin: 16px 0 0; font-size: var(--fs-caption); color: var(--muted); }

/* ---------- Works：分類ごとのリスト ---------- */
/* 区切り線は本文の幅にそろえる（左右の余白の内側だけに引く） */
.works-group, .notice { background: linear-gradient(var(--rule), var(--rule)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat; }
.works-group { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; padding-block: 28px; }
.apps { list-style: none; margin: 0; padding: 0; }
.apps li + li { margin-top: 22px; }
.app { display: block; text-decoration: none; }
.app-name { font-size: var(--fs-lead); font-weight: 500; letter-spacing: 0.06em; line-height: 1.5; }
.app:hover .app-name { text-decoration: underline; }
.app-desc { display: block; font-size: var(--fs-ui); color: var(--muted); line-height: 1.8; max-width: 38em; text-wrap: pretty; }
.app-domain { display: block; font-size: var(--fs-caption); color: var(--muted); letter-spacing: 0.02em; overflow-wrap: anywhere; }

.notice { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; padding-block: 28px 8px; }
.notice ul { margin: 0; padding-left: 1.1em; font-size: var(--fs-ui); color: var(--muted); }

/* ---------- Contact ---------- */
.contact-body p { margin: 0 0 28px; max-width: 34em; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 22px;
  border: 1px solid var(--ink); border-radius: 999px; text-decoration: none;
  font-size: var(--fs-ui); letter-spacing: 0.08em;
}
.button:hover { background: var(--ink); color: var(--bg); }

/* ---------- フッター ---------- */
.site-footer { padding-block: 40px; font-size: var(--fs-caption); color: var(--muted); letter-spacing: 0.08em; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- ランディングアニメーション（トップのみ） ---------- */
/* 幕が出るまでの一瞬、ページ本体を見せない（head の小さなスクリプトが付ける印） */
.intro-pending body { visibility: hidden; }
#intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 16px; background: var(--bg); cursor: pointer; transition: opacity 0.5s ease, visibility 0.5s; }
#intro.hide { opacity: 0; visibility: hidden; }
.typist { position: relative; width: min(260px, 70vw); aspect-ratio: 1; }
.typist img { width: 100%; height: 100%; display: block; }
.typist.shake img { border-radius: 50%; animation: tap 0.14s steps(2) infinite; }
@keyframes tap { 0% { transform: none; } 50% { transform: translate(1.5px, 2px) rotate(-0.8deg); } 100% { transform: translate(-1px, 1px) rotate(0.6deg); } }
.key { position: absolute; font-size: 13px; font-weight: 500; line-height: 1; color: var(--muted); pointer-events: none; animation: pop 0.9s ease-out forwards; }
@keyframes pop { 0% { opacity: 0; transform: scale(0.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), -55px) scale(1.1); } }
.intro-text { font-size: var(--fs-ui); letter-spacing: 0.2em; min-height: 1.3em; }
.intro-text::after { content: "|"; margin-left: 2px; animation: blink 0.8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.intro-skip { font-size: var(--fs-caption); color: var(--muted); letter-spacing: 0.08em; }

/* ---------- スマホ ---------- */
@media (max-width: 640px) {
  .site-header .bar { flex-wrap: wrap; min-height: 0; padding-block: 18px 6px; row-gap: 4px; }
  .site-nav { order: 3; width: 100%; justify-content: flex-start; gap: 24px; }
  .home { min-height: calc(100svh - 120px - 80px); }
  .about-hero { grid-template-columns: 1fr; justify-items: center; }
  .about-figure { order: -1; width: 120px; }
  .bubble { border-radius: 32px; }
  .bubble::after { right: auto; left: 50%; top: -22px; transform: translateX(-50%); border-left: 14px solid transparent; border-right: 14px solid transparent; border-bottom: 26px solid var(--bubble); border-top: 0; }
  .values, .works-group, .notice { grid-template-columns: 1fr; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .home .square, .ready .home .square { opacity: 1; transform: none; transition: none; }
}

/* ---------- 英語表示の調整：ラテン文字は字間を詰める ---------- */
html[lang="en"] body { letter-spacing: 0.01em; }
html[lang="en"] .bubble p { letter-spacing: 0.02em; line-height: 1.9; }
/* 日本語は文節で改行する（「モー / ド」のような途中の改行を防ぐ。対応ブラウザのみ） */
html[lang="ja"] p, html[lang="ja"] li, html[lang="ja"] .app-desc { word-break: auto-phrase; line-break: strict; }
