/* ============================================
   CSS Reset & Base Styles
   Biz-Retriever Design System v2.0
   ============================================ */

/* Pretendard Variable Font — CDN */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

/* ============================================
   Box Model & Universal Reset
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================
   Root & Document
   ============================================ */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    tab-size: 4;
    line-height: 1.5;
    hanging-punctuation: first last;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition:
        background-color var(--duration-200) var(--ease-in-out),
        color var(--duration-200) var(--ease-in-out);
    -webkit-tap-highlight-color: transparent;
    overflow-wrap: break-word;
    word-break: keep-all;  /* Korean: keep words together */
}

/* ============================================
   Typography Reset
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    text-wrap: balance;
}

p {
    text-wrap: pretty;
    line-height: var(--line-height-relaxed);
}

small {
    font-size: var(--font-size-sm);
}

strong, b {
    font-weight: var(--font-weight-semibold);
}

/* ============================================
   Interactive Element Reset
   ============================================ */
button {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-appearance: none;
    appearance: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
}

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    text-underline-offset: 2px;
}

a:hover {
    color: var(--primary-hover);
}

/* ============================================
   Media & Embeds
   ============================================ */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

svg {
    fill: currentColor;
}

/* ============================================
   Lists & Table
   ============================================ */
ul, ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background: var(--blue-100);
    color: var(--blue-900);
}

body.dark-mode ::selection {
    background: rgba(37, 99, 235, 0.3);
    color: var(--slate-100);
}

/* ============================================
   Scrollbar — Thin & minimal
   ============================================ */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--slate-300) transparent;
}

body.dark-mode * {
    scrollbar-color: var(--slate-600) transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--slate-600);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--slate-500);
}

/* ============================================
   Placeholder
   ============================================ */
::placeholder {
    color: var(--text-disabled);
    opacity: 1;
}

/* ============================================
   Focus Reset — accessibility.css handles styles
   ============================================ */
:focus {
    outline: none;
}
