/* ApexDesk website. One stylesheet, no dependencies.
   The home page opens with a dark launch stage (name, line, the apps in a
   collage, the figures) and goes on as a sober site that follows the
   visitor's light or dark mode. */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

    --bg: #ffffff;
    --bg-alt: #f5f6f9;
    --surface: #ffffff;
    --text: #0b0e16;
    --muted: #4a5163;
    --faint: #677086;
    --line: #e3e6ee;
    --accent: #1f5eff;
    --accent-text: #1a4fd6;
    --accent-soft: #e9efff;
    --shadow: 0 1px 2px rgba(10, 20, 50, .06), 0 16px 40px -16px rgba(10, 20, 50, .22);

    /* the launch stage, the same in both modes */
    --ink: #020308;
    --ink-2: #070a14;
    --ink-text: #f6f8fd;
    --ink-muted: #a9b2c7;
    --ink-faint: #7f889e;
    --ink-line: rgba(255, 255, 255, .09);
    --c1: #2f6bff;
    --c2: #22c6ff;
    --c3: #9b5cff;
    --c4: #ff4fa3;

    --radius: 18px;
    --wrap: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0c12;
        --bg-alt: #10131b;
        --surface: #141823;
        --text: #eef1f8;
        --muted: #b1b8c9;
        --faint: #8d95a8;
        --line: #232838;
        --accent: #3b74ff;
        --accent-text: #8fb0ff;
        --accent-soft: #16213d;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.6 var(--font);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.025em; margin: 0 0 .5em; }
h2 { font-size: clamp(30px, 4.4vw, 52px); font-weight: 750; }
h3 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding-left: 1.2em; }
li { margin: .3em 0; }
code { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 3px solid var(--c2); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #000; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.todo { display: inline-block; font: 600 12px/1 var(--mono); background: #ffe7a3; color: #5a3d00; padding: 3px 6px; border-radius: 5px; vertical-align: middle; }

/* ---------- header ---------- */

.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: inherit; text-decoration: none; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: var(--text); }
.nav a.lang { border: 1px solid var(--line); }
.nav a.nav-cta { background: var(--text); color: var(--bg); font-weight: 600; margin-left: 6px; }
.nav a.nav-cta:hover { opacity: .88; }

/* On the home page the header floats over the dark stage. */
.home .site-header { position: absolute; left: 0; right: 0; background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.home .site-header .brand { color: var(--ink-text); }
.home .site-header .nav a { color: var(--ink-muted); }
.home .site-header .nav a:hover { color: var(--ink-text); }
.home .site-header .nav a.lang { border-color: var(--ink-line); }
.home .site-header .nav a.nav-cta { background: var(--ink-text); color: var(--ink); }

@media (max-width: 860px) {
    .nav a:not(.lang):not(.nav-cta) { display: none; }
}

/* ---------- buttons ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, box-shadow .2s ease, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- the launch stage ---------- */

.stage { position: relative; background: var(--ink); color: var(--ink-text); overflow: hidden; isolation: isolate; }
.stage::before {
    content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1;
    background:
        radial-gradient(40% 35% at 50% 18%, rgba(47, 107, 255, .45), transparent 70%),
        radial-gradient(30% 30% at 22% 38%, rgba(155, 92, 255, .30), transparent 70%),
        radial-gradient(30% 30% at 80% 36%, rgba(34, 198, 255, .28), transparent 70%);
    filter: blur(10px);
}
.stage::after { /* fine grid, fading out */
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
    background-image: linear-gradient(var(--ink-line) 1px, transparent 1px), linear-gradient(90deg, var(--ink-line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(70% 45% at 50% 20%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(70% 45% at 50% 20%, #000 20%, transparent 75%);
}

.hero { text-align: center; padding: clamp(120px, 17vh, 190px) 0 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 22px; }
.eyebrow::before, .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .5; }
.hero-name {
    font-size: clamp(64px, 11vw, 164px); font-weight: 800; letter-spacing: -.055em; line-height: .92; margin: 0 0 .18em;
    background: linear-gradient(180deg, #fff 30%, #b9c6e8 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
    padding-bottom: .06em;
}
.hero-line { font-size: clamp(24px, 3.4vw, 42px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; margin: 0 auto 18px; max-width: 18em; }
.hero-line em { font-style: normal; background: linear-gradient(90deg, var(--c2), var(--c1) 45%, var(--c3) 80%, var(--c4)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--ink-muted); font-size: clamp(17px, 1.6vw, 20px); max-width: 36em; margin: 0 auto 34px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-cta .btn-primary { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 10px 40px -6px rgba(47, 107, 255, .8); }
.hero-cta .btn-ghost { background: transparent; color: var(--ink-text); border-color: rgba(255,255,255,.22); }
.hero-note { margin: 16px 0 0; font-size: 14px; color: var(--ink-faint); }

/* The apps, overlapping: a fan of real windows in perspective. */
.collage { position: relative; height: clamp(300px, 50vw, 700px); margin: clamp(48px, 7vw, 88px) auto 0; max-width: 1400px; perspective: 2200px; }
.win {
    position: absolute; left: 50%; top: 0; width: 58%; margin: 0;
    border-radius: 12px; overflow: hidden; background: #fff;
    box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 40px 80px -20px rgba(0,0,0,.8), 0 20px 50px -10px rgba(30, 60, 160, .45);
    transform-style: preserve-3d;
    transition: transform 1.1s cubic-bezier(.2, .8, .2, 1), opacity 1.1s ease;
    will-change: transform;
}
.win img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.win figcaption { position: absolute; left: 12px; bottom: 12px; font-size: 13px; font-weight: 600; color: #fff; background: rgba(5, 8, 20, .72); padding: 5px 11px; border-radius: 999px; backdrop-filter: blur(6px); }
/* resting places, back to front */
.win.w-pdf    { --x: -122%; --y: -10%; --r: 18deg;  --z: -300px; z-index: 1; width: 42%; }
.win.w-db     { --x:  22%;  --y: -10%; --r: -18deg; --z: -300px; z-index: 1; width: 42%; }
.win.w-doc    { --x: -98%;  --y: 36%;  --r: 12deg;  --z: -140px; z-index: 2; width: 48%; }
.win.w-slides { --x: -2%;   --y: 36%;  --r: -12deg; --z: -140px; z-index: 2; width: 48%; }
.win.w-sheet  { --x: -50%;  --y: 34%;  --r: 0deg;   --z: 0;      z-index: 3; }
.win.w-pdf figcaption, .win.w-db figcaption { bottom: auto; top: 12px; }
.win.w-db figcaption, .win.w-slides figcaption { left: auto; right: 12px; }
.win { transform: translate3d(var(--x), var(--y), var(--z)) rotateY(var(--r)) rotateX(var(--tilt, 0deg)); }
/* before they come in (only with JavaScript and motion) */
.js .collage:not(.in) .win { transform: translate3d(-50%, 30%, -400px) rotateX(18deg); opacity: 0; }
.js .collage:not(.in) .w-sheet { transform: translate3d(-50%, 18%, 0) rotateX(12deg); }
.collage .win:nth-child(2), .collage .win:nth-child(3) { transition-delay: .12s; }
.collage .win:nth-child(4), .collage .win:nth-child(5) { transition-delay: .24s; }
.collage::after { /* the floor fades the windows into the next band */
    content: ""; position: absolute; left: -10%; right: -10%; bottom: -2px; height: 45%; z-index: 5; pointer-events: none;
    background: linear-gradient(transparent, var(--ink) 92%);
}

@media (max-width: 720px) {
    .win { width: 86%; }
    .win.w-sheet  { --x: -50%; --y: 22%; }
    .win.w-doc    { --x: -88%; --y: 0;   width: 70%; }
    .win.w-slides { --x: -12%; --y: 0;   width: 70%; }
    .win.w-pdf, .win.w-db { display: none; }
    .collage { height: 78vw; perspective: 1400px; }
    .win figcaption { display: none; }
}

/* The figures */
.figures { position: relative; z-index: 6; padding: 24px 0 clamp(80px, 10vw, 130px); }
.figures-head { text-align: center; max-width: 780px; margin: 0 auto clamp(40px, 6vw, 72px); }
.figures-head h2 { color: var(--ink-text); }
.figures-head p { color: var(--ink-muted); font-size: 19px; }
.kicker { display: block; font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c2); margin-bottom: 14px; }
.big-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--ink-line); border: 1px solid var(--ink-line); border-radius: var(--radius); overflow: hidden; margin-bottom: clamp(40px, 6vw, 64px); }
.big-fig { background: var(--ink-2); padding: clamp(24px, 3.4vw, 44px); }
.big-fig .n { display: block; font-size: clamp(54px, 8vw, 104px); font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; margin-bottom: 14px;
    background: linear-gradient(180deg, #fff, #9fb4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-fig .n small { font-size: .42em; letter-spacing: -.02em; margin-left: .08em; }
.big-fig p { color: var(--ink-muted); margin: 0; font-size: 16px; }
.big-fig strong { color: var(--ink-text); font-weight: 600; }
@media (max-width: 760px) { .big-figs { grid-template-columns: 1fr; } }

.compare { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.4vw, 28px); }
.cmp { background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: var(--radius); padding: clamp(20px, 2.6vw, 32px); }
.cmp h3 { color: var(--ink-text); font-size: 17px; margin-bottom: 4px; }
.cmp .how { color: var(--ink-faint); font-size: 14px; margin-bottom: 20px; }
.bar { display: grid; grid-template-columns: 9.5em 1fr; align-items: center; gap: 12px; margin: 10px 0; font-size: 14px; color: var(--ink-muted); }
.bar .track { position: relative; height: 30px; border-radius: 8px; background: rgba(255,255,255,.04); }
.bar .fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 50%); border-radius: 8px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: flex-end; padding: 0 10px; color: var(--ink-text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); min-width: 6px; }
.bar .fill.out { padding: 0; }
.bar .fill.out .v { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
.bar.us { color: var(--ink-text); font-weight: 600; }
.bar.us .fill { background: linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 0 24px -4px rgba(34, 198, 255, .6); }
.js .compare:not(.in) .fill { width: 0 !important; }
.fine { font-size: 13px; color: var(--ink-faint); margin: 28px 0 0; text-align: center; }
.fine a { color: var(--ink-muted); }
@media (max-width: 860px) { .compare { grid-template-columns: 1fr; } .bar { grid-template-columns: 7.5em 1fr; } }

/* ---------- the sober site ---------- */

section { padding: clamp(72px, 9vw, 120px) 0; }
section.alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head p { color: var(--muted); font-size: 19px; }
.section-head .kicker { color: var(--accent-text); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card p, .card li { color: var(--muted); }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 18px; }
.card .ico svg { width: 22px; height: 22px; }
.without { margin-top: clamp(40px, 5vw, 64px); }
.without-title { font-size: 24px; margin-bottom: 20px; }

/* One band per app: a big window next to what it does. */
.app { display: grid; grid-template-columns: 1fr 1.35fr; gap: clamp(28px, 5vw, 72px); align-items: center; padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.app:first-of-type { border-top: 0; padding-top: 0; }
.app.flip { grid-template-columns: 1.35fr 1fr; }
.app.flip .app-text { order: 2; }
.app-text .num { font: 600 14px/1 var(--mono); color: var(--accent-text); letter-spacing: .06em; }
.app-text h3 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; margin: 12px 0 14px; }
.app-text > p { color: var(--muted); font-size: 18px; }
.app-text ul { list-style: none; padding: 0; margin: 18px 0; }
.app-text li { position: relative; padding-left: 26px; color: var(--muted); }
.app-text li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.fmts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fmts li { padding: 0 !important; margin: 0; }
.fmts li::before { display: none; }
.fmts code { display: inline-block; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; color: var(--text); }
.shot { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 70px -30px rgba(10, 20, 60, .45), 0 8px 20px -10px rgba(10, 20, 60, .25); background: #fff; }
.shot img { width: 100%; }
@media (max-width: 900px) {
    .app, .app.flip { grid-template-columns: 1fr; }
    .app.flip .app-text { order: 0; }
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--bg-alt); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

.closing { text-align: center; }
.closing h2 { margin-bottom: 18px; }
.closing p { color: var(--muted); font-size: 19px; margin-bottom: 28px; }
.closing .hero-cta .btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 30px -10px var(--accent); }
.closing .hero-cta .btn-ghost { color: var(--text); border-color: var(--line); background: var(--surface); }

/* ---------- inner pages ---------- */

.page-head { background: var(--ink); color: var(--ink-text); padding: clamp(56px, 8vw, 96px) 0; position: relative; overflow: hidden; isolation: isolate; }
.page-head::before { content: ""; position: absolute; inset: -40% 10% auto; height: 160%; z-index: -1; background: radial-gradient(45% 45% at 50% 30%, rgba(47, 107, 255, .40), transparent 70%); }
.page-head h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 800; letter-spacing: -.045em; }
.page-head p { color: var(--ink-muted); font-size: 19px; margin: 0; max-width: 40em; }
.notice { background: #fff6dc; color: #4d3800; border: 1px solid #f0d98a; border-radius: 12px; padding: 14px 18px; margin-bottom: 28px; }
@media (prefers-color-scheme: dark) { .notice { background: #2a2310; color: #f3e2a8; border-color: #5a4a18; } }
.dl .card .btn { display: flex; margin: 10px 0; }
.dl .card ul { margin-top: 16px; }
.card.soon { opacity: .8; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .02em; background: var(--accent-soft); color: var(--accent-text); padding: 4px 10px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.plan { display: flex; flex-direction: column; }
.plan .btn { margin-top: auto; }
.plan h2 { font-size: clamp(26px, 2.6vw, 34px); white-space: nowrap; }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.price { font-size: 36px; font-weight: 750; letter-spacing: -.03em; margin: 10px 0 16px; }
.plan ul { margin-bottom: 24px; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 36px 0; font-size: 14px; color: var(--faint); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- reveal on scroll ---------- */

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .js .reveal, .js .collage:not(.in) .win { opacity: 1; transform: none; }
    .js .collage:not(.in) .win { transform: translate3d(var(--x), var(--y), var(--z)) rotateY(var(--r)); }
    .js .compare:not(.in) .fill { width: var(--w) !important; }
}

h1, h2, h3, .hero-line { text-wrap: balance; }

/* Business band: dark, so it reads as its own pitch between the sober sections. */
section.biz { position: relative; background: var(--ink); color: var(--ink-text); overflow: hidden; isolation: isolate; }
section.biz::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(50% 60% at 85% 0%, rgba(47, 107, 255, .28), transparent 70%), radial-gradient(40% 50% at 0% 100%, rgba(155, 92, 255, .2), transparent 70%);
}
.biz-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 64px; align-items: end; margin-bottom: 56px; }
.biz-head h2 { color: #fff; margin: 10px 0 0; }
.biz-head p { color: var(--ink-muted); font-size: 18px; margin: 0 0 24px; }
.biz-head .hero-cta { justify-content: flex-start; }
.biz .kicker { color: var(--c2); }
.biz .card { background: rgba(255, 255, 255, .04); border-color: var(--ink-line); }
.biz .card h3 { color: #fff; }
.biz .card p { color: var(--ink-muted); }
.biz .card .ico { background: rgba(34, 198, 255, .12); color: var(--c2); }
@media (max-width: 860px) { .biz-head { grid-template-columns: 1fr; } }

/* Pricing: who can use it for free */
.fine-print { color: var(--faint); font-size: 15px; margin-top: 24px; }

/* Pricing: who can use it for free */
.free-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .free-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .free-grid { grid-template-columns: 1fr; } }

.ms-note { max-width: 46em; margin: 32px auto 0; text-align: center; color: var(--ink-muted); font-size: 16px; }
.ms-note strong { color: var(--ink-text); }
.ms-note a { color: var(--c2); }
