/**
 * Foundation: tokens, reset, progress, shared primitives.
 */

:root {
  --ink: #0e1620;
  --navy: #0e1620;
  --blue: #0066d6;
  --steel: #e8e8ed;
  --mist: #f5f6f9;
  --line: #e2e4e8;
  --red: #0066d6;
  --gold: #d4a23a;
  --white: #ffffff;
  --muted: #6a7280;
  --accent-soft: rgba(0, 102, 214, 0.08);
  --shadow-sm: 0 2px 8px rgba(14, 22, 32, 0.06);
  --shadow: 0 12px 32px rgba(14, 22, 32, 0.08);
  --shadow-lg: 0 24px 56px rgba(14, 22, 32, 0.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --transition: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* ── Custom scrollbar (薄く・繊細に) ── */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--mist);
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--mist);
  border-radius: 999px;
  background: #c8ccd4;
  transition: background var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #c8ccd4 var(--mist);
}

/* ── Focus-visible ring (統一された焦点リング) ── */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ── Image rendering ── */
img {
  image-rendering: -webkit-optimize-contrast;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

#nprogress {
  pointer-events: none;
}

#nprogress .bar {
  background: #d2e3fc;
  height: 4px;
  left: 0;
  overflow: hidden;
  position: fixed;
  right: 0;
  top: 0;
  transform: none !important;
  width: 100% !important;
  z-index: 100001;
}

#nprogress .bar::before,
#nprogress .bar::after {
  animation-iteration-count: infinite;
  background: #1a73e8;
  content: "";
  height: 100%;
  position: absolute;
  right: auto;
  top: 0;
}

#nprogress .bar::before {
  animation-duration: 1s;
  animation-name: stellar-progress-material-primary;
  animation-timing-function: linear;
}

#nprogress .bar::after {
  animation-duration: 1.25s;
  animation-name: stellar-progress-material-secondary;
  animation-timing-function: linear;
}

#nprogress .peg {
  display: none;
}

#nprogress .spinner {
  display: none;
}

@keyframes stellar-progress-material-primary {
  0% {
    left: -35%;
    right: 100%;
  }

  60% {
    left: 100%;
    right: -90%;
  }

  100% {
    left: 100%;
    right: -90%;
  }
}

@keyframes stellar-progress-material-secondary {
  0% {
    left: -200%;
    right: 100%;
  }

  45% {
    left: -30%;
    right: 35%;
  }

  75% {
    left: 100%;
    right: -10%;
  }

  100% {
    left: 100%;
    right: -10%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #nprogress .bar::before,
  #nprogress .bar::after {
    animation-duration: 2.2s;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1,
h2,
h3,
p,
li,
dt,
dd,
a,
button,
label,
span,
strong {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
.eyebrow,
.primary-button,
.secondary-button,
.screen-toolbar button,
.screen-search button,
.screen-shortcuts a {
  overflow-wrap: anywhere;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

p {
  margin: 0;
}

ol,
ul {
  margin: 0;
  padding: 0;
}

dl {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* ── Reduced motion (動きの軽減設定) ── */
@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;
  }
}

/* ── AJAX busy state ── */
[aria-busy="true"] {
  cursor: progress;
}

[aria-busy="true"] .product-result-card,
[aria-busy="true"] .brand-result-card {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity var(--transition);
}

/* ── Skip to content link (コンテンツへスキップ) ── */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100002;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--ink);
  font-size: 14px;
  font-weight: 700;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 12px;
}

