/* Shared styles for firmd component detail pages.
   Token palette and typography align with website/main.html. */

:root {
    --black: #050505;
    --charcoal: #0c0c0b;
    --ink: #f7f0df;
    --paper: #ebe1c8;
    --muted: #9b927f;
    --line: #343027;
    --line-2: #514a3c;
    --orange: #42d9ff;
    --lime: #42d9ff;
    --blue: #42d9ff;
    --pink: #ebe1c8;
    --sand: #ebe1c8;
    --mono: "Berkeley Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    --display: "DIN Condensed", "Avenir Next Condensed", Impact, sans-serif;
    --body: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

html {
    background: var(--black);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(112deg, transparent 0 58%, rgba(255, 90, 31, 0.1) 58% 59%, transparent 59%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 180px),
        var(--black);
    font-family: var(--body);
    line-height: 1.55;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(90deg, rgba(247, 240, 223, 0.045) 0 1px, transparent 1px 80px),
        repeating-linear-gradient(0deg, rgba(247, 240, 223, 0.018) 0 1px, transparent 1px 9px);
    mask-image: linear-gradient(90deg, black, transparent 78%);
    opacity: 0.55;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 72% 12%, rgba(66, 217, 255, 0.16), transparent 26rem);
    mix-blend-mode: screen;
}

a { color: inherit; }

.shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

/* Topbar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(5, 5, 5, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.topbar .shell {
    min-height: 58px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.brand {
    font-family: var(--mono);
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--paper);
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
}

.brand img {
    display: block;
    height: 28px;
    width: auto;
}

nav {
    display: flex;
    gap: 6px;
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
}

nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    color: var(--paper);
    text-decoration: none;
    background: rgba(247, 240, 223, 0.04);
    white-space: nowrap;
}

nav a:hover,
nav a:focus-visible {
    border-color: var(--lime);
    color: var(--lime);
    outline: none;
}

nav a.cta {
    border-color: var(--orange);
    color: var(--orange);
}

.crumb {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    background: rgba(247, 240, 223, 0.04);
}

.crumb:hover {
    border-color: var(--lime);
    color: var(--lime);
}

main {
    position: relative;
    z-index: 1;
}

/* Hero */

.detail-hero {
    padding: 80px 0 40px;
}

.detail-hero .kicker {
    font-family: var(--mono);
    color: var(--orange);
    font-size: 0.76rem;
    text-transform: uppercase;
    margin-bottom: 18px;
    letter-spacing: 0;
}

.detail-hero h1 {
    margin: 0 0 22px;
    font-family: var(--display);
    font-size: 4.6rem;
    line-height: 0.86;
    text-transform: uppercase;
    font-weight: 800;
}

.detail-hero .lead {
    max-width: 720px;
    color: var(--paper);
    font-size: 1.22rem;
    margin: 0;
}

.substrate {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 6px 12px;
    border: 1px solid var(--line-2);
    background: rgba(247, 240, 223, 0.04);
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--paper);
}

.substrate .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Status tag at the top of each detail page */

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: 1px solid var(--line-2);
    background: rgba(247, 240, 223, 0.04);
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--paper);
    margin-bottom: 22px;
}

.status-tag .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-tag .label { color: var(--ink); }
.status-tag .sep { color: var(--line-2); }
.status-tag .note { color: var(--muted); text-transform: none; font-size: 0.7rem; }

.status-shipped .dot { background: var(--lime); }
.status-partial .dot { background: var(--orange); }
.status-planned .dot { background: var(--paper); }

/* Inline PLANNED badge — flags a not-yet-shipped piece of functionality
   in the same paragraph as the real, today behaviour it sits next to. */

.planned {
    display: inline-block;
    padding: 1px 7px;
    margin-right: 6px;
    border: 1px solid var(--paper);
    background: rgba(235, 225, 200, 0.06);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--paper);
    vertical-align: middle;
    line-height: 1.5;
    border-radius: 1px;
}

/* Inline cross-link to evaluation page */
.eval-link {
    display: inline-block;
    margin-top: 14px;
    padding: 6px 12px;
    border: 1px solid var(--line-2);
    background: rgba(66, 217, 255, 0.06);
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--blue);
    text-decoration: none;
}
.eval-link:hover { border-color: var(--blue); }

/* Sections */

section {
    border-top: 1px solid var(--line);
    padding: 64px 0;
}

.section-grid {
    display: grid;
    grid-template-columns: 0.58fr 1.42fr;
    gap: 48px;
    align-items: start;
}

.label {
    font-family: var(--mono);
    color: var(--lime);
    font-size: 0.76rem;
    text-transform: uppercase;
    margin-bottom: 14px;
    letter-spacing: 0;
}

h2 {
    margin: 0 0 22px;
    font-family: var(--display);
    font-size: 2.8rem;
    line-height: 0.9;
    text-transform: uppercase;
}

.prose p {
    margin: 0 0 16px;
    color: var(--paper);
    font-size: 1.04rem;
}

.prose p:last-child { margin-bottom: 0; }

.prose strong { color: var(--ink); }

/* Bullet list (mechanism) */

.mechanism {
    display: grid;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.mechanism > div {
    background: var(--black);
    padding: 18px 20px;
}

.mechanism strong {
    display: block;
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--paper);
    margin-bottom: 8px;
}

.mechanism p {
    margin: 0;
    color: var(--paper);
    font-size: 0.98rem;
}

/* Screenshot grid */

.screenshots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.screenshot {
    aspect-ratio: 16 / 10;
    background:
        repeating-linear-gradient(135deg, rgba(247, 240, 223, 0.04) 0 12px, transparent 12px 24px),
        var(--charcoal);
    border: 1px solid var(--line-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    text-align: center;
    padding: 16px;
}

.screenshot .tag {
    font-size: 0.68rem;
    color: var(--line-2);
}

.screenshot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Edge-to-edge when a real image is present (drop the placeholder padding). */
.screenshot:has(img) {
    padding: 0;
}

/* 2x2 layout for sections with four screenshots. */
.screenshots.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Lightbox — opens when any .screenshot img is clicked. */
.screenshot img {
    cursor: zoom-in;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 88vh;
    object-fit: contain;
    border: 1px solid var(--line-2);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    background: var(--charcoal);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: rgba(247, 240, 223, 0.05);
    border: 1px solid var(--line-2);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
    border-color: var(--orange);
    color: var(--orange);
    outline: none;
}

/* Related */

.related {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.related a {
    display: block;
    background: var(--black);
    padding: 18px 20px;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.18s ease;
}

.related a:hover { background: var(--charcoal); }

.related strong {
    display: block;
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--paper);
    margin-bottom: 6px;
}

.related p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
}

footer.site-foot {
    border-top: 1px solid var(--line);
    padding: 24px 0;
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--muted);
}
footer.site-foot .shell { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
footer.site-foot a { color: var(--muted); text-decoration: none; }
footer.site-foot a:hover { color: var(--paper); }

.page-actions {
    padding: 32px 0 56px;
}

/* Responsive */

@media (max-width: 980px) {
    .section-grid { grid-template-columns: 1fr; gap: 24px; }
    .detail-hero h1 { font-size: 3.4rem; }
    .screenshots { grid-template-columns: 1fr; }
    .related { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
    .shell { width: min(100% - 24px, 1180px); }
    .topbar .shell {
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        min-height: 54px;
        padding: 9px 0;
    }
    .brand img { height: 26px; }
    nav {
        flex: 0 0 100%;
        margin-left: 0;
        justify-content: flex-end;
        gap: 4px;
        font-size: 0.66rem;
    }
    nav a { min-height: 32px; padding: 0 8px; }
    .detail-hero { padding: 48px 0 28px; }
    .detail-hero h1 { font-size: 2.6rem; }
    h2 { font-size: 2rem; }
    section { padding: 44px 0; }
    .related { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
    .topbar .shell { gap: 8px; }
    nav { gap: 3px; font-size: 0.58rem; }
    nav a { min-height: 30px; padding: 0 6px; }
}
