html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:root {
    --bg: #e9e3d5;
    --paper: #fdfcf8;
    --paper-strong: #f6f2e8;
    --ink: #231a08;
    --muted: #6c5a30;
    --link: #906700;
    --rule: #cdc1a4;
    --shadow: rgba(35, 26, 8, 0.12);
    --sans: 'Trebuchet MS', Verdana, sans-serif;
    --display: 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    --mono: 'IBM Plex Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
    --bg: #0f1620;
    --paper: #182231;
    --paper-strong: #202d40;
    --ink: #eef4ff;
    --muted: #aab9d2;
    --link: #7db7ff;
    --rule: #344860;
    --shadow: rgba(0, 0, 0, 0.34);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.45;
}

a {
    color: var(--link);
}

a:hover {
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.skip-link {
    position: fixed;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.7rem 1rem;
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    border: 1px solid var(--rule);
}

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

.page-shell {
    width: min(1140px, calc(100% - 32px));
    margin: 1.2rem auto 2rem;
}

.site-header,
.panel,
.site-footer {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 14px;
    box-shadow: 0 2px 8px var(--shadow);
}

.site-header {
    position: relative;
    padding: 1.6rem 1.4rem 1.1rem;
}

.site-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.site-kicker {
    margin: 0 0 0.35rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.site-title {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    line-height: 1;
    letter-spacing: 0.01em;
}

.site-tagline {
    margin: 0.6rem 0 0;
    font-size: 1.05rem;
    color: var(--muted);
}

.site-logo {
    width: 132px;
}

.site-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 132px;
    height: 132px;
    border: 1px solid var(--rule);
    border-radius: 28px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.site-logo-link:hover {
    text-decoration: none;
}

.site-logo-mark {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.55rem;
    filter: none;
}

[data-theme="dark"] .site-logo-link {
    background: radial-gradient(circle at 50% 32%, rgba(103, 171, 255, 0.18), rgba(8, 14, 24, 0.96) 72%);
}

[data-theme="dark"] .site-logo-mark {
    filter: hue-rotate(160deg) saturate(1.15) brightness(1.12) contrast(1.02) drop-shadow(0 0 20px rgba(116, 179, 255, 0.2));
    mix-blend-mode: screen;
}

.top-nav,
.utility-nav,
.language-nav,
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.1rem;
    align-items: center;
}

.top-nav {
    margin-top: 1.35rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--rule);
    font-size: clamp(1.05rem, 2.5vw, 1.45rem);
    justify-content: center;
}

.top-nav a {
    text-decoration: none;
}

.utility-row {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.utility-nav,
.language-nav {
    font-family: var(--mono);
    font-size: 0.78rem;
}

.floating-controls {
    position: fixed;
    top: 50%;
    right: 24px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transform: translateY(-50%);
}

.floating-panel {
    display: grid;
    gap: 0.5rem;
    padding: 0.7rem;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    border: 1px solid var(--rule);
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow);
    backdrop-filter: blur(10px);
}

.floating-panel .theme-toggle,
.floating-panel .language-nav a {
    width: 100%;
}

.floating-panel .language-nav {
    display: grid;
    gap: 0.5rem;
}

.theme-toggle,
.utility-link,
.language-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--rule);
    background: var(--paper-strong);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}

.utility-link {
    gap: 0.55rem;
}

.utility-link.linkedin-link {
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 14px;
    background: color-mix(in srgb, var(--paper-strong) 78%, #0A66C2 22%);
}

.utility-link.github-link {
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 14px;
    background: color-mix(in srgb, var(--paper-strong) 82%, #171515 18%);
}

[data-theme="dark"] .utility-link.linkedin-link {
    background: color-mix(in srgb, var(--paper-strong) 70%, #0A66C2 30%);
}

[data-theme="dark"] .utility-link.github-link {
    background: color-mix(in srgb, var(--paper-strong) 76%, #5c6f86 24%);
}

.brand-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.language-nav a.active {
    font-weight: 700;
}

.theme-toggle svg {
    width: 14px;
    height: 14px;
}

.theme-toggle .moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon {
    display: inline-block;
}

.content-stack {
    display: grid;
    gap: 1.15rem;
    margin-top: 1.15rem;
}

.panel {
    padding: 1.35rem 1.3rem;
}

.panel h2,
.panel h3 {
    margin: 0 0 1rem;
    font-family: var(--display);
    line-height: 1.08;
    letter-spacing: 0.01em;
}

.panel h2 {
    font-size: clamp(2rem, 4vw, 3.25rem);
}

.panel h3 {
    font-size: 1.5rem;
}

.panel p,
.panel li,
.panel dd,
.panel dt,
.panel th,
.panel td {
    font-size: 1.02rem;
}

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

.panel p,
.panel ul,
.panel dl,
.panel table,
.panel blockquote {
    margin: 0 0 1rem;
}

.panel ul {
    padding-left: 1.5rem;
}

.hero-copy {
    max-width: 72rem;
}

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

.metric {
    padding: 0.9rem;
    border: 1px solid var(--rule);
    background: var(--paper-strong);
}

.metric-label {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-value {
    font-family: var(--display);
    font-size: 2rem;
    line-height: 1;
}

.columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.2rem;
}

.note-box {
    padding: 0.95rem 1rem;
    border: 1px solid var(--rule);
    background: var(--paper-strong);
}

.note-box+.note-box {
    margin-top: 0.8rem;
}

.note-box h3 {
    margin-bottom: 0.55rem;
    font-size: 1.2rem;
}

blockquote {
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--link);
    background: var(--paper-strong);
}

.archive-intro {
    margin-bottom: 0.8rem;
}

.archive-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--rule);
    background: var(--paper-strong);
}

.archive-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.archive-table caption {
    padding: 0.8rem 1rem;
    text-align: left;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.archive-table th,
.archive-table td {
    padding: 0.75rem 0.9rem;
    border-top: 1px solid var(--rule);
    text-align: left;
    vertical-align: top;
}

.archive-table thead th {
    border-top: 0;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.archive-table tbody tr:nth-child(even) {
    background: rgba(144, 103, 0, 0.05);
}

.repo-name {
    font-weight: 700;
}

.repo-meta {
    font-family: var(--mono);
    font-size: 0.82rem;
}

.repo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.repo-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--rule);
    background: var(--paper);
    color: var(--link);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.76rem;
    cursor: pointer;
}

button.repo-action {
    appearance: none;
}

.readme-row[hidden] {
    display: none;
}

.readme-cell {
    padding: 0;
}

.readme-panel {
    padding: 1rem;
    background: var(--paper);
}

.readme-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
}

.readme-title {
    margin: 0;
    font-family: var(--display);
    font-size: 1.35rem;
    letter-spacing: 0.01em;
}

.readme-content {
    overflow-x: auto;
}

.github-readme {
    color: #1f2328;
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    font-size: 16px;
    line-height: 1.5;
}

[data-theme="dark"] .github-readme {
    color: #f0f6fc;
    background: #0d1117;
    border-color: #30363d;
}

.github-readme a {
    color: #0969da;
}

[data-theme="dark"] .github-readme a {
    color: #58a6ff;
}

.github-readme> :first-child {
    margin-top: 0;
}

.github-readme> :last-child {
    margin-bottom: 0;
}

.github-readme h1,
.github-readme h2,
.github-readme h3,
.github-readme h4,
.github-readme h5,
.github-readme h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: normal;
    font-family: inherit;
}

.github-readme h1 {
    font-size: 2em;
}

.github-readme h2 {
    font-size: 1.5em;
}

.github-readme h3 {
    font-size: 1.25em;
}

.github-readme h4 {
    font-size: 1em;
}

.github-readme h5 {
    font-size: 0.875em;
}

.github-readme h6 {
    font-size: 0.85em;
    color: #57606a;
}

[data-theme="dark"] .github-readme h6 {
    color: #9198a1;
}

.github-readme h1,
.github-readme h2 {
    padding-bottom: 0.3em;
    border-bottom: 1px solid #d8dee4;
}

[data-theme="dark"] .github-readme h1,
[data-theme="dark"] .github-readme h2 {
    border-bottom-color: #21262d;
}

.github-readme p,
.github-readme ul,
.github-readme ol,
.github-readme dl,
.github-readme table,
.github-readme blockquote,
.github-readme pre {
    margin-top: 0;
    margin-bottom: 16px;
}

.github-readme ul,
.github-readme ol {
    padding-left: 2em;
}

.github-readme ul.contains-task-list,
.github-readme ul.contains-task-list ul {
    list-style: none;
    padding-left: 0;
}

.github-readme .task-list-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.github-readme .task-list-item input {
    margin: 0.22rem 0 0;
}

.github-readme li+li {
    margin-top: 0.25em;
}

.github-readme code,
.github-readme pre {
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, 'Liberation Mono', monospace;
}

.github-readme code {
    padding: 0.2em 0.4em;
    border-radius: 6px;
    background: rgba(175, 184, 193, 0.2);
    font-size: 85%;
}

.github-readme kbd {
    display: inline-block;
    padding: 0.18em 0.4em;
    border: 1px solid rgba(31, 35, 40, 0.15);
    border-bottom-color: rgba(31, 35, 40, 0.35);
    border-radius: 6px;
    box-shadow: inset 0 -1px 0 rgba(31, 35, 40, 0.12);
    background: #f6f8fa;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 0.85em;
}

[data-theme="dark"] .github-readme kbd {
    border-color: rgba(240, 246, 252, 0.15);
    border-bottom-color: rgba(240, 246, 252, 0.35);
    box-shadow: inset 0 -1px 0 rgba(240, 246, 252, 0.12);
    background: #161b22;
}

.github-readme pre {
    padding: 16px;
    overflow: auto;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    background: #f6f8fa;
    line-height: 1.45;
}

[data-theme="dark"] .github-readme pre {
    background: #161b22;
    border-color: #30363d;
}

.github-readme pre code {
    padding: 0;
    background: transparent;
    font-size: 100%;
    white-space: pre;
}

.github-readme blockquote {
    padding: 0 1em;
    color: #57606a;
    border-left: 0.25em solid #d0d7de;
    background: transparent;
}

[data-theme="dark"] .github-readme blockquote {
    color: #9198a1;
    border-left-color: #3d444d;
}

.github-readme table {
    display: block;
    width: max-content;
    max-width: 100%;
    overflow: auto;
    border-collapse: collapse;
}

.github-readme th,
.github-readme td {
    padding: 6px 13px;
    border: 1px solid #d0d7de;
}

[data-theme="dark"] .github-readme th,
[data-theme="dark"] .github-readme td {
    border-color: #30363d;
}

.github-readme tr {
    background: #ffffff;
    border-top: 1px solid #d8dee4;
}

.github-readme tr:nth-child(2n) {
    background: #f6f8fa;
}

[data-theme="dark"] .github-readme tr {
    background: #0d1117;
    border-top-color: #21262d;
}

[data-theme="dark"] .github-readme tr:nth-child(2n) {
    background: #161b22;
}

.github-readme img {
    max-width: 100%;
    height: auto;
}

.github-readme details {
    margin-bottom: 16px;
}

.github-readme summary {
    cursor: pointer;
}

.github-readme a code {
    color: inherit;
}

.github-readme hr {
    height: 0.25em;
    margin: 24px 0;
    padding: 0;
    background: #d0d7de;
    border: 0;
}

[data-theme="dark"] .github-readme hr {
    background: #21262d;
}

.readme-placeholder {
    margin: 0;
    font-family: var(--mono);
    color: var(--muted);
}

.loading-repos,
.error-repos,
.no-repos {
    padding: 1rem;
    border: 1px solid var(--rule);
    background: var(--paper-strong);
    font-family: var(--mono);
    color: var(--muted);
}

.contact-links a {
    text-decoration: none;
}

.contact-links {
    gap: 0.85rem;
}

.contact-button {
    width: 88px;
    height: 88px;
    padding: 0;
    justify-content: center;
    border-radius: 20px;
}

.contact-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    border: 1px solid var(--rule);
    background: var(--paper);
    flex: 0 0 auto;
}

.contact-thumb svg {
    width: 34px;
    height: 34px;
}

.contact-label {
    font-family: var(--mono);
    font-size: 0.82rem;
}

.site-footer {
    margin-top: 1.15rem;
    padding: 1rem 1.3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem;
    font-size: 0.92rem;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 820px) {

    .utility-row {
        position: static;
        justify-content: center;
        margin-top: 1rem;
        padding-top: 0.9rem;
        border-top: 1px solid var(--rule);
    }

    .floating-controls {
        top: auto;
        right: 16px;
        bottom: 16px;
        transform: none;
    }

    .site-brand,
    .columns,
    .metrics {
        grid-template-columns: 1fr;
    }

    .site-logo {
        width: 96px;
    }

    .site-logo-link {
        width: 96px;
        height: 96px;
        border-radius: 22px;
    }

    .site-logo-mark {
        width: 100%;
        height: 100%;
    }

    .panel,
    .site-header,
    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 560px) {
    .page-shell {
        width: min(100% - 16px, 1140px);
        margin-top: 0.75rem;
    }

    .top-nav {
        font-size: 1rem;
    }

    .floating-controls {
        right: 8px;
        left: 8px;
    }

    .floating-panel {
        grid-template-columns: 1fr;
    }

    .panel h2 {
        font-size: 2rem;
    }

    .github-readme {
        padding: 16px;
        font-size: 15px;
    }
}