/* Megalith — shared styles for megalithlabs.ai / api.megalithlabs.ai */

@font-face {
    font-family: 'Heading Now';
    src: url('/HN94.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Heading Now';
    src: url('/HN95.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --cream: #f4f1e8;
    --cream-soft: #ece9df;
    --ink: #2c2c2c;
    --ink-light: #888;
    --ink-faint: #b8b3a4;
    --orange: #f26522;
    --teal: #00a3ad;
    --grid: rgba(0,0,0,0.035);
    --rule: rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'IBM Plex Mono', monospace;
    background: var(--cream);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.65;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 24px 24px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 2rem 4rem;
}

/* ---------- Header ---------- */
header.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 4rem;
}

.logo img { height: 22px; display: block; }

nav.site-nav {
    display: flex;
    gap: 2.25rem;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

nav.site-nav a {
    color: var(--ink-light);
    text-decoration: none;
    transition: color 0.15s;
}

nav.site-nav a:hover, nav.site-nav a.active { color: var(--orange); }

/* ---------- Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 5rem;
    margin-bottom: 6rem;
    align-items: start;
}

.hero-wide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 6rem;
    align-items: start;
}

.hero-text { padding-top: 0.5rem; }

.hero-text .code { margin-top: 2.25rem; }

.hero-diagram {
    width: 100%;
    max-width: 540px;
    justify-self: end;
}

.hero-diagram svg {
    width: 100%;
    height: auto;
    display: block;
}

.hero-headline {
    font-family: 'Heading Now', sans-serif;
    font-weight: 700;
    font-size: 56px;
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.hero-headline .accent { color: var(--orange); }

.hero-sub {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-light);
    margin-top: 1.75rem;
    max-width: 38ch;
}

.hero-side {
    padding-top: 0.5rem;
}

.hero-side-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink-light);
    margin-bottom: 0.75rem;
}

/* ---------- Code block ---------- */
.code {
    background: var(--ink);
    color: var(--cream);
    padding: 1rem 1.25rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    line-height: 1.7;
    border-left: 3px solid var(--orange);
    overflow-x: auto;
}

.code .comment { color: var(--ink-faint); }
.code .accent { color: var(--orange); }

.code-caption {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-light);
    margin-top: 0.5rem;
}

/* ---------- Section labels ---------- */
.section-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Heading Now', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink);
    margin-bottom: 2rem;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--rule);
}

section { margin-bottom: 5.5rem; }

h2.section-heading {
    font-family: 'Heading Now', sans-serif;
    font-weight: 700;
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 2rem;
    max-width: 30ch;
}

/* ---------- Two-column section (diagram + prose) ---------- */
.section-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.section-pair-diagram {
    width: 100%;
    max-width: 540px;
}

.section-pair-diagram svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ---------- Verticals list ---------- */
.verticals {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 3rem;
}

.verticals li {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-left: 1rem;
    border-left: 2px solid var(--ink);
}

.verticals li strong {
    font-family: 'Heading Now', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.verticals li span {
    font-size: 11.5px;
    color: var(--ink-light);
    line-height: 1.55;
}

/* Verticals with icons */
.verticals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 3rem;
}

.vertical {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.vertical-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: var(--ink);
}

.vertical-text {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.vertical-text strong {
    font-family: 'Heading Now', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.vertical-text span {
    font-size: 11.5px;
    color: var(--ink-light);
    line-height: 1.55;
}

/* ---------- Stats grid ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat {
    border-top: 1px solid var(--ink);
    padding-top: 0.85rem;
}

.stat-value {
    font-family: 'Heading Now', sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-light);
    margin-top: 0.4rem;
}

.stat-sub {
    font-size: 11px;
    color: var(--ink-light);
    margin-top: 0.35rem;
}

/* ---------- Steps ---------- */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step {
    padding-left: 1rem;
    border-left: 2px solid var(--orange);
}

.step-num {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--teal);
    margin-bottom: 0.6rem;
}

.step-title {
    font-family: 'Heading Now', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-body {
    font-size: 12px;
    color: var(--ink-light);
    line-height: 1.65;
}

/* ---------- Standards stack ---------- */
.standards-stack {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.standard {
    padding: 1.5rem;
    background: var(--cream-soft);
    border-top: 3px solid var(--ink);
}

.standard-name {
    font-family: 'Heading Now', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.25rem;
}

.standard-role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--teal);
    margin-bottom: 1rem;
}

.standard-body {
    font-size: 12px;
    color: var(--ink-light);
    line-height: 1.7;
}

.standard-body a {
    color: var(--orange);
}

.standard-body .mono {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--ink);
}

.standard-body ul {
    list-style: none;
    margin-top: 1rem;
    padding-left: 0;
}

.standard-body li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
}

.standard-body li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--ink-faint);
}

.standard-body li strong {
    color: var(--ink);
    font-weight: 500;
}

/* ---------- Card grid (use cases) ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.card {
    background: var(--cream-soft);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--ink);
    display: block;
    border: 1px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
}

.card:hover {
    border-color: var(--orange);
    transform: translateY(-2px);
}

.card-tag {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--teal);
    margin-bottom: 0.75rem;
}

.card-title {
    font-family: 'Heading Now', sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.card-body {
    font-size: 12px;
    color: var(--ink-light);
    line-height: 1.6;
}

.card-link {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--orange);
    margin-top: 1rem;
    display: block;
}

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th, td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--rule);
}

th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-light);
    font-weight: 500;
}

td .accent { color: var(--orange); font-weight: 500; }
td .mono { font-family: 'IBM Plex Mono', monospace; color: var(--ink); }

/* ---------- Long-form body text ---------- */
.body-prose {
    max-width: 64ch;
    font-size: 14px;
    line-height: 1.75;
    color: var(--ink);
}

.body-prose p { margin-bottom: 1.1rem; }
.body-prose strong { color: var(--orange); font-weight: 500; }
.body-prose a { color: var(--orange); }

/* ---------- Map placeholder ---------- */
.map-frame {
    position: relative;
    background: var(--cream-soft);
    border: 1px solid var(--rule);
    aspect-ratio: 1 / 1;
    max-width: 720px;
    margin: 0 auto 2.5rem;
    overflow: hidden;
}

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

.map-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255,255,255,0.92);
    padding: 0.6rem 0.8rem;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink);
}

.map-overlay-coord {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--ink-light);
    text-transform: none;
    letter-spacing: 0;
    font-size: 10.5px;
    margin-top: 0.3rem;
}

/* ---------- Footer ---------- */
footer.site-footer {
    border-top: 1px solid var(--rule);
    padding-top: 2rem;
    margin-top: 6rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
    font-size: 11px;
    color: var(--ink-light);
}

footer.site-footer .disclosure {
    max-width: 42ch;
    line-height: 1.7;
}

footer.site-footer .links {
    display: flex;
    gap: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 10px;
}

footer.site-footer a {
    color: var(--ink-light);
    text-decoration: none;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .page { padding: 1.25rem 1.25rem 3rem; }
    header.site-header { margin-bottom: 2.5rem; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
    nav.site-nav { gap: 1.25rem; }
    .hero { grid-template-columns: 1fr; gap: 2.5rem; margin-bottom: 4rem; }
    .hero-wide { grid-template-columns: 1fr; gap: 2.5rem; margin-bottom: 4rem; }
    .hero-diagram { justify-self: stretch; max-width: 100%; }
    .hero-headline { font-size: 38px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .verticals, .verticals-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .steps, .cards, .standards-stack { grid-template-columns: 1fr; }
    .section-pair { grid-template-columns: 1fr; gap: 2rem; }
    .section-pair-diagram { max-width: 100%; }
    section { margin-bottom: 4rem; }
    footer.site-footer { flex-direction: column; gap: 1.5rem; }
}
