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

* {
  margin: 0;
}

/* scroll-behavior: smooth는 ScrollSmoother/ScrollTrigger와 충돌하므로 쓰지 않는다.
   부드러운 이동은 전부 JS에서 처리한다. */
html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.7;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

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

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

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

ul,
ol {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

::selection {
  background: var(--accent-glow);
  color: var(--fg);
}

:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ---- shared primitives ---- */

.mono {
  font-family: var(--font-sans);
}

.label {
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--fg-dim);
}

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 1000;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-sans);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  background: rgb(255 255 255 / 0.95);
  border: 1px solid var(--glass-border-hi);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  transform: translateY(-160%);
  transition: transform var(--d-fast) var(--ease-out);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: none;
}

/* ---- themed scrollbar ---- */
.scroll-theme {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

.scroll-theme::-webkit-scrollbar {
  width: var(--scroll-size);
  height: var(--scroll-size);
}

.scroll-theme::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-theme::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
}

.scroll-theme::-webkit-scrollbar-thumb:hover {
  background-color: var(--scroll-thumb-hover);
}

.scroll-theme::-webkit-scrollbar-corner {
  background: transparent;
}

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