/* =========================================================
   GitHub Pages Finder
   Main stylesheet
   ========================================================= */

:root {
    --bg: #080a0f;
    --bg-soft: #0d1017;
    --surface: rgba(18, 22, 31, 0.78);
    --surface-solid: #12161f;
    --surface-hover: #171c27;

    --border: rgba(255, 255, 255, 0.09);
    --border-hover: rgba(158, 175, 255, 0.28);

    --text: #f5f7fa;
    --text-soft: #aeb6c4;
    --text-muted: #737d8e;

    --accent: #9eafff;
    --accent-soft: rgba(158, 175, 255, 0.12);
    --accent-strong: #b8c5ff;

    --danger: #ff7d8d;
    --danger-soft: rgba(255, 125, 141, 0.1);

    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --max-width: 1040px;
}


/* =========================================================
   Reset
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 50% -10%,
            rgba(93, 111, 190, 0.16),
            transparent 38%
        ),
        radial-gradient(
            circle at 0% 60%,
            rgba(82, 96, 170, 0.07),
            transparent 30%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 16px;
    line-height: 1.6;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* =========================================================
   Base elements
   ========================================================= */

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

::selection {
    background: rgba(158, 175, 255, 0.25);
    color: var(--text);
}


/* =========================================================
   Main container
   ========================================================= */

.container {
    width: min(
        calc(100% - 40px),
        var(--max-width)
    );

    margin: 0 auto;
    padding: 92px 0 80px;
}


/* =========================================================
   Header / Hero
   ========================================================= */

header {
    max-width: 760px;
    margin: 0 auto 44px;
    text-align: center;
}

header h1 {
    font-size: clamp(2.35rem, 6vw, 4.25rem);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.055em;

    background:
        linear-gradient(
            135deg,
            #ffffff 15%,
            #cbd4ff 55%,
            #929fff 100%
        );

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

header p {
    margin-top: 18px;

    color: var(--text-soft);

    font-size: clamp(
        0.98rem,
        2vw,
        1.12rem
    );

    font-weight: 400;
}


/* =========================================================
   Search section
   ========================================================= */

.search-section {
    width: min(100%, 780px);
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 10px;

    padding: 8px;

    background: rgba(16, 19, 27, 0.86);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.input-group:focus-within {
    border-color: var(--border-hover);

    box-shadow:
        0 0 0 4px rgba(158, 175, 255, 0.06),
        var(--shadow);
}

.input-group input {
    min-width: 0;
    flex: 1;

    padding: 15px 16px;

    color: var(--text);
    background: transparent;

    border: 0;
    outline: 0;

    font-size: 0.98rem;
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 176px;

    padding: 0 22px;

    color: #080a0f;
    background: var(--accent);

    border-radius: 11px;

    cursor: pointer;

    font-size: 0.92rem;
    font-weight: 600;

    transition:
        background 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}

.input-group button:hover {
    background: var(--accent-strong);

    transform: translateY(-1px);

    box-shadow:
        0 10px 30px rgba(158, 175, 255, 0.16);
}

.input-group button:active {
    transform: translateY(0);
}

.input-group button:focus-visible {
    outline: 3px solid rgba(158, 175, 255, 0.35);
    outline-offset: 3px;
}

.input-group button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}


/* =========================================================
   Spinner
   ========================================================= */

.spinner {
    width: 18px;
    height: 18px;

    margin-left: 8px;

    border: 2px solid rgba(8, 10, 15, 0.28);
    border-top-color: #080a0f;

    border-radius: 50%;

    animation: spin 700ms linear infinite;
}

.hidden {
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   Error message
   ========================================================= */

.error-message {
    margin-top: 14px;
    padding: 13px 16px;

    color: var(--danger);
    background: var(--danger-soft);

    border: 1px solid rgba(255, 125, 141, 0.16);
    border-radius: var(--radius-sm);

    font-size: 0.9rem;
}


/* =========================================================
   Stats
   ========================================================= */

.stats {
    width: min(100%, 780px);

    margin: 30px auto 18px;

    color: var(--text-soft);

    font-size: 0.9rem;
}

.stats strong {
    color: var(--text);
    font-weight: 600;
}


/* =========================================================
   Results
   ========================================================= */

.results-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(260px, 1fr)
        );

    gap: 14px;

    width: 100%;
}



/* =========================================================
   Empty / result states
   ========================================================= */

.results-grid:empty {
    display: none;
}


/* =========================================================
   Content pages
   About / Privacy / Terms
   ========================================================= */

.content-page {
    width: min(100%, 820px);

    margin: 0 auto;

    padding: 34px;

    background:
        linear-gradient(
            145deg,
            rgba(18, 22, 31, 0.82),
            rgba(12, 15, 21, 0.82)
        );

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.content-page section + section {
    margin-top: 34px;
}

.content-page h2 {
    margin-bottom: 12px;

    color: var(--text);

    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.content-page p {
    color: var(--text-soft);

    font-size: 0.94rem;
}

.content-page p + p {
    margin-top: 13px;
}

.content-page ul {
    display: grid;
    gap: 9px;

    margin-top: 12px;
    padding-left: 20px;

    color: var(--text-soft);

    font-size: 0.94rem;
}

.content-page li::marker {
    color: var(--accent);
}

.back-link {
    margin-top: 38px !important;
    padding-top: 24px;

    border-top: 1px solid var(--border);
}

.back-link a {
    color: var(--accent);
    font-weight: 500;

    transition: color 160ms ease;
}

.back-link a:hover {
    color: var(--accent-strong);
}


/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    width: min(
        calc(100% - 40px),
        var(--max-width)
    );

    margin: 0 auto;

    padding: 30px 0 34px;

    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-brand strong {
    color: var(--text);

    font-size: 0.9rem;
    font-weight: 600;
}

.footer-brand span {
    color: var(--text-muted);

    font-size: 0.78rem;
}

.footer-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 20px;
}

.footer-nav a {
    color: var(--text-muted);

    font-size: 0.8rem;

    transition:
        color 160ms ease;
}

.footer-nav a:hover {
    color: var(--text);
}

.footer-nav a:focus-visible,
.back-link a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 3px;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 25px;
    padding-top: 18px;

    border-top: 1px solid rgba(255, 255, 255, 0.05);

    color: var(--text-muted);

    font-size: 0.72rem;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 700px) {

    .container {
        width: min(
            calc(100% - 28px),
            var(--max-width)
        );

        padding: 64px 0 55px;
    }

    header {
        margin-bottom: 32px;
    }

    header h1 {
        font-size: clamp(
            2.15rem,
            12vw,
            3rem
        );
    }

    header p {
        margin-top: 14px;
        font-size: 0.92rem;
    }

    .input-group {
        flex-direction: column;
        padding: 7px;
    }

    .input-group input {
        width: 100%;
        padding: 14px 13px;
    }

    .input-group button {
        width: 100%;
        min-height: 48px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .content-page {
        padding: 24px 20px;
        border-radius: var(--radius-md);
    }

    .content-page section + section {
        margin-top: 28px;
    }

    .site-footer {
        width: min(
            calc(100% - 28px),
            var(--max-width)
        );
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 22px;
    }

    .footer-nav {
        gap: 15px;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
}


/* =========================================================
   Small screens
   ========================================================= */

@media (max-width: 420px) {

    .container {
        padding-top: 48px;
    }

    header h1 {
        font-size: 2.05rem;
    }

    .input-group input {
        font-size: 0.9rem;
    }


    .content-page {
        padding: 21px 17px;
    }

    .content-page p,
    .content-page ul {
        font-size: 0.9rem;
    }
}


/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   GitHub Pages Result Cards
   ========================================================= */

.repo-card {
    position: relative;

    display: flex;
    flex-direction: column;

    min-height: 165px;

    padding: 22px;

    color: var(--text);
    background:
        linear-gradient(
            145deg,
            rgba(20, 24, 34, 0.88),
            rgba(13, 16, 23, 0.88)
        );

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.16);

    text-decoration: none;

    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}

.repo-card:hover {
    transform: translateY(-3px);

    border-color: var(--border-hover);

    background: var(--surface-hover);

    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.24);
}

.repo-card:focus-visible {
    outline: 3px solid rgba(158, 175, 255, 0.35);
    outline-offset: 3px;
}

.repo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 9px;
}

.repo-name {
    color: var(--text);

    font-size: 1rem;
    font-weight: 600;

    overflow-wrap: anywhere;
}

.repo-desc {
    margin: 0;

    color: var(--text-muted);

    font-size: 0.82rem;
    line-height: 1.55;

    overflow-wrap: anywhere;
}

.repo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    margin-top: auto;
    padding-top: 20px;

    color: var(--text-muted);

    font-size: 0.72rem;
}

.view-link {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    flex-shrink: 0;

    color: var(--accent);

    font-size: 0.82rem;
    font-weight: 500;

    transition:
        color 160ms ease,
        transform 160ms ease;
}

.repo-card:hover .view-link {
    color: var(--accent-strong);
    transform: translateX(2px);
}

.view-link svg {
    width: 15px;
    height: 15px;

    flex-shrink: 0;
}


/* =========================================================
   Responsive Result Cards
   ========================================================= */

@media (max-width: 640px) {

    .repo-card {
        min-height: 155px;
        padding: 18px;
    }

    .repo-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .view-link {
        align-self: flex-end;
    }

}


/* =========================================================
   Sticky Footer Layout
   ========================================================= */

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}


/* =========================================================
   Page Height Layout
   ========================================================= */

.container {
    flex: 1;
}


/* =========================================================
   GitHub Activity Reporter
   ========================================================= */

.activity-container {
    padding-bottom: 70px;
}

.activity-status {
    min-height: 24px;
    margin-top: 10px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.8rem;
}

.activity-report {
    display: grid;
    gap: 16px;
    width: 100%;
    margin-top: 30px;
}

.activity-panel {
    padding: 24px;
    background: linear-gradient(145deg, rgba(18, 22, 31, 0.88), rgba(12, 15, 21, 0.88));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.activity-profile {
    display: flex;
    align-items: center;
    gap: 18px;
}

.activity-avatar {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    border-radius: 50%;
    border: 1px solid var(--border);
}

.activity-profile-main { min-width: 0; flex: 1; }

.activity-profile-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.activity-profile-title h2,
.activity-panel h2 {
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 600;
}

.activity-profile-title p,
.activity-panel-heading p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.activity-bio {
    margin-top: 9px;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.activity-profile-link {
    flex-shrink: 0;
    color: var(--accent);
    font-size: 0.8rem;
}

.activity-profile-link:hover { color: var(--accent-strong); }

.activity-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.activity-stat {
    padding: 19px;
    background: rgba(18, 22, 31, 0.62);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.activity-stat strong {
    display: block;
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 600;
}

.activity-stat span {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.activity-panel-heading { margin-bottom: 20px; }

.activity-breakdown { display: grid; gap: 13px; }

.activity-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 0.8rem;
}

.activity-bar-label strong { color: var(--text); font-weight: 600; }

.activity-bar {
    height: 7px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.activity-bar span {
    display: block;
    height: 100%;
    min-width: 4px;
    background: var(--accent);
    border-radius: inherit;
}

.language-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.language-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    color: var(--text-soft);
    background: var(--accent-soft);
    border: 1px solid rgba(158, 175, 255, 0.12);
    border-radius: 999px;
    font-size: 0.78rem;
}

.language-pill strong { color: var(--text); font-weight: 600; }

.repo-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.activity-repo-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.activity-repo-table th,
.activity-repo-table td {
    padding: 13px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    text-align: left;
    font-size: 0.8rem;
}

.activity-repo-table th {
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-muted);
    font-weight: 500;
}

.activity-repo-table td { color: var(--text-soft); }
.activity-repo-table tr:last-child td { border-bottom: 0; }
.activity-repo-table td a { color: var(--accent); }
.activity-repo-table td a:hover { color: var(--accent-strong); }

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.sort-button:hover { color: var(--text); }
.sort-button span { color: var(--accent); font-size: 0.78rem; }

.activity-timeline { display: grid; gap: 0; }

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 12px;
    padding-bottom: 18px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 15px;
    bottom: 0;
    left: 3px;
    width: 1px;
    background: var(--border);
}

.timeline-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    align-items: center;
}

.timeline-content strong { color: var(--text); font-size: 0.82rem; }
.timeline-content a { color: var(--accent); font-size: 0.78rem; overflow-wrap: anywhere; }
.timeline-content time { grid-column: 2; grid-row: 1 / span 2; color: var(--text-muted); font-size: 0.72rem; }
.activity-muted { color: var(--text-muted); font-size: 0.82rem; }

@media (max-width: 700px) {
    .activity-panel { padding: 19px; border-radius: var(--radius-md); }
    .activity-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .activity-profile { align-items: flex-start; }
    .activity-profile-title { align-items: flex-start; flex-direction: column; gap: 8px; }
    .activity-profile-link { align-self: flex-start; }
}

@media (max-width: 420px) {
    .activity-stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .activity-stat { padding: 15px; }
    .activity-avatar { width: 58px; height: 58px; flex-basis: 58px; }
    .timeline-content { grid-template-columns: 1fr; }
    .timeline-content time { grid-column: 1; grid-row: auto; }
}
