/* ==========================================================================
   Momot Stack — modern dark skin layered on top of Source (built/screen.css)
   Overrides only: Source's markup, members, Portal and Ghost helpers are
   left as they are.
   ========================================================================== */

:root {
    --mm-bg: #0b0f19;
    --mm-surface: #111827;
    --mm-surface-2: #161f33;
    --mm-code-bg: #0a0e17;
    --mm-line: rgb(148 163 184 / 0.14);
    --mm-line-strong: rgb(148 163 184 / 0.26);
    --mm-text: #e5e9f0;
    --mm-muted: #94a3b8;
    --mm-cyan: #22d3ee;
    --mm-violet: #a78bfa;
    --mm-gradient: linear-gradient(90deg, var(--mm-cyan), var(--mm-violet));
    --mm-glow: 0 0 0 1px rgb(34 211 238 / 0.35), 0 10px 40px -10px rgb(124 58 237 / 0.45);
    --mm-radius: 14px;

    --background-color: var(--mm-bg);
    --color-darker-gray: var(--mm-text);
    --color-primary-text: var(--mm-text);
    --color-secondary-text: var(--mm-muted);
    --color-border: var(--mm-line);
    --color-dark-border: var(--mm-line-strong);
    --color-lighter-gray: rgb(148 163 184 / 0.08);
    --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-display: "Space Grotesk", var(--font-sans);
    --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: dark;
}

/* Fonts are self-hosted in the theme. Setting these on <body> takes
   precedence over any Brand-font variables Ghost puts on :root. */
body {
    --gh-font-heading: var(--font-display);
    --gh-font-body: var(--font-sans);
    background-color: var(--mm-bg);
    color: var(--mm-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgb(34 211 238 / 0.3); color: #fff; }

.is-title,
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    letter-spacing: -0.025em;
}

.is-body { font-family: var(--font-sans); }

/* Gradient text utility used on hero + highlights */
.mm-gradient-text,
.gh-header.is-classic .gh-header-title {
    background: linear-gradient(100deg, #f8fafc 20%, #a5f3fc 55%, #c4b5fd 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --- Navigation ---------------------------------------------------------- */

.gh-navigation {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgb(11 15 25 / 0.72);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--mm-line);
}

.gh-navigation::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: var(--mm-gradient);
    opacity: 0.35;
}

.gh-navigation-logo {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.gh-navigation .nav a { color: var(--mm-muted); font-weight: 500; }
.gh-navigation .nav a:hover,
.gh-navigation .nav-current a { color: var(--mm-text); opacity: 1; }

/* --- Buttons & forms ----------------------------------------------------- */

.gh-button,
.gh-form .gh-button {
    font-weight: 600;
    color: #0b0f19;
    background: var(--mm-gradient);
    border-radius: 999px;
    box-shadow: 0 6px 24px -8px rgb(34 211 238 / 0.55);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.gh-button:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 10px 32px -8px rgb(167 139 250 / 0.7);
}

.gh-form {
    background: rgb(17 24 39 / 0.8);
    border: 1px solid var(--mm-line-strong);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.gh-form:focus-within { box-shadow: var(--mm-glow); }

.gh-form-input { color: var(--mm-text); }
.gh-form-input::placeholder,
button.gh-form-input,
.gh-form > svg { color: var(--mm-muted); }

/* --- Hero: circuit / dot-grid pattern ------------------------------------ */

.gh-header.is-classic {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-bottom: 1px solid var(--mm-line);
}

.mm-hero-pattern {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    color: #64748b;
    background:
        radial-gradient(55% 60% at 50% 0%, rgb(34 211 238 / 0.14), transparent 70%),
        radial-gradient(45% 55% at 80% 90%, rgb(167 139 250 / 0.12), transparent 70%);
}

.mm-hero-svg { width: 100%; height: 100%; }

.gh-header.is-classic .gh-header-title {
    font-weight: 700;
    letter-spacing: -0.035em;
}

/* --- Feed & cards -------------------------------------------------------- */

.gh-container-title {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mm-muted);
    border-bottom-color: var(--mm-line);
}

/* Mono only for tags, dates and meta */
.gh-card-tag,
.gh-article-tag,
.gh-card-meta,
.gh-card-date,
.gh-article-meta-content,
.gh-article-meta-date,
.gh-article-meta-length {
    font-family: var(--font-mono);
    letter-spacing: 0;
}

.gh-card-tag,
.gh-article-tag {
    display: inline-block;
    width: fit-content;
    padding: 2px 10px;
    font-size: 1.15rem;
    font-weight: 500;
    text-transform: lowercase;
    color: var(--mm-cyan);
    background: rgb(34 211 238 / 0.08);
    border: 1px solid rgb(34 211 238 / 0.25);
    border-radius: 999px;
}

.gh-card-title { font-weight: 600; transition: color 0.15s ease; }
.gh-card-link:hover .gh-card-title { opacity: 1; color: #a5f3fc; }
.gh-card-excerpt { color: var(--mm-muted); }

.gh-card-image {
    border-radius: 10px;
    overflow: hidden;
}

.gh-container.is-grid .gh-card,
.gh-featured .gh-card {
    padding: 14px;
    background: linear-gradient(180deg, var(--mm-surface), rgb(17 24 39 / 0.6));
    border: 1px solid var(--mm-line);
    border-radius: var(--mm-radius);
    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.gh-container.is-grid .gh-card:hover,
.gh-featured .gh-card:hover {
    border-color: rgb(34 211 238 / 0.45);
    box-shadow: var(--mm-glow);
    transform: translateY(-3px);
}

.gh-container.is-grid .gh-card-wrapper { padding: 4px 4px 6px; }

.gh-container.is-list .gh-card + .gh-card { border-top-color: var(--mm-line); }

.gh-more a { color: var(--mm-cyan); }

/* --- Article ------------------------------------------------------------- */

.gh-article-title { font-weight: 700; letter-spacing: -0.035em; }
.gh-article-excerpt { color: var(--mm-muted); }

.gh-content > h2,
.gh-content > h3 { font-weight: 600; }

.gh-content a:not(.kg-btn):not(.kg-bookmark-container):not(.kg-file-card-container) {
    color: var(--mm-cyan);
    text-decoration: none;
    background-image: var(--mm-gradient);
    background-size: 100% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: color 0.15s ease, background-size 0.2s ease;
}

.gh-content a:not(.kg-btn):not(.kg-bookmark-container):not(.kg-file-card-container):hover {
    color: var(--mm-violet);
    opacity: 1;
}

.gh-content > blockquote:not([class]) {
    border-left: 3px solid;
    border-image: linear-gradient(180deg, var(--mm-cyan), var(--mm-violet)) 1;
}

.gh-content > hr { border-color: var(--mm-line); }

/* Inline code */
.gh-content :not(pre) > code {
    padding: 0.15em 0.4em;
    font-family: var(--font-mono);
    font-size: 0.86em;
    color: #a5f3fc;
    background: rgb(34 211 238 / 0.08);
    border: 1px solid rgb(34 211 238 / 0.18);
    border-radius: 6px;
}

/* Code blocks */
.gh-content pre {
    position: relative;
    padding: 20px 22px;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    line-height: 1.7;
    color: #cbd5e1;
    background: var(--mm-code-bg);
    border: 1px solid var(--mm-line-strong);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.03);
    overflow-x: auto;
    tab-size: 4;
}

.gh-content pre[data-lang] { padding-top: 40px; }

.gh-content pre[data-lang]::before {
    content: attr(data-lang);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 6px 16px;
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mm-muted);
    border-bottom: 1px solid var(--mm-line);
    background: linear-gradient(90deg, rgb(34 211 238 / 0.07), rgb(167 139 250 / 0.07));
}

.gh-content pre code {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
}

/* Prism tokens */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #64748b; font-style: italic; }
.token.punctuation { color: #94a3b8; }
.token.property, .token.tag, .token.constant, .token.symbol { color: #67e8f9; }
.token.boolean, .token.number { color: #f0abfc; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #86efac; }
.token.operator, .token.entity, .token.url, .token.variable { color: #fcd34d; }
.token.atrule, .token.attr-value, .token.keyword { color: #c4b5fd; }
.token.function, .token.class-name { color: #7dd3fc; }
.token.regex, .token.important { color: #fdba74; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }
.token.deleted { color: #fca5a5; background: rgb(248 113 113 / 0.1); }
.token.inserted { color: #86efac; background: rgb(74 222 128 / 0.1); }

/* Koenig cards on a dark background */
.kg-bookmark-container,
.kg-callout-card-grey,
.kg-callout-card-white,
.kg-toggle-card,
.kg-product-card-container,
.kg-file-card-container {
    color: var(--mm-text) !important;
    background: var(--mm-surface) !important;
    border: 1px solid var(--mm-line-strong) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.kg-bookmark-container:hover { border-color: rgb(34 211 238 / 0.45) !important; }
.kg-bookmark-title,
.kg-toggle-heading-text,
.kg-file-card-title { color: var(--mm-text) !important; }
.kg-bookmark-description,
.kg-bookmark-metadata,
.kg-file-card-caption,
.kg-file-card-metadata { color: var(--mm-muted) !important; }

/* --- Sidebar, CTA & footer ----------------------------------------------- */

.gh-about,
.gh-cta-inner {
    background: var(--mm-surface);
    border: 1px solid var(--mm-line);
    border-radius: var(--mm-radius);
}

.gh-footer {
    position: relative;
    border-top: 1px solid var(--mm-line);
    background: linear-gradient(180deg, transparent, rgb(124 58 237 / 0.05));
}

.gh-footer-copyright,
.gh-footer-menu { font-family: var(--font-mono); font-size: 1.25rem; }

.gh-footer-signup-header { font-weight: 700; letter-spacing: -0.03em; }

@media (prefers-reduced-motion: reduce) {
    .gh-button,
    .gh-container.is-grid .gh-card,
    .gh-featured .gh-card { transition: none; }
    .gh-button:hover,
    .gh-container.is-grid .gh-card:hover,
    .gh-featured .gh-card:hover { transform: none; }
}

/* --- Fixes for Source defaults on a dark canvas --------------------------- */

/* Source draws hairline dividers between grid cells; the bordered cards replace them */
.gh-container.is-grid .gh-card::before,
.gh-container.is-grid .gh-card::after { display: none; }

.gh-navigation-actions { background: transparent; }

.gh-header.is-classic:not(.has-image) + .gh-container,
.gh-header.is-classic + .gh-container { margin-top: clamp(32px, 4vw, 56px); }

/* Bordered cards need far less air than Source's divider layout */
.gh-container.is-grid .gh-feed {
    gap: 24px;
    overflow: visible;
}

@media (max-width: 576px) {
    .gh-container.is-grid .gh-feed { gap: 16px; }
}
