/* ==========================================================================
   Localhost Finder – stylesheet
   ========================================================================== */

@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/geist-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/geist-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/geist-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Silkscreen';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/silkscreen-latin-400-normal.woff2') format('woff2');
}

:root {
    color-scheme: dark;

    --background: oklch(0.2 0.02 260);
    --foreground: oklch(0.97 0.01 100);
    --card: oklch(0.26 0.025 260);
    --card-foreground: oklch(0.97 0.01 100);
    --primary: oklch(0.76 0.2 140);
    --primary-foreground: oklch(0.18 0.03 150);
    --muted: oklch(0.3 0.025 260);
    --muted-foreground: oklch(0.8 0.02 255);
    --border: oklch(1 0 0 / 14%);
    --ring: oklch(0.76 0.2 140);

    --border-soft: oklch(1 0 0 / 8.4%);
    --primary-hover: oklch(0.76 0.2 140 / 85%);
    --black-30: rgba(0, 0, 0, 0.3);
    --black-40: rgba(0, 0, 0, 0.4);
    --black-50: rgba(0, 0, 0, 0.5);
    --black-60: rgba(0, 0, 0, 0.6);

    --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    --font-display: 'Silkscreen', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    --bevel-panel: inset 0 2px 0 rgba(255, 255, 255, 0.12), inset 0 -3px 0 rgba(0, 0, 0, 0.35);
    --bevel-button: inset 0 2px 0 rgba(255, 255, 255, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid var(--border);
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    font-family: var(--font-sans);
    line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    min-height: 100vh;
    background-color: var(--background);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--foreground);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: inherit; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; cursor: pointer; }
table { border-collapse: collapse; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* ---------- Helpers ---------- */

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

.container {
    width: 100%;
    max-width: 72rem;
    margin-inline: auto;
    padding-inline: 1rem;
}
@media (min-width: 640px) {
    .container { padding-inline: 1.5rem; }
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.page main { flex: 1; }

.icon { flex-shrink: 0; }
.icon-sm { width: 0.875rem; height: 0.875rem; }
.icon-md { width: 1rem; height: 1rem; }
.icon-lg { width: 1.25rem; height: 1.25rem; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted-foreground); }
.shrink { margin-top: 0.125rem; }

/* ---------- Panels & buttons ---------- */

.panel {
    border: 2px solid var(--black-50);
    background-color: var(--card);
    box-shadow: var(--bevel-panel);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    line-height: 1.25rem;
    border: 2px solid var(--black-60);
    box-shadow: var(--bevel-button);
    transition: background-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
    outline: none;
    box-shadow: var(--bevel-button), 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}
.btn-primary { background-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: var(--card); color: var(--foreground); }
.btn-secondary:hover { background-color: var(--muted); }
.btn-small { padding: 0.375rem 0.75rem; font-size: 0.75rem; line-height: 1rem; }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 2px solid var(--black-50);
    background-color: oklch(0.2 0.02 260 / 90%);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
.skip-link:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 60;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background-color: var(--background);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 4rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
}
.brand-logo {
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--black-60);
}
@media (min-width: 640px) {
    .brand { font-size: 1rem; }
}

.main-nav {
    display: none;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}
.main-nav a { transition: color 0.15s; }
.main-nav a:hover { color: var(--primary); }
@media (min-width: 768px) {
    .main-nav { display: flex; }
}

.lang-switch {
    display: flex;
    padding: 0.125rem;
    border: 2px solid var(--black-50);
    background-color: var(--card);
}
.lang-button {
    padding: 0.25rem 0.625rem;
    font-family: var(--font-display);
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--muted-foreground);
    transition: color 0.15s, background-color 0.15s;
}
.lang-button:hover { color: var(--foreground); }
.lang-button:focus-visible { outline-offset: 0; }
.lang-button[aria-pressed='true'] {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

/* ---------- Sections ---------- */

.section {
    scroll-margin-top: 5rem;
    border-top: 1px solid var(--border-soft);
    padding-block: 4rem;
}
.section-dim { background-color: rgba(0, 0, 0, 0.2); }
@media (min-width: 640px) {
    .section { padding-block: 6rem; }
}

.section-heading {
    max-width: 42rem;
    margin-inline: auto;
    text-align: center;
}
.section-heading h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.375;
    text-wrap: balance;
}
.section-heading p {
    margin-top: 1rem;
    color: var(--muted-foreground);
    text-wrap: pretty;
}
@media (min-width: 640px) {
    .section-heading h2 { font-size: 1.875rem; }
}
@media (min-width: 1024px) {
    .section-heading h2 { font-size: 2.25rem; line-height: 1.2; }
}

.card { padding: 1.5rem; }
.card h3 {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1.375;
}
.card p {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    text-wrap: pretty;
}

.grid { display: grid; margin-top: 3rem; }

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

.hero { position: relative; overflow: hidden; }
.hero-grid {
    display: grid;
    align-items: center;
    gap: 3rem;
    padding-block: 4rem;
}
@media (min-width: 640px) {
    .hero-grid { padding-block: 6rem; }
}
@media (min-width: 1024px) {
    .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border: 2px solid oklch(0.76 0.2 140 / 60%);
    background-color: oklch(0.76 0.2 140 / 10%);
    font-family: var(--font-display);
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--primary);
}

.hero h1 {
    margin-top: 1.5rem;
    font-family: var(--font-display);
    font-size: 1.875rem;
    line-height: 1.25;
    text-wrap: balance;
}
@media (min-width: 640px) {
    .hero h1 { font-size: 2.25rem; line-height: 1.11; }
}
@media (min-width: 1024px) {
    .hero h1 { font-size: 3rem; line-height: 1; }
}

.hero-description {
    max-width: 36rem;
    margin-top: 1.5rem;
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--muted-foreground);
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}
@media (min-width: 640px) {
    .hero-actions { flex-direction: row; }
}

.hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.hero-logo {
    width: 12rem;
    height: 12rem;
    border: 2px solid var(--black-60);
    box-shadow: 8px 8px 0 0 rgba(0, 0, 0, 0.45);
}
@media (min-width: 640px) {
    .hero-logo { width: 14rem; height: 14rem; }
}

.preview-wrap { width: 100%; max-width: 28rem; }
.preview { overflow: hidden; color: var(--card-foreground); }
.preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--black-50);
    background-color: var(--muted);
}
.preview-title { font-family: var(--font-display); font-size: 0.875rem; line-height: 1.25rem; }
.preview-button {
    padding: 0.375rem 0.75rem;
    border: 2px solid var(--black-60);
    background-color: var(--primary);
    font-family: var(--font-display);
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--primary-foreground);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}
.preview-list > li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}
.preview-list > li + li { border-top: 1px solid var(--black-30); }
.status-dot {
    flex-shrink: 0;
    width: 0.625rem;
    height: 0.625rem;
    background-color: var(--primary);
}
.preview-info { min-width: 0; flex: 1; }
.preview-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
}
.preview-meta { font-size: 0.75rem; color: var(--muted-foreground); }
.preview-players {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted-foreground);
}
.preview-caption {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* ---------- Features ---------- */

.grid-features { gap: 1rem; }
@media (min-width: 640px) {
    .grid-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .grid-features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid oklch(0.76 0.2 140 / 50%);
    background-color: oklch(0.76 0.2 140 / 15%);
    color: var(--primary);
}

/* ---------- How it works ---------- */

.grid-steps { gap: 1.5rem; }
@media (min-width: 768px) {
    .grid-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 2px solid var(--black-60);
    background-color: var(--primary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--primary-foreground);
}

/* ---------- Downloads ---------- */

.table-wrap { position: relative; margin-top: 3rem; overflow-x: auto; }
.versions-table {
    width: 100%;
    min-width: 640px;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.25rem;
}
.versions-table thead { background-color: var(--muted); }
.versions-table thead tr { border-bottom: 2px solid var(--black-40); }
.versions-table th,
.versions-table td { padding: 0.75rem 1rem; text-align: left; }
.versions-table thead th {
    font-family: var(--font-display);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 400;
}
.versions-table tbody tr { border-bottom: 1px solid var(--black-30); }
.versions-table tbody tr:last-child { border-bottom: 0; }
.versions-table tbody th { font-weight: 600; white-space: nowrap; }
.download-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.requirements { margin-top: 3rem; padding: 1.5rem; }
.requirements h3 { font-family: var(--font-display); font-size: 1rem; line-height: 1.5; }
.requirements ul {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}
.requirements li { display: flex; gap: 0.5rem; text-wrap: pretty; }
@media (min-width: 640px) {
    .requirements { padding: 2rem; }
    .requirements ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Privacy ---------- */

.privacy-list {
    display: grid;
    gap: 0.75rem;
    max-width: 48rem;
    margin: 3rem auto 0;
}
.privacy-list li {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    font-size: 0.875rem;
    text-wrap: pretty;
}

/* ---------- FAQ ---------- */

.faq-list { max-width: 48rem; margin: 3rem auto 0; }
.faq-list details { padding: 1.25rem; }
.faq-list details + details { border-top: 1px solid var(--black-30); }
.faq-list details[open] { padding-bottom: 1.5rem; }
.faq-list summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 0.125rem;
    font-weight: 500;
    cursor: pointer;
}
.faq-list summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.faq-plus {
    font-family: var(--font-display);
    color: var(--primary);
    transition: transform 0.15s;
}
.faq-list details[open] .faq-plus { transform: rotate(45deg); }
.faq-list details p {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    text-wrap: pretty;
}

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border-soft); }
.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-block: 2rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}
.footer-text { display: flex; flex-direction: column; gap: 0.25rem; }
.footer-made { font-weight: 500; color: var(--foreground); }
.footer-disclaimer { max-width: 36rem; font-size: 0.75rem; line-height: 1rem; text-wrap: pretty; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a { transition: color 0.15s; }
.footer-nav a:hover { color: var(--foreground); }
@media (min-width: 768px) {
    .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- 404 ---------- */

.not-found {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
}
.not-found-card {
    width: 100%;
    max-width: 32rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.not-found-code {
    font-family: var(--font-display);
    font-size: 4.5rem;
    line-height: 1;
    color: var(--primary);
}
.not-found-card h1 {
    margin-top: 1.5rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.375;
    text-wrap: balance;
}
.not-found-text {
    margin: 1rem 0 2rem;
    color: var(--muted-foreground);
    text-wrap: pretty;
}
