/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand:   #0055ff;
    --brand-d: #0040cc;
    --bg:      #f8f9fc;
    --surface: #ffffff;
    --text:    #1a1a2e;
    --muted:   #5a6072;
    --border:  #dde1eb;
    --error:   #d93025;
    --warn:    #b45309;
    --success: #166534;
    --radius:  8px;
    --shadow:  0 2px 8px rgba(0,0,0,.08);
}

html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 1rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.header-nav a {
    font-size: .875rem;
    color: var(--muted);
    white-space: nowrap;
    text-decoration: none;
}
.header-nav a:hover { color: var(--brand); }

@media (max-width: 640px) {
    .header-nav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        border-bottom: 1px solid var(--border);
        display: none;
        z-index: 100;
    }
    .header-nav.open { display: flex; }
    .header-nav a {
        padding: .75rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }
    .header-nav a:last-child { border-bottom: none; }
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 32px;
        height: 32px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
    }
    .menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--text);
        border-radius: 2px;
        transition: transform .2s, opacity .2s;
    }
    .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (min-width: 641px) {
    .menu-toggle { display: none; }
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -0.5px;
    text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--brand-d); }

/* ── Main ── */
main {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

/* ── Hero / form section ── */
.hero { margin-bottom: 3rem; }

.hero h1 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.25;
}

.shorten-form { margin-top: 1.25rem; }

.input-row {
    display: flex;
    gap: .5rem;
    align-items: stretch;
    width: 100%;
}

.url-input {
    flex: 1;
    padding: .75rem 1rem;
    font-size: 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .15s;
    background: var(--surface);
    color: var(--text);
    min-width: 0;
    height: 48px;
}
.url-input:focus { border-color: var(--brand); }

.btn-shorten {
    padding: 0 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    height: 48px;
    transition: background .15s;
    flex-shrink: 0;
}
.btn-shorten:hover { background: var(--brand-d); }

/* ── Alerts ── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .95rem;
}
.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--error);
}

/* ── Result card ── */
.result-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.result-label {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: .4rem;
}

.result-url-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.short-link {
    font-size: 1.05rem;
    font-weight: 600;
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

.delete-link {
    font-size: .85rem;
    color: var(--muted);
    word-break: break-all;
    flex: 1;
    min-width: 0;
}
.delete-label { margin-top: .75rem; }

.btn-copy {
    padding: .35rem .85rem;
    font-size: .8rem;
    font-weight: 600;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s;
    color: var(--text);
    min-width: 56px;
    height: 32px;
}
.btn-copy:hover { background: #eef0f8; }
.btn-copy.copied { color: var(--success); border-color: #86efac; }

.warn {
    font-size: .85rem;
    color: var(--warn);
    margin-top: .5rem;
}
.notice {
    font-size: .9rem;
    color: var(--muted);
    margin-top: .25rem;
}

/* ── SEO content sections ── */
.seo-content {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.seo-block h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .4rem;
}
.seo-block p { font-size: .95rem; color: var(--muted); }

/* ── Error pages (404, 410) ── */
.error-page, .delete-page {
    text-align: center;
    padding: 3rem 1rem;
}
.error-page h1, .delete-page h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: .75rem;
}
.error-page p, .delete-page p {
    color: var(--muted);
    margin-bottom: 1.5rem;
}
.btn-home {
    display: inline-block;
    padding: .6rem 1.5rem;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
}
.btn-home:hover { background: var(--brand-d); text-decoration: none; }

.delete-success h1 { color: var(--success); }
.delete-error  h1  { color: var(--error); }

/* ── Interstitial / countdown ── */
.interstitial {
    text-align: center;
    padding: 3rem 1rem;
}
.redirect-notice { font-size: 1rem; color: var(--muted); margin-bottom: .5rem; }
.redirect-domain { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; }
.countdown {
    font-size: 3rem;
    font-weight: 800;
    color: var(--brand);
    line-height: 1;
    margin-bottom: 1.5rem;
    min-height: 3.5rem;
}
.btn-skip {
    display: inline-block;
    padding: .6rem 1.5rem;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
}
.btn-skip:hover { background: var(--brand-d); text-decoration: none; }

/* ── SEO internal links block ── */
/* Steps list */
.steps-list {
    margin: .6rem 0 .6rem 1.4rem;
    counter-reset: steps;
}
.steps-list li {
    font-size: .975rem;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: .3rem;
}

/* FAQ */
.faq-item {
    margin-bottom: 1.1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.faq-item h3 {
    font-size: .975rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .3rem;
}
.faq-item p {
    font-size: .925rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.65;
}

.seo-internal-links {
    margin-top: 2rem;
    padding: 1.1rem 1.25rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
}
.seo-links-label {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: .5rem;
}
.seo-internal-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .75rem;
}
.seo-internal-links ul li::before { content: '→ '; color: var(--brand); }
.seo-internal-links ul li a { font-size: .9rem; }

/* ── Static pages (About / Privacy / Terms) ── */
.page-content {
    max-width: 680px;
}
.page-content h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: .35rem;
}
.page-content section {
    margin-top: 2rem;
}
.page-content h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .5rem;
    color: var(--text);
}
.page-content p {
    font-size: .975rem;
    color: var(--muted);
    margin-bottom: .6rem;
    line-height: 1.7;
}
.page-content ul {
    margin: .4rem 0 .6rem 1.4rem;
}
.page-content ul li {
    font-size: .975rem;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: .2rem;
}
.page-content code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: .875rem;
    background: #eef0f8;
    padding: .1em .35em;
    border-radius: 4px;
    color: var(--text);
}
.page-content address {
    font-style: normal;
    font-size: .95rem;
    color: var(--muted);
    line-height: 1.8;
    margin: .5rem 0;
}
.contact-email {
    font-weight: 600;
    word-break: break-all;
}
.contact-email-large {
    display: inline-block;
    font-size: 1.15rem;
    margin: .5rem 0;
}
.sponsor-block {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 2rem;
}
.last-updated {
    font-size: .8rem;
    color: var(--muted);
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    padding: 1.25rem;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--muted);
    text-align: center;
}
.footer-brand { margin: 0; }
.footer-nav {
    display: flex;
    gap: 1.25rem;
}
.footer-nav a {
    color: var(--muted);
    font-size: .85rem;
}
.footer-nav a:hover { color: var(--brand); }
.footer-sponsor { margin: 0; font-size: .8rem; }
.footer-sponsor a { color: var(--muted); }
.footer-sponsor a:hover { color: var(--brand); }
.brand-footer {
    font-weight: 800;
    color: var(--brand);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .input-row { flex-direction: column; }
    .btn-shorten { width: 100%; }
    .result-url-row { flex-direction: column; align-items: flex-start; }
    .btn-copy { align-self: flex-start; }
}
