body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0 auto;
    max-width: 1100px;
    padding: 0 1rem 3rem;
    color: #333;
    line-height: 1.6;
}

h1,
h2,
h3 {
    color: #1a1a1a;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

h2 {
    margin-top: 2.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #ddd;
    padding-bottom: 0.25rem;
}

h3 {
    margin: 1.6rem 0 0.35rem;
    font-size: 1.05rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    align-items: center;
    margin: 1rem auto 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ddd;
    font-size: 0.95rem;
}

.site-nav a {
    color: #444;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: #0066cc;
    text-decoration: underline;
    text-underline-offset: 0.22rem;
}

a:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 2px;
}

.layout {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0;
    box-sizing: border-box;
    gap: 3rem;
}

.content,
.main-column {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: #f9f9f9;
    padding: 1rem;
    border-left: 1px solid #ccc;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.sidebar h2:first-child {
    margin-top: 0;
}

.sidebar h2:not(:first-child) {
    margin-top: 2rem;
}

.sidebar ul {
    list-style: none;
    padding-left: 0;
}

.sidebar-column {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-column .sidebar {
    width: 100%;
}

.credentials-sidebar {
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }

    .home-layout {
        gap: 0;
    }

    .sidebar {
        width: 100%;
        margin-top: 2rem;
        border-left: none;
        border-top: 1px solid #ccc;
        box-shadow: none;
    }

    .home-layout > .main-column,
    .home-layout > .sidebar-column {
        display: contents;
    }

    .home-layout .banner {
        order: 1;
        width: 100%;
        margin-bottom: 1rem;
        box-sizing: border-box;
    }

    .home-layout .contact-sidebar {
        order: 2;
        margin-top: 0;
        margin-bottom: 1rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .home-layout .contact-sidebar h2 {
        margin-bottom: 0.35rem;
    }

    .home-layout .contact-sidebar p,
    .home-layout .contact-sidebar ul {
        margin-top: 0.25rem;
        margin-bottom: 0.25rem;
    }

    .home-layout .content {
        order: 3;
        width: 100%;
    }

    .home-layout .credentials-sidebar {
        order: 4;
    }
}

.banner {
    background: url('./images/GitHubIOBanner.png') no-repeat center center;
    background-size: cover;
    padding: 4rem 1rem;
    border-radius: 12px;
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: fadeInSlideUp 1s ease-out both;
}

.banner h1,
.banner p {
    color: white;
}

.banner p {
    margin: 0.5rem 0 0;
    font-size: 1.2rem;
}

p {
    margin-top: 0.5rem;
}

.project {
    margin-bottom: 2rem;
}

.project:target {
    outline: 2px solid #0066cc;
    outline-offset: 8px;
    border-radius: 4px;
}

.equation-card {
    margin: 1.75rem 0 2rem;
    padding: 1.2rem 1rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    text-align: center;
}

.equation {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.12em 0.28em;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 6vw, 3.6rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.equation sub {
    font-size: 0.52em;
    line-height: 0;
    position: relative;
    bottom: -0.12em;
}

.equation-op {
    font-weight: 400;
    padding: 0 0.03em;
}

.equation-caption {
    margin: 0.8rem auto 0;
    max-width: 48rem;
    line-height: 1.4;
}

.technical-notes-callout {
    margin-top: 2.5rem;
    padding: 1rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
}

.technical-notes-callout h3 {
    margin-top: 0;
}

.repo-note {
    font-size: 0.95rem;
    color: #555;
}

.contact-link {
    text-decoration: none;
    color: #0066cc;
}

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

footer {
    margin-top: 3rem;
    font-size: 0.95rem;
    color: #777;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
}

table th,
table td {
    border: 1px solid #d4d4d4;
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

table th {
    background: #f5f5f5;
    font-weight: 650;
}

.cert-badges img {
    display: block;
    margin-bottom: 1rem;
    max-width: 100%;
    height: auto;
}

.bibliography-intro {
    max-width: 52rem;
    color: #555;
}

.bibliography {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bibliography li {
    padding: 0.9rem 0;
    border-bottom: 1px solid #e5e5e5;
}

.bibliography li:first-child {
    border-top: 1px solid #e5e5e5;
}

.citation-title {
    font-weight: 650;
}

.citation-meta {
    display: block;
    color: #666;
    font-size: 0.93rem;
    margin-top: 0.15rem;
}

.credential-table td:first-child {
    width: 9.5rem;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
    font-size: 0.92rem;
}

.reference-note {
    color: #666;
    font-size: 0.92rem;
}

.badge-entry {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    column-gap: 1.1rem;
    min-height: 96px;
}

.badge-entry > a,
.badge-entry > img {
    width: 96px;
    height: 96px;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-entry img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.badge-entry img[src*="voicexml"] {
    width: 76px;
    height: 96px;
}

.badge-entry .badge-text {
    min-width: 0;
}

.stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #0066cc;
    font-weight: bold;
}

.stat-label {
    font-size: 0.72rem;
    color: #777;
    letter-spacing: 0.05em;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0;
}

.tag {
    background: #f0f0f0;
    color: #555;
    font-size: 0.72rem;
    font-family: 'Courier New', monospace;
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    border: 1px solid #ddd;
}

@media (max-width: 640px) {
    body {
        padding: 0 0.8rem 2rem;
    }

    .layout {
        padding-top: 1rem;
    }

    .banner {
        padding: 2.8rem 0.8rem;
    }

    .equation-card {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    .credential-table,
    .credential-table tbody,
    .credential-table tr,
    .credential-table td {
        display: block;
        width: 100%;
    }

    .credential-table td:first-child {
        width: auto;
        border-bottom: 0;
        padding-bottom: 0.15rem;
    }

    .credential-table td:last-child {
        border-top: 0;
        padding-top: 0.15rem;
    }

    .badge-entry {
        grid-template-columns: 80px minmax(0, 1fr);
        column-gap: 0.85rem;
    }

    .badge-entry > a,
    .badge-entry > img {
        width: 80px;
        height: 88px;
    }

    .badge-entry img {
        width: 72px;
        height: 72px;
    }

    .badge-entry img[src*="voicexml"] {
        width: 68px;
        height: 86px;
    }
}


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

.media-grid-wide {
    grid-template-columns: 1fr;
}

.media-card {
    margin: 0;
}

.media-card figcaption {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.45rem;
}

.media-placeholder {
    min-height: 260px;
    border: 1px dashed #aaa;
    border-radius: 8px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1rem;
    text-align: center;
    color: #666;
    box-sizing: border-box;
}

.media-placeholder strong {
    color: #333;
}

.media-placeholder span {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
}

.generated-gallery .media-placeholder {
    min-height: 320px;
}

.generated-gallery .media-placeholder.landscape {
    min-height: 220px;
}

.architecture-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 1rem;
    margin: 1rem 0 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
}

.architecture-flow span {
    background: white;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    padding: 0.35rem 0.55rem;
    font-family: 'Courier New', monospace;
    font-size: 0.86rem;
}

.architecture-flow b {
    color: #777;
}

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

    .generated-gallery .media-placeholder,
    .generated-gallery .media-placeholder.landscape {
        min-height: 240px;
    }
}


.case-study-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fafafa;
}

.case-study-image.portrait {
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.case-study-image.landscape {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
