/* ============================================================
   BASE — Reset + 全局排版
   依賴 tokens.css
   ============================================================ */

/* ── Google Fonts ────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Modern Reset ────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--ds-font-body);
    font-weight: var(--ds-weight-normal);
    font-size: var(--ds-text-base);
    line-height: var(--ds-leading-normal);
    color: var(--ds-text-primary);
    background-color: var(--ds-bg-primary);
    overflow-x: hidden;
}

/* ── 排版 ────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--ds-font-display);
    font-weight: var(--ds-weight-bold);
    line-height: var(--ds-leading-tight);
    color: var(--ds-text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--ds-text-5xl);
}

h2 {
    font-size: var(--ds-text-4xl);
}

h3 {
    font-size: var(--ds-text-3xl);
}

h4 {
    font-size: var(--ds-text-2xl);
}

h5 {
    font-size: var(--ds-text-xl);
}

h6 {
    font-size: var(--ds-text-lg);
}

p {
    margin-bottom: var(--ds-space-4);
    color: var(--ds-text-secondary);
    line-height: var(--ds-leading-normal);
}

a {
    color: var(--ds-accent);
    text-decoration: none;
    transition: color var(--ds-transition-fast);
}

a:hover {
    color: var(--ds-accent-bright);
}

strong,
b {
    font-weight: var(--ds-weight-semibold);
    color: var(--ds-text-primary);
}

code,
kbd,
samp {
    font-family: var(--ds-font-mono);
    font-size: 0.9em;
    background: var(--ds-bg-elevated);
    padding: 0.15em 0.4em;
    border-radius: var(--ds-radius-sm);
}

img,
video,
svg {
    max-width: 100%;
    display: block;
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* ── 選取樣式 ────────────────────────────────── */
::selection {
    background: var(--ds-accent-glow-strong);
    color: var(--ds-accent-bright);
}

/* ── 滾動條（WebKit） ────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--ds-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--ds-bg-hover);
    border-radius: var(--ds-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ds-accent-dim);
}