@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    --bg-base: #07100f;
    --bg-band: #0b1715;
    --bg-surface: #101c1a;
    --bg-surface-hover: #172522;
    --border-color: rgba(235, 240, 236, 0.11);
    --border-strong: rgba(235, 240, 236, 0.22);
    --text-primary: #f1f5f2;
    --text-secondary: #b9c4bd;
    --text-muted: #7f8c85;
    --accent-cyan: #4dd6c7;
    --accent-blue: #65a8ff;
    --accent-green: #79d28a;
    --accent-amber: #f4bf63;
    --accent-rust: #ef7d5b;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.28);
    --transition-smooth: all 0.22s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        var(--bg-base);
    background-size: 72px 72px;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: clip;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

a {
    color: inherit;
}

:where(a, button):focus-visible {
    outline: 3px solid var(--accent-amber);
    outline-offset: 3px;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 2rem;
}

header {
    background: rgba(7, 16, 15, 0.84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    transition: background-color 160ms ease, box-shadow 160ms ease;
    z-index: 100;
}

header.scrolled {
    background: rgba(7, 16, 15, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

header.menu-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
}

body.menu-open {
    overflow: hidden !important;
    overscroll-behavior: contain;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
    gap: 1.5rem;
}

.logo {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

#navbar ul {
    align-items: center;
    display: flex;
    gap: 1.25rem;
    list-style: none;
}

#navbar a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 0;
    position: relative;
    text-decoration: none;
    transition: var(--transition-smooth);
}

#navbar a:hover,
#navbar a.active {
    color: var(--text-primary);
}

#navbar a::after {
    background: var(--accent-cyan);
    bottom: 0;
    content: '';
    height: 2px;
    left: 0;
    position: absolute;
    transition: var(--transition-smooth);
    width: 0;
}

#navbar a:hover::after,
#navbar a.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    display: none;
    height: 44px;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 10px;
    position: relative;
    width: 44px;
    z-index: 101;
}

.mobile-menu-toggle span {
    background: var(--text-primary);
    border-radius: 2px;
    display: block;
    height: 2px;
    left: 7px;
    opacity: 1;
    position: absolute;
    transition: var(--transition-smooth);
    width: 30px;
}

.mobile-menu-toggle span:nth-child(1) {
    top: 12px;
}

.mobile-menu-toggle span:nth-child(2) {
    top: 21px;
}

.mobile-menu-toggle span:nth-child(3) {
    top: 30px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    background: var(--accent-cyan);
    top: 21px;
    transform: rotate(135deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    left: -60px;
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    background: var(--accent-cyan);
    top: 21px;
    transform: rotate(-135deg);
}

.hero {
    padding-bottom: 5rem;
    padding-top: 7rem;
    position: relative;
}

.hero-profile {
    align-items: center;
    display: grid;
    gap: 3rem;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    padding-bottom: 3rem;
    padding-top: 4rem;
}

.hero-tag,
.project-tag,
.patent-number {
    color: var(--accent-cyan);
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.hero h1 {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: clamp(3.1rem, 6vw, 4.8rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 0.94;
    margin-bottom: 1rem;
}

.focus-card-link {
    color: inherit;
    text-decoration: none;
}

#project-aviro360,
#project-edge-ai,
#project-civics-tests,
#project-bragg-live {
    scroll-margin-top: 90px;
}

.role-line {
    color: var(--accent-amber);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.4rem;
    max-width: 780px;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
    max-width: 720px;
}

#hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.hero-secondary-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.hero-secondary-links .text-link + .text-link {
    border-left: 1px solid var(--border-color);
    margin-left: 1rem;
    padding-left: 1rem;
}

.hero-link-separator {
    color: var(--border-strong);
    margin: 0 0.7rem;
}

.hero-secondary-links .text-link {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.hero-secondary-links .text-link:hover {
    color: var(--accent-cyan);
}

.btn {
    align-items: center;
    background: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
    border-radius: 8px;
    color: #06100f;
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-body);
    font-weight: 800;
    gap: 0.5rem;
    justify-content: center;
    min-height: 44px;
    padding: 0.72rem 1.35rem;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.btn:hover {
    box-shadow: 0 10px 28px rgba(77, 214, 199, 0.22);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
}

.btn-sm {
    font-size: 0.84rem;
    min-height: 38px;
    padding: 0.52rem 0.95rem;
}

.text-link {
    color: var(--accent-cyan);
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
}

.text-link:hover {
    color: var(--accent-amber);
}

.hero-system-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    padding: 1.1rem;
}

.topology-heading {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
}

.topology-heading span,
.topology-zone-label,
.topology-recovery span {
    color: var(--accent-cyan);
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.topology-heading strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-top: 0.2rem;
}

.topology-diagram {
    align-items: stretch;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr);
}

.topology-zone {
    background: rgba(7, 16, 15, 0.48);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: grid;
    gap: 0.5rem;
    padding: 0.65rem;
}

.topology-cloud-zone {
    border-color: rgba(101, 168, 255, 0.28);
}

.topology-zone small {
    align-self: end;
    color: var(--text-muted);
    font-size: 0.64rem;
    line-height: 1.3;
}

.topology-node {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent-green);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.55rem 0.6rem;
}

.topology-node-cloud {
    border-left-color: var(--accent-blue);
}

.topology-node strong,
.topology-node span {
    display: block;
}

.topology-node strong {
    font-family: var(--font-heading);
    font-size: 0.78rem;
}

.topology-node span {
    color: var(--text-muted);
    font-size: 0.61rem;
    line-height: 1.3;
}

.topology-exchange {
    align-content: center;
    display: grid;
    gap: 0.6rem;
}

.topology-flow {
    color: var(--text-muted);
    display: grid;
    font-size: 0.58rem;
    font-weight: 700;
    gap: 0.25rem;
    text-align: center;
}

.topology-flow i {
    background: var(--accent-cyan);
    display: block;
    height: 2px;
    position: relative;
}

.topology-flow-out i::after,
.topology-flow-in i::before {
    border-bottom: 4px solid transparent;
    border-top: 4px solid transparent;
    content: "";
    position: absolute;
    top: -3px;
}

.topology-flow-out i::after {
    border-left: 6px solid var(--accent-cyan);
    right: -1px;
}

.topology-flow-in i::before {
    border-right: 6px solid var(--accent-amber);
    left: -1px;
}

.topology-flow-in i {
    background: var(--accent-amber);
}

.topology-trust {
    color: var(--text-secondary);
    font-size: 0.58rem;
    line-height: 1.35;
    text-align: center;
}

.topology-recovery {
    background: rgba(244, 191, 99, 0.07);
    border: 1px solid rgba(244, 191, 99, 0.22);
    border-radius: 6px;
    margin-top: 0.75rem;
    padding: 0.6rem 0.7rem;
}

.topology-recovery span {
    color: var(--accent-amber);
}

.topology-recovery strong {
    display: block;
    font-size: 0.68rem;
    margin-top: 0.2rem;
}

.system-diagram {
    display: grid;
    gap: 0.6rem;
}

.diagram-node {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 700;
    min-height: 48px;
    padding: 0.75rem 0.85rem;
}

.diagram-node:nth-of-type(3) {
    border-left-color: var(--accent-amber);
}

.diagram-node:nth-of-type(5) {
    border-left-color: var(--accent-green);
}

.diagram-connector {
    background: var(--border-strong);
    height: 16px;
    margin-left: 1.4rem;
    width: 2px;
}

section.section-block {
    border-top: 1px solid var(--border-color);
    padding-bottom: 5.5rem;
    padding-top: 5.5rem;
}

.compact-section {
    padding-top: 4rem;
}

.section-heading-row {
    align-items: end;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
}

.section-title {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.08;
    margin-bottom: 1rem;
}

.section-title a,
.section-title-link {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.section-title a:hover,
.section-title-link:hover {
    color: var(--accent-cyan);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 400;
    margin-bottom: 2.8rem;
    max-width: 720px;
}

.metric-grid,
.focus-grid,
.article-grid {
    display: grid;
    gap: 1rem;
}

.metric-grid {
    grid-template-columns: repeat(4, 1fr);
}

.focus-grid {
    grid-template-columns: repeat(3, 1fr);
}

.article-grid {
    grid-template-columns: repeat(3, 1fr);
}

.metric-card,
.focus-card,
.article-card,
.list-panel,
.project-featured-card,
.patent-card,
.resume-panel {
    background: rgba(16, 28, 26, 0.86);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.metric-card,
.focus-card,
.article-card,
.list-panel,
.resume-panel {
    padding: 1.25rem;
}

.metric-card:hover,
.focus-card:hover,
.article-card:hover,
.list-panel:hover,
.project-featured-card:hover,
.patent-card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-strong);
    transform: translateY(-3px);
}

.metric-card strong {
    color: var(--accent-amber);
    display: block;
    font-family: var(--font-heading);
    font-size: 1.7rem;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.metric-card span,
.focus-card p,
.article-card p,
.list-panel small,
.resume-panel p,
.resume-panel li {
    color: var(--text-secondary);
}

.metric-card-link {
    cursor: pointer;
    display: block;
    text-decoration: none;
}

.metric-card-link:hover {
    border-color: var(--accent-cyan);
}

.metric-card-link:hover span {
    color: var(--text-primary);
}

.focus-card h3,
.article-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.article-card h3 a {
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

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

.project-featured-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-featured-image-wrapper {
    aspect-ratio: 16 / 9;
    background: #050b0a;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    width: 100%;
}

.project-featured-image {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
    width: 100%;
}

.project-featured-card:hover .project-featured-image,
.patent-card:hover .patent-image {
    transform: scale(1.03);
}

.project-featured-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.45rem;
}

.project-title {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.65rem;
}

.project-summary,
.patent-summary {
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.65;
}

.project-summary {
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

.project-influence {
    border-left: 2px solid var(--accent-cyan);
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.55;
    margin-bottom: 1.1rem;
    padding-left: 0.8rem;
}

.project-influence strong {
    color: var(--text-primary);
}

.compact-products-grid {
    gap: 0.8rem;
}

.compact-products-section {
    padding-bottom: 4rem !important;
    padding-top: 4rem !important;
}

.compact-product-card .project-featured-content {
    padding: 1.1rem 1.2rem;
}

.compact-product-card .project-title {
    font-size: 1.2rem;
}

.compact-product-card .project-summary {
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 0.9rem;
}

.compact-product-card .tech-tags {
    margin-bottom: 0.85rem;
}

.compact-product-card .project-links {
    margin-top: 0;
}

.project-disclosure {
    border-left: 2px solid var(--accent-amber);
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.55;
    margin-top: 1.25rem;
    padding-left: 0.85rem;
}

.project-group-title {
    margin-bottom: 1.5rem;
    margin-top: 3.5rem;
}

#projects-showcase-section > .project-group-title:first-child {
    margin-top: 0;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tech-badge {
    background: rgba(77, 214, 199, 0.1);
    border: 1px solid rgba(77, 214, 199, 0.22);
    border-radius: 4px;
    color: var(--accent-cyan);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.24rem 0.55rem;
}

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

.list-panel {
    display: grid;
    gap: 0.4rem;
    min-height: 150px;
    text-decoration: none;
}

.list-panel span {
    color: var(--accent-cyan);
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
}

.list-panel strong {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.18rem;
    line-height: 1.25;
}

.patent-card {
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    margin-bottom: 2rem;
    overflow: hidden;
    padding: 1.6rem;
}

.patent-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.patent-header {
    margin-bottom: 1.25rem;
}

.patent-title {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 0.7rem;
}

.patent-date {
    color: var(--text-muted);
    display: block;
    font-size: 0.92rem;
    margin-bottom: 1.2rem;
}

.patent-summary {
    margin-bottom: 1.5rem;
}

.metadata-grid {
    border-top: 1px solid var(--border-color);
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 1.6rem;
    padding-top: 1.25rem;
}

.meta-item h4,
.resume-panel h3 {
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.meta-item p {
    color: var(--text-primary);
    font-size: 0.94rem;
    font-weight: 700;
}

.architecture-review {
    border-top: 1px solid var(--border-color);
    grid-column: 1 / -1;
    padding-top: 1.5rem;
}

.architecture-review-heading {
    max-width: 780px;
}

.architecture-review-heading h3 {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.35rem;
    line-height: 1.3;
    margin: 0.35rem 0 0.65rem;
}

.architecture-review-heading p {
    color: var(--text-secondary);
}

.architecture-decision-list {
    display: grid;
    gap: 0 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1.5rem;
}

.architecture-decision {
    border-top: 1px solid var(--border-color);
    padding: 1rem 0 1.1rem;
}

.architecture-decision dt {
    color: var(--accent-cyan);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.architecture-decision dd {
    color: var(--text-primary);
    font-size: 0.94rem;
    margin: 0;
}

.patent-visual {
    aspect-ratio: 4 / 3;
    background: #050b0a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.patent-image {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
    width: 100%;
}

.case-study-grid,
.resume-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr;
}

.case-study-grid {
    margin-bottom: 2rem;
}

.case-study-section {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
}

.resume-panel ul {
    margin-left: 1.1rem;
}

.resume-panel li + li {
    margin-top: 0.45rem;
}

.section-block > .resume-panel + .resume-panel {
    margin-top: 1rem;
}

.resume-panel p + p,
.resume-panel p + ul,
.resume-panel ul + p {
    margin-top: 0.7rem;
}

.resume-project-tag {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.resume-detail {
    margin-top: 0.5rem;
}

.resume-tech-tags,
.resume-link {
    margin-top: 0.75rem;
}

.resume-evidence {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.footer-version {
    font-size: 0.85em;
    margin-left: 0.5rem;
    opacity: 0.5;
}

.article-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 150px;
    position: relative;
}

.article-card h3 a::after {
    content: '';
    inset: 0;
    position: absolute;
}

.article-card h3 a:focus-visible {
    outline: none;
}

.article-card h3 a:focus-visible::after {
    border-radius: 8px;
    outline: 3px solid var(--accent-amber);
    outline-offset: 3px;
}

.article-card .project-links {
    position: relative;
    z-index: 1;
}

.article-card p {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.article-card .article-card-meta {
    color: var(--text-muted);
    flex-grow: 0;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.resume-machine-links,
.resume-contact-line {
    color: var(--text-muted);
    font-size: 0.88rem !important;
}

.resume-machine-links {
    margin-top: 1rem;
}

.resume-contact-line {
    margin-top: 1.4rem;
}

footer {
    background: #050b0a;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 3rem 0;
}

.footer-grid {
    align-items: center;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.footer-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-nav a:hover {
    color: var(--text-primary);
}

.footer-copyright {
    font-size: 0.85rem;
}

.site-version {
    white-space: nowrap;
}

.modal-overlay {
    align-items: center;
    background: rgba(5, 11, 10, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    height: 100%;
    justify-content: center;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    transition: opacity 0.25s ease;
    width: 100%;
    z-index: 1000;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    max-height: 88vh;
    max-width: 460px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2rem;
    position: relative;
    transform: translateY(10px);
    transition: transform 0.25s ease;
    width: 90%;
}

.modal-overlay.open .modal-card {
    transform: translateY(0);
}

.modal-close-btn {
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.75rem;
    height: 44px;
    justify-content: center;
    line-height: 1;
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem;
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    transition: var(--transition-smooth);
    width: 44px;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-title {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.modal-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-link-item {
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    gap: 0.9rem;
    padding: 0.9rem;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.modal-link-item:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.icon-wrapper {
    align-items: center;
    background: rgba(77, 214, 199, 0.1);
    border-radius: 8px;
    color: var(--accent-cyan);
    display: flex;
    flex: 0 0 44px;
    font-size: 0.76rem;
    font-weight: 800;
    height: 44px;
    justify-content: center;
    text-transform: uppercase;
    width: 44px;
}

.link-icon {
    height: 20px;
    width: 20px;
}

.link-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.link-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.link-value {
    color: var(--text-primary);
    font-size: 0.94rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

.animated-item {
    animation: fadeInUp 0.65s ease forwards;
    opacity: 0;
}

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

    .animated-item {
        animation: none;
        opacity: 1;
        transform: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}

.showcase-section {
    padding-bottom: 6rem;
}

.policy-hero {
    padding-bottom: 2rem;
}

.policy-title {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-top: 0;
}

.not-found-guidance {
    margin-bottom: 1.8rem;
}

.terminal-suggestion {
    color: var(--accent-cyan);
    font-size: 0.85rem;
}

.terminal-suggestion a {
    color: var(--accent-cyan);
    text-decoration: underline;
}

.delay-1 {
    animation-delay: 0.12s;
}

.delay-2 {
    animation-delay: 0.22s;
}

.delay-3 {
    animation-delay: 0.32s;
}

@media (max-width: 980px) {
    .hero-profile,
    .metric-grid,
    .focus-grid,
    .article-grid,
    .patent-card,
    .case-study-grid,
    .resume-grid {
        grid-template-columns: 1fr;
    }

    .hero-system-card {
        width: 100%;
        max-width: 560px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.35rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    #navbar {
        align-items: center;
        background: rgba(7, 16, 15, 0.98);
        border-top: 1px solid var(--border-color);
        bottom: 0;
        display: flex;
        height: calc(100dvh - 70px);
        max-height: calc(100dvh - 70px);
        justify-content: center;
        left: 0;
        opacity: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 2rem 1rem;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 70px;
        transform: translateY(-10px);
        transition: opacity 0.25s ease, transform 0.25s ease;
        width: 100%;
        z-index: 999;
    }

    #navbar.open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    #navbar ul {
        flex-direction: column;
        gap: 1.5rem;
    }

    #navbar a {
        display: inline-block;
        font-size: 1.35rem;
        padding: 0.6rem 1.2rem;
    }

    .hero {
        padding-bottom: 3rem;
        padding-top: 4.5rem;
    }

    .hero h1 {
        font-size: clamp(2.3rem, 7.5vw, 3.2rem);
    }

    .hero p {
        font-size: 1.05rem;
    }

    .topology-diagram {
        grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    }

    section.section-block {
        padding-bottom: 4rem;
        padding-top: 4rem;
    }

    .section-heading-row,
    .footer-grid {
        align-items: flex-start;
        flex-direction: column;
    }

    .projects-featured-grid,
    .split-list {
        grid-template-columns: 1fr;
    }

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

    .architecture-decision-list {
        grid-template-columns: 1fr;
    }

    .article-body pre {
        font-size: 0.82rem;
        padding: 1rem;
    }

    .article-body .ascii-diagram {
        font-size: 0.74rem;
    }

    .article-body table {
        font-size: 0.88rem;
    }

    .article-body th,
    .article-body td {
        padding: 0.75rem 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1rem;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 7vw, 2.55rem);
    }

    .role-line {
        font-size: 0.98rem;
    }

    #hero-actions,
    .project-links {
        flex-direction: column;
        width: 100%;
    }

    #hero-actions .btn,
    .project-links .btn {
        width: 100%;
    }

    .topology-diagram {
        gap: 0.45rem;
        grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
    }

    .topology-zone {
        padding: 0.5rem;
    }

    .topology-trust,
    .topology-flow {
        font-size: 0.52rem;
    }

    .project-featured-content,
    .patent-card,
    .metric-card,
    .focus-card,
    .article-card,
    .list-panel,
    .resume-panel,
    .modal-card {
        padding: 1.15rem 1rem;
    }

    .article-hero {
        padding-bottom: 2rem;
        padding-top: 3.5rem;
    }

    .article-body {
        font-size: 1rem;
        line-height: 1.75;
    }

    .article-body h2 {
        font-size: 1.4rem;
        margin-top: 2.2rem;
    }

    .article-body h3 {
        font-size: 1.18rem;
        margin-top: 1.8rem;
    }

    .article-body pre {
        font-size: 0.78rem;
        padding: 0.85rem;
    }

    .article-body .ascii-diagram {
        font-size: 0.68rem;
    }

    .article-body blockquote,
    .article-body .design-principle {
        padding: 0.9rem 1rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 0.8rem;
    }

    .hero h1 {
        font-size: 1.95rem;
    }

    .section-title {
        font-size: 1.65rem;
    }

    .btn {
        font-size: 0.88rem;
        padding: 0.65rem 1rem;
    }
}

/* ==========================================================================
   Article Detail & Content Styling
   ========================================================================== */

.article-hero {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.article-meta-row {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.88rem;
    gap: 1rem;
    margin-top: 1.25rem;
}

.article-meta-item {
    align-items: center;
    display: flex;
    gap: 0.4rem;
}

.article-meta-divider {
    color: var(--border-strong);
}

.article-container {
    margin-left: auto;
    margin-right: auto;
    max-width: 860px;
}

.article-body {
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.transfer-matrix {
    background: var(--color-bg-alt, #111827);
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow-x: auto;
    padding: 1rem;
    text-align: center;
}

.transfer-matrix-equation {
    color: #00d2ff;
    font-family: 'Fira Code', monospace;
    font-size: 1.05rem;
    margin: 0;
}

.transfer-matrix-brackets {
    align-items: center;
    border-left: 2px solid #00d2ff;
    border-radius: 4px;
    border-right: 2px solid #00d2ff;
    display: inline-flex;
    margin-left: 0.5rem;
    padding: 0.25rem 0.75rem;
}

.transfer-matrix-values {
    display: grid;
    gap: 0.75rem 1.5rem;
    grid-template-columns: auto auto;
    text-align: center;
}

.article-body p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.article-related {
    background: rgba(16, 28, 26, 0.72);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 3rem;
    padding: 1.25rem;
}

.article-related h2 {
    border-bottom: 0;
    font-size: 1.25rem;
    margin-bottom: 0.65rem;
    margin-top: 0;
    padding-bottom: 0;
}

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

.article-body h2 {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 1.25rem;
    margin-top: 3rem;
    padding-bottom: 0.5rem;
}

.article-body h3 {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 1rem;
    margin-top: 2.25rem;
}

.article-body h4 {
    color: var(--accent-cyan);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    margin-top: 1.75rem;
}

.article-body ul,
.article-body ol {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body li strong {
    color: var(--text-primary);
}

.article-body hr {
    background: var(--border-color);
    border: 0;
    height: 1px;
    margin: 3rem 0;
}

.article-body blockquote,
.article-body .design-principle {
    background: rgba(77, 214, 199, 0.04);
    border-left: 3px solid var(--accent-cyan);
    border-radius: 0 8px 8px 0;
    color: var(--text-primary);
    margin: 2rem 0;
    padding: 1.1rem 1.4rem;
}

.article-body blockquote p,
.article-body .design-principle p {
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 0;
}

.article-body blockquote strong,
.article-body .design-principle strong {
    color: var(--accent-cyan);
    font-style: normal;
}

.article-body pre {
    background: #040908;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #4dd6c7;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, Monaco, monospace;
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 1.75rem 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem;
}

.article-body pre code {
    background: none;
    border: none;
    color: inherit;
    font-size: inherit;
    padding: 0;
}

.article-body code {
    background: rgba(77, 214, 199, 0.1);
    border: 1px solid rgba(77, 214, 199, 0.2);
    border-radius: 4px;
    color: var(--accent-cyan);
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, Monaco, monospace;
    font-size: 0.88em;
    padding: 0.15rem 0.4rem;
}

.article-body .ascii-diagram {
    color: #92e4db;
    display: block;
    font-size: 0.82rem;
    letter-spacing: 0;
    line-height: 1.35;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: pre;
}

.article-body table {
    background: rgba(16, 28, 26, 0.6);
    border: 1px solid var(--border-color);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    display: block;
    font-size: 0.95rem;
    margin: 2rem 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.article-body th,
.article-body td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 1.1rem;
    text-align: left;
}

.article-body th {
    background: rgba(77, 214, 199, 0.08);
    color: var(--accent-cyan);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.article-body tr:last-child td {
    border-bottom: none;
}

.article-body tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.015);
}

.article-body ul.checklist {
    list-style: none;
    padding-left: 0;
}

.article-body ul.checklist li {
    margin-bottom: 0.65rem;
    padding-left: 1.75rem;
    position: relative;
}

.article-body ul.checklist li::before {
    color: var(--accent-cyan);
    content: "✓";
    font-weight: 800;
    left: 0;
    position: absolute;
    top: 0;
}
