/*
 * Quilix — temporary maintenance page.
 *
 * Design tokens mirror the live site's Tailwind theme (brand violet, cyan
 * accent, Space Grotesk / Inter / JetBrains Mono) so the look carries over.
 * Dark mode follows the OS unless the visitor picked a theme, which the
 * inline bootstrap in <head> applies as [data-theme].
 */

/* ------------------------------------------------------------------ Tokens */
:root {
    --brand-400: oklch(68% .21 290);
    --brand-500: oklch(60% .24 290);
    --brand-600: oklch(52% .24 290);
    --brand-700: oklch(44% .21 290);
    --accent-500: oklch(70% .2 200);

    --red-400: oklch(70.4% .191 22.216);
    --amber-400: oklch(82.8% .189 84.429);
    --amber-500: oklch(76.9% .188 70.08);
    --emerald-400: oklch(76.5% .177 163.223);

    --surface: #fff;
    --surface-muted: #f7f7f8;
    --surface-raised: #fff;
    --border: #e7e7ea;
    --fg: #0b0b0f;
    --fg-muted: #5b5b66;
    --link: var(--brand-600);
    --nav-bg: rgb(255 255 255 / .8);

    --pending-fg: oklch(50% .15 65);
    --pending-bg: oklch(96% .07 90);
    --pending-border: oklch(85% .12 80);
    --ok-fg: oklch(48% .15 150);
    --ok-bg: oklch(96% .06 145);
    --ok-border: oklch(85% .1 145);

    --radius-card: 14px;
    --shadow-card: 0 1px 2px #0f11150a, 0 8px 24px -8px #0f11151a;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    color-scheme: light;
}

/* Dark tokens: once for the OS preference, once for an explicit choice. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --surface: #0a0a0c;
        --surface-muted: #111114;
        --surface-raised: #15151a;
        --border: #23232a;
        --fg: #f4f4f7;
        --fg-muted: #9a9aa6;
        --link: var(--brand-400);
        --nav-bg: rgb(10 10 12 / .8);

        --pending-fg: oklch(85% .18 80);
        --pending-bg: oklch(25% .1 70);
        --pending-border: oklch(35% .1 70);
        --ok-fg: oklch(85% .18 145);
        --ok-bg: oklch(25% .1 145);
        --ok-border: oklch(35% .1 145);

        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --surface: #0a0a0c;
    --surface-muted: #111114;
    --surface-raised: #15151a;
    --border: #23232a;
    --fg: #f4f4f7;
    --fg-muted: #9a9aa6;
    --link: var(--brand-400);
    --nav-bg: rgb(10 10 12 / .8);

    --pending-fg: oklch(85% .18 80);
    --pending-bg: oklch(25% .1 70);
    --pending-border: oklch(35% .1 70);
    --ok-fg: oklch(85% .18 145);
    --ok-bg: oklch(25% .1 145);
    --ok-border: oklch(35% .1 145);

    color-scheme: dark;
}

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

html {
    background: var(--surface);
    color: var(--fg);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    font-family: var(--font-sans);
    font-feature-settings: "cv02", "cv11";
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

h1, h2, h3, p, dl, dd {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

svg {
    display: block;
    flex-shrink: 0;
}

code,
.mono {
    font-family: var(--font-mono);
}

code {
    font-size: .75rem;
}

::selection {
    background: var(--brand-500);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: 76rem;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* -------------------------------------------------------------- Components */
.gradient-text {
    background: linear-gradient(135deg, var(--brand-400), var(--accent-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-bg {
    background:
        radial-gradient(60% 50% at 20% 0, #8557ff2e 0%, #0000 60%),
        radial-gradient(50% 40% at 100% 10%, #00b5bd24 0%, #0000 60%);
    background:
        radial-gradient(60% 50% at 20% 0%, color-mix(in oklch, var(--brand-500) 18%, transparent) 0%, transparent 60%),
        radial-gradient(50% 40% at 100% 10%, color-mix(in oklch, var(--accent-500) 14%, transparent) 0%, transparent 60%);
}

.card {
    background-color: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .3rem .7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--fg-muted);
    font-size: .75rem;
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .12s, background .2s, color .2s, box-shadow .2s, border-color .2s, filter .2s;
}

.btn:active {
    transform: translateY(1px);
}

.btn svg {
    width: 1rem;
    height: 1rem;
    transition: transform .2s;
}

.btn:hover .arrow {
    transform: translateX(2px);
}

.btn-sm {
    font-size: .875rem;
}

.btn-sm svg {
    width: .875rem;
    height: .875rem;
}

.btn-lg {
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff;
    box-shadow: 0 6px 20px -8px var(--brand-500);
}

.btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 28px -8px var(--brand-500);
}

.btn-secondary {
    background: var(--surface-raised);
    color: var(--fg);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--surface-muted);
}

.link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--link);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-btn:hover {
    text-decoration-thickness: 2px;
}

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

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.025em;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    background: linear-gradient(to bottom right, var(--brand-500), var(--brand-700));
    color: #fff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: var(--surface-raised);
    color: var(--fg-muted);
    cursor: pointer;
    transition: color .15s;
}

.icon-btn:hover {
    color: var(--fg);
}

.icon-btn svg {
    width: 1rem;
    height: 1rem;
}

.icon-moon {
    display: none;
}

:root[data-theme="dark"] .icon-sun {
    display: none;
}

:root[data-theme="dark"] .icon-moon {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-sun {
        display: none;
    }

    :root:not([data-theme="light"]) .icon-moon {
        display: block;
    }
}

/* -------------------------------------------------------------------- Hero */
.hero {
    text-align: center;
}

.hero-inner {
    padding-block: 4.5rem 4rem;
}

.status-dot {
    position: relative;
    width: .5rem;
    height: .5rem;
    border-radius: 999px;
    background: var(--amber-500);
}

.status-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    opacity: 0;
}

.title {
    margin-top: 1.5rem;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 1.6rem + 4.5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.025em;
}

.lead {
    max-width: 40rem;
    margin: 1.5rem auto 0;
    color: var(--fg-muted);
    font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem);
    line-height: 1.6;
    text-wrap: pretty;
}

.sub {
    max-width: 36rem;
    margin: .75rem auto 0;
    color: var(--fg-muted);
    line-height: 1.6;
    text-wrap: pretty;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 2rem;
}

.meta {
    margin-top: 1.5rem;
    color: var(--fg-muted);
    font-size: .75rem;
}

/* Auto-redirect countdown pill */
.redirect {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    max-width: 100%;
    margin-top: 1.25rem;
    padding: .4rem .9rem .4rem .55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--fg-muted);
    font-size: .8125rem;
}

.redirect[hidden] {
    display: none;
}

.redirect + .meta {
    margin-top: 1.25rem;
}

.ring {
    width: 1.125rem;
    height: 1.125rem;
    transform: rotate(-90deg);
}

.ring circle {
    fill: none;
    stroke-width: 2.5;
}

.ring-track {
    stroke: var(--border);
}

.ring-fill {
    stroke: var(--brand-500);
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
}

.redirect.is-cancelled {
    padding-left: .9rem;
}

.redirect.is-cancelled .ring,
.redirect.is-cancelled .link-btn {
    display: none;
}

/* Browser-frame status card */
.frame {
    max-width: 56rem;
    margin: 3.5rem auto 0;
    overflow: hidden;
    text-align: left;
}

.frame-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.frame-dot {
    width: .75rem;
    height: .75rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.frame-dot-red { background: var(--red-400); }
.frame-dot-amber { background: var(--amber-400); }
.frame-dot-green { background: var(--emerald-400); }

.frame-url {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex: 1;
    min-width: 0;
    margin-inline: 1rem;
    padding: .25rem .75rem;
    border-radius: .375rem;
    background: var(--surface);
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: .75rem;
}

.frame-url svg {
    width: .75rem;
    height: .75rem;
}

.frame-progress {
    position: relative;
    height: 2px;
    overflow: hidden;
}

.frame-body {
    display: grid;
}

.frame-side,
.frame-main {
    padding: 1.5rem;
}

.frame-side {
    border-bottom: 1px solid var(--border);
}

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: .75rem;
    border-radius: 999px;
    background: linear-gradient(to bottom right, var(--brand-400), var(--accent-500));
    color: #fff;
}

.avatar svg {
    width: 1.5rem;
    height: 1.5rem;
}

.side-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.side-sub {
    margin-top: .25rem;
    color: var(--fg-muted);
    font-size: .875rem;
}

.kv {
    display: grid;
    gap: .375rem;
    margin-top: 1rem;
    font-size: .75rem;
}

.kv div {
    display: flex;
    gap: .5rem;
}

.kv dt {
    width: 3.25rem;
    flex-shrink: 0;
    color: var(--fg-muted);
}

.kv dd {
    font-family: var(--font-mono);
}

.label {
    margin-bottom: .5rem;
    color: var(--fg-muted);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.status-list {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.status-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem .75rem;
    border-radius: .375rem;
    background: var(--surface-muted);
    font-size: .875rem;
    font-weight: 500;
}

.row-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-family: var(--font-mono);
    font-size: .8125rem;
    color: var(--link);
}

.row-link svg {
    width: .75rem;
    height: .75rem;
}

.row-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--fg-muted);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}

.pill-pending {
    color: var(--pending-fg);
    background: var(--pending-bg);
    border-color: var(--pending-border);
}

.pill-ok {
    color: var(--ok-fg);
    background: var(--ok-bg);
    border-color: var(--ok-border);
}

.frame-note {
    margin-top: 1rem;
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: .75rem;
}

.frame-note span {
    color: var(--brand-500);
}

/* ---------------------------------------------------------------- Sections */
.section {
    padding-block: 5rem;
    scroll-margin-top: 4rem;
}

.section-muted {
    background: var(--surface-muted);
    border-block: 1px solid var(--border);
}

.section-head {
    max-width: 42rem;
    margin: 0 auto 3rem;
    text-align: center;
}

.section-head h2 {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-size: clamp(1.875rem, 1.4rem + 2vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.section-head p {
    margin-top: .75rem;
    color: var(--fg-muted);
    text-wrap: pretty;
}

.grid-3 {
    display: grid;
    gap: 1.25rem;
}

.feature {
    padding: 1.5rem;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 1rem;
    border-radius: .5rem;
    background: linear-gradient(to bottom right, var(--brand-500), var(--brand-700));
    color: #fff;
}

.feature-icon-2 {
    background: linear-gradient(to bottom right, var(--brand-500), var(--accent-500));
}

.feature-icon-3 {
    background: linear-gradient(to bottom right, var(--accent-500), var(--brand-500));
}

.feature-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.feature h3 {
    margin-bottom: .25rem;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
}

.feature p {
    color: var(--fg-muted);
    font-size: .875rem;
    line-height: 1.6;
}

.cta {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.cta h2 {
    font-family: var(--font-display);
    font-size: clamp(1.875rem, 1.2rem + 2.6vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.cta p {
    max-width: 36rem;
    margin: 1rem auto 0;
    color: var(--fg-muted);
    font-size: 1.125rem;
    text-wrap: pretty;
}

/* ------------------------------------------------------------------ Footer */
.footer {
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem;
    padding-block: 1.5rem;
    color: var(--fg-muted);
    font-size: .75rem;
}

.footer a {
    color: var(--fg);
    font-weight: 600;
}

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

/* -------------------------------------------------------------- Breakpoints */
@media (min-width: 48rem) {
    .hero-inner {
        padding-block: 6.5rem 5rem;
    }

    .frame-body {
        grid-template-columns: 1fr 2fr;
    }

    .frame-side {
        border-bottom: 0;
        border-right: 1px solid var(--border);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .cta {
        padding: 4rem;
    }
}

/* ------------------------------------------------------------------ Motion */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }

    .rise {
        animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
        animation-delay: calc(var(--d, 0) * 90ms);
    }

    .status-dot::after {
        animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
    }

    /* Indeterminate "working on it" sweep; omitted entirely for reduced motion. */
    .frame-progress::after {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 35%;
        background: linear-gradient(90deg, transparent, var(--brand-500), var(--accent-500), transparent);
        opacity: .6;
        animation: sweep 2.6s ease-in-out infinite;
    }

    .ring-fill {
        transition: stroke-dashoffset 1s linear;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

@keyframes ping {
    0% {
        opacity: .75;
        transform: scale(1);
    }
    75%,
    100% {
        opacity: 0;
        transform: scale(2.4);
    }
}

@keyframes sweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(300%); }
}
