/* ==========================================================================
   Rclone Services Ltd - Adaptive Dark/Light Theme
   ========================================================================== */

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

/* --- Dark theme (default) --- */
:root {
    /* Brand colors (shared) */
    --blue-dark: #3F79AD;
    --blue-mid: #70CAF2;
    --blue-light: #B4E3F9;
    --orange: #FB7A20;
    --orange-hover: #FF9340;

    /* Theme colors */
    --bg: #080D18;
    --bg2: #0D1525;
    --bg3: #121C32;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.18);
    --border-hover: rgba(251, 122, 32, 0.4);
    --glow: 0 0 15px rgba(251, 122, 32, 0.3), 0 0 45px rgba(251, 122, 32, 0.15), 0 0 80px rgba(251, 122, 32, 0.05);

    --text: #F0F4FF;
    --text-muted: #7A8BA8;
    --text-dim: #3D5070;

    --accent-dim: rgba(251, 122, 32, 0.12);
    --accent-mid: rgba(251, 122, 32, 0.25);
    --blue-dim: rgba(63, 121, 173, 0.15);

    --nav-bg: rgba(8, 13, 24, 0.85);
    --nav-link-hover-bg: rgba(255, 255, 255, 0.05);
    --row-stripe: rgba(255, 255, 255, 0.02);
    --row-hover: rgba(251, 122, 32, 0.04);
    --code-color: var(--blue-mid);
    --btn-primary-text: #050D1A;
    --noise-opacity: 0.03;
    --orb1-opacity: 0.06;
    --orb2-opacity: 0.08;

    /* Spacing */
    --sp-1: 0.5rem;
    --sp-2: 1rem;
    --sp-3: 1.5rem;
    --sp-4: 2rem;
    --sp-5: 3rem;
    --sp-6: 4rem;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
                 "Courier New", monospace;
}

/* --- Light theme --- */
@media (prefers-color-scheme: light) {
    :root {
        --bg: #ffffff;
        --bg2: #f5f7fa;
        --bg3: #ebeef3;
        --border: rgba(0, 0, 0, 0.1);
        --border-strong: rgba(0, 0, 0, 0.18);
        --border-hover: rgba(251, 122, 32, 0.45);
        --glow: 0 0 15px rgba(251, 122, 32, 0.2), 0 0 45px rgba(251, 122, 32, 0.08), 0 0 80px rgba(251, 122, 32, 0.03);

        --text: #1a1a2e;
        --text-muted: #555566;
        --text-dim: #888899;

        --accent-dim: rgba(251, 122, 32, 0.08);
        --accent-mid: rgba(251, 122, 32, 0.18);
        --blue-dim: rgba(63, 121, 173, 0.1);

        --nav-bg: rgba(255, 255, 255, 0.85);
        --nav-link-hover-bg: rgba(0, 0, 0, 0.05);
        --row-stripe: rgba(0, 0, 0, 0.02);
        --row-hover: rgba(251, 122, 32, 0.06);
        --code-color: #c7500e;
        --btn-primary-text: #ffffff;
        --noise-opacity: 0.015;
        --orb1-opacity: 0.06;
        --orb2-opacity: 0.06;
    }
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: var(--noise-opacity);
    pointer-events: none;
    z-index: 0;
}

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

/* --- Glow orbs --- */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}
.orb-1 { width: 600px; height: 600px; top: -200px; left: -100px; background: rgba(251, 122, 32, var(--orb1-opacity)); }
.orb-2 { width: 500px; height: 500px; bottom: 20%; right: -150px; background: rgba(63, 121, 173, var(--orb2-opacity)); }

/* --- Logo switching --- */
.logo-light { display: none; }
.logo-dark { display: block; }

@media (prefers-color-scheme: light) {
    .logo-light { display: block; }
    .logo-dark { display: none; }
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    margin-top: var(--sp-4);
    margin-bottom: var(--sp-2);
    color: var(--text);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.8rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.03em; }

p { margin: 0 0 var(--sp-2); }

ul, ol {
    margin: 0 0 var(--sp-2);
    padding-left: var(--sp-3);
}

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

/* --- Links --- */
a {
    color: var(--orange);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--orange-hover); }

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--sp-4);
}

main {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--sp-4) var(--sp-4) var(--sp-6);
}

article { max-width: 100%; }

/* --- Navigation --- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.site-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-brand img { height: 28px; }

/* Hamburger toggle (CSS-only) */
.nav-toggle { display: none; }

.nav-toggle-label {
    display: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.3rem;
    padding: var(--sp-1);
    line-height: 1;
    transition: color 0.2s;
}

.nav-toggle-label:hover { color: var(--text); }

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-links a {
    display: block;
    padding: 0.4rem 0.9rem;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--nav-link-hover-bg);
    box-shadow: 0 0 12px rgba(251, 122, 32, 0.5), 0 0 35px rgba(251, 122, 32, 0.25), 0 0 70px rgba(251, 122, 32, 0.1);
}

.nav-cta {
    color: var(--orange) !important;
    border: 1px solid var(--accent-mid) !important;
    background: var(--accent-dim) !important;
    font-family: var(--font-mono) !important;
    font-size: 12px !important;
    letter-spacing: 0.02em;
}

.nav-cta:hover {
    background: var(--accent-mid) !important;
    border-color: rgba(251, 122, 32, 0.5) !important;
    color: var(--orange) !important;
    box-shadow: var(--glow) !important;
}

/* Responsive nav */
@media (max-width: 768px) {
    .nav-toggle-label { display: block; }

    .site-nav .container {
        flex-wrap: wrap;
        height: auto;
        min-height: 64px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: var(--sp-1) 0 var(--sp-2);
        gap: 0;
    }

    .nav-links li { width: 100%; }

    .nav-links a {
        padding: 0.6rem var(--sp-2);
        border-radius: 0;
    }

    .nav-toggle:checked ~ .nav-links { display: flex; }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: middle;
}

.btn-primary {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--btn-primary-text);
}

.btn-primary:hover {
    background: var(--orange-hover);
    border-color: var(--orange-hover);
    color: var(--btn-primary-text);
    transform: translateY(-1px);
    box-shadow: var(--glow);
}

.btn-accent {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: var(--text);
}

.btn-accent:hover {
    background: var(--blue-mid);
    border-color: var(--blue-mid);
    color: var(--btn-primary-text);
    transform: translateY(-1px);
    box-shadow: var(--glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--glow);
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: var(--sp-2) 0 var(--sp-3);
    font-size: 0.875rem;
    border: 2px solid var(--orange);
    border-radius: 8px;
    overflow: hidden;
}

thead th,
thead td {
    background: var(--bg3);
    color: var(--orange);
    font-weight: 600;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-strong);
    border-right: 1px solid var(--border-strong);
    font-size: 13px;
    letter-spacing: 0.01em;
}

thead th:last-child,
thead td:last-child { border-right: none; }

tbody td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-strong);
    border-right: 1px solid var(--border-strong);
    color: var(--text);
}

tbody td:last-child { border-right: none; }

tbody tr { transition: background 0.2s; }

tbody tr:nth-child(even) { background: var(--row-stripe); }

tbody tr:hover { background: var(--row-hover); }

/* Horizontal scroll wrapper for mobile */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--sp-2) 0 var(--sp-3);
}
.table-wrap table { margin: 0; }

/* --- Blockquotes --- */
blockquote {
    margin: var(--sp-2) 0;
    padding: var(--sp-2) var(--sp-3);
    border-left: 3px solid var(--orange);
    background: var(--bg2);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
}

blockquote p:last-child { margin-bottom: 0; }

/* --- Code --- */
code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--code-color);
    background: var(--bg3);
    padding: 0.15em 0.45em;
    border-radius: 4px;
}

pre {
    padding: var(--sp-2);
    margin: 0 0 var(--sp-2);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    white-space: pre;
    font-size: inherit;
    color: inherit;
}

/* --- Card panels (for content sections) --- */
.card-panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.card-panel:hover { border-color: var(--border-hover); box-shadow: var(--glow); }

/* --- Shortcode: h1-centered --- */
.h1-centered {
    text-align: center;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-top: var(--sp-5);
    margin-bottom: var(--sp-4);
}

/* --- Shortcode: columns --- */
.md-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
    margin: var(--sp-3) 0;
}

.md-columns div.markdown-inner {
    padding: var(--sp-3);
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.md-columns div.markdown-inner:hover {
    border-color: var(--border-hover);
    box-shadow: var(--glow);
}

.md-columns .markdown-inner {
    margin-top: 0;
    margin-bottom: 0;
}

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

/* --- Shortcode: nick profile --- */
.nick-profile { text-align: center; }

.nick-profile img {
    border-radius: 50%;
    max-width: 180px;
}

/* Nick shortcode inline (in about page) */
article img[alt="Nick"] {
    border-radius: 50%;
    border: 2px solid var(--border);
}

article small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: var(--sp-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-2);
    max-width: 1100px;
    margin: 0 auto;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.footer-left img {
    height: 22px;
    opacity: 0.6;
}

.site-footer p {
    margin: 0;
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 300;
}

.site-footer a {
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover { color: var(--orange); }

.footer-links {
    display: flex;
    gap: var(--sp-3);
}

/* --- 404 page --- */
.error-page {
    text-align: center;
    padding: var(--sp-6) 0;
}

.error-page h1 {
    font-size: clamp(3rem, 8vw, 4rem);
    margin-bottom: var(--sp-2);
}

.error-page p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--sp-4);
}

/* --- Utilities --- */
.heart { color: #e31b23; }

.rclone-logo { height: 28px; }


/* iframe responsiveness (for stats embeds) */
iframe {
    max-width: 100%;
    border-radius: 8px;
}

/* ==========================================================================
   Homepage - Hero, Sections, Cards, Stats, Sponsor Tiers
   ========================================================================== */

/* --- Hero --- */
.hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 120px var(--sp-4) 100px;
    max-width: 860px;
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--orange);
    background: var(--accent-dim);
    border: 1px solid rgba(251, 122, 32, 0.2);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 2rem;
    animation: fadeUp 0.6s ease both;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1.0;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-top: 0;
    animation: fadeUp 0.6s 0.1s ease both;
}

.hero-title .accent {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--orange);
    display: block;
}

@media (max-width: 768px) {
    .hero-title .accent {
        color: var(--orange);
        -webkit-text-stroke: 0;
    }
}

.hero-sub {
    margin-top: 1.5rem;
    font-size: 1.15rem;
    font-weight: 300;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.7;
    animation: fadeUp 0.6s 0.2s ease both;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeUp 0.6s 0.3s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Divider --- */
.divider {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 var(--sp-4);
    max-width: 1100px;
    margin: 0 auto;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* --- Sections (two-column layout) --- */
.section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 5rem 0;
    border-bottom: 1px solid var(--border);
}

.section:last-child { border-bottom: none; }
.section.reverse { direction: rtl; }
.section.reverse > * { direction: ltr; }

.section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--orange);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-label::before {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--orange);
}

.section-heading {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
    margin-top: 0;
}

.section-body {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.section-body strong {
    color: var(--text);
    font-weight: 500;
}

.section-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-links .btn { width: fit-content; }

/* --- Panel headings & icons --- */
.panel-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-dim);
    border: 1px solid rgba(251, 122, 32, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel-icon svg { width: 16px; height: 16px; }

.panel-note {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 300;
    line-height: 1.6;
}

.panel-note a { color: var(--orange); text-decoration: none; }
.panel-note a:hover { text-decoration: underline; }

/* --- Feature list (checkmark bullets) --- */
.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-left: 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 300;
}

.feature-list li::before {
    content: '';
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid rgba(251, 122, 32, 0.25);
    position: relative;
    top: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23FB7A20' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}

/* --- Stats grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.stats-grid:hover {
    border-color: var(--border-hover);
    box-shadow: var(--glow);
}

.stat {
    background: var(--bg2);
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--orange);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* --- Sponsor tiers --- */
.sponsor-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sponsor-tier {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sponsor-tier:hover { border-color: var(--border-hover); box-shadow: var(--glow); }

.tier-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tier-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.tier-desc {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 300;
}

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

@media (max-width: 768px) {
    main { padding: var(--sp-2) var(--sp-2) var(--sp-5); }

    .hero { padding: 80px var(--sp-2) 60px; }

    .section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section.reverse { direction: ltr; }

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

    .stats-grid .stat:last-child { grid-column: 1 / -1; }

    .sponsor-tier {
        flex-wrap: wrap;
    }

    .tier-desc {
        width: 100%;
        padding-left: 20px;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--sp-3) var(--sp-2);
    }

    .footer-links { flex-wrap: wrap; }
}
