/* TNIJ.to — ciemny motyw, kolor przewodni: lime acid */
:root {
    --bg: #0a0c08;
    --surface: #12150e;
    --surface-2: #181c13;
    --border: #262c1d;
    --text: #eef3e4;
    --muted: #8d9681;
    --lime: #c6ff00;
    --lime-dim: #9fd100;
    --lime-ink: #0b0f00;
    --danger: #ff6b5e;
    --radius: 14px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Arial Black", "Archivo Black", "Helvetica Neue", "Segoe UI Black", var(--font);
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--lime); color: var(--lime-ink); }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

.glow {
    position: fixed;
    inset: -30vh -20vw auto;
    height: 80vh;
    background: radial-gradient(ellipse at 50% 30%, rgba(198, 255, 0, 0.13), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.wrap {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
}

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

/* ---------- Wordmark ---------- */

.wordmark {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(4.4rem, 19vw, 11.5rem);
    line-height: 0.86;
    letter-spacing: -0.045em;
    color: var(--text);
    text-transform: none;
}
.wordmark span { color: var(--lime); }

.wordmark--small {
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    text-decoration: none !important;
}

.topbar {
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    padding: 22px 20px 0;
}

/* ---------- Hero ---------- */

.hero {
    text-align: center;
    padding: clamp(48px, 11vh, 110px) 0 8px;
}

.cutline {
    position: relative;
    height: 22px;
    margin: 18px auto 10px;
    max-width: 560px;
}
.cutline::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    border-top: 2px dashed rgba(198, 255, 0, 0.55);
}
.cutline span {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -54%);
    font-size: 20px;
    color: var(--lime);
    background: var(--bg);
    padding: 0 6px;
    line-height: 1;
    animation: snip 6s ease-in-out infinite;
}
@keyframes snip {
    0%   { left: 0; }
    50%  { left: 100%; }
    100% { left: 0; }
}

.tagline {
    margin: 0 auto;
    max-width: 30em;
    color: var(--muted);
    font-size: 1.08rem;
}

/* ---------- Formularz ---------- */

.shorten { margin: 36px 0 0; }

.shorten__row {
    display: flex;
    gap: 10px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    transition: border-color .2s, box-shadow .2s;
}
.shorten__row:focus-within {
    border-color: rgba(198, 255, 0, 0.6);
    box-shadow: 0 0 0 4px rgba(198, 255, 0, 0.12);
}

.shorten__input {
    flex: 1;
    min-width: 0;
    padding: 14px 14px;
    background: transparent;
    border: 0;
    color: var(--text);
    font: inherit;
    font-size: 1.05rem;
    outline: none;
}
.shorten__input::placeholder { color: #5d6553; }

.shorten__error {
    margin: 12px 4px 0;
    color: var(--danger);
    font-weight: 600;
}

/* ---------- Przyciski ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform .08s, background .2s, color .2s, border-color .2s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
    padding: 14px 30px;
    background: var(--lime);
    color: var(--lime-ink);
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}
.btn--primary:hover { background: #d6ff3d; }
.btn--primary[disabled] { opacity: .6; cursor: progress; }

.btn--ghost {
    padding: 10px 16px;
    background: transparent;
    color: var(--lime);
    border: 1px solid rgba(198, 255, 0, 0.45);
}
.btn--ghost:hover { background: rgba(198, 255, 0, 0.1); border-color: var(--lime); }
.btn--ghost.is-done { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }

.btn--small { padding: 6px 12px; font-size: .88rem; border-radius: 10px; }

/* ---------- Wynik ---------- */

.label {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.label em { font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; }

.result {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    margin-top: 22px;
    padding: 26px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid rgba(198, 255, 0, 0.35);
    border-radius: calc(var(--radius) + 6px);
    animation: pop .35s cubic-bezier(.2, .9, .3, 1.2);
}
.result[hidden] { display: none; }
@keyframes pop {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.result__main { min-width: 0; }

.result__short {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.result__link {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    letter-spacing: -0.02em;
    word-break: break-all;
}
.result__short--small a {
    font-family: var(--mono);
    font-size: .88rem;
    word-break: break-all;
    color: var(--text);
}

.result__target {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .92rem;
    overflow-wrap: anywhere;
}
.result__target span, .result__target a { color: var(--text); }

.result__stats {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--border);
}

/* ---------- QR ---------- */

.qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.qr__img {
    width: 156px;
    height: 156px;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
}
.qr__img img, .qr__img svg { display: block; width: 100%; height: 100%; }
.qr__actions { display: flex; gap: 8px; }

/* ---------- Cechy ---------- */

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 56px 0 40px;
}
.features div {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(18, 21, 14, 0.6);
}
.features strong { display: block; color: var(--lime); margin-bottom: 4px; }
.features span { color: var(--muted); font-size: .93rem; }

/* ---------- Statystyki ---------- */

.stats-head { padding: 44px 0 10px; }
.stats-head__short {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 3.4rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    word-break: break-all;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 26px 0 14px;
}
.kpi {
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.kpi__value {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 6vw, 2.6rem);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.kpi__label { color: var(--muted); font-size: .9rem; }
.kpi--accent { border-color: rgba(198, 255, 0, 0.45); }
.kpi--accent .kpi__value { color: var(--lime); }

.card {
    padding: 22px;
    margin-bottom: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.chart-card__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.chart-card__head h2 { margin: 0; font-size: 1.05rem; }

.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--border); stroke-width: 1; }
.chart__axis { fill: var(--muted); font: 11px var(--font); }
.chart__bar { fill: var(--lime-dim); transition: fill .15s; }
.chart__bar--today { fill: var(--lime); }
.chart__zero { fill: var(--border); }
.chart__hit { fill: transparent; }
.chart__col:hover .chart__bar { fill: #e2ff80; }
.chart__col:hover .chart__hit { fill: rgba(198, 255, 0, 0.05); }

.stats-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.stats-meta dl { margin: 0; display: grid; gap: 12px; }
.stats-meta dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.stats-meta dd { margin: 2px 0 0; }

/* ---------- Błędy ---------- */

.error-page {
    text-align: center;
    padding: 12vh 0 40px;
}
.error-page__code {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(5rem, 22vw, 9rem);
    line-height: 1;
    color: var(--lime);
    letter-spacing: -0.05em;
}
.error-page h1 { margin: 10px 0 6px; font-size: 1.6rem; }
.error-page .btn { margin-top: 22px; }

/* ---------- Drobne ---------- */

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

.footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 28px 20px 34px;
    color: #5d6553;
    font-size: .85rem;
}
.footer .dot { color: var(--lime); }

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
    .shorten__row { flex-direction: column; padding: 6px; }
    .btn--primary { width: 100%; }
    .result { grid-template-columns: 1fr; padding: 20px; }
    .qr { flex-direction: row; justify-content: flex-start; }
    .qr__actions { flex-direction: column; }
    .features, .kpis { grid-template-columns: 1fr; }
    .kpis { grid-template-columns: 1fr 1fr; }
    .kpi--accent { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .cutline span { left: 50%; }
}

/* ---------- Statystyki serwisu (strona główna) ---------- */

.stats-strip {
    margin: 56px 0 0;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}
.stats-strip__kpis { display: grid; grid-template-columns: repeat(3, 1fr); }
.stats-strip__kpi { padding: 2px 24px 4px; border-left: 1px solid var(--border); min-width: 0; }
.stats-strip__kpi:first-child { padding-left: 0; border-left: 0; }
.stats-strip__label,
.stats-strip__chart-head {
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}
.stats-strip__value {
    display: block;
    margin-top: 8px;
    font-family: var(--mono);
    font-size: clamp(1.5rem, 4.4vw, 2.1rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.stats-strip__chart { margin-top: 36px; }
.stats-strip__chart-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.stats-strip__chart-head .slashes { color: var(--lime); letter-spacing: 0; }

.spark { display: block; width: 100%; height: 120px; overflow: visible; }
.spark__area { fill: rgba(198, 255, 0, 0.09); }
.spark__line {
    fill: none;
    stroke: var(--lime);
    stroke-width: 2;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.spark__hit { fill: transparent; }
.spark__hit:hover { fill: rgba(198, 255, 0, 0.07); }

.stats-strip + .features { margin-top: 48px; }

@media (max-width: 520px) {
    .stats-strip__kpi { padding: 0 12px; }
    .stats-strip__label { font-size: .64rem; letter-spacing: .1em; }
}
