/* =============================================
   k-tomorrow 공통 사이트 스타일 (index, terms, privacy)
   - Tailwind CDN 위에 얇은 커스텀 유틸 레이어
   - 중복 제거: 브랜드 토큰, 카드, 글로우, markdown, legal heading, a11y
   - 확장 시: 컴포넌트화(예: buttons, forms) 분리 고려
   ============================================= */

/* 브랜드 토큰 (R G B) */
:root {
    --brand: 67 56 202; /* indigo-700 */
}

.brand-text {
    color: rgb(var(--brand));
}
.brand-bg {
    background-color: rgb(var(--brand));
}
.brand-border {
    border-color: rgb(var(--brand));
}
.brand-ring {
    --tw-ring-color: rgb(var(--brand));
}

/* 접근성: 모션 축소 선호 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Gradient / Glass 유틸 */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Card + Glow */
.card {
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow:
        0 1px 2px -1px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.06);
    position: relative;
    transition:
        box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.4s;
}
.card:hover,
.card:focus-visible {
    box-shadow:
        0 8px 24px -4px rgba(0, 0, 0, 0.12),
        0 4px 16px -2px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}
.card:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.12);
}
@media (prefers-reduced-motion: reduce) {
    .card {
        transition: none !important;
        transform: none !important;
    }
}
.card-glow {
    --glow-color: var(--brand);
    --glow-opacity: 0;
    --mx: 50%;
    --my: 50%;
}
.card-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mx) var(--my), rgba(var(--glow-color) / 0.28) 0%, rgba(var(--glow-color) / 0) 65%);
    opacity: var(--glow-opacity);
    transition: opacity 0.4s ease;
    pointer-events: none;
    mix-blend-mode: multiply;
}
.card-glow:hover::before,
.card-glow:focus-visible::before {
    opacity: 0.55;
}
@media (hover: none) {
    .card-glow::before {
        display: none;
    }
}

/* Markdown (legal/문서 공통) */
.markdown table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}
.markdown th,
.markdown td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.875rem;
    text-align: left;
    font-size: 0.95rem;
}
.markdown hr {
    height: 0.25em;
    margin: 24px 0;
    background-color: #e5e7eb;
    border: 0;
}
.markdown blockquote {
    margin: 0;
    padding: 0 1em;
    border-left: 0.25em solid #e5e7eb;
    color: #4b5563;
}
.markdown pre {
    border: 1px solid #e5e7eb;
    color: #1f2937;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    overflow-x: auto;
    line-height: 1.5;
    font-family: 'Fira Code', 'Courier New', monospace;
}
.markdown li:has(> input[type='checkbox']) {
    list-style: none;
}

/* Legal Heading / Anchor */
h2[id^='article-'] {
    scroll-margin-top: 6rem;
    position: relative;
}
h2[id^='article-'] .heading-anchor {
    opacity: 0;
    text-decoration: none;
    margin-left: 0.5rem;
    font-size: 0.8em;
    color: #6366f1;
    transition: opacity 0.2s;
}
h2[id^='article-']:hover .heading-anchor,
h2[id^='article-']:focus-within .heading-anchor {
    opacity: 1;
}
h2[id^='article-']:target {
    outline: 0;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0));
}
.markdown h2[id^='article-'] {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

/* Utilities (확장 포인트) */
/* ... add future shared utilities here ... */

/* =============================
    Fixed Header Offset
    - 고정된 헤더가 첫 섹션을 가리는 현상 방지
    - header.site-header 바로 뒤 main 에 상단 패딩 부여
    - (현재 index: 내부 컨테이너 h-16 -> 64px, legal 페이지 내부 h-14 -> 56px)
    - 4rem(64px)로 통일 적용, 약간 여유 공간 허용
    ============================= */
.site-header + main {
    padding-top: 4rem;
}
