:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #5b667a;
    --line: #dce3ef;
    --blue: #0f5eea;
    --navy: #08233f;
    --teal: #008699;
    --orange: #ff6b1a;
    --surface: #f3f6fb;
    --card: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
    color: var(--ink);
    background: var(--surface);
}

a { color: inherit; text-decoration: none; }
input, textarea, select, button { font: inherit; }

.site-shell {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--navy) 0 46%, var(--surface) 46% 100%);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1160px;
    margin: 0 auto;
    padding: 22px 24px;
    color: #fff;
}

.brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    font-weight: 800;
    font-size: 28px;
}

.brand span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #fff;
    background: var(--orange);
    border-radius: 8px;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-weight: 700;
}

.hero {
    max-width: 1160px;
    margin: 0 auto;
    padding: 42px 24px 72px;
}

.hero-copy {
    color: #fff;
    text-align: center;
    max-width: 880px;
    margin: 0 auto 44px;
}

.eyebrow {
    color: var(--teal);
    font-weight: 800;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
}

.hero-copy .eyebrow { color: #68d7e7; }

.hero-copy h1 {
    margin: 0;
    font-size: clamp(40px, 6vw, 68px);
    line-height: 1;
    letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
    margin: 22px auto 0;
    max-width: 780px;
    color: #d9e6f5;
    font-size: 20px;
    line-height: 1.6;
}

.shortener-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgb(8 35 63 / 18%);
    padding: 32px;
}

.shortener-form {
    display: grid;
    gap: 20px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

input, textarea, select {
    width: 100%;
    border: 1px solid #b9c3d1;
    border-radius: 7px;
    padding: 14px 16px;
    color: var(--ink);
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder,
textarea::placeholder {
    color: #6b7280;
    font-weight: 700;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgb(15 94 234 / 12%);
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #5b667a 50%),
        linear-gradient(135deg, #5b667a 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 44px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}
small { color: #b42318; font-weight: 600; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 18px;
}

.form-grid.single {
    grid-template-columns: 1fr;
}

.toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.toggles label {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 12px;
    font-weight: 700;
}

.toggles input { width: auto; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    padding: 13px 20px;
    cursor: pointer;
    font-weight: 800;
}

.button.primary {
    width: fit-content;
    color: #fff;
    background: var(--blue);
}

.button.ghost {
    color: var(--ink);
    background: #fff;
}

.button.subtle {
    color: var(--ink);
    background: #eef3fb;
}

.created-link {
    display: grid;
    gap: 8px;
    padding: 16px;
    margin-bottom: 22px;
    border: 1px solid #b6edf4;
    border-radius: 8px;
    background: #eafcff;
}

.created-link span { color: var(--teal); font-weight: 800; }
.created-link strong { font-size: 20px; }
.created-link img { grid-row: span 2; width: 92px; height: 92px; }

.public-disabled {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid #f7d08a;
    border-radius: 8px;
    background: #fff8e8;
}

.public-disabled span {
    color: #9a5b00;
    font-weight: 900;
}

.public-disabled p {
    margin: 0;
    color: var(--muted);
}

.recent-links { margin-top: 28px; }

.recent-links h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.recent-links article {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 12px;
}

.recent-links article div {
    display: grid;
    gap: 4px;
}

.recent-links a {
    color: var(--blue);
    font-weight: 700;
}

.recent-links span {
    color: #16803a;
    font-weight: 800;
}

.redirect-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 12%, rgb(0 134 153 / 22%), transparent 28%),
        linear-gradient(145deg, #071f38 0%, #08233f 52%, #0d3650 100%);
}

.redirect-card {
    width: min(100%, 460px);
    background: #fff;
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 24px 70px rgb(0 0 0 / 24%);
}

.redirect-card.wide { width: min(100%, 680px); text-align: center; }
.redirect-card h1 { margin: 0 0 16px; font-size: 32px; line-height: 1.1; }
.redirect-card p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.redirect-card form { display: grid; gap: 16px; }

.redirect-card-modern {
    width: min(100%, 920px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 22px;
    padding: 14px;
    text-align: left;
}

.redirect-card-modern:not(:has(.redirect-ad)) {
    grid-template-columns: 1fr;
    width: min(100%, 680px);
}

.redirect-content {
    padding: 32px;
}

.redirect-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--teal);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 6px rgb(0 134 153 / 12%);
}

.redirect-card-modern h1 {
    max-width: 560px;
    margin: 16px 0 10px;
    font-size: clamp(30px, 5vw, 46px);
}

.redirect-copy {
    max-width: 560px;
    margin: 0;
    font-size: 17px;
}

.destination-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 26px 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.destination-pill span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.destination-pill strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.redirect-progress {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7eef9;
}

.redirect-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--teal));
    transition: width .28s linear;
}

.redirect-timer {
    margin: 12px 0 22px;
    color: var(--muted);
    font-weight: 700;
}

.redirect-timer strong {
    color: var(--blue);
    font-size: 24px;
}

.redirect-timer.muted {
    margin-top: 12px;
}

.redirect-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.redirect-ad {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 12px;
    border-radius: 8px;
    background: #f4f8fd;
}

.countdown {
    display: inline-grid;
    place-items: center;
    width: 96px;
    height: 96px;
    margin: 18px auto;
    border-radius: 50%;
    color: var(--blue);
    background: #eef5ff;
    font-size: 28px;
    font-weight: 900;
}

.ad-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    padding: 12px 14px;
    color: var(--teal);
    background: #e8fbfd;
    font-weight: 800;
    text-decoration: none;
}

.ad-image {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
}

.redirect-ad .ad-link {
    color: #fff;
    background: var(--teal);
}

.ad-placeholder {
    display: grid;
    place-items: center;
    min-height: 260px;
    padding: 24px;
    border: 1px dashed #b9c3d1;
    border-radius: 8px;
    color: var(--muted);
    background: #fff;
    text-align: center;
}

.ad-placeholder span {
    color: var(--teal);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ad-placeholder strong {
    color: var(--ink);
    font-size: 22px;
}

@media (max-width: 760px) {
    .topbar, .topbar nav, .recent-links article {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero { padding-top: 18px; }
    .hero-copy { text-align: left; }
    .shortener-panel { padding: 20px; }

    .form-grid,
    .toggles,
    .created-link {
        grid-template-columns: 1fr;
    }

    .created-link img { grid-row: auto; }

    .redirect-card-modern {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .redirect-content {
        padding: 22px;
    }

    .destination-pill {
        align-items: flex-start;
        flex-direction: column;
    }
}
