/*
 * nd-base.css — ニコルデジマ Base Reset & Body Styles
 * ====================================================
 * This file resets browser defaults and sets the foundational
 * visual layer: background, fonts, text colour, selection,
 * focus states, and reduced-motion behaviour.
 *
 * After uploading, you should see:
 * - Warm paper background (#fbfaf7) instead of white
 * - Body text in Noto Sans JP instead of browser default
 * - Text colour #1a1a1a instead of black
 * - Blue highlight replaced with kaki-tinted selection
 *
 * DEPENDS ON: nd-tokens.css (must load first)
 */


/* ─── RESET ─── */

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

html,
body {
  margin: 0;
  padding: 0;
}

/* Remove default margins from common elements */
h1, h2, h3, h4, h5, h6,
p,
blockquote,
figure,
figcaption,
dl, dd {
  margin: 0;
}

/* Reset list styles — we restyle lists per-component */
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Prevent images from overflowing their container */
img,
svg,
video {
  max-width: 100%;
  display: block;
}

/* Reset table spacing */
table {
  border-collapse: collapse;
  border-spacing: 0;
}


/* ─── BODY ─── */

html {
  /* Smoother font rendering on macOS/iOS */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 2;
}

/* Headings — Noto Serif JP globally */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
}


/* ─── BASE ELEMENTS ─── */

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Placeholder text colour */
::placeholder {
  color: var(--ink-3);
}


/* ─── SELECTION ─── */
/* Replaces the browser's default blue highlight with a kaki tint */

::selection {
  background-color: var(--kaki-soft);
  color: var(--ink);
}


/* ─── FOCUS STATES ─── */
/*
 * The design system had no focus states defined.
 * This adds a consistent kaki outline to all interactive elements,
 * visible only for keyboard navigation (not mouse clicks).
 *
 * :focus-visible fires on keyboard focus but not mouse clicks.
 * Supported in all modern browsers.
 */

:focus-visible {
  outline: 2px solid var(--kaki);
  outline-offset: 2px;
}

/* Inputs get a border change instead of an outline (looks cleaner) */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--kaki);
}


/* ─── REDUCED MOTION ─── */
/*
 * Respects the user's OS-level "reduce motion" preference.
 * All animations and transitions are suppressed globally.
 * Individual CSS files don't need to repeat this.
 */

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