:root {
    --page-width: 1180px;
    --text-main: #111111;
    --text-muted: #5d6470;
    --surface: #ffffff;
    --surface-soft: #f4f6f8;
    --border: #d9dee5;
    --accent: #1f4f8a;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text-main);
    background: var(--surface);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.navigation {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.08em;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

main {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.hero {
    padding: 7rem 0 6rem;
    max-width: 900px;
}

.eyebrow {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent);
}

.hero h1 {
    margin: 0;
    font-family: "Playfair Display", serif;
    font-size: clamp(2.8rem, 7vw, 5.8rem);
    line-height: 1;
    letter-spacing: -0.04em;
    max-width: 1000px;
}

.hero-description {
    margin: 2rem 0 0;
    max-width: 680px;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.hero-actions {
    margin-top: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.button {
    display: inline-block;
    padding: 0.9rem 1.25rem;
    border: 1px solid var(--text-main);
    font-weight: 600;
}

.button.primary {
    background: var(--text-main);
    color: var(--surface);
}

.button.secondary {
    background: var(--surface);
}

.credentials {
    padding: 5rem 0 7rem;
    border-top: 1px solid var(--border);
}

.section-heading {
    max-width: 720px;
    margin-bottom: 2.5rem;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
}

.credential-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.credential-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.5rem;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.credential-badge {
    width: 110px;
    min-height: 110px;
    flex: 0 0 110px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    text-align: center;
}

.badge-mark {
    font-weight: 700;
    letter-spacing: 0.08em;
}

.badge-level {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.credential-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.credential-link:hover {
    text-decoration: underline;
}

.credential-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.credential-card p {
    margin: 0;
    color: var(--text-muted);
}

@media (max-width: 760px) {
    .navigation {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
    }

    .hero {
        padding: 5rem 0 4rem;
    }

    .credential-grid {
        grid-template-columns: 1fr;
    }
}

.engineering {
    padding: 6rem 0 7rem;
    border-top: 1px solid var(--border);
}

.section-heading p:not(.eyebrow) {
    max-width: 680px;
    color: var(--text-muted);
    font-size: 1.05rem;
}

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

.project-card {
    padding: 2rem;
    border: 1px solid var(--border);
    background: var(--surface);
}

.project-label {
    margin: 0 0 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.project-card h3 {
    margin: 0 0 1rem;
    font-family: "Playfair Display", serif;
    font-size: 1.8rem;
}

.project-card > p {
    color: var(--text-muted);
}

.project-meta {
    margin: 1.5rem 0;
    display: grid;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.project-link {
    font-weight: 700;
}

.project-link:hover {
    text-decoration: underline;
}

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

.architecture-method {
    padding: 6rem 0 7rem;
    border-top: 1px solid var(--border);
}

.architecture-flow {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto
        minmax(0, 1fr) auto
        minmax(0, 1fr) auto
        minmax(0, 1fr) auto
        minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.architecture-step {
    height: 100%;
    min-height: 300px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    display: flex;
    flex-direction: column;
}

.step-number {
    display: block;
    margin-bottom: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.architecture-step h3 {
    margin: 0 0 0.75rem;
    font-family: "Playfair Display", serif;
    font-size: 1.4rem;
}

.architecture-step p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.architecture-arrow {
    align-self: center;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.architecture-principle {
    margin: 2.5rem 0 0;
    font-size: 1.1rem;
    font-weight: 700;
}

@media (max-width: 980px) {
    .architecture-flow {
        grid-template-columns: 1fr;
    }

    .architecture-arrow {
        transform: rotate(90deg);
        justify-self: center;
    }

    .architecture-step {
        min-height: auto;
    }
}

.implementation-title {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.architecture-step:nth-of-type(7) {
    padding-left: 0.65rem;
}

.live-architecture {
    padding: 6rem 0 7rem;
    border-top: 1px solid var(--border);
}

.architecture-stack {
    max-width: 720px;
    display: grid;
    gap: 0.75rem;
    margin-top: 3rem;
}

.architecture-layer {
    padding: 1.75rem;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.layer-label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.architecture-layer h3 {
    margin: 0 0 0.5rem;
    font-family: "Playfair Display", serif;
    font-size: 1.6rem;
}

.architecture-layer p {
    margin: 0;
    color: var(--text-muted);
}

.stack-arrow {
    padding-left: 2rem;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.backend-heading {
    margin-top: 5rem;
    max-width: 700px;
}

.backend-heading h3 {
    margin: 0;
    font-family: "Playfair Display", serif;
    font-size: 2rem;
}

.backend-flow {
    margin-top: 2rem;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto
        minmax(0, 1fr) auto
        minmax(0, 1fr) auto
        minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.backend-service {
    padding: 1.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
}

.backend-service span {
    display: block;
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
}

.backend-service h4 {
    margin: 0 0 0.75rem;
    font-family: "Playfair Display", serif;
    font-size: 1.4rem;
}

.backend-service p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.backend-arrow {
    align-self: center;
    font-size: 1.4rem;
    color: var(--text-muted);
}

.architecture-controls {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.architecture-controls div {
    padding-top: 1rem;
    border-top: 2px solid var(--text-main);
}

.architecture-controls strong,
.architecture-controls span {
    display: block;
}

.architecture-controls span {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 980px) {
    .backend-flow {
        grid-template-columns: 1fr;
    }

    .backend-arrow {
        transform: rotate(90deg);
        justify-self: center;
    }

    .architecture-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .architecture-controls {
        grid-template-columns: 1fr;
    }
}

.live-metric {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.metric-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.live-metric strong {
    font-family: "Playfair Display", serif;
    font-size: 2.5rem;
}

.guestbook {
    margin-top: 5rem;
    padding-top: 4rem;
    border-top: 1px solid var(--border);
}

.guestbook-form {
    display: grid;
    gap: 1.5rem;
    max-width: 700px;
}

.guestbook-form label {
    display: grid;
    gap: 0.5rem;
    font-weight: 600;
}

.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    font: inherit;
    background: var(--surface);
}

.guestbook-form textarea {
    min-height: 140px;
    resize: vertical;
}

.guestbook-status {
    margin: 0;
    color: var(--text-muted);
}

.guestbook-comments {
    margin-top: 3rem;
}

.guestbook-comments h4 {
    margin-bottom: 1rem;
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
}

.guestbook-comment {
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
}

.guestbook-comment strong {
    display: block;
    margin-bottom: 0.4rem;
}

.guestbook-comment p {
    margin: 0;
    color: var(--text-muted);
}

.credential-badge {
    width: 120px;
    flex: 0 0 120px;
    display: block;
}

.credential-badge img {
    width: 100%;
    height: auto;
    display: block;
}

.credential-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.credential-link:hover {
    text-decoration: underline;
}

.closing-note {
    margin-top: 5rem;
    padding-top: 4rem;
    border-top: 1px solid var(--border);
    max-width: 760px;
}

.closing-note h3 {
    margin: 0 0 1.5rem;
    font-family: "Playfair Display", serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
}

.closing-note p:not(.eyebrow) {
    color: var(--text-muted);
    font-size: 1.05rem;
}