/* Morkerr — Obsidian Studio redesign */
:root {
    --bg: #09090b;
    --bg-elevated: #111113;
    --bg-card: #141416;
    --bg-card-hover: #1a1a1e;
    --surface: #fafafa;
    --surface-muted: #a1a1aa;
    --ink: #fafafa;
    --muted: #a1a1aa;
    --soft: #18181b;
    --line: #27272a;
    --line-strong: #3f3f46;
    --accent: #e879f9;
    --accent-dim: rgba(232, 121, 249, 0.12);
    --accent-glow: rgba(232, 121, 249, 0.35);
    --cyan: #22d3ee;
    --lime: #a3e635;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --font-display: "Outfit", system-ui, sans-serif;
    --font-body: "Source Sans 3", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(232, 121, 249, 0.15), transparent 50%),
        radial-gradient(ellipse 60% 40% at 90% 0%, rgba(34, 211, 238, 0.1), transparent 45%),
        var(--bg);
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.container {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

/* —— Header —— */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(9, 9, 11, 0.75);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(20px) saturate(1.2);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.brand-logo {
    width: 100px;
    height: auto;
    object-fit: contain;
    filter: brightness(1.15);
}

.brand span {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.88rem;
}

.main-nav,
.header-actions,
.footer-links,
.hero-actions,
.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-nav a {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.main-nav a:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.05);
}

.sandbox-pill,
.system-badge,
.eyebrow,
.result-count {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sandbox-pill {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.25);
    padding: 6px 12px;
}

.system-badge {
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(232, 121, 249, 0.3);
    padding: 6px 12px;
}

.eyebrow {
    color: var(--accent);
    background: transparent;
    padding: 0;
    letter-spacing: 0.1em;
}

/* —— Buttons —— */
.btn {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    min-height: 44px;
    padding: 11px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #e879f9 0%, #c026d3 100%);
    color: #09090b;
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 12px 40px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--muted);
}

.compact-btn {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* —— Hero —— */
.hero-band {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-band::before {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    top: -200px;
    right: -100px;
    background: radial-gradient(circle, rgba(232, 121, 249, 0.2), transparent 70%);
    pointer-events: none;
}

.hero-layout {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    gap: 48px;
    align-items: center;
    padding: 72px 0 80px;
}

.hero-copy h1 {
    margin: 20px 0 24px;
    max-width: 620px;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #fff 0%, #d4d4d8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-copy p {
    max-width: 520px;
    margin: 0 0 32px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.75;
}

.hero-copy .btn-secondary {
    border-color: var(--line-strong);
}

.hero-terminal {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
}

.hero-terminal-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--line-strong);
}

.hero-terminal-bar span:nth-child(1) { background: #ef4444; }
.hero-terminal-bar span:nth-child(2) { background: #eab308; }
.hero-terminal-bar span:nth-child(3) { background: #22c55e; }

.hero-terminal-title {
    margin-left: 8px;
    font-size: 0.75rem;
    color: var(--muted);
    font-family: ui-monospace, monospace;
}

.hero-terminal-body {
    padding: 22px;
    font-family: ui-monospace, "Cascadia Code", monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: #86efac;
}

.hero-terminal-body .dim { color: var(--muted); }
.hero-terminal-body .key { color: var(--cyan); }
.hero-terminal-body .val { color: #fde68a; }

.hero-terminal .hero-stats {
    margin-top: 0;
    padding: 16px;
    border-top: 1px solid var(--line);
    background: var(--bg-elevated);
}

.hero-terminal .hero-stats div {
    background: transparent;
    border: none;
    padding: 12px 8px;
}

.hero-stats {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hero-stats div {
    padding: 16px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    text-align: center;
}

.hero-stats strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.hero-stats span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

/* Legacy hero panel (fallback) */
.hero-panel {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
}

.hero-panel-title {
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.hero-panel-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;
}

.hero-panel-list li {
    color: var(--surface-muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.hero-panel-list strong {
    color: var(--ink);
}

/* —— Trust bar —— */
.hero-highlights {
    padding: 0;
    border-bottom: 1px solid var(--line);
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
}

.highlight-card {
    padding: 32px 28px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    transition: background 0.25s ease;
}

.highlight-card:last-child {
    border-right: 0;
}

.highlight-card:hover {
    background: rgba(255, 255, 255, 0.02);
}

.highlight-card strong {
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.highlight-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.highlight-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 1rem;
}

/* —— Sections —— */
.featured-strip,
.catalog-section,
.license-flow,
.build-system {
    padding: 80px 0;
}

.featured-strip {
    background: var(--bg-elevated);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-heading {
    max-width: 560px;
    margin-bottom: 36px;
}

.section-heading.compact {
    margin-bottom: 28px;
}

.section-heading h2,
.catalog-toolbar h2,
.build-grid h2 {
    margin: 10px 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.section-heading p,
.build-points p {
    color: var(--muted);
    margin: 0;
    font-size: 1rem;
}

.featured-grid,
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

/* —— Product cards —— */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    border-color: rgba(232, 121, 249, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.product-card.is-featured {
    border-color: rgba(232, 121, 249, 0.25);
    background: linear-gradient(165deg, var(--bg-card) 0%, rgba(232, 121, 249, 0.06) 100%);
}

.product-card-top {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.product-logo {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(232, 121, 249, 0.2);
    font-size: 1.3rem;
}

.product-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.product-card h3 {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.product-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.field-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.field-strip span {
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    color: var(--surface-muted);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: ui-monospace, monospace;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.card-meta span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-actions {
    margin-top: 4px;
}

.card-actions .btn {
    flex: 1;
    min-height: 42px;
}

.card-actions .btn-primary {
    flex: 1.2;
}

/* —— License timeline —— */
.license-flow {
    background: var(--bg);
}

.flow-layout {
    display: block;
}

.flow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    position: relative;
}

.flow-steps::before {
    content: "";
    position: absolute;
    top: 28px;
    left: 12%;
    right: 12%;
    height: 2px;
    background: linear-gradient(90deg, var(--line), var(--accent), var(--line));
    z-index: 0;
}

.flow-steps div {
    position: relative;
    z-index: 1;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 16px 0 0;
    min-height: auto;
}

.flow-steps span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 16px;
}

.flow-steps strong {
    display: block;
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
}

.flow-steps p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
    max-width: 220px;
}

/* —— Catalog —— */
.catalog-section {
    background: var(--bg-elevated);
    border-top: 1px solid var(--line);
}

.catalog-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.result-count {
    color: var(--muted);
    background: var(--bg-card);
    border: 1px solid var(--line);
    padding: 8px 14px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.82rem;
}

.filters {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}

.search-box {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    color: var(--muted);
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: rgba(232, 121, 249, 0.4);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.search-box input::placeholder {
    color: #52525b;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    min-height: 42px;
    border: 1px solid var(--line);
    background: var(--bg-card);
    border-radius: 999px;
    padding: 8px 16px;
    color: var(--muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.filter-chip.is-active {
    background: var(--accent);
    color: #09090b;
    border-color: var(--accent);
}

/* —— CTA band —— */
.build-system {
    background: linear-gradient(135deg, rgba(232, 121, 249, 0.08) 0%, rgba(34, 211, 238, 0.06) 100%);
    border-top: 1px solid var(--line);
}

.build-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.build-grid .eyebrow {
    color: var(--cyan);
}

.build-grid > div > p {
    color: var(--muted);
    margin: 16px 0 24px;
    max-width: 480px;
}

.build-points {
    display: grid;
    gap: 12px;
}

.build-points p {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.build-points strong {
    color: var(--ink);
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-display);
}

.empty-state {
    grid-column: 1 / -1;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    color: var(--muted);
    background: var(--bg-card);
}

/* —— Policy pages —— */
.policy-page {
    padding: 64px 0 88px;
}

.policy-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.45fr);
    gap: 32px;
    align-items: start;
}

.policy-intro,
.policy-content {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.policy-intro h1 {
    margin: 12px 0 16px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.policy-intro p,
.policy-content p,
.policy-content li {
    color: var(--muted);
    line-height: 1.7;
}

.policy-content {
    display: grid;
    gap: 28px;
}

.policy-content section {
    border-bottom: 1px solid var(--line);
    padding-bottom: 24px;
}

.policy-content section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.policy-content h2 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
}

/* —— Footer —— */
.site-footer {
    padding: 40px 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-grid strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--ink);
}

.footer-grid p {
    margin: 6px 0 0;
    font-size: 0.9rem;
    max-width: 360px;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

/* —— Toast —— */
.site-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    width: min(380px, calc(100% - 40px));
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    transform: translateY(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.site-toast strong {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-display);
}

.site-toast span {
    color: var(--muted);
    font-size: 0.88rem;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 980px) {
    .main-nav {
        display: none;
    }

    .hero-layout,
    .build-grid,
    .filters {
        grid-template-columns: 1fr;
    }

    .flow-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }

    .flow-steps::before {
        display: none;
    }

    .policy-layout {
        grid-template-columns: 1fr;
    }

    .featured-grid,
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .highlight-grid {
        grid-template-columns: 1fr;
    }

    .highlight-card {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .highlight-card:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 680px) {
    .container {
        width: min(100% - 32px, 1200px);
    }

    .header-inner {
        min-height: auto;
        padding: 14px 0;
    }

    .brand span,
    .sandbox-pill {
        display: none;
    }

    .hero-layout {
        padding: 48px 0 56px;
    }

    .hero-actions,
    .header-actions,
    .footer-grid,
    .catalog-toolbar {
        align-items: stretch;
    }

    .hero-actions,
    .footer-grid,
    .catalog-toolbar {
        flex-direction: column;
    }

    .featured-grid,
    .product-grid,
    .flow-steps {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }
}
