/* PixMode LP — DESIGN.md（watrix-docs/pixmode/DESIGN.md）のトークンをそのまま写したもの。
   値を変えるときは DESIGN.md を先に直す。 */

:root {
  /* Color — Primary */
  --primary: #3378F2;
  --primary-dark: #2954D9;
  --primary-light: #4A8FFA;
  --primary-wash: #EEF3FE;

  /* Color — Semantic */
  --danger: #D0342C;
  --warning: #B26A00;
  --success: #1D7A4C;

  /* Color — Neutral */
  --text: #14161C;
  --text-2: #5A6070;
  --text-3: #9AA0AE;
  --border: #E3E6EC;
  --bg: #FFFFFF;
  --surface: #F6F7F9;
  --letterbox: #0B0B0F;

  /* Spacing */
  --xs: 4px; --s: 8px; --m: 16px; --l: 24px; --xl: 48px; --xxl: 96px;

  /* Radius / Shadow */
  --r-btn: 12px;
  --r-card: 16px;
  --sh-1: 0 1px 3px rgba(20, 22, 28, 0.08);
  --sh-2: 0 4px 12px rgba(20, 22, 28, 0.10);
  --sh-3: 0 12px 32px rgba(20, 22, 28, 0.14);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
          "Hiragino Kaku Gothic ProN", "Noto Sans JP", "BIZ UDPGothic",
          "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5B93FF;
    --primary-wash: #172336;
    /* 暗地では AA を満たさなくなるので明るく振る */
    --danger: #FF6F63;
    --warning: #E0A44A;
    --success: #4ED18B;
    --text: #F2F4F8;
    --text-2: #A3AAB8;
    --text-3: #6D7484;
    --border: #2A2F38;
    --bg: #0E1013;
    --surface: #171A1F;
    --sh-1: 0 1px 3px rgba(0, 0, 0, 0.5);
    --sh-2: 0 4px 12px rgba(0, 0, 0, 0.5);
    --sh-3: 0 12px 32px rgba(0, 0, 0, 0.6);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
}

/* ---- 共通 ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--l); }
.wrap--wide { max-width: 1200px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

section { padding: var(--xxl) 0; }
section.alt { background: var(--surface); }

h1, h2, h3 { font-feature-settings: "palt" 1; margin: 0 0 var(--m); }
h2 { font-size: 34px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.5; }
p { margin: 0 0 var(--m); }
p:last-child { margin-bottom: 0; }

.lede { color: var(--text-2); font-size: 17px; max-width: 62ch; }
.caption { font-size: 13px; line-height: 1.7; color: var(--text-2); }

a { color: var(--primary); }

/* ---- ヘッダー ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.site-header.scrolled { box-shadow: var(--sh-3); border-bottom-color: var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: var(--m); height: 60px; }
.brand { display: flex; align-items: center; gap: var(--s); font-weight: 600; text-decoration: none; color: var(--text); }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: var(--l); }
.site-header nav a { color: var(--text-2); text-decoration: none; font-size: 15px; }
.site-header nav a:hover { color: var(--text); }
@media (max-width: 599px) { .site-header nav a.hide-sp { display: none; } }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s);
  min-height: 52px; padding: var(--m) 32px;
  border-radius: var(--r-btn); border: 0;
  font-family: inherit; font-size: 17px; font-weight: 600; text-decoration: none;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary-dark) 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(41, 84, 217, 0.28);
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { background: linear-gradient(180deg, #3378F2 0%, #1F45B8 100%); transform: translateY(-1px); }
.btn--secondary {
  min-height: 44px; padding: 14px var(--l);
  background: transparent; border: 1px solid var(--border);
  color: var(--text); font-size: 15px; font-weight: 500; box-shadow: none;
}
.btn--secondary:hover { background: var(--surface); transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--m); align-items: center; }
.btn-note { font-size: 13px; line-height: 1.7; color: var(--text-2); margin-top: var(--s); }

/* ---- ヒーロー ---- */
.hero { padding: var(--xl) 0 var(--xxl); }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--xl); align-items: center; }
@media (max-width: 839px) { .hero__grid { grid-template-columns: 1fr; gap: var(--l); } }
.hero h1 {
  font-size: clamp(34px, 5vw, 56px); font-weight: 700; line-height: 1.25;
  letter-spacing: -0.01em; margin-bottom: var(--l);
}
.hero .lede { font-size: 19px; margin-bottom: var(--l); }

/* ---- ヒーローの図版（メニューバーから開いた実際の見た目） ---- */
/* 画像を1枚も持たずに済ませたいので、アプリの UI を CSS で組み立てている。
   文言と並び順は Sources/UI/MenuContent.swift に合わせる。
   寸法は px ではなく cqw（画面の幅に対する割合）で持つ。px で書くと画面が
   縮んだときにメニューだけ縮まず、overflow:hidden で下が切れる。 */
.shot {
  position: relative;
  border-radius: 14px;
  padding: 10px 10px 22px;
  background: linear-gradient(180deg, #2C303A 0%, #1A1D24 100%);
  box-shadow: var(--sh-3);
}
.shot__screen {
  position: relative;
  container-type: inline-size;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 3024 / 1964;
  background: linear-gradient(140deg, #7EA9FF 0%, var(--primary) 42%, #23409E 100%);
}
/* 画面下の縁。MacBook の顎に見せる */
.shot::after {
  content: "";
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 56px; height: 4px; border-radius: 2px; background: #3A3F4B;
}

/* メニューバー */
.shot__menubar {
  display: flex; align-items: center; gap: 2.7cqw;
  height: 4.25cqw; padding: 0 1.9cqw;
  background: rgba(20, 22, 28, 0.28);
  backdrop-filter: blur(8px);
  font-size: 1.74cqw; color: #FFFFFF; letter-spacing: 0;
}
.shot__menubar .apple { font-size: 1.95cqw; }
.shot__menubar .spacer { margin-left: auto; }
.shot__menubar .pm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.5cqw; height: 3.1cqw; border-radius: 0.6cqw;
  background: rgba(255, 255, 255, 0.9);
}
.shot__menubar .pm img { width: 2.3cqw; height: 2.3cqw; display: block; }

/* 開いたメニュー */
.shot__menu {
  /* メニューバーのアイコンの真下に落ちるよう、右端をアイコンに合わせる */
  position: absolute; top: 5cqw; right: 13%; width: 60%;
  border-radius: 1.5cqw; padding: 0.8cqw;
  background: rgba(252, 252, 253, 0.94);
  backdrop-filter: blur(20px);
  box-shadow: 0 1.5cqw 4.6cqw rgba(0, 0, 0, 0.35);
  font-size: 1.83cqw; line-height: 1.6; color: #14161C;
  text-align: left;
}
.shot__menu ul { list-style: none; margin: 0; padding: 0; }
.shot__menu li {
  display: flex; align-items: center; gap: 1cqw;
  padding: 0.48cqw 1.35cqw; border-radius: 0.8cqw;
  font-family: var(--mono); letter-spacing: 0; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.shot__menu li .tick { width: 1.35cqw; color: var(--text); }
.shot__menu li .sub { font-family: var(--font); color: #6B7280; }
.shot__menu li.on { background: var(--primary); color: #FFFFFF; }
.shot__menu li.on .tick, .shot__menu li.on .sub { color: rgba(255, 255, 255, 0.85); }
.shot__menu li.cmd { font-family: var(--font); }
.shot__menu li.ver { font-family: var(--font); color: #9AA0AE; font-size: 1.64cqw; }
.shot__menu hr { border: 0; border-top: 1px solid rgba(20, 22, 28, 0.12); margin: 0.6cqw 1.2cqw; }

.shot__caption { font-size: 13px; line-height: 1.7; color: var(--text-2); margin-top: var(--m); }

/* Before / After */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--l); margin-top: var(--xl); }
@media (max-width: 839px) { .compare { grid-template-columns: 1fr; } }

.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 28px; box-shadow: var(--sh-1);
}
.card--after { border-color: var(--primary); }
.card__label { display: flex; align-items: baseline; gap: var(--s); margin-bottom: var(--m); }
.card__label h3 { margin: 0; }
.card__label .count { font-size: 13px; color: var(--text-2); font-family: var(--mono); letter-spacing: 0; }

/* 解像度の一覧を模した行 */
.modes { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 15px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.modes li {
  display: flex; align-items: center; gap: var(--s);
  min-height: 36px; padding: 0 var(--s);
  border-bottom: 1px solid var(--border);
}
.modes li:last-child { border-bottom: 0; }
.modes .res { flex: 1; }
.modes .bad { color: var(--text-3); }
.modes .bad .tag { color: var(--danger); }
.modes .ok .check { color: var(--success); }
.modes li.selected { background: var(--primary-wash); box-shadow: inset 3px 0 0 var(--primary); border-radius: 4px; }
.modes .tag, .modes .check { font-size: 12px; font-family: var(--font); letter-spacing: 0.02em; }
/* 暗地では黒帯が地に溶けるので、常に輪郭を持たせる */
.modes .bar { display: inline-block; width: 22px; height: 4px; background: var(--letterbox); border-radius: 1px; box-shadow: 0 0 0 1px var(--border); }
.modes .more { color: var(--text-3); border-bottom: 0; }

/* ---- 実測値 ---- */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--l); margin-top: var(--xl); }
@media (max-width: 839px) { .metrics { grid-template-columns: 1fr; } }
.metric { text-align: left; }
.metric .num {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(48px, 7vw, 72px); font-weight: 700; line-height: 1; letter-spacing: -0.02em;
  display: block; margin-bottom: var(--s);
}
.metric--bad .num { color: var(--danger); }
.metric--good .num { color: var(--primary); }
.metric .what { font-weight: 600; display: block; }
.metric .why { color: var(--text-2); font-size: 15px; line-height: 1.75; }

/* ---- 黒帯の説明図 ---- */
.letterbox-demo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--xl); align-items: center; margin-top: var(--xl); }
@media (max-width: 839px) { .letterbox-demo { grid-template-columns: 1fr; gap: var(--l); } }
.screen {
  /* 地が黒なので、暗地でも画面の輪郭が分かるよう border を必ず付ける */
  background: var(--letterbox); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--sh-2);
  aspect-ratio: 3024 / 1964; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.screen__content {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-family: var(--mono); font-size: 14px; letter-spacing: 0;
}
/* 16:9 を 1.5397:1 の画面に出すと上下が余る */
.screen--letterboxed .screen__content { height: 84.4%; }
.figure-note { font-size: 13px; color: var(--text-2); margin-top: var(--s); line-height: 1.7; }

/* ---- 機能カード ---- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--l); margin-top: var(--xl); }
@media (max-width: 839px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .features { grid-template-columns: 1fr; } }
.features .card p { color: var(--text-2); font-size: 15px; line-height: 1.75; margin: 0; }

/* ---- 他のアプリ ---- */
.apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--m); margin-top: var(--xl); }
@media (max-width: 599px) { .apps { grid-template-columns: 1fr; } }
.app {
  display: flex; align-items: flex-start; gap: var(--m);
  padding: 20px; border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--bg); text-decoration: none; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.app:hover { border-color: var(--primary); box-shadow: var(--sh-2); transform: translateY(-1px); }
.app img { width: 48px; height: 48px; border-radius: 10px; flex: none; }
.app__name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 17px; }
.app__name .ext { color: var(--text-3); }
.app__desc { color: var(--text-2); font-size: 15px; line-height: 1.7; margin: 4px 0 0; }

/* ---- コード ---- */
pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: var(--m) 20px; overflow-x: auto; margin: 0;
}
pre code { font-family: var(--mono); font-size: 15px; line-height: 1.7; letter-spacing: 0; }

/* ---- FAQ ---- */
.faq { margin-top: var(--xl); border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; padding: var(--l) 0; font-weight: 600; font-size: 17px;
  list-style: none; display: flex; align-items: center; gap: var(--m);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; margin-left: auto; color: var(--text-3); font-weight: 400; }
.faq details[open] summary::after { content: "－"; }
.faq details > p { color: var(--text-2); font-size: 15px; line-height: 1.8; padding: 0 0 var(--l); margin: 0; max-width: 68ch; }

/* ---- フッター ---- */
.site-footer { border-top: 1px solid var(--border); padding: var(--xl) 0; color: var(--text-2); font-size: 15px; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: var(--l); margin-bottom: var(--m); }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }

@media (max-width: 839px) {
  section { padding: var(--xl) 0; }
  h2 { font-size: 26px; }
}
