:root {
    --bg: #07111f;
    --bg-accent: radial-gradient(circle at top left, rgba(66, 153, 225, 0.35), transparent 30%),
        radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.25), transparent 28%),
        linear-gradient(180deg, #07111f 0%, #0b1324 55%, #09101d 100%);
    --surface: rgba(10, 18, 34, 0.78);
    --surface-strong: rgba(15, 23, 42, 0.95);
    --border: rgba(148, 163, 184, 0.18);
    --text: #e5eefb;
    --muted: #9fb0cc;
    --primary: #67e8f9;
    --primary-strong: #22d3ee;
    --success: #34d399;
    --danger: #fb7185;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: var(--bg-accent);
    color: var(--text);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 90%);
    pointer-events: none;
}

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

.page-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
    position: relative;
    z-index: 1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(7, 17, 31, 0.72);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1rem;
}

.brand small {
    color: var(--muted);
    margin-top: 0.2rem;
}

.brand-mark {
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    color: white;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

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

.nav-links > a:first-child {
    color: var(--muted);
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.86);
}

.flash-success {
    border-color: rgba(52, 211, 153, 0.35);
    color: #d1fae5;
}

.flash-error {
    border-color: rgba(251, 113, 133, 0.35);
    color: #ffe4e6;
}

.surface-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
    align-items: start;
}

.hero-copy,
.form-card,
.recent-section,
.result-layout,
.error-layout {
    padding: 2rem;
}

.eyebrow,
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(103, 232, 249, 0.12);
    border: 1px solid rgba(103, 232, 249, 0.2);
    color: #c9f9ff;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.success-eyebrow {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.25);
    color: #d1fae5;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin: 1rem 0;
    font-size: clamp(2.4rem, 4vw, 4.6rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

h2 {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

h3 {
    font-size: 1.05rem;
    margin-bottom: 0.45rem;
}

.hero-text,
.section-heading p,
.feature-list p,
.empty-state p,
.destination,
.destination-card p {
    color: var(--muted);
    line-height: 1.7;
}

.stat-grid,
.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.75rem 0;
}

.stat-card,
.detail-card {
    padding: 1rem;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.13);
}

.stat-card span,
.detail-card span,
.link-meta,
.link-label,
.destination-card span {
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-card strong,
.detail-card strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.8rem;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.form-card {
    position: sticky;
    top: 1rem;
}

.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.link-form {
    display: grid;
    gap: 0.9rem;
}

label {
    font-size: 0.95rem;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.88);
    color: var(--text);
    font: inherit;
}

input:focus {
    outline: 2px solid rgba(34, 211, 238, 0.28);
    border-color: rgba(34, 211, 238, 0.48);
}

input::placeholder {
    color: #6b7a93;
}

.input-with-prefix {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.88);
}

.input-with-prefix span {
    padding-left: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.input-with-prefix input {
    border: 0;
    background: transparent;
    padding-left: 0;
}

.input-with-prefix input:focus {
    outline: none;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.85rem 1.15rem;
    border-radius: 16px;
    border: 1px solid transparent;
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    box-shadow: 0 18px 35px rgba(14, 165, 233, 0.22);
}

.button-secondary {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.16);
}

.button-ghost {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.16);
}

.recent-section {
    margin-top: 1.5rem;
}

.recent-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.link-card {
    padding: 1.1rem;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.68);
}

.link-card-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.link-label {
    display: block;
    margin-bottom: 0.35rem;
}

.link-url {
    display: block;
    font-weight: 700;
    word-break: break-word;
}

.destination {
    min-height: 3.2rem;
    margin-bottom: 1rem;
    word-break: break-word;
}

.link-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pill {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(103, 232, 249, 0.12);
    border: 1px solid rgba(103, 232, 249, 0.16);
    font-size: 0.85rem;
}

.empty-state {
    padding: 1.2rem;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.58);
    border: 1px dashed rgba(148, 163, 184, 0.22);
    text-align: center;
}

.result-layout,
.error-layout {
    max-width: 860px;
    margin: 0 auto;
}

.copy-panel,
.destination-card {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.copy-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.8rem;
    margin-top: 0.75rem;
}

.action-row {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.centered {
    justify-content: center;
}

.toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(52, 211, 153, 0.28);
    color: #d1fae5;
    box-shadow: var(--shadow);
    z-index: 100;
}

@media (max-width: 960px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        position: static;
    }

    .feature-list,
    .stat-grid,
    .result-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 1rem, 1180px);
        padding-top: 0.75rem;
    }

    .topbar,
    .hero-copy,
    .form-card,
    .recent-section,
    .result-layout,
    .error-layout {
        padding: 1.25rem;
        border-radius: 22px;
    }

    .topbar,
    .section-heading-inline,
    .link-card-top,
    .link-meta,
    .copy-row,
    .action-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
    }

    h1 {
        font-size: 2.4rem;
    }
}
