@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #08090c;
    --bg-soft: #11131a;
    --panel: rgba(255, 255, 255, 0.07);
    --panel-strong: rgba(255, 255, 255, 0.11);
    --line: rgba(255, 255, 255, 0.13);
    --text: rgba(255, 255, 255, 0.94);
    --muted: rgba(255, 255, 255, 0.68);
    --dim: rgba(255, 255, 255, 0.48);
    --ember: #ff6b35;
    --ember-2: #ff9b54;
    --gold: #ffd166;
    --blue: #7db7ff;
    --radius: 28px;
    --radius-lg: 42px;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(circle at 16% 0%, rgba(255, 107, 53, 0.22), transparent 32rem),
        radial-gradient(circle at 88% 8%, rgba(125, 183, 255, 0.18), transparent 36rem),
        linear-gradient(180deg, #08090c 0%, #0d0f15 44%, #07080b 100%);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 74%);
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.shell {
    width: min(var(--max), calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.shell-narrow {
    width: min(760px, calc(100% - 40px));
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 54px;
}

.brand,
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.brand {
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-mark {
    display: inline-block;
    font-size: 1.75rem;
    line-height: 1;
}

.nav-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.nav-link {
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(9, 10, 13, 0.78);
    color: var(--muted);
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--text);
    border-color: rgba(255, 209, 102, 0.45);
    transform: translateY(-1px);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 24px;
    align-items: stretch;
}

.hero-panel,
.form-panel,
.directory-panel,
.error-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.11), transparent 35%),
        rgba(255, 255, 255, 0.06);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(18px);
}

.hero-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(32px, 5vw, 58px);
}

.hero-panel::after {
    position: absolute;
    right: -120px;
    bottom: -160px;
    width: 360px;
    height: 360px;
    content: "";
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.26), transparent 68%);
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--ember-2);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 18px;
    font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
    font-size: clamp(2.7rem, 6.1vw, 5.35rem);
    font-weight: 800;
    line-height: 0.96;
    letter-spacing: -0.052em;
}

h2 {
    color: var(--text);
    font-size: clamp(1.4rem, 3vw, 2.1rem);
}

.hero-copy {
    max-width: 620px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.domain-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.domain-cloud li,
.pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--muted);
    font-size: 0.88rem;
}

.form-panel {
    padding: clamp(24px, 4vw, 34px);
}

.form-header {
    margin-bottom: 24px;
}

.form-header p {
    margin-bottom: 0;
    color: var(--muted);
}

.field {
    margin-bottom: 20px;
}

label,
.field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 800;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    outline: none;
    padding: 14px 15px;
    background: rgba(8, 9, 12, 0.76);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder {
    color: var(--dim);
}

input:focus,
select:focus {
    border-color: rgba(255, 209, 102, 0.55);
    background: rgba(8, 9, 12, 0.92);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.14);
}

.short-link-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.58fr) minmax(160px, 1fr);
    gap: 10px;
}

.private-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 22px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.5;
}

.private-row input {
    width: auto;
    margin-top: 4px;
    accent-color: var(--ember);
}

.hint {
    display: block;
    margin-top: 8px;
    color: var(--dim);
    font-size: 0.82rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 14px 20px;
    color: #170904;
    background: linear-gradient(135deg, var(--ember), var(--gold));
    box-shadow: 0 18px 54px rgba(255, 107, 53, 0.32);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 24px 64px rgba(255, 107, 53, 0.4);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.button-secondary {
    width: auto;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.result {
    display: none;
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    line-height: 1.5;
}

.result.success,
.result.error {
    display: block;
}

.result.success {
    border-color: rgba(255, 209, 102, 0.42);
    background: rgba(255, 209, 102, 0.09);
}

.result.error {
    border-color: rgba(255, 107, 53, 0.5);
    background: rgba(255, 107, 53, 0.12);
}

.result-title {
    margin-bottom: 8px;
    color: var(--gold);
    font-weight: 800;
}

.created-link {
    text-align: center;
}

.short-url {
    margin: 10px 0;
    word-break: break-all;
}

.short-url a,
.text-link {
    color: var(--gold);
    font-weight: 800;
    text-decoration: none;
}

.short-url a:hover,
.text-link:hover {
    text-decoration: underline;
}

.copy-btn {
    width: auto;
    margin-top: 8px;
    padding: 9px 14px;
    font-size: 0.88rem;
}

.qr-card {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 22px;
    background: rgba(8, 9, 12, 0.48);
}

.qr-card img {
    width: 148px;
    height: 148px;
    border-radius: 18px;
    background: #fff;
    padding: 10px;
}

.qr-card strong,
.qr-card span,
.qr-card .qr-download {
    display: block;
}

.qr-card strong {
    color: var(--text);
    margin-bottom: 5px;
}

.qr-card span {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.qr-card .qr-download {
    width: auto;
    margin-top: 8px;
    padding: 9px 14px;
    font-size: 0.88rem;
}

.info-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.info-card,
.stat-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    background: rgba(255, 255, 255, 0.055);
}

.info-card strong,
.stat-value {
    display: block;
    margin-bottom: 6px;
    color: var(--gold);
    font-size: 1.8rem;
    line-height: 1;
}

.info-card span,
.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.directory-hero {
    margin-bottom: 24px;
}

.directory-panel {
    padding: clamp(22px, 4vw, 34px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.loading,
.empty-state {
    padding: 46px 16px;
    color: var(--muted);
    text-align: center;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(8, 9, 12, 0.42);
}

.links-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.links-table th,
.links-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.links-table th {
    color: var(--dim);
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.links-table tr:hover td {
    background: rgba(255, 255, 255, 0.035);
}

.links-table tr:last-child td {
    border-bottom: 0;
}

.short-link {
    display: inline-block;
    color: var(--gold);
    font-weight: 800;
    text-decoration: none;
}

.destination-url {
    max-width: 380px;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.destination-url a {
    color: var(--muted);
    text-decoration: none;
}

.destination-url a:hover {
    color: var(--text);
}

.clicks {
    color: var(--ember-2);
    font-weight: 800;
}

.date {
    color: var(--dim);
    white-space: nowrap;
}

.copy-icon {
    width: auto;
    margin-left: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    cursor: pointer;
}

.error-page .top-nav {
    margin-bottom: 24px;
}

.error-panel {
    padding: clamp(32px, 6vw, 58px);
    text-align: center;
}

.error-panel h1 {
    margin-right: auto;
    margin-left: auto;
}

@media (max-width: 860px) {
    .hero-grid,
    .info-strip,
    .qr-card {
        grid-template-columns: 1fr;
    }

    .short-link-row,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-nav,
    .toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: clamp(3.3rem, 16vw, 5.6rem);
    }
}

@media (max-width: 520px) {
    .shell {
        width: min(100% - 26px, var(--max));
        padding-top: 18px;
    }

    .hero-panel,
    .form-panel,
    .directory-panel,
    .error-panel {
        border-radius: 28px;
    }
}
