/* =========================================================
   KITT Study
   base.css v1.0
   ---------------------------------------------------------
   Purpose:
   - サイト全体の基本色
   - フォント
   - 本文
   - 見出し
   - リンク
   - リスト
   - 基本文字要素
   ========================================================= */


/* ---------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------- */

:root {
  /* Brand */
  --color-primary: #2563eb;

  /* Text */
  --color-text: #1f2937;
  --color-heading: #111827;
  --color-muted: #6b7280;

  /* Background */
  --color-background: #ffffff;
  --color-background-soft: #f8fbff;

  /* Border */
  --color-border: #d1d5db;
  --color-border-accent: #bfdbfe;

  /* Link */
  --color-link: #2563eb;

  /* Focus */
  --color-focus: #2563eb;

  /* Typography */
  --font-sans:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    "Yu Gothic",
    "YuGothic",
    "Meiryo",
    sans-serif;

  --font-size-base: 16px;
  --line-height-base: 1.9;

  /* Heading */
  --font-size-h1: clamp(30px, 5vw, 48px);
  --font-size-h2: clamp(24px, 3.5vw, 34px);
  --font-size-h3: 20px;

  --line-height-heading: 1.45;
}


/* ---------------------------------------------------------
   2. Document
   --------------------------------------------------------- */

html {
  background: var(--color-background);
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--color-background);
  color: var(--color-text);

  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: 400;
  line-height: var(--line-height-base);

  overflow-wrap: break-word;
}


/* ---------------------------------------------------------
   3. Headings
   --------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  font-weight: 700;
  line-height: var(--line-height-heading);
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: 800;
  letter-spacing: 0.02em;
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

h4 {
  font-size: 18px;
}

h5,
h6 {
  font-size: 16px;
}


/* ---------------------------------------------------------
   4. Paragraphs
   --------------------------------------------------------- */

p {
  margin-bottom: 18px;
}

p:last-child {
  margin-bottom: 0;
}


/* ---------------------------------------------------------
   5. Links
   --------------------------------------------------------- */

a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}


/* ---------------------------------------------------------
   6. Lists
   --------------------------------------------------------- */

ul,
ol {
  padding-left: 1.5em;
}

ul {
  list-style: disc;
}

ol {
  list-style: decimal;
}

li {
  margin-bottom: 0.4em;
}

li:last-child {
  margin-bottom: 0;
}


/*
 * reset.css で指定したナビゲーション等のリストは、
 * 通常の本文リストへ戻さない。
 */
ul[role="list"],
ol[role="list"] {
  padding-left: 0;
  list-style: none;
}


/* ---------------------------------------------------------
   7. Strong / Emphasis
   --------------------------------------------------------- */

strong,
b {
  font-weight: 700;
}

em,
i {
  font-style: italic;
}


/* ---------------------------------------------------------
   8. Small / Supplemental text
   --------------------------------------------------------- */

small {
  font-size: 0.875em;
}

.text-muted {
  color: var(--color-muted);
}


/* ---------------------------------------------------------
   9. Blockquote
   --------------------------------------------------------- */

blockquote {
  padding-left: 1em;
  border-left: 4px solid var(--color-border-accent);
}


/* ---------------------------------------------------------
   10. Horizontal rule
   --------------------------------------------------------- */

hr {
  height: 1px;
  background: var(--color-border);
}


/* ---------------------------------------------------------
   11. Code
   --------------------------------------------------------- */

code,
kbd,
samp,
pre {
  font-family:
    Consolas,
    "SFMono-Regular",
    "Courier New",
    monospace;
}

code {
  font-size: 0.9em;
}


/* ---------------------------------------------------------
   12. Selection
   --------------------------------------------------------- */

::selection {
  background: #dbeafe;
  color: var(--color-heading);
}