/* BackupFlow — Unslopped stylesheet aligned with iOS Design-System.md (BF tokens) */

:root {
    /* Neutral dark ramp (BF.bg / BF.surface / BF.line) */
    --bg: #0e1013;
    --bg-alt: #111419;
    --surface: #15181e;
    --surface-raised: #1c2028;
    --border: rgba(238, 240, 245, 0.08);
    --border-strong: rgba(238, 240, 245, 0.14);

    /* Three text roles */
    --text-primary: #eef0f5;
    --text-secondary: #a3a9b8;
    --text-muted: #7c8496;

    /* Single accent (BF.accent) + semantic tokens */
    --accent: #6b9eff;
    --accent-hover: #80acff;
    --accent-ink: #090c11;
    --ok: #4dc780;
    --fail: #ed5c54;

    /* Protocol identity dots (BF.proto*) */
    --proto-sftp: #2e945c;
    --proto-webdav: #7a75f5;
    --proto-ftp: #f59438;

    /* Radii (nested scale) */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-panel: 20px;

    /* Motion */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --dur-fast: 150ms;
    --dur-med: 200ms;
    --dur-enter: 360ms;

    /* Typography */
    --font-sans:
        "IBM Plex Sans",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "PingFang SC",
        "Noto Sans KR",
        "Noto Sans JP",
        "Noto Sans Devanagari",
        sans-serif;
    --font-arabic:
        "IBM Plex Sans Arabic",
        "IBM Plex Sans",
        -apple-system,
        sans-serif;
    --font-mono:
        "IBM Plex Mono",
        ui-monospace,
        SFMono-Regular,
        Menlo,
        monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    background-color: var(--bg);
    color: var(--text-primary);
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-primary);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.icon-ok {
    color: var(--ok);
}

/* Focus visibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip link */
.skip-link {
    position: absolute;
    inset-inline-start: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    inset-inline-start: 16px;
    top: 16px;
    width: auto;
    height: auto;
    z-index: 2000;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    text-decoration: none;
}

/* Container */
.container {
    max-width: 1152px;
    margin-inline: auto;
    padding-inline: 24px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 64px;
    background-color: rgba(14, 16, 19, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background-color var(--dur-fast) var(--ease);
}

.navbar.scrolled {
    background-color: rgba(14, 16, 19, 0.96);
}

.nav-container {
    max-width: 1152px;
    height: 100%;
    margin-inline: auto;
    padding-inline: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-image {
    display: block;
    border-radius: 6px;
    object-fit: cover;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding-inline: 16px;
    border-radius: var(--radius-md);
    background-color: var(--text-primary);
    color: var(--bg);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition:
        background-color var(--dur-fast) var(--ease),
        transform var(--dur-fast) var(--ease);
}

.nav-cta:hover {
    background-color: #ffffff;
}

.nav-cta:active {
    transform: scale(0.98);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding-inline: 12px;
    border-radius: var(--radius-md);
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition:
        border-color var(--dur-fast) var(--ease),
        color var(--dur-fast) var(--ease),
        background-color var(--dur-fast) var(--ease);
}

.lang-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background-color: var(--surface-raised);
}

.lang-caret {
    width: 14px;
    height: 14px;
    transition: transform var(--dur-med) var(--ease);
}

.lang-toggle[aria-expanded="true"] .lang-caret {
    transform: rotate(180deg);
}

.lang-menu {
    list-style: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 184px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    border-radius: var(--radius-lg);
    background-color: var(--surface-raised);
    border: 1px solid var(--border-strong);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition:
        opacity var(--dur-med) var(--ease),
        transform var(--dur-med) var(--ease),
        visibility var(--dur-med);
    z-index: 1100;
}

.lang-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    height: 36px;
    padding-inline: 12px;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    text-align: start;
    cursor: pointer;
    transition:
        background-color var(--dur-fast) var(--ease),
        color var(--dur-fast) var(--ease);
}

.lang-option:hover,
.lang-option:focus-visible {
    background-color: rgba(238, 240, 245, 0.06);
    color: var(--text-primary);
    outline: none;
}

.lang-option.active {
    background-color: rgba(107, 158, 255, 0.14);
    color: var(--accent);
    font-weight: 500;
}

.lang-option-code {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Hero Section */
.hero {
    padding-top: 120px;
    padding-bottom: 80px;
}

.hero-top {
    max-width: 720px;
    margin-bottom: 48px;
}

.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--ok);
    flex-shrink: 0;
}

.status-ok {
    background-color: var(--ok);
}

.status-fail {
    background-color: var(--fail);
}

.mono-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.hero-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 18px;
    line-height: 1.55;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 58ch;
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.hero-footnote {
    display: flex;
    align-items: center;
}

.quiet-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}

.quiet-link:hover {
    color: var(--text-primary);
}

.quiet-link .icon {
    width: 14px;
    height: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding-inline: 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition:
        background-color var(--dur-fast) var(--ease),
        border-color var(--dur-fast) var(--ease),
        color var(--dur-fast) var(--ease),
        transform var(--dur-fast) var(--ease);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--accent);
    color: var(--accent-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

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

.btn-secondary:hover {
    background-color: var(--surface-raised);
    border-color: rgba(238, 240, 245, 0.22);
}

.btn-full {
    width: 100%;
}

/* Hero Visual */
.hero-frame {
    padding: 8px;
    border-radius: var(--radius-panel);
    background-color: var(--surface);
    border: 1px solid var(--border);
}

.hero-banner {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    background-color: var(--bg);
}

/* Sections */
.section {
    padding-block: 96px;
    border-top: 1px solid var(--border);
}

.section-alt {
    background-color: var(--bg-alt);
}

.section-header {
    max-width: 640px;
    margin-bottom: 48px;
}

.section-title {
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-secondary);
}

/* Cards */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: border-color var(--dur-fast) var(--ease);
}

.card:hover {
    border-color: var(--border-strong);
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background-color: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.card-footnote {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Features Layout (varied rhythm: 2 wide lead cards + 6 uniform cards) */
.features-lead-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card-lead {
    gap: 24px;
    justify-content: space-between;
}

.card-lead-media {
    display: grid;
    grid-template-columns: 1fr 220px;
    align-items: center;
    gap: 24px;
}

.protocol-list {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background-color: var(--bg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.protocol-row {
    display: grid;
    grid-template-columns: 8px 72px 1fr;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding-inline: 16px;
    border-bottom: 1px solid var(--border);
}

.protocol-row:last-child {
    border-bottom: 0;
}

.proto-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.proto-sftp {
    background-color: var(--proto-sftp);
}

.proto-webdav {
    background-color: var(--proto-webdav);
}

.proto-ftp {
    background-color: var(--proto-ftp);
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.mono-detail {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.mono-muted {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-inline-start: auto;
}

.health-preview {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: var(--bg);
}

.health-preview img {
    display: block;
    width: 100%;
    height: auto;
}

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

.diff-readout {
    margin-top: 16px;
    border-radius: var(--radius-md);
    background-color: var(--bg);
    border: 1px solid var(--border);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.diff-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-code-strip {
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background-color: var(--bg);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Screenshots Section */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 24px;
}

.screenshot-card {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.device-frame {
    padding: 8px;
    border-radius: 36px;
    background-color: var(--surface);
    border: 1px solid var(--border);
}

.screenshot-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1242 / 2688;
    border-radius: 28px;
    background-color: var(--bg);
}

.screenshot-card figcaption h3 {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.screenshot-card figcaption p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Use Cases Section */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.use-case-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--dur-fast) var(--ease);
}

.use-case-card:hover {
    border-color: var(--border-strong);
}

.use-case-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
}

.use-case-body {
    padding: 24px;
}

/* Pricing Section */
.pricing-card {
    max-width: 480px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.pricing-header {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.pricing-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.price-figure {
    font-family: var(--font-mono);
    font-size: 40px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.price-period {
    font-size: 14px;
    color: var(--text-secondary);
}

.pricing-features {
    list-style: none;
    margin-bottom: 28px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-block: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.feature-item:last-child {
    border-bottom: 0;
}

.pricing-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Download Section */
.download-panel {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    padding: 40px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
}

.download-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 48ch;
    margin-bottom: 28px;
}

.download-visual {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background-color: var(--bg);
    border: 1px solid var(--border);
}

.app-icon-large {
    width: 112px;
    height: 112px;
    border-radius: 22.37%;
    border: 1px solid var(--border-strong);
    object-fit: cover;
    flex-shrink: 0;
}

.spec-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spec-row dt {
    font-size: 12px;
    color: var(--text-muted);
}

.spec-row dd {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Support Section */
.support-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.support-link {
    margin-top: auto;
    padding-top: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}

.support-link:hover {
    color: var(--accent-hover);
}

/* Footer */
.footer {
    background-color: var(--bg);
    border-top: 1px solid var(--border);
    padding-block: 56px 32px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 360px;
}

.footer-description {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-muted);
}

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

.footer-column h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.footer-column a {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 8px;
    transition: color var(--dur-fast) var(--ease);
}

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

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

/* Entrance animation (subtle, single pass) */
.reveal {
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity var(--dur-enter) var(--ease),
        transform var(--dur-enter) var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* RTL Support (Arabic) */
html[dir="rtl"] body {
    font-family: var(--font-arabic);
    font-size: 16px;
    line-height: 1.7;
}

html[dir="rtl"] .hero-title,
html[dir="rtl"] .section-title,
html[dir="rtl"] .card-title,
html[dir="rtl"] .logo-text {
    letter-spacing: 0;
    line-height: 1.35;
}

html[dir="rtl"] .icon-directional {
    transform: scaleX(-1);
}

/* Responsive */
@media (max-width: 960px) {
    .features-lead-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .download-panel {
        grid-template-columns: 1fr;
        padding: 32px;
    }

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

@media (max-width: 768px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        inset-inline-end: 24px;
        min-width: 224px;
        padding: 16px;
        border-radius: var(--radius-lg);
        background-color: var(--surface-raised);
        border: 1px solid var(--border-strong);
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .nav-menu.active {
        display: flex;
    }

    .lang-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .lang-menu {
        position: static;
        width: 100%;
        max-height: 0;
        opacity: 1;
        visibility: visible;
        overflow: hidden;
        padding: 0;
        border: 0;
        transform: none;
        margin-top: 0;
        transition: max-height var(--dur-med) var(--ease);
    }

    .lang-menu.open {
        max-height: 280px;
        margin-top: 8px;
        padding: 4px;
        border: 1px solid var(--border);
    }

    .hero {
        padding-top: 96px;
        padding-bottom: 64px;
    }

    .section {
        padding-block: 64px;
    }

    .card-lead-media {
        grid-template-columns: 1fr;
    }

    .features-grid,
    .use-cases-grid {
        grid-template-columns: 1fr;
    }

    .screenshots-grid {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 12px;
        scrollbar-width: none;
    }

    .screenshots-grid::-webkit-scrollbar {
        display: none;
    }

    .screenshot-card {
        flex: 0 0 74%;
        scroll-snap-align: start;
    }

    .download-visual {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
