/* ログインの画面の見た目（ログイン無しで返す）。
   見本 A案「実験ノート」（site/mockups/a-notebook/index.html）の色・字・手書き風の線を写した最小の物。
   色・字・余白は :root の変数にだけ書く。暗い見た目は OS の設定に従う（手で切り替える台本は置かない。設計書 4.1） */

:root {
  --bg: #f6f2e7;
  --paper: #fffdf8;
  --grid: #e4e5e1;
  --rule: #c6d3ea;
  --ink: #24272c;
  --ink-2: #434850;
  --muted: #5f6670;
  --line: #cdc6b4;
  --accent: #2353a6;
  --accent-soft: #e2eaf7;
  --on-accent: #ffffff;
  --hl: #ffe680;
  --bad: #b0302f;
  --bad-soft: #fae6e4;
  --shadow: 0 1px 2px rgb(60 50 30 / 10%), 0 6px 16px rgb(60 50 30 / 8%);
  --fs-2: 14px;
  --fs-3: 16px;
  --fs-4: 18px;
  --fs-6: clamp(28px, 3vw, 36px);
  --font: 'Hiragino Sans', 'BIZ UDPGothic', 'Yu Gothic UI', 'Noto Sans JP', Meiryo, system-ui, sans-serif;
  --hand:
    'Zen Kurenaido', 'UD デジタル 教科書体 NK', 'UD Digi Kyokasho NK', 'Klee', 'Hiragino Maru Gothic ProN',
    'BIZ UDPGothic', 'Yu Gothic UI', sans-serif;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --cell: 24px;
  --sketch: 10px 3px 12px 4px / 4px 12px 3px 10px;
  --sketch-sm: 6px 2px 7px 3px / 3px 7px 2px 6px;
  --dur-1: 120ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #23221f;
    --paper: #2d2c28;
    --grid: #2c2b28;
    --rule: #3b4560;
    --ink: #ece8df;
    --ink-2: #cfcabe;
    --muted: #a8a295;
    --line: #4a4841;
    --accent: #94b6f0;
    --accent-soft: #2a3650;
    --on-accent: #1a1b1e;
    --hl: #5e4f14;
    --bad: #f08e88;
    --bad-soft: #3d2220;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 6px 16px rgb(0 0 0 / 24%);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #23221f;
  --paper: #2d2c28;
  --grid: #2c2b28;
  --rule: #3b4560;
  --ink: #ece8df;
  --ink-2: #cfcabe;
  --muted: #a8a295;
  --line: #4a4841;
  --accent: #94b6f0;
  --accent-soft: #2a3650;
  --on-accent: #1a1b1e;
  --hl: #5e4f14;
  --bad: #f08e88;
  --bad-soft: #3d2220;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 6px 16px rgb(0 0 0 / 24%);
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-3);
  line-height: 1.8;
  word-break: auto-phrase;
  overflow-wrap: break-word;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  -webkit-tap-highlight-color: transparent;
}
.sprite {
  position: absolute;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 画面の真ん中に、ノートの1枚を置く。横の余白は安全域より狭くしない（設計書 4.6） */
.login {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--sp-4);
  max-width: 640px;
  margin-inline: auto;
  padding-block: var(--sp-7);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  text-align: center;
}
.login-art {
  display: block;
  inline-size: min(240px, 70vw);
  block-size: auto;
}
.login-title {
  margin: 0;
  font-family: var(--hand);
  font-size: var(--fs-6);
  line-height: 1.35;
  text-wrap: balance;
}
.lead {
  margin: 0;
  max-width: 32em;
  color: var(--ink-2);
  font-family: var(--hand);
  font-size: var(--fs-4);
}

/* この案の印：見出しに、手で塗った蛍光ペンの線 */
.hl {
  position: relative;
  z-index: 0;
  padding-inline: var(--sp-1);
}
.hl::before {
  content: '';
  position: absolute;
  inset-inline: calc(var(--sp-1) * -1);
  bottom: 4%;
  block-size: 42%;
  z-index: -1;
  background: var(--hl);
  border-radius: 4px 10px 6px 12px / 6px 4px 10px 4px;
  filter: url(#wobble);
  rotate: -1deg;
}

/* 図の線と面（色は変数だけ） */
.s-ink {
  stroke: var(--ink);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.s-accent {
  stroke: var(--accent);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.s-rule {
  stroke: var(--rule);
  fill: none;
  stroke-linecap: round;
}
.f-paper {
  fill: var(--paper);
}
.f-soft {
  fill: var(--accent-soft);
}
.f-hl {
  fill: var(--hl);
}

/* 失敗の知らせ：左に手で引いた太い線 */
.notice {
  position: relative;
  margin: 0;
  max-width: 28em;
  padding: var(--sp-2) var(--sp-4);
  background: var(--bad-soft);
  color: var(--ink);
  font-size: var(--fs-2);
  text-align: start;
  border-radius: var(--sketch-sm);
}
.notice::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  inline-size: 8px;
  border-left: 4px solid var(--bad);
  filter: url(#wobble-line);
  pointer-events: none;
}

/* ボタン：青ペンで塗った紙。枠は揺れた線（::after）にする */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 48px;
  padding: var(--sp-2) var(--sp-6);
  font-family: var(--hand);
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: 1.6;
  text-decoration: none;
  border-radius: var(--sketch);
  touch-action: manipulation;
  transition: transform var(--dur-1) var(--ease);
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow);
}
.btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 1.5px solid var(--accent);
  border-radius: var(--sketch);
  filter: url(#wobble);
  pointer-events: none;
}
.btn:hover {
  transform: translateY(-1px) rotate(-0.4deg);
}
/* タップの反応は Futari と同じ（沈めず、薄くする） */
@media (hover: none) {
  .btn:active {
    opacity: 0.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
  .btn:hover {
    transform: none;
  }
}
