/* ============================================================
   Linkle — URL 단축 서비스
   콘셉트: 깊은 잉크색 배경 위 선라이즈 그라디언트 악센트의
   다크 테마 랜딩 페이지.
   ============================================================ */

:root {
    --bg: #0b0d13;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-strong: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f4f2ee;
    --muted: #9095a8;
    --accent: #ff7a52;
    --accent-soft: #ffb057;
    --accent-gradient: linear-gradient(120deg, #ff5d3a 0%, #ff8a4d 45%, #ffc266 100%);
    --success-text: #7fe0a8;
    --error-text: #ff9a8a;
    --error-border: rgba(255, 120, 100, 0.35);
    --radius: 14px;
    --font-display: "Space Grotesk", "Noto Sans KR", sans-serif;
    --font-body: "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 3.5rem 1.25rem 2.5rem;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---------- 배경: 글로우 + 그레인 ---------- */

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
}

.glow-a {
    width: 44rem;
    height: 44rem;
    top: -24rem;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle,
        rgba(255, 106, 61, 0.28) 0%,
        rgba(255, 154, 61, 0.10) 45%,
        transparent 70%);
}

.glow-b {
    width: 30rem;
    height: 30rem;
    bottom: -18rem;
    right: -10rem;
    background: radial-gradient(circle,
        rgba(90, 100, 255, 0.10) 0%,
        transparent 65%);
}

.grain {
    position: absolute;
    inset: 0;
    opacity: 0.5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 레이아웃 ---------- */

.container {
    max-width: 860px;
    margin: 0 auto;
}

/* ---------- 상단 내비게이션 ---------- */

.topnav {
    max-width: 860px;
    margin: 0 auto 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.logo-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 8px;
    background: var(--accent-gradient);
    color: #1a0e08;
    font-size: 1.05rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links .nav-cta {
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    color: var(--text);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.nav-links .nav-cta:hover {
    border-color: var(--accent);
    background: rgba(255, 122, 82, 0.1);
}

/* ---------- 히어로 ---------- */

.hero {
    text-align: center;
    margin-bottom: 2.75rem;
}

.hero-badge {
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.hero-title {
    margin: 0 0 0.9rem;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.hero-title em {
    font-style: normal;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

/* ---------- 단축 폼 ---------- */

.shorten {
    margin-bottom: 3.5rem;
}

.form-hint {
    margin: 0.75rem 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.shorten-form {
    display: flex;
    gap: 0.6rem;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    backdrop-filter: blur(8px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.shorten-form:focus-within {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 4px rgba(255, 122, 82, 0.12),
                0 12px 40px -18px rgba(255, 106, 61, 0.45);
}

.shorten-form input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
}

.shorten-form input::placeholder {
    color: rgba(144, 149, 168, 0.6);
}

.shorten-form input:focus {
    outline: none;
}

button,
.button {
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    background: var(--accent-gradient);
    color: #1a0e08;
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px -8px rgba(255, 106, 61, 0.55);
}

button:active,
.button:active {
    transform: translateY(0);
}

/* ---------- 알림 ---------- */

.alert {
    margin: 0.9rem 0 0;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    border: 1px solid var(--border);
    background: var(--surface);
}

.alert-success {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-color: rgba(127, 224, 168, 0.3);
}

.alert-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--success-text);
}

.created-link {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border-strong);
}

.created-link:hover {
    color: var(--accent-soft);
    border-color: var(--accent-soft);
}

.copy-btn {
    margin-left: auto;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
}

.copy-btn:hover {
    box-shadow: none;
    transform: none;
    border-color: var(--border-strong);
}

.copy-btn.copied {
    color: var(--success-text);
    border-color: rgba(127, 224, 168, 0.4);
}

.alert-error {
    border-color: var(--error-border);
    color: var(--error-text);
}

/* ---------- 기능 소개 ---------- */

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.feature {
    padding: 1.5rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    backdrop-filter: blur(8px);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    font-size: 1.15rem;
    margin-bottom: 0.9rem;
}

.feature h3 {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
}

.feature p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

/* ---------- 링크 목록 ---------- */

.board {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    padding: 1.5rem 1.5rem 1.25rem;
    backdrop-filter: blur(8px);
}

.board-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.board-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.count {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--muted);
}

.muted {
    color: var(--muted);
    font-size: 0.88rem;
}

.empty {
    color: var(--muted);
    margin: 0;
    padding: 2.5rem 0;
    text-align: center;
    line-height: 1.8;
}

.url-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.url-table th,
.url-table td {
    padding: 0.8rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.95rem;
    vertical-align: middle;
}

.url-table tbody tr {
    transition: background 0.15s ease;
}

.url-table tbody tr:hover {
    background: var(--surface-strong);
}

.url-table tbody tr:last-child td {
    border-bottom: none;
}

.url-table th {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.url-table td.numeric,
.url-table th.numeric {
    text-align: right;
    width: 5rem;
}

.url-table th:first-child,
.url-table td:first-child {
    width: 7.5rem;
}

.url-table th.date-col,
.url-table td.date-col {
    width: 10.5rem;
}

.short-chip {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 122, 82, 0.12);
    border: 1px solid rgba(255, 122, 82, 0.25);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-soft);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.short-chip:hover {
    background: rgba(255, 122, 82, 0.22);
    border-color: rgba(255, 122, 82, 0.5);
}

.original a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    text-decoration: none;
}

.original a:hover {
    color: var(--text);
}

.clicks {
    font-family: var(--font-mono);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------- 페이지네이션 ---------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.pagination a {
    color: var(--text);
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.15s ease;
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent-soft);
}

/* ---------- 404 ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    padding: 2rem;
    backdrop-filter: blur(8px);
}

.card.center {
    text-align: center;
    padding: 3.5rem 2rem;
    margin-top: 4rem;
}

.card.center h1 {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.card.center p {
    color: var(--muted);
    margin: 0 0 1.75rem;
}

/* ---------- 푸터 ---------- */

.footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

/* ---------- 모션: 진입 시퀀스 ---------- */

.reveal {
    animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal-delay-1 {
    animation-delay: 0.12s;
}

.reveal-delay-2 {
    animation-delay: 0.24s;
}

.reveal-delay-3 {
    animation-delay: 0.36s;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        animation: none;
    }

    button,
    .button,
    .url-table tbody tr {
        transition: none;
    }
}

/* ---------- 접근성 / 반응형 ---------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 640px) {
    body {
        padding-top: 2rem;
    }

    .topnav {
        margin-bottom: 2.5rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .desktop-only {
        display: none;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .shorten-form {
        flex-direction: column;
    }

    .shorten-form button {
        width: 100%;
    }

    .url-table th.date-col,
    .url-table td.date-col {
        display: none;
    }

    .url-table th:first-child,
    .url-table td:first-child {
        width: 6rem;
    }
}
