/* PacketHound website. Colours come from the logo: navy #051C37, orange #FE7801. */

:root {
    --navy: #051c37;
    --orange: #fe7801;
    --orange-dark: #d96400;
    --bg: #ffffff;
    --bg-alt: #f5f7fa;
    --surface: #ffffff;
    --ink: #0f1b2d;
    --muted: #5b6676;
    --line: #e3e8ef;
    --accent: #1d5fd1;          /* links and primary buttons */
    --accent-ink: #ffffff;
    --feature-icon-bg: #fff1e6;
    --code-bg: #f1f4f8;
    --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 8px 24px rgba(15, 27, 45, .06);
    --radius: 14px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1422;
        --bg-alt: #0f1b2d;
        --surface: #13223a;
        --ink: #e8edf4;
        --muted: #9aa6b8;
        --line: #22324b;
        --accent: #6aa2ff;
        --accent-ink: #061226;
        --feature-icon-bg: #2a1c0e;
        --code-bg: #0b1422;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
code, pre { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: .92em; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
pre code { background: none; padding: 0; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: 12px; top: -48px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; }

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

/* ------------------------------------------------------------ buttons */

.btn {
    display: inline-flex; align-items: center; gap: .5em;
    padding: .65em 1.2em; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
    text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-dark); }
.btn-large { padding: .85em 1.6em; font-size: 1.08rem; }
.btn-small { padding: .4em .9em; font-size: .92rem; }
.btn.is-disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

/* ------------------------------------------------------------ header */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.wordmark { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.wm-a { color: var(--navy); }
.wm-b { color: var(--orange); }
@media (prefers-color-scheme: dark) { .wm-a { color: #ffffff; } }

.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover { color: var(--accent); }
.site-nav .nav-github { display: inline-flex; align-items: center; gap: 8px; }
.nav-github-label { display: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--ink); cursor: pointer; }

@media (max-width: 760px) {
    .nav-toggle { display: inline-flex; }
    .site-nav {
        display: none; position: absolute; left: 0; right: 0; top: 64px;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px;
    }
    .site-nav.is-open { display: flex; }
    .site-nav a:not(.btn) { padding: 10px 0; border-bottom: 1px solid var(--line); }
    .site-nav .btn { margin-top: 12px; justify-content: center; }
    .nav-github-label { display: inline; }
}

/* ------------------------------------------------------------ hero */

.hero { padding: clamp(40px, 7vw, 90px) 0 clamp(40px, 6vw, 70px); }
.hero { background:
    radial-gradient(1000px 400px at 85% 10%, color-mix(in srgb, var(--orange) 12%, transparent), transparent 70%),
    radial-gradient(800px 400px at 0% 100%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%); }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: block; line-height: 1.5; color: var(--orange-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; margin-bottom: .6em; }
@media (prefers-color-scheme: dark) { .eyebrow { color: var(--orange); } }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.hero-actions { margin-top: 28px; }
.hero-meta { margin-top: 12px; color: var(--muted); font-size: .92rem; }
.hero-art {
    background: #ffffff; border-radius: 24px; padding: 28px; box-shadow: var(--shadow);
    border: 1px solid var(--line); display: flex; justify-content: center;
}
.hero-art img { width: 100%; max-width: 440px; }

@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-art { order: -1; max-width: 460px; }
}

/* ------------------------------------------------------------ sections */

.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-tight { padding-top: 8px; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

.page-head { padding: clamp(40px, 6vw, 72px) 0 24px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature p { color: var(--muted); margin: 0; font-size: .97rem; }
.feature-icon {
    width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
    background: var(--feature-icon-bg); color: var(--orange-dark); margin-bottom: 14px;
}
@media (prefers-color-scheme: dark) { .feature-icon { color: var(--orange); } }

/* ------------------------------------------------------------ screenshots */

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.shot { margin: 0; }
.shot-open {
    display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
    background: var(--surface); cursor: zoom-in; box-shadow: var(--shadow); transition: transform .2s;
}
.shot-open:hover { transform: translateY(-3px); }
.shot-open img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.shot figcaption { padding: 10px 2px 0; display: grid; gap: 2px; }
.shot figcaption span { color: var(--muted); font-size: .94rem; }

.lightbox {
    width: min(1200px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: 14px;
    background: var(--surface); color: var(--ink); overflow: visible;
}
.lightbox::backdrop { background: rgba(5, 12, 24, .82); }
.lightbox figure { margin: 0; }
.lightbox img { display: block; width: 100%; max-height: calc(94vh - 70px); object-fit: contain; border-radius: 14px 14px 0 0; background: #fff; }
.lightbox figcaption { padding: 12px 18px; }
.lightbox figcaption span { color: var(--muted); }
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(5, 12, 24, .65);
    width: 44px; height: 44px; border-radius: 50%; font-size: 28px; line-height: 1; display: grid; place-items: center;
}
.lightbox-close { top: -14px; right: -14px; }
.lightbox-prev { left: -22px; top: 40%; }
.lightbox-next { right: -22px; top: 40%; }
.lightbox [hidden] { display: none; }
@media (max-width: 700px) {
    .lightbox-close { top: 8px; right: 8px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

/* ------------------------------------------------------------ how it works */

.steps { list-style: none; padding: 0; margin: 0 0 36px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.steps li::before {
    content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    background: var(--navy); color: #fff; font-weight: 700; margin-bottom: 14px;
}
@media (prefers-color-scheme: dark) { .steps li::before { background: var(--orange); color: #1b0d00; } }
.steps p { color: var(--muted); margin: 0; }

.callout { border-left: 4px solid var(--orange); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; padding: 22px 26px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.callout ul { margin: 0; padding-left: 1.2em; }
.callout li { margin-bottom: .5em; color: var(--muted); }
.callout li strong { color: var(--ink); }

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

.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--orange); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 6px; }

/* ------------------------------------------------------------ call to action */

.cta { background: var(--navy); color: #fff; padding: 56px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta h2 { color: #fff; }
.cta p { color: #c3cddb; margin: 0; }

/* ------------------------------------------------------------ download page */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .6em; }
.card p:last-child, .card ul:last-child, .card ol:last-child { margin-bottom: 0; }
.download-card { display: flex; gap: 24px; align-items: center; }
.download-card h2 { margin-bottom: .2em; }
.download-card .btn { margin-top: 6px; word-break: break-all; }
@media (max-width: 600px) { .download-card { flex-direction: column; text-align: center; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 .card { margin-bottom: 20px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; gap: 0; } }

.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { padding-left: 28px; position: relative; margin-bottom: .5em; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 12px; height: 7px; border-left: 2.5px solid var(--orange); border-bottom: 2.5px solid var(--orange); transform: rotate(-45deg); }
.numbered { padding-left: 1.3em; margin: 0; }
.numbered li { margin-bottom: .5em; }

.notice { border-left: 4px solid var(--orange); }

/* "Buy me a coffee" button: same size as Buy Me a Coffee's own snippet (217x60), smaller in the footer. */
.donate { display: inline-block; line-height: 0; border-radius: 10px; transition: transform .15s, box-shadow .15s; }
.donate:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.donate img { width: auto; }
.donate-large img { height: 60px; }
.donate-small img { height: 40px; }
.support-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.support-card p { color: var(--muted); }

.hash { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 1em; }
.hash code { word-break: break-all; padding: 8px 10px; flex: 1 1 300px; font-size: .88rem; }
.copy-btn.is-done { border-color: var(--orange); }

.versions { width: 100%; border-collapse: collapse; }
.versions th, .versions td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.versions th { color: var(--muted); font-weight: 600; font-size: .9rem; }
.version-links { white-space: nowrap; }
.version-links a + a { margin-left: 14px; }

.changelog-entry h2 { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: .3em; }
.changelog-entry { scroll-margin-top: 90px; }
.badge {
    font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--orange-dark); background: var(--feature-icon-bg); border-radius: 999px; padding: 3px 10px;
}
@media (prefers-color-scheme: dark) { .badge { color: var(--orange); } }

.prose h2 { font-size: 1.4rem; margin-top: 1.4em; }
.prose li { margin-bottom: .5em; }

.page-404 { text-align: center; padding-bottom: 80px; }
.page-404 img { max-width: 288px; background: #fff; border-radius: 20px; padding: 12px; }

/* ------------------------------------------------------------ footer */

.site-footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: .94rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); margin-right: auto; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-github { display: inline-flex; align-items: center; gap: 6px; }
.footer-note { width: 100%; color: var(--muted); font-size: .85rem; margin: 0; }
