:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --surface-alt: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #d2d2d7;
  --accent: #0071e3;
  --accent-text: #0066cc;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #101010;
    --surface: #1d1d1f;
    --surface-alt: #1d1d1f;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --border: #424245;
    --accent: #0071e3;
    --accent-text: #2997ff;
    --nav-bg: rgba(22, 22, 23, 0.72);
    --shadow: none;
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  /* 固定ナビの裏にセクション見出しが隠れないようにする */
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* 日本語を文節の途中で折り返さない（対応ブラウザのみ） */
  word-break: auto-phrase;
  text-wrap: pretty;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding-inline: 22px;
}

/* ナビ */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 980px;
  height: 48px;
  margin: 0 auto;
  padding-inline: 22px;
}

.nav-brand {
  flex-shrink: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

/*
 * 狭い画面や文字を大きくする設定では1行に収まらないので、文字を縮めず、リンクの列を横スクロールさせる。
 * スクロールバーは高さ 48px のナビでは邪魔なので隠す
 */
.nav-links {
  display: flex;
  gap: 24px;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  display: block;
  /* タップしやすいよう、ナビの高さいっぱいを押せる範囲にする */
  padding-block: 14px;
  color: var(--text);
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0.8;
}

.nav-links a:hover {
  opacity: 1;
  text-decoration: none;
}

/* ヒーロー */
.hero {
  padding-block: clamp(96px, 16vw, 160px) clamp(48px, 8vw, 80px);
  text-align: center;
}

.hero-role {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 600;
}

.hero-name {
  margin: 8px 0 24px;
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* 文字の形に背景を切り抜けるブラウザでだけ透明にする。非対応だと文字が消えるため */
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .hero-name {
    background: linear-gradient(90deg, #0071e3, #a855f7 55%, #f43f5e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/*
 * ハイコントラスト表示では背景が消えて透明な文字だけが残るので、システムの文字色に戻す。
 * 記述の順番に関係なく上の指定に勝つよう、:root を付けて詳細度を上げている
 */
@media (forced-colors: active) {
  :root .hero-name {
    background: none;
    color: CanvasText;
  }
}

.hero-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.button {
  display: inline-block;
  padding: 10px 22px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: background-color 0.2s;
}

.button:hover {
  background: #0077ed;
  text-decoration: none;
}

/* セクション */
.section {
  padding-block: clamp(72px, 10vw, 112px);
}

.section-alt {
  background: var(--bg-alt);
}

.section-eyebrow {
  margin: 0;
  color: var(--accent-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.section-title {
  margin: 4px 0 40px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* スキル */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: 20px;
  margin: 0;
}

.skill {
  padding: 28px;
  background: var(--surface-alt);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.skill-name {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.skill-years {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.skill-detail {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* カード */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  background: var(--surface-alt);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

/* 背景がグレーのセクションでは、カードを白にして背景から浮かせる */
.section-alt .card,
.section-alt .skill {
  background: var(--surface);
}

/* タッチ端末ではタップ後に浮いたまま残るため、マウス操作の端末に限る */
@media (hover: hover) {
  .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
  }
}

/* iOS のホーム画面と同じ角丸に揃える */
.card-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-meta {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.card-title {
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card-body {
  margin: 0 0 20px;
  font-size: 0.95rem;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.store-link {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}

.store-link::after {
  content: " \2197";
  content: " \2197" / "";
  color: var(--muted);
}

.store-link:hover {
  border-color: var(--accent-text);
  color: var(--accent-text);
  text-decoration: none;
}

.subsection-title {
  margin: 64px 0 16px;
  font-size: 1.3rem;
  font-weight: 700;
}

/* 自己紹介 */
.about-body {
  max-width: 40em;
  margin: 0;
  font-size: 1.05rem;
}

.about-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: 20px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.about-list > li {
  padding: 28px;
  background: var(--surface-alt);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

/* 2列のカードの最後に置き、横幅いっぱいに広げる */
.about-list .about-wide {
  grid-column: 1 / -1;
}

.about-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.about-points b {
  display: block;
  margin-bottom: 2px;
}

.section-alt .about-list > li {
  background: var(--surface);
}

.about-points li {
  padding: 16px 18px;
  background: var(--bg-alt);
  border-radius: 14px;
  font-size: 0.9rem;
}

.about-list strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.about-list span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* その他の担当アプリ */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 16px;
  padding-block: 20px;
  border-top: 1px solid var(--border);
}

.timeline li:last-child {
  border-bottom: 1px solid var(--border);
}

.timeline-period {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.timeline-title {
  margin: 0;
  font-weight: 600;
}

@media (max-width: 600px) {
  .nav-links {
    gap: 16px;
  }

  .nav-brand {
    font-size: 0.85rem;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* 読み込み時にふわっと出す。動きを減らす設定の人には出さない */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .hero .container > * {
    animation: fade-up 0.8s ease both;
  }

  .hero .container > :nth-child(2) { animation-delay: 0.1s; }
  .hero .container > :nth-child(3) { animation-delay: 0.2s; }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* フッター */
.footer {
  padding-block: 24px;
  background: var(--bg-alt);
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}
