:root {
    --bg: #fcfcfa;
    --surface: #ffffff;
    --surface-soft: #fcfdfc;
    --line: #d8dfe3;
    --line-strong: #b8c5cc;
    --text: #1c252b;
    --muted: #57656d;
    --primary: #0e7490;
    --primary-strong: #0b5d74;
    --accent: #ea580c;
    --shadow-soft: 0 8px 22px rgba(14, 38, 53, 0.05);
    --shadow-card: 0 3px 10px rgba(14, 38, 53, 0.04);
    --title-size: clamp(0.9rem, 2.2vw, 1.2rem);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    color: var(--text);
    font-family: "Courier New", "Courier Prime", "Liberation Mono", "Nimbus Mono PS", Courier, monospace;
    line-height: 1.62;
    background: #fffdf9;
    min-height: 100vh;
    text-rendering: geometricPrecision;
}

.noise-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(7, 24, 34, 0.02) 1px, transparent 1px);
    background-size: 100% 26px;
    opacity: 0.4;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 1rem;
    z-index: 30;
    background: var(--text);
    color: #fff;
    text-decoration: none;
    padding: 0.45rem 0.7rem;
    border-radius: 0;
}

.skip-link:focus {
    top: 1rem;
}

.site-header,
.site-shell,
.site-footer {
    width: min(1380px, calc(100% - 2.4rem));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.site-header {
    margin-top: 1.2rem;
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-title {
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.03em;
    font-size: var(--title-size);
    font-weight: 700;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.site-nav a {
    text-decoration: none;
    color: var(--primary-strong);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 0.45rem 0.7rem 0.25rem;
    font-size: 0.85rem;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    border-color: var(--primary);
    background: #ecf8fc;
    transform: translateY(-1px);
}

.site-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 1.2rem;
    align-items: start;
}

.site-main {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0;
    min-width: 0;
    padding: clamp(1rem, 3vw, 1.7rem);
    box-shadow: var(--shadow-soft);
    animation: enter-up 0.45s ease;
}

.site-main > :first-child {
    margin-top: 0;
}

.site-main h1,
.site-main h2,
.site-main h3 {
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.site-main h1 {
    font-size: var(--title-size);
}

.site-main h2 {
    font-size: clamp(0.84rem, 2vw, 1.08rem);
}

.site-main h3 {
    font-size: clamp(0.8rem, 1.7vw, 0.98rem);
}

.site-main h4 {
    font-size: clamp(0.76rem, 1.5vw, 0.9rem);
}

.site-main h5 {
    font-size: 0.76rem;
}

.site-main h6 {
    font-size: 0.72rem;
}

.site-main a {
    color: var(--primary-strong);
}

.site-main a:hover {
    color: var(--accent);
}

.projects-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 0.95rem;
    box-shadow: var(--shadow-card);
    animation: enter-up 0.55s ease;
}

.projects-heading {
    margin: 0 0 0.8rem;
    color: var(--text);
    font-size: 0.9rem;
    text-transform: lowercase;
}

.project-group {
    margin-bottom: 0.95rem;
}

.project-group:last-child {
    margin-bottom: 0;
}

.project-group h3 {
    margin: 0 0 0.45rem;
    color: var(--primary-strong);
    font-size: 0.72rem;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.project-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.project-item {
    padding: 0.5rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.project-item:hover {
    border-color: var(--line-strong);
    transform: translateX(1px);
}

.project-item a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
}

.project-item a:hover,
.project-item a:focus-visible {
    color: var(--primary-strong);
}

.project-type,
.project-description {
    margin: 0.22rem 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.hero {
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: 0;
    background:
        linear-gradient(160deg, rgba(14, 116, 144, 0.05), rgba(255, 255, 255, 0.96)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0 2px, rgba(248, 250, 250, 0.4) 2px 6px);
    padding: clamp(1rem, 3vw, 1.6rem);
}

.hero .hero-kicker {
    margin: 0;
    color: var(--primary-strong);
    font-size: 0.8rem;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    max-width: none;
    width: 100%;
    padding-top: 0.15rem;
}

.hero .hero-domain {
    text-transform: lowercase;
}

.hero h1 {
    margin: 0 0 0.6rem;
    font-size: var(--title-size);
    max-width: 22ch;
}

.hero p {
    margin: 0.45rem 0;
    color: #223039;
    max-width: 60ch;
}

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

.hero-note {
    color: var(--muted);
    font-size: 0.92rem;
}

.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.8rem;
}

.post-list li {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    border-radius: 0;
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow-card);
    animation: enter-up 0.35s ease both;
}

.post-list li:nth-child(2) {
    animation-delay: 0.04s;
}

.post-list li:nth-child(3) {
    animation-delay: 0.08s;
}

.post-title {
    margin: 0 0 0.35rem;
    font-size: clamp(0.84rem, 2vw, 1.08rem);
}

.post-title a {
    color: var(--text);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--primary-strong);
}

.post-meta,
.post-summary {
    margin: 0.25rem 0;
    color: var(--muted);
    font-size: 0.89rem;
}

.post {
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    min-width: 0;
    padding: clamp(1rem, 3vw, 1.35rem);
}

.post-header {
    border-bottom: 1px dashed var(--line);
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
}

.post-header h1 {
    margin: 0;
    font-size: var(--title-size);
}

.prose > * {
    width: 100%;
    max-width: 72ch;
    min-width: 0;
}

.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    margin-top: 1.3rem;
    margin-bottom: 0.5rem;
}

.post .prose h2 {
    font-size: clamp(0.84rem, 2vw, 1.08rem);
}

.post .prose h3 {
    font-size: clamp(0.8rem, 1.7vw, 0.98rem);
}

.post .prose h4 {
    font-size: clamp(0.76rem, 1.5vw, 0.9rem);
}

.post .prose h5 {
    font-size: 0.76rem;
}

.post .prose h6 {
    font-size: 0.72rem;
}

.prose p,
.prose li {
    color: #263740;
}

.prose ul {
    padding-left: 1.8rem;
}

.prose ol {
    padding-left: 2.7rem;
}

.prose table {
    width: 100%;
    max-width: 72ch;
    margin: 1rem 0 1.2rem;
    border-collapse: collapse;
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: var(--shadow-card);
    font-size: 0.9rem;
}

.prose thead {
    background: #f1f3f5;
}

.prose th,
.prose td {
    border: 1px solid var(--line);
    padding: 0.45rem 0.55rem;
    text-align: left;
    vertical-align: top;
}

.prose th {
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.prose blockquote {
    margin: 1rem 1.25rem;
}

.prose code {
    background: #f0f4f7;
    border: 1px solid #dde5ea;
    border-radius: 0;
    padding: 0.04rem 0.28rem;
    font-size: 0.9em;
}

.prose pre {
    background: #fcfcfc;
    border: 1px dashed #0b5d74;
    border-radius: 0;
    max-width: 100%;
    padding: 0.8rem 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.prose pre code {
    display: block;
    min-width: max-content;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9em;
}

.site-footer {
    margin-top: 1.2rem;
    margin-bottom: 1.3rem;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    color: var(--muted);
    padding: 1.2rem 1rem 0.9rem;
    font-size: 0.86rem;
    line-height: 1.35;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: var(--primary-strong);
}

.projects-sidebar::-webkit-scrollbar {
    width: 10px;
}

.projects-sidebar::-webkit-scrollbar-track {
    background: #eff4f8;
    border-radius: 0;
}

.projects-sidebar::-webkit-scrollbar-thumb {
    background: #bdd2dd;
    border-radius: 0;
    border: 2px solid #eff4f8;
}

@keyframes enter-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .site-shell {
        grid-template-columns: 1fr;
    }

    .projects-sidebar {
        position: static;
        max-height: none;
        margin-top: 0.8rem;
    }
}

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

    .prose table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .prose th,
    .prose td {
        padding: 0.42rem 0.5rem;
    }

    .site-header,
    .site-shell,
    .site-footer {
        width: min(100%, calc(100% - 1.1rem));
    }

    .site-main,
    .projects-sidebar {
        border-radius: 0;
    }

    .post-list li {
        padding: 0.82rem 0.85rem;
    }
}
