/* Same palette and type scale as the extension's options page (src/extension/options/options.css) */
:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #dde3ea;
    --border-strong: #c3ccd6;
    --text: #1f2933;
    --text-muted: #52606d;
    --accent: #1873d3;
    --accent-hover: #135fae;
    --accent-soft: #e8f2fe;
    --trail: #1E90FF;

    --radius: 8px;
    --radius-large: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    --shadow-large: 0 12px 32px rgba(16, 24, 40, 0.12), 0 2px 6px rgba(16, 24, 40, 0.06);
    --focus-ring: 0 0 0 3px rgba(24, 115, 211, 0.35);

    --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --wrap: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-hover);
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 4px;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 16px;
    top: 12px;
    z-index: 100;
    background: var(--surface);
    padding: 8px 14px;
    border-radius: var(--radius);
}

/* Header and footer */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
}

.brand:hover {
    color: var(--text);
}

.site-nav {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
}

.site-nav a:hover {
    background: #e9edf2;
    color: var(--text);
}

.site-nav a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
}

.site-footer {
    margin-top: 72px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 14px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    padding-bottom: 24px;
}

.footer-inner p {
    margin: 0;
}

.footer-inner ul {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

/* Home: hero */

.hero {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    align-items: center;
    gap: 48px;
    padding-top: 64px;
    padding-bottom: 64px;
}

.hero h1 {
    font-size: 48px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
}

.hero h1 span {
    color: var(--accent);
}

.lead {
    font-size: 19px;
    color: var(--text-muted);
    margin: 0 0 28px;
    max-width: 34em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-note {
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* A browser window with a gesture being drawn in it */

.demo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-large);
    overflow: hidden;
}

.demo-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

.demo-bar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
}

.demo-bar span {
    margin-left: 10px;
    flex: 1;
    height: 22px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.demo svg {
    display: block;
    width: 100%;
    height: auto;
}

.demo-text rect {
    fill: #e6ebf1;
}

.demo-trail {
    fill: none;
    stroke: var(--trail);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 420;
    stroke-dashoffset: 420;
    animation: draw 4s ease-in-out infinite;
}

.demo-label {
    opacity: 0;
    animation: label 4s ease-in-out infinite;
}

.demo-label rect {
    fill: rgba(31, 41, 51, 0.9);
}

.demo-label text {
    fill: white;
    font: 600 18px var(--font);
}

@keyframes draw {
    0%, 8% { stroke-dashoffset: 420; opacity: 1; }
    50%, 80% { stroke-dashoffset: 0; opacity: 1; }
    92%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes label {
    0%, 30% { opacity: 0; }
    42%, 80% { opacity: 1; }
    92%, 100% { opacity: 0; }
}

/* Home: sections */

.section {
    padding-top: 72px;
}

.section-head {
    max-width: 680px;
    margin-bottom: 32px;
}

.section-head h2 {
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}

.section-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 18px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow);
    padding: 24px;
}

.card h3 {
    margin: 0 0 6px;
    font-size: 19px;
}

.card p {
    margin: 0;
    color: var(--text-muted);
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 14px;
}

.badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 10px;
    margin-bottom: 10px;
}

/* Gesture tables */

.gesture-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.gesture-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
}

.gesture-list li:first-child {
    border-top: none;
}

.arrows {
    min-width: 64px;
    font-size: 20px;
    letter-spacing: 2px;
    color: var(--accent);
}

/* Features */

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.features li {
    display: flex;
    gap: 14px;
}

.features svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--accent);
}

.features strong {
    display: block;
}

.features span {
    color: var(--text-muted);
}

/* Screenshots */

.shots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.shots figure {
    margin: 0;
}

.shots a {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s, transform 0.15s;
}

.shots a:hover {
    box-shadow: var(--shadow-large);
    transform: translateY(-2px);
}

.shots img {
    display: block;
}

.shots figcaption {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 15px;
}

/* Privacy and call to action */

.callout {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--accent-soft);
    border: 1px solid #c9def7;
    border-radius: var(--radius-large);
    padding: 28px 32px;
}

.callout svg {
    flex-shrink: 0;
    color: var(--accent);
}

.callout h2 {
    margin: 0 0 4px;
    font-size: 24px;
}

.callout p {
    margin: 0;
    color: var(--text-muted);
}

.cta {
    text-align: center;
}

.cta .section-head {
    margin-left: auto;
    margin-right: auto;
}

.cta .hero-actions {
    justify-content: center;
}

/* FAQ */

.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 20px;
    margin-bottom: 10px;
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 16px 0;
}

.faq details p {
    margin: 0 0 16px;
    color: var(--text-muted);
}

/* Markdown pages */

.doc {
    max-width: 800px;
    padding-top: 48px;
    /* Long URLs and permission patterns have no break points */
    overflow-wrap: break-word;
}

.doc h1 {
    font-size: 38px;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 24px;
}

.doc h2 {
    font-size: 26px;
    margin: 44px 0 12px;
    padding-top: 8px;
}

.doc h3 {
    font-size: 19px;
    margin: 28px 0 8px;
}

.doc p,
.doc li {
    color: #323f4b;
}

.doc ul,
.doc ol {
    padding-left: 24px;
}

.doc li + li {
    margin-top: 4px;
}

.doc code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
}

.doc pre {
    background: #1f2933;
    color: #e4e7eb;
    border-radius: var(--radius);
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
}

.doc pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

/* Rouge wraps fenced code in div.highlight; the dark pre above is the whole style */
.doc div.highlight {
    background: none;
}

.doc table {
    border-collapse: collapse;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.doc th,
.doc td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.doc hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

.doc blockquote {
    margin: 20px 0;
    padding: 12px 20px;
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.doc blockquote p {
    margin: 0;
}

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 36px;
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .grid-3,
    .features,
    .shots {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .wrap {
        padding: 0 16px;
    }

    .header-inner {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding-top: 10px;
        padding-bottom: 8px;
    }

    .site-nav {
        margin-left: -12px;
        flex-wrap: wrap;
    }

    .site-header {
        position: static;
    }

    .section {
        padding-top: 52px;
    }

    .section-head h2 {
        font-size: 26px;
    }

    .callout {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
    }

    .doc h1 {
        font-size: 30px;
    }
}

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

    .demo-trail {
        animation: none;
        stroke-dashoffset: 0;
    }

    .demo-label {
        animation: none;
        opacity: 1;
    }

    * {
        transition: none !important;
    }
}
