/* fmlabs — dark, minimal, futuristic */

:root {
    --bg: #050607;
    --fg: #e6e8ea;
    --muted: #6b7178;
    --faint: #2a2e33;
    --line: rgba(230, 232, 234, 0.08);
    --accent: #7df9ff;
    --accent-dim: rgba(125, 249, 255, 0.14);

    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

    color-scheme: dark;
}

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

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* background: starfield canvas, injected and animated by app.js (slow warp through space) */
.space {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

/* background: two soft nebula fields slowly moving behind the stars */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background:
        radial-gradient(40vmax 40vmax at 30% 35%, rgba(125, 249, 255, 0.06), transparent 70%),
        radial-gradient(45vmax 45vmax at 70% 65%, rgba(120, 90, 255, 0.05), transparent 70%);
    background-size: 200% 200%;
    animation: glow-move 40s ease-in-out infinite alternate;
}

@keyframes glow-move {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 60% 40%; }
    100% { background-position: 100% 100%; }
}

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

::selection {
    background: var(--accent);
    color: var(--bg);
}

/* ---------- navigation ---------- */

.nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 28px;
    padding: 24px 32px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    z-index: 10;
}

.nav a,
.nav button {
    color: var(--muted);
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav a:hover,
.nav button:hover,
.nav a:focus-visible,
.nav button:focus-visible {
    color: var(--fg);
    outline: none;
}

/* ---------- landing ---------- */

.hero {
    min-height: 100%;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 0 16px;
}

/* landing: header bar with wordmark top left and login button top right */
.landing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
}

/* subtle header-bar wordmark, top left, in the glow colours (cyan → violet), slowly shifting */
.landing .wordmark {
    font-family: "Unbounded", var(--sans);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    background: linear-gradient(90deg, #7df9ff 0%, #8f7bff 50%, #7df9ff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: title-glow 16s ease-in-out infinite alternate;
}

@keyframes title-glow {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}

/* landing: centre block with the service keywords and the inquire button */
.intro {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 0 16px;
    pointer-events: none;
}

.intro > * {
    pointer-events: auto;
}

.services {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 36px;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--fg);
}

.services li {
    position: relative;
    animation: appear 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.services li:nth-child(2) { animation-delay: 0.2s; }
.services li:nth-child(3) { animation-delay: 0.4s; }

/* thin cyan separator between the keywords */
.services li + li::before {
    content: "";
    position: absolute;
    left: -19px;
    top: 50%;
    width: 3px;
    height: 3px;
    background: var(--accent);
    opacity: 0.6;
    transform: translateY(-50%);
}

.inquire-cta {
    animation-delay: 0.7s;
}

/* notice shown when javascript is disabled (popups won't work) */
/* plain status line with hairlines either side, so it doesn't read as a button */
.noscript {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

.noscript::before,
.noscript::after {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--faint);
}

/* inquire popup: a bit wider for the message field */
dialog.inquire {
    width: min(440px, calc(100vw - 32px));
}

/* compact button so it sits in the header bar */
.landing .login-cta {
    padding: 8px 18px;
}

.login-cta {
    padding: 12px 28px;
    background: transparent;
    border: 1px solid var(--faint);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    animation: appear 1.6s 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.login-cta:hover,
.login-cta:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
    outline: none;
}

.wordmark {
    margin: 0;
    font-family: var(--sans);
    font-weight: 200;
    font-size: clamp(2.5rem, 9vw, 6rem);
    letter-spacing: -0.04em;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, #8a9098 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: appear 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 32px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--faint);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

/* ---------- content pages ---------- */

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 120px 32px 96px;
}

.back {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-bottom: 64px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.back:hover,
.back:focus-visible {
    color: var(--fg);
    transform: translateX(-3px);
    outline: none;
}

.page h1 {
    margin: 0 0 48px;
    font-weight: 200;
    font-size: 2.25rem;
    letter-spacing: -0.02em;
}

.page h2 {
    margin: 40px 0 8px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.page p {
    margin: 0 0 12px;
    color: #b8bdc2;
}

.page a {
    border-bottom: 1px solid var(--faint);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.page a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* contact: key/value list */
.kv {
    margin: 0;
    display: grid;
    grid-template-columns: 96px 1fr;
    row-gap: 20px;
    column-gap: 24px;
}

.kv dt {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--muted);
    padding-top: 3px;
}

.kv dd {
    margin: 0;
}

.kv address {
    font-style: normal;
}

.mono {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.02em;
    word-break: break-word;
}

/* ---------- login dialog ---------- */

dialog.login {
    width: min(360px, calc(100vw - 32px));
    padding: 40px 32px 32px;
    background: rgba(10, 12, 14, 0.92);
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(125, 249, 255, 0.04), 0 40px 120px rgba(0, 0, 0, 0.8);
}

dialog.login[open] {
    animation: appear 0.35s ease both;
}

dialog.login::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.login h2 {
    margin: 0 0 28px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: var(--muted);
}

.login .close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.login .close:hover {
    color: var(--fg);
}

.field {
    display: block;
    margin-bottom: 20px;
}

.field span {
    display: block;
    margin-bottom: 6px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--muted);
}

.field input,
.field textarea {
    width: 100%;
    resize: vertical;
    padding: 8px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--faint);
    color: var(--fg);
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
}

.submit {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--faint);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.submit:hover,
.submit:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
    outline: none;
}

.login-status {
    min-height: 1.2em;
    margin: 16px 0 0;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    text-align: center;
}

/* ---------- 404 ---------- */

.not-found .code {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--accent);
    margin-bottom: 16px;
}

/* ---------- motion ---------- */

@keyframes appear {
    from { opacity: 0; transform: translateY(8px); filter: blur(6px); }
    to   { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 520px) {
    .nav { gap: 18px; padding: 20px 16px; }
    .landing { padding: 16px; }
    .services { flex-direction: column; align-items: center; font-size: 12px; }
    .services li + li::before { display: none; }
    .footer { display: none; }
    .page { padding: 96px 16px 64px; }
    .kv { grid-template-columns: 1fr; row-gap: 4px; }
    .kv dd { margin-bottom: 16px; }
}
