/* Base: reset, element defaults, focus, reduced motion.
   Values from tokens.css only. Logical properties throughout. */

/* ---- Reset ---- */

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

* {
  margin: 0;
}

html {
  text-size-adjust: 100%;
}

body {
  min-block-size: 100dvb;
  font-family: var(--font-ja);
  font-size: var(--text-body-size);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-body-lh);
  color: var(--color-ink-700);
  background-color: var(--color-bg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: var(--font-weight-bold);
  line-height: inherit;
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-inline-size: 100%;
}

img,
video {
  block-size: auto;
}

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

button {
  cursor: pointer;
}

/* Lists that carry a class are UI lists (nav, cards): no bullets or indent. */
ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
dd,
dt {
  overflow-wrap: break-word;
}

/* ---- Focus (SPEC §2: 2px ring, 2px offset, keyboard only) ---- */

:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Non-interactive targets that scripts focus (tabindex="-1", e.g. the body
   after back-to-top) are not controls, so they get no ring. */
[tabindex="-1"]:focus-visible {
  outline: none;
}

/* ---- Scrolling ----
   In-page anchors (#team, #youtube in the header, drawer and footer)
   scroll smoothly, like back-to-top; instant under reduced motion. The
   targets set scroll-margin-block-start to land below the sticky header. */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ---- Reduced motion ----
   The token switch is what components rely on. The universal rule is a
   safety net only: it has zero specificity, and !important is banned. */

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-hover: 0s;
    --duration-drawer: 0s;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: 0s;
    animation-duration: 0s;
    animation-iteration-count: 1;
  }
}
