@import url("https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
    /* Colors - Light Mode (Premium SaaS Look) */
    --bg-1: #ffffff;
    --page-bg: #f3f4f5;
    --bg-2: #f7f8f9;
    --bg-3: #eff0f1;
    --ink: #232629;
    --muted: #5d6165;
    --card-bg: #ffffff;
    --border: #dadcde;
    --nav-bg: rgba(255, 255, 255, 0.96);
    --nav-border: #dadcde;
    --nav-ink: #232629;
    --nav-muted: #4d5257;
    --code-bg: #1b1e20;
    --code-surface: #232629;
    --code-border: rgba(148, 163, 184, 0.28);
    --code-text: #e2e8f0;
    --code-muted: #94a3b8;

    --primary: #3d7be0;
    /* Indigo 600 */
    --primary-hover: #2f6acb;
    /* Indigo 700 */
    --primary-text: #ffffff;

    --secondary: #eff0f1;
    /* Slate 100 */
    --secondary-text: #232629;
    /* Slate 700 */
    --secondary-hover: #e3e5e7;
    /* Slate 200 */

    --accent-gradient: linear-gradient(90deg, #3d7be0 0%, #3d9be9 100%);
    --primary-soft: rgba(61, 123, 224, 0.12);

    --input-bg: #ffffff;
    --input-border: #c3c7cb;
    --input-focus-ring: rgba(61, 123, 224, 0.3);

    /* Fonts */
    --font-sans: "Noto Sans", "Noto Sans Display", sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    /* Layout */
    --radius-lg: 12px;
    --radius-md: 10px;
    --radius-sm: 6px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --container-width: 1040px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-1: #1b1e20;
        --page-bg: #1b1e20;
        /* Slate 900 */
        --bg-2: #232629;
        /* Slate 800 */
        --bg-3: #2a2e32;
        --ink: #fcfcfc;
        /* Slate 50 */
        --muted: #a1a9b1;
        /* Slate 400 */
        --card-bg: #232629;
        --border: #3b4045;
        /* Slate 700 */
        --nav-bg: rgba(35, 38, 41, 0.96);
        --nav-border: #3b4045;
        --nav-ink: #fcfcfc;
        --nav-muted: #d0d4d8;

        --primary: #4d9ff0;
        /* Indigo 500 */
        --primary-hover: #6fb3f5;
        /* Indigo 400 */
        --primary-text: #ffffff;

        --secondary: #31363b;
        /* Slate 700 */
        --secondary-text: #fcfcfc;
        /* Slate 50 */
        --secondary-hover: #3b4045;
        /* Slate 600 */

        --input-bg: #1b1e20;
        --input-border: #4d5257;
        --input-focus-ring: rgba(77, 159, 240, 0.35);
        --primary-soft: rgba(77, 159, 240, 0.16);
    }
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    background-color: var(--page-bg);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

a:hover {
    border-bottom-color: var(--primary);
}

/* Layout */
main {
    position: relative;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 80px 24px 100px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* Hero Section */
header.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding-bottom: 20px;
    animation: fade-in-up 0.8s ease backwards;
}

.hero .eyebrow {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--ink);
    line-height: 1.1;
}

.hero p {
    font-size: 1.125rem;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
}

.hero-logo {
    width: 120px;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    margin-top: 16px;
    transition: transform 0.3s ease;
}

.hero-logo:hover {
    transform: rotate(-3deg) scale(1.05);
}

/* Typography Headings */
h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

/* Grid & Cards */
.grid {
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.2s;
}

.card:hover::before {
    opacity: 1;
}

/* Steps List */
ol.steps-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0;
}

ol.steps-list li {
    position: relative;
    padding-left: 36px;
    margin-bottom: 16px;
    color: var(--muted);
}

ol.steps-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 2px;
    width: 24px;
    height: 24px;
    background: var(--bg-2);
    /* pill bg */
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

ol.steps-list li:last-child {
    margin-bottom: 0;
}

/* Forms */
label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ink);
}

textarea,
input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--ink);
    outline: none;
    transition: all 0.2s;
}

textarea:focus,
input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Button Group */
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    margin-bottom: 24px;
}

.row:last-child {
    margin-bottom: 0px;
}

button {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    /* full rounded */
    border: none;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

button:not(.secondary) {
    background: var(--primary);
    color: var(--primary-text);
    box-shadow: 0 2px 4px rgba(61, 123, 224, 0.2);
}

button:not(.secondary):hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(61, 123, 224, 0.3);
}

button:not(.secondary):active {
    transform: translateY(0);
}

button.secondary {
    background: var(--secondary);
    color: var(--secondary-text);
}

button.secondary:hover {
    background: var(--secondary-hover);
}

.status {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.5;
}

.status strong {
    color: var(--ink);
}

/* Helper / Utility Details */
details {
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 16px;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    outline: none;
    list-style: none;
    /* Hide default */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::after {
    content: "+";
    color: var(--muted);
    font-size: 1.2em;
    font-weight: 400;
}

details[open] summary::after {
    content: "−";
    /* minus sign */
}

details ul {
    margin: 12px 0 0 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 0.875rem;
}

details ul li {
    margin-bottom: 6px;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 2px 6px;
    background: var(--bg-3);
    border-radius: 4px;
    color: var(--primary);
}

/* Footer */
footer {
    margin-top: auto;
    text-align: center;
    padding-top: 40px;
    padding-bottom: 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.875rem;
}

footer a {
    color: var(--muted);
    font-weight: 500;
}

footer p {
    margin: 0 0 12px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
}

footer a:hover {
    color: var(--primary);
}

/* Animations */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    header.hero h1 {
        font-size: 2rem;
    }

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

    .card {
        padding: 24px;
    }
}

/* Feature Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.feature-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
    color: var(--ink);
}

/* Screenshots */
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.screenshot-frame {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.screenshot-frame:hover {
    transform: scale(1.02);
}

.screenshot-frame img {
    width: 100%;
    height: auto;
    display: block;
}

/* Code Blocks */
div.code-toolbar {
    margin: 0 0 24px 0;
}

pre.code-block,
pre[class*="language-"].code-block {
    position: relative;
    background: linear-gradient(180deg, var(--code-surface), var(--code-bg));
    color: var(--code-text);
    padding: 46px 20px 22px 4.25em;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.7;
    margin: 0;
    border: 1px solid var(--code-border);
    box-shadow: 0 22px 44px -32px rgba(15, 23, 42, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    text-shadow: none;
}

pre.code-block::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 20px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 18px 0 0 #f59e0b, 36px 0 0 #22c55e;
}

pre.code-block code,
code[class*="language-"] {
    color: var(--code-text);
    background: transparent;
    font-family: var(--font-mono);
    text-shadow: none;
}

pre.command-line .command-line-prompt {
    border-right-color: rgba(148, 163, 184, 0.26);
    color: var(--code-muted);
}

div.code-toolbar > .toolbar {
    top: 12px;
    right: 12px;
    opacity: 1;
}

div.code-toolbar > .toolbar > .toolbar-item > button.copy-to-clipboard-button {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: var(--radius-sm);
    color: var(--code-text);
    padding: 6px 12px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: none;
}

div.code-toolbar > .toolbar > .toolbar-item > button.copy-to-clipboard-button:hover {
    background: rgba(56, 189, 248, 0.22);
    color: white;
    transform: translateY(-1px);
}

/* Section Spacing */
section {
    position: relative;
    scroll-margin-top: 40px;
    /* Offset for anchor links */
}

h2.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    display: table;
    margin-left: auto;
    margin-right: auto;
}

h2.section-title::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    opacity: 0.5;
}

/* OAuth Helper Container */
.oauth-container {
    background: var(--bg-1);
    /* specific override if needed */
    border: 1px solid var(--primary);
    /* highlight */
    padding: 4px;
    /* thick border effect */
    border-radius: calc(var(--radius-lg) + 4px);
    /* outer radius */
}

.oauth-inner {
    background: var(--bg-2);
    border-radius: var(--radius-lg);
    padding: 40px;
}

@media (max-width: 640px) {
    .oauth-inner {
        padding: 20px;
    }
}

/* Compliance Navigation */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--nav-border);
    color: var(--nav-ink);
    padding: 16px 0;
    margin-bottom: -1px;
    /* overlap border */
}

.nav-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (min-width: 640px) {
    .nav-content {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .nav-content {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .nav-content {
        max-width: 1024px;
    }
}

.nav-logo {
    font-weight: 700;
    color: var(--nav-ink);
    text-decoration: none;
    font-size: 1rem;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--nav-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero tagline, the "not just a fork" note, help links */
.hero p.tagline {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--ink);
    margin: 12px auto -8px;
}

.callout {
    border-left: 4px solid var(--primary);
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
}

.callout p {
    margin: 0;
}

.eyebrow.pill {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 4px 14px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 8px;
}

/* Four feature cards per row on wide screens, two on tablets */
.features-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 0;
}

@media (max-width: 960px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card h3 {
    margin-top: 0;
}

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

a.link-card {
    color: inherit;
    font-weight: inherit;
    border-bottom: 1px solid var(--border);
    transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}

a.link-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

a.link-card h3 {
    color: var(--primary);
}

/* Screenshots: open full size, with a caption */
.screenshot-grid {
    margin-bottom: 0;
}

figure.screenshot-frame {
    margin: 0;
    background: var(--card-bg);
}

figure.screenshot-frame a,
figure.screenshot-frame a:hover {
    border: 0;
    display: block;
}

figure.screenshot-frame img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top left;
}

figure.screenshot-frame figcaption {
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* Install: one card per row, so commands fit on one line */
.stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stack .card h3:first-child {
    margin-top: 0;
}

/* Phones: the nav on one line, smaller code */
@media (max-width: 640px) {
    main {
        padding: 40px 16px 60px;
        gap: 40px;
    }

    .nav-content {
        padding: 0 16px;
        gap: 12px;
    }

    .nav-logo {
        white-space: nowrap;
        font-size: 0.95rem;
    }

    .nav-links {
        gap: 14px;
    }

    .nav-links a {
        white-space: nowrap;
        font-size: 0.85rem;
    }

    .nav-links a[href^="https://github"] {
        display: none;
    }

    pre.code-block,
    pre[class*="language-"].code-block {
        font-size: 0.78rem;
    }

    .hero p.tagline {
        font-size: 1.15rem;
    }
}
