@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    --bg: #101517;
    --bg2: #172023;
    --panel: #1a2528;
    --line: #2d3d40;
    --text: #eff4f2;
    --muted: #a7b5b4;
    --accent: #a6ddc3;
    --accent2: #87b5e9;
    --max: 1130px
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65
}

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

a:hover {
    color: var(--accent)
}

.container {
    max-width: var(--max);
    padding: 0 28px;
    margin: auto
}

.skip {
    position: absolute;
    left: -999px
}

.skip:focus {
    left: 20px;
    top: 20px;
    z-index: 10;
    background: var(--accent);
    color: #111;
    padding: 10px
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #101517eb;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--line)
}

.nav {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px
}

.brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.17rem;
    font-weight: 700;
    letter-spacing: -.055em
}

.brand span {
    color: var(--accent)
}

.links {
    display: flex;
    gap: 28px;
    align-items: center
}

.links a {
    font-size: .93rem;
    color: var(--muted)
}

.links a:hover, .links a[aria-current] {
    color: var(--text)
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #6a8a80;
    background: var(--accent);
    color: #10201b !important;
    border-radius: 8px;
    padding: 11px 18px;
    font-weight: 700;
    font-size: .91rem;
    transition: transform .2s ease, background .2s ease
}

.btn:hover {
    transform: translateY(-2px);
    background: #c5f0de
}

.btn-outline {
    background: transparent;
    color: var(--text) !important;
    border-color: #5c7272
}

.btn-outline:hover {
    background: #253638
}

.hero {
    padding: 102px 0 95px;
    position: relative;
    overflow: hidden
}

.hero:before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, #4b89752e, transparent 65%);
    right: -140px;
    top: -130px;
    pointer-events: none
}

.eyebrow {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .17em;
    color: var(--accent);
    text-transform: uppercase;
    margin: 0 0 20px
}

h1, h2, h3 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    line-height: 1.13;
    letter-spacing: -.045em
}

h1 {
    font-size: clamp(3.1rem, 7vw, 6rem);
    max-width: 950px;
    margin: 0 0 26px
}

h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin: 0 0 16px
}

h3 {
    font-size: 1.4rem;
    margin: 0 0 10px
}

.lead {
    font-size: 1.16rem;
    max-width: 690px;
    color: var(--muted);
    margin: 0 0 28px
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

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

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 25px;
    margin-bottom: 35px
}

.section-head p {
    max-width: 570px;
    color: var(--muted);
    margin: 0
}

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

.project {
    border: 1px solid var(--line);
    background: var(--bg2);
    border-radius: 13px;
    overflow: hidden;
    transition: border-color .2s, transform .2s
}

.project:hover {
    border-color: #75958b;
    transform: translateY(-3px)
}

.project .visual {
    height: 270px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #273538
}

.project img {
    height: 100%;
    width: 100%;
    object-fit: cover
}

.project .details {
    padding: 24px
}

.project p {
    color: var(--muted);
    margin: 0 0 14px
}

.meta {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--accent) !important;
    font-weight: 700
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px
}

.tags span {
    font-size: .75rem;
    border: 1px solid #3c5251;
    padding: 4px 9px;
    border-radius: 50px;
    color: #c3d5d0
}

.arrow {
    font-weight: 700;
    color: var(--accent)
}

.grid-2 {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 65px
}

.muted {
    color: var(--muted)
}

.callout {
    border-left: 3px solid var(--accent);
    background: #1b2829;
    padding: 20px 25px;
    border-radius: 0 8px 8px 0;
    color: #d0dcd6
}

.foot {
    border-top: 1px solid var(--line);
    padding: 32px 0 42px;
    color: var(--muted);
    font-size: .88rem
}

.foot .container {
    display: flex;
    justify-content: space-between;
    gap: 25px
}

.page-hero {
    padding: 75px 0 45px
}

.page-hero h1 {
    font-size: clamp(2.7rem, 6vw, 4.7rem)
}

.article {
    max-width: 850px;
    margin: auto;
    padding: 0 28px 90px
}

.article p {
    color: #c6d3d0
}

.article h2 {
    margin: 45px 0 14px;
    font-size: 2rem
}

.article h3 {
    margin: 28px 0 12px
}

.article ul {
    color: #c6d3d0;
    padding-left: 23px
}

.article li {
    margin-bottom: 7px
}

.wide-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #cad0db
}

.figure {
    margin: 30px 0
}

.figure figcaption {
    color: var(--muted);
    font-size: .84rem;
    margin-top: 9px
}

.process {
    display: grid;
    grid-template-columns:repeat(3, 1fr);
    gap: 12px;
    margin: 22px 0
}

.process div {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 16px;
    background: var(--bg2);
    font-size: .9rem
}

.process strong {
    display: block;
    color: var(--accent)
}

.code-visual {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    background: #142024;
    color: #a6ddc3;
    font-size: .96rem;
    line-height: 2;
    padding: 30px;
    white-space: pre-wrap
}

.abstract-visual {
    background: radial-gradient(circle at 25% 20%, #386a646b, transparent 45%), linear-gradient(135deg, #1d3038, #162122);
    display: grid;
    place-items: center;
    color: #bce9d4;
    font-size: 5rem;
    font-family: 'Space Grotesk';
    letter-spacing: -.09em
}

.pill-note {
    font-size: .82rem;
    color: var(--muted)
}

.contact-card {
    padding: 35px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg2)
}

.mobile-menu {
    display: none
}

@media (max-width: 740px) {
    .container {
        padding: 0 20px
    }

    .nav {
        height: 66px
    }

    .links {
        gap: 12px
    }

    .links a {
        font-size: .82rem
    }

    .nav .btn {
        display: none
    }

    .hero {
        padding: 77px 0
    }

    .section {
        padding: 58px 0
    }

    .project-grid, .grid-2 {
        grid-template-columns:1fr;
        gap: 20px
    }

    .project .visual {
        height: 235px
    }

    .section-head {
        display: block
    }

    .foot .container {
        display: block
    }

    .process {
        grid-template-columns:1fr
    }

    .page-hero {
        padding: 55px 0 30px
    }

    .article {
        padding: 0 20px 65px
    }
}

.project-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.project-meta-row .meta {
    margin: 0;
}

/* In-progress status badge */
.project-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;

    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 6px;

    background: rgba(245, 158, 11, 0.10);
    color: #fbbf24;

    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ServUP terminal preview */
.servup-terminal {
    display: flex;
    flex-direction: column;
    gap: 10px;

    width: 85%;
    max-width: 360px;
    padding: 24px;

    background: #101719;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;

    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #9caeb0;

    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.terminal-prompt {
    color: var(--accent);
    font-weight: 600;
}

.terminal-success {
    color: #81d4a0;
}


.document-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}

.document-viewer {
    width: 100%;
    height: min(85vh, 1050px);

    overflow: hidden;
    background: #e8ecef;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
}

.document-viewer iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 640px) {
    .document-viewer {
        height: 70vh;
    }
}


/* CatScript grammar section */

.grammar-section {
    margin: 40px 0;
}

.grammar-viewer {
    margin-top: 24px;
    overflow: hidden;

    background: #0c1214;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.grammar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 18px 22px;
    cursor: pointer;

    background: #172124;
    color: #dce9e6;

    list-style: none;
    transition: background 0.2s ease;
}

.grammar-header::-webkit-details-marker {
    display: none;
}

.grammar-header:hover {
    background: #20302e;
}

.grammar-header:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -3px;
}

.grammar-filename {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.grammar-toggle {
    font-size: 0.75rem;
    font-weight: 600;
    color: #a5b8b5;
}

.grammar-toggle::after {
    content: " +";
    font-size: 1rem;
    margin-left: 8px;
}

.grammar-viewer[open] .grammar-toggle::after {
    content: " −";
}

.grammar-content {
    padding: 24px;
    border-top: 1px solid var(--line);
}

.grammar-content pre {
    margin: 0;
    padding: 0;
    overflow-x: auto;

    font-family: Consolas, "Cascadia Code", monospace;
    font-size: 0.82rem;
    line-height: 1.8;
    color: #b8d6cb;

    white-space: pre;
    tab-size: 4;
}

.grammar-content code {
    font: inherit;
}

.grammar-note {
    margin-top: 14px;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--muted);
}

@media (max-width: 640px) {
    .grammar-header {
        padding: 14px 16px;
    }

    .grammar-content {
        padding: 16px;
    }

    .grammar-content pre {
        font-size: 0.72rem;
    }
}


/* Compiler architecture diagram */

.architecture-diagram {
    margin: 24px 0 40px;
    width: 100%;
}

.architecture-diagram img {
    display: block;
    width: 100%;
    height: auto;

    border: 1px solid var(--line);
    border-radius: 12px;
}

.architecture-diagram figcaption {
    margin-top: 12px;

    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.5;
}


/* Contact page */

.contact-section {
    padding-top: 20px;
}

.contact-layout {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(32px, 6vw, 90px);
    align-items: start;
}

.contact-info h2,
.contact-form-card h2 {
    margin-bottom: 18px;
}

.contact-info > .muted {
    margin-bottom: 36px;
}

.contact-method {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.contact-label {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.contact-method a {
    color: var(--text);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.contact-method a:hover {
    color: var(--accent);
}

.contact-method p {
    margin: 0;
    color: var(--text);
}

.contact-form-card {
    padding: clamp(24px, 4vw, 40px);
    background: #172124;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}

.contact-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 13px 15px;
    margin-bottom: 12px;

    color: var(--text);
    background: #101719;

    border: 1px solid var(--line);
    border-radius: 8px;

    font: inherit;
    transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
}

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

.contact-submit {
    cursor: pointer;
    border: none;
    margin-top: 8px;
    align-self: flex-start;
}

.contact-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contact-form-note {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.6;
}

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

@media (max-width: 480px) {
    .contact-submit {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after {
        scroll-behavior: auto !important;
        transition: none !important
    }
}