/* FileGenie Meridian design system
 * A quiet, editorial interface for high-trust file operations. The existing
 * structure remains data-driven; this layer re-art-directs shared components
 * consistently across every route and workspace.
 */
:root {
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --brand: #635bff;
    --brand-dark: #4b44d5;
    --accent: #18b6c9;
    --cyan: #18b6c9;
    --emerald: #16a579;
    --bg: #f5f7fb;
    --bg-alt: #eaf0f8;
    --bg-elev: #ffffff;
    --surface: rgba(255, 255, 255, .82);
    --border: #d9e1ee;
    --text: #111a2e;
    --text-muted: #536079;
    --text-faint: #66738b;
    --shadow-sm: 0 2px 8px rgba(19, 34, 62, .06);
    --shadow-md: 0 14px 34px rgba(19, 34, 62, .10);
    --shadow-lg: 0 28px 70px rgba(19, 34, 62, .16);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 26px;
    --header-h: 76px;
}

[data-theme="dark"] {
    --brand: #8d86ff;
    --brand-dark: #b0acff;
    --accent: #43d5de;
    --cyan: #43d5de;
    --emerald: #55d6aa;
    --bg: #080d18;
    --bg-alt: #0e1727;
    --bg-elev: #131e31;
    --surface: rgba(19, 30, 49, .82);
    --border: #273750;
    --text: #eff4ff;
    --text-muted: #a7b4cb;
    --text-faint: #8491aa;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .22);
    --shadow-md: 0 18px 38px rgba(0, 0, 0, .28);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, .42);
}

html { scroll-behavior: smooth; }
body { letter-spacing: -.008em; background: var(--bg); }
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .32;
    background: radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 31rem);
}
.skip-link {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 300;
    padding: 10px 14px;
    color: #fff;
    background: var(--brand-dark);
    border-radius: 8px;
    transform: translateY(-160%);
    transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom-color: color-mix(in srgb, var(--border) 72%, transparent);
}
.header-inner { gap: 22px; }
.brand { gap: 11px; }
.brand-mark { filter: drop-shadow(0 5px 10px color-mix(in srgb, var(--brand) 26%, transparent)); }
.brand-name { font-size: 1.16rem; letter-spacing: -.04em; }
.brand-name b { color: var(--brand); }
.primary-nav { gap: 2px; }
.nav-link { padding: 10px 13px; font-size: .86rem; letter-spacing: .01em; }
.nav-link:hover { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.search-trigger, .theme-toggle, .nav-burger {
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.search-trigger { padding: 9px 12px; }
.theme-toggle { width: 42px; height: 42px; }

.section { padding: clamp(60px, 8vw, 104px) 0; }
.section-alt { background: color-mix(in srgb, var(--bg-alt) 64%, transparent); }
.section-head { margin-bottom: 30px; }
.section-head h2, .page-head h1 { letter-spacing: -.05em; }
.page-head { max-width: 760px; margin-bottom: 38px; }
.page-head h1 { font-size: clamp(2.35rem, 5vw, 4.4rem); line-height: .98; }
.page-sub { font-size: 1.05rem; line-height: 1.75; }

.fg-hero {
    min-height: min(790px, calc(100vh - var(--header-h)));
    display: grid;
    align-items: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg) 88%, var(--brand)), var(--bg) 62%);
}
.fg-hero::before { opacity: .18; background-size: 96px 96px; }
.fg-hero-copy h1 { font-size: clamp(3.5rem, 6.5vw, 7rem); line-height: .91; letter-spacing: -.085em; }
.fg-hero-copy h1 em { color: transparent; background: linear-gradient(110deg, var(--brand), var(--accent)); background-clip: text; -webkit-background-clip: text; }
.fg-hero-copy .hero-sub { font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 540px; }
.fg-hero-copy .badge { border-radius: 9px; background: color-mix(in srgb, var(--surface) 76%, var(--brand)); }
.hero-cta .btn { min-height: 52px; border-radius: 12px; }
.btn { border-radius: 11px; letter-spacing: -.01em; }
.btn-primary { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--accent))); box-shadow: 0 12px 22px color-mix(in srgb, var(--brand) 25%, transparent); }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); transform: translateY(-1px); }
.btn-ghost { background: color-mix(in srgb, var(--surface) 75%, transparent); }
.hero-stats strong { font-size: 1.55rem; }

.fg3d-stage { border-radius: 28px; box-shadow: var(--shadow-lg), inset 0 1px rgba(255,255,255,.24); }
.fg3d-scene-kicker, .fg3d-scene-footer { letter-spacing: .14em; font-size: .58rem; }
.fg-story { background: color-mix(in srgb, var(--bg-alt) 45%, transparent); }
.fg-story-step { border-left-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.fg-story-step.is-active { border-left-color: var(--brand); }

.tool-grid { gap: 14px; }
.tool-card, .category-card, .privacy-item, .side-card, .tool-workspace, .tool-info, .faq-item {
    background: var(--surface);
    border-color: color-mix(in srgb, var(--border) 85%, transparent);
    box-shadow: var(--shadow-sm);
}
.tool-card { min-height: 172px; padding: 20px; border-radius: 15px; position: relative; overflow: hidden; }
.tool-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -45px; bottom: -45px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 12%, transparent); }
.tool-card:hover, .category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 48%, var(--border)); }
.tool-icon { border-radius: 12px; background: color-mix(in srgb, var(--brand) 11%, var(--surface)); }
.tool-name { letter-spacing: -.025em; }
.tool-desc, .category-card p { line-height: 1.55; }
.category-card { border-radius: 20px; padding: 24px; }
.category-icon { border-radius: 15px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 90%, #17203a), var(--accent)); box-shadow: 0 10px 18px color-mix(in srgb, var(--brand) 19%, transparent); }
.privacy-band { gap: 14px; }
.privacy-item { border-radius: 15px; }

.tool-section { padding-top: 42px; }
.breadcrumbs { font-family: var(--mono); font-size: .69rem; letter-spacing: .02em; }
.tool-master-hero { gap: 30px; }
.tool-master-copy { padding: clamp(22px, 4vw, 48px); border: 1px solid var(--border); border-radius: 25px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, var(--brand)), var(--surface)); box-shadow: var(--shadow-md); }
.tool-header h1 { font-size: clamp(2rem, 4vw, 3.8rem); letter-spacing: -.065em; line-height: .98; }
.tool-hero-icon { border-radius: 16px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.tool-master-trust { color: var(--text-muted); font-size: .79rem; }
.tool-layout { gap: 20px; }
.tool-workspace { border-radius: 22px; padding: clamp(20px, 4vw, 38px); }
.ws-intro { border-bottom-color: var(--border); }
.dropzone { min-height: 245px; border-radius: 18px; border: 1px dashed color-mix(in srgb, var(--brand) 48%, var(--border)); background: radial-gradient(circle at center, color-mix(in srgb, var(--brand) 8%, transparent), transparent 65%), color-mix(in srgb, var(--bg-alt) 42%, var(--surface)); }
.dropzone:hover, .dropzone.drag-over { border-color: var(--brand); background-color: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.dropzone-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 16px; color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); }
.file-row { border-radius: 11px; background: color-mix(in srgb, var(--bg-alt) 55%, var(--surface)); }
.fr-order { display: inline-flex; gap: 3px; margin-left: auto; }
.fr-move { border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 6px; width: 26px; height: 26px; line-height: 1; }
.fr-move:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.fr-move:disabled { opacity: .38; cursor: not-allowed; }
.settings-panel { border-color: var(--border); }
.setting-input, .setting-select, .diff-box, .tool-list-search { border-radius: 10px; background: var(--bg-elev); }
.progress-bar { height: 9px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 12%, var(--border)); }
.progress-bar span { background: linear-gradient(90deg, var(--brand), var(--accent)); }
.result { border-radius: 16px; border-color: color-mix(in srgb, var(--emerald) 40%, var(--border)); background: color-mix(in srgb, var(--emerald) 9%, var(--surface)); }
.result-icon { color: var(--emerald); }
.side-card { border-radius: 16px; }
.related-list a:hover { color: var(--brand); }

.site-footer { background: color-mix(in srgb, var(--bg-alt) 52%, var(--bg)); }
.footer-bottom { color: var(--text-faint); }
.search-panel { border-radius: 20px; }
.search-result.active, .search-result:hover { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }

@media (max-width: 860px) {
    .fg-hero { min-height: auto; padding-top: 76px; }
    .fg-hero-copy h1 { font-size: clamp(3.25rem, 13vw, 5.4rem); }
    .fg3d-stage { height: 360px; }
    .tool-master-copy { padding: 24px; }
}
@media (max-width: 520px) {
    .container { padding-inline: 16px; }
    .fg-hero { padding-top: 54px; }
    .fg-hero-copy h1 { font-size: 3.15rem; }
    .fg-hero-copy .hero-stats { gap: 18px; }
    .fg3d-stage { height: 300px; border-radius: 20px; }
    .tool-master-copy { border-radius: 18px; padding: 20px; }
    .tool-workspace { padding: 16px; }
    .file-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .fr-size { grid-column: 2; }
    .fr-order { grid-column: 3; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .fg3d-canvas { display: none; }
    .fg3d-fallback { opacity: 1 !important; transform: none !important; }
}
