:root {
    --bg-color: #f0f2f5;
    --text-main: #111418;
    --text-muted: #5e656d;
    --accent: #00e5ff;
    --font-heading: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --bracket-size: 6px;
}

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

body,
html {
    width: 100vw;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-heading);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Grid Background */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(17, 20, 24, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(17, 20, 24, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    opacity: 0.5;
    transform: perspective(1000px) rotateX(60deg) scale(2.5) translateY(-20%);
}

/* Top Navigation */
nav {
    position: relative;
    width: 100%;
    padding: 2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.logo-svg {
    width: 24px;
    height: 24px;
}

.nav-center {
    display: flex;
    gap: 4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
}

.nav-link::before {
    content: '// ';
    opacity: 0.4;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.lang-toggle {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-color);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
    transform: scale(1.05);
}

/* Brackets */
.tech-glass {
    position: relative;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-main);
    cursor: pointer;
    text-decoration: none;
}

.brackets::before,
.brackets::after {
    content: '';
    position: absolute;
    width: var(--bracket-size);
    height: var(--bracket-size);
    border: 1px solid var(--text-main);
}

.brackets::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.brackets::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

.brackets span::before,
.brackets span::after {
    content: '';
    position: absolute;
    width: var(--bracket-size);
    height: var(--bracket-size);
    border: 1px solid var(--text-main);
}

.brackets span::before {
    top: -1px;
    right: -1px;
    border-left: none;
    border-bottom: none;
}

.brackets span::after {
    bottom: -1px;
    left: -1px;
    border-right: none;
    border-top: none;
}

/* Container Content Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.overline {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.headline {
    font-size: 4rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 3rem;
}

.headline span.bold {
    font-weight: 800;
    display: block;
}

.headline span.thin {
    font-weight: 200;
    display: block;
    color: var(--text-muted);
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.service-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem;
    align-items: flex-start;
    text-align: left;
    cursor: default;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-heading);
}

.service-card p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
    text-transform: none;
}

.stack-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.5rem;
    margin-bottom: 1rem;
    justify-content: flex-start;
    cursor: default;
}

.stack-icon {
    width: 32px;
    height: 32px;
    border: 1px dashed var(--text-muted);
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stack-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.stack-name {
    font-weight: 800;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-heading);
}

.stack-role {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.stack-category-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    width: 100%;
}

.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(17, 20, 24, 0.2);
    padding: 1rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
    resize: vertical;
}

.form-control:focus {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.6);
}

select.form-control {
    appearance: none;
    border-radius: 0;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-main) 50%), linear-gradient(135deg, var(--text-main) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1.5em), calc(100% - 15px) calc(1.5em);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    .headline {
        font-size: 3rem;
    }
}

/* Footer */
.site-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 3rem;
    border-top: 1px solid rgba(17, 20, 24, 0.1);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--text-main);
}

.intro {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 760px;
    margin-bottom: 3rem;
}

/* ---- Added for the multi-page site ---- */
nav.breadcrumb,
nav.footer-nav {
    position: static;
    display: block;
    width: auto;
    padding: 0;
    pointer-events: auto;
    z-index: auto;
}
a.btn-primary {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-wide {
    width: 100%;
    padding: 1.15rem 2.5rem;
}

.nav-link[aria-current="page"] {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumb li + li::before {
    content: '/';
    margin-right: 0.5rem;
    opacity: 0.5;
}

.breadcrumb a,
.prose a,
.faq a,
.related a,
.quote-aside a,
.form-note a,
.plain-links a,
.text-link {
    color: var(--text-main);
}

a.service-card {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.service-card h2,
.service-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font-heading);
}

.service-card .more {
    color: var(--text-main);
    font-weight: 600;
}

.prose,
.faq,
.related,
.cta {
    margin-top: 4rem;
    max-width: 820px;
}

.prose h2,
.faq > h2,
.related h2,
.cta h2,
.quote-aside h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.prose p,
.prose li,
.related li,
.cta p,
.quote-aside p,
.quote-aside li,
.plain-links li {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.prose p + p,
.prose p + h2,
.prose ul + h2,
.prose ul + p {
    margin-top: 1rem;
}

.prose h2 + p,
.prose p + ul {
    margin-top: 0.5rem;
}

.prose ul,
.related ul,
.plain-links {
    padding-left: 1.25rem;
}

.prose li + li,
.related li + li,
.plain-links li + li {
    margin-top: 0.4rem;
}

.steps {
    padding-left: 1.5rem;
    margin-top: 1rem;
}

.steps li {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.steps li + li {
    margin-top: 0.6rem;
}

.steps strong {
    color: var(--text-main);
}

.faq-item {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(17, 20, 24, 0.1);
}

.faq-item h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.faq-item p,
.faq-more {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.faq-more {
    margin-top: 1rem;
}

.cta {
    padding: 2.5rem;
    border: 1px solid rgba(17, 20, 24, 0.15);
    background: rgba(255, 255, 255, 0.4);
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.text-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stack-why {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Quote form */
.quote-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.check-group {
    border: none;
}

.check-group legend {
    margin-bottom: 0.75rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-main);
    padding: 0.35rem 0;
    cursor: pointer;
}

.check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--text-main);
}

.form-note {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.hp {
    position: absolute;
    left: -9999px;
}

.quote-aside {
    padding: 2rem;
    border: 1px solid rgba(17, 20, 24, 0.15);
    background: rgba(255, 255, 255, 0.4);
}

.quote-aside p {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .quote-layout,
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .quote-aside {
        margin-top: 2rem;
    }

    nav .nav-right {
        width: 100%;
        justify-content: center;
    }

    .cta {
        padding: 1.75rem;
    }
}

/* What we've built */
nav.project-index {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1rem;
    width: auto;
    padding: 0;
    z-index: auto;
}

.project-index .tech-glass {
    padding: 0.85rem 1.5rem;
    text-transform: none;
    font-size: 0.8rem;
}

.project {
    margin-top: 6rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(17, 20, 24, 0.15);
    scroll-margin-top: 1.5rem;
}

.project-title {
    font-size: 3rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
}

.project-title span {
    display: block;
}

.project-title .bold {
    font-weight: 800;
}

.project-title .thin {
    font-weight: 200;
    color: var(--text-muted);
}

.project-shot {
    position: relative;
    margin: 0 0 3rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(17, 20, 24, 0.12);
}

.project-shot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top;
}

.project-shot figcaption {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.project-gallery .project-shot {
    margin: 0;
    padding: 0.5rem;
}

.project-body {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
}

.project-body .prose {
    margin-top: 0;
}

.prose h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.prose p + h3,
.prose ul + h3 {
    margin-top: 2rem;
}

.spec {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    border-top: 1px solid rgba(17, 20, 24, 0.15);
}

.spec div {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(17, 20, 24, 0.1);
}

.spec dt {
    color: var(--text-muted);
}

.spec dd {
    color: var(--text-main);
}

.spec a {
    color: var(--text-main);
}

.project-index a:focus-visible,
.spec a:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--text-main);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .project {
        margin-top: 4rem;
    }

    .project-title {
        font-size: 2.25rem;
    }

    .project-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }
}

/* Primary nav on phones: same stacked layout as the home page */
@media (max-width: 768px) {
    nav[aria-label="Primary"] {
        flex-direction: column;
        gap: 1.5rem;
        padding: 2rem 1.5rem;
    }

    nav[aria-label="Primary"] .nav-center {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }

    nav[aria-label="Primary"] .nav-links {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    nav[aria-label="Primary"] .nav-center {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    nav[aria-label="Primary"] .nav-links {
        justify-content: center;
    }
}
