:root {
    --fg: #111;
    --muted: #666;
    --bg: #fafaf9;
    --accent: #111;
    --error: #b00020;
    --border: #e5e5e3;
    font-size: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.5;
}

main {
    max-width: 640px;
    margin: 0 auto;
    padding: 5rem 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin: 0 0 .25rem;
}
header .dot { color: var(--accent); }
.tag {
    color: var(--muted);
    margin: 0 0 3rem;
    font-size: 1.05rem;
}
.tag .arrow { margin: 0 .25em; }

.content { flex: 1; }

footer {
    margin-top: 4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: .85rem;
    color: var(--muted);
}
footer a { color: inherit; }

/* form */
.shorten {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: .5rem;
    align-items: stretch;
}
.shorten input[type=url] {
    grid-column: 1 / -1;
    padding: .9rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
}
.shorten input[type=url]:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}
.shorten select, .shorten button {
    padding: .65rem .9rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
}
.shorten button {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.shorten .error {
    grid-column: 1 / -1;
    color: var(--error);
    margin: .25rem 0 0;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* result */
.result .short {
    font-size: 1.5rem;
    margin: .5rem 0;
    word-break: break-all;
}
.result .short a { color: var(--fg); text-decoration: none; border-bottom: 2px solid var(--accent); }
.result .copy {
    background: white; border: 1px solid var(--border); border-radius: 4px;
    padding: .35rem .8rem; cursor: pointer; font: inherit;
}
.result .ttl { color: var(--muted); font-size: .9rem; margin: .75rem 0; }

/* stats */
.stats h2 { font-size: 1.5rem; margin: 0 0 .25rem; word-break: break-all; }
.stats .target { color: var(--muted); margin: 0 0 1.5rem; }
.stats dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 2rem; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; }
.stats h3 { font-size: 1rem; margin: 1rem 0 .5rem; color: var(--muted); font-weight: 500; }
.bars rect { fill: var(--accent); }
