:root {
    --ink: #05080d;
    --ink-soft: #0b111a;
    --panel: #101923;
    --line: rgba(180, 206, 224, .18);
    --line-strong: rgba(180, 206, 224, .34);
    --text: #f3f7fa;
    --muted: #8e9eaa;
    --cyan: #27d9ef;
    --lime: #c9f449;
    --sidebar: 276px;
    --radius: 2px;
    --font-display: "Bahnschrift SemiCondensed", "Arial Narrow", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); }
body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    overflow-x: hidden;
}
::selection { background: var(--cyan); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.accent { color: var(--cyan); }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 100; background: var(--lime); color: var(--ink); padding: .65rem 1rem; font-family: ui-monospace, monospace; font-size: .8rem; }
.skip-link:focus { top: 1rem; }
.icon { width: 1.15rem; height: 1.15rem; flex: none; }

.site-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar); border-right: 1px solid var(--line); background: #070b11; }
.site-sidebar::after { content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px); background-size: 100% 4px; }
.sidebar-inner { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 1.3rem 1.35rem 1.25rem; }
.sidebar-topline, .sidebar-footer-line { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font: 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(201,244,73,.1); }
.profile-mark { display: block; flex: 0 0 94px; width: 94px; height: 94px; margin: 2.7rem 0 1.1rem; border: 1px solid var(--line-strong); padding: 4px; border-radius: 50%; overflow: hidden; background: #fff; transition: border-color .2s, transform .2s; }
.profile-mark:hover { border-color: var(--cyan); transform: rotate(2deg); }
.profile-mark img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; transform: scale(1.22); transform-origin: 50% 30%; filter: saturate(.92) contrast(1.04); }
.monogram { color: var(--text); font-family: var(--font-display); font-size: 3.5rem; font-weight: 650; line-height: .9; letter-spacing: -.08em; }
.monogram span { color: var(--lime); font-weight: 400; }
.sidebar-name { margin: .9rem 0 .15rem; color: var(--text); font-weight: 650; font-size: .98rem; }
.sidebar-role { display: flex; align-items: center; gap: .55rem; margin: 0; color: var(--cyan); font: 11px/1.4 ui-monospace, monospace; }
.site-nav { display: flex; flex-direction: column; gap: .25rem; margin-top: 3.2rem; }
.site-nav-link { position: relative; display: flex; align-items: center; gap: .8rem; min-height: 42px; color: var(--muted); font: 12px/1 ui-monospace, monospace; transition: color .2s, padding-left .2s; }
.site-nav-link::before { content: ""; position: absolute; left: -1.35rem; width: 2px; height: 0; background: var(--lime); transition: height .2s; }
.site-nav-link:hover, .site-nav-link.is-active { color: var(--text); padding-left: .25rem; }
.site-nav-link.is-active { color: var(--cyan); }
.site-nav-link.is-active::before { height: 24px; }
.nav-index { color: var(--lime); font-size: 10px; }
.sidebar-socials { display: flex; gap: .65rem; margin-top: auto; padding: 1rem 0; border-top: 1px solid var(--line); }
.sidebar-socials a { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); color: var(--muted); transition: color .2s, border-color .2s, background .2s; }
.sidebar-socials .social-icon { width: 1rem; height: 1rem; }
.sidebar-socials a:hover { color: var(--ink); border-color: var(--cyan); background: var(--cyan); }
.sidebar-footer-line { padding-top: .8rem; border-top: 1px solid var(--line); }
.mobile-nav-toggle { display: none; position: fixed; top: 1rem; right: 1rem; z-index: 60; width: 48px; height: 48px; align-items: center; justify-content: center; background: rgba(7,11,17,.94); color: var(--cyan); border: 1px solid var(--line-strong); }

.site-main { margin-left: var(--sidebar); }
.section-anchor { scroll-margin-top: 1.5rem; }
.hero-section, .profile-section, .projects-section, .ebooks-section, .contact-section { position: relative; border-bottom: 1px solid var(--line); }
.hero-section { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(390px, .95fr); align-items: center; gap: 2rem; overflow: hidden; padding: 5rem clamp(2rem, 6vw, 6.5rem) 4rem clamp(2rem, 6vw, 6.5rem); background: radial-gradient(circle at 76% 44%, rgba(12, 76, 101, .16), transparent 35%), var(--ink); }
.hero-grid { position: absolute; inset: 0; opacity: .55; pointer-events: none; background-image: linear-gradient(rgba(39,217,239,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(39,217,239,.07) 1px, transparent 1px); background-size: 72px 72px; mask-image: linear-gradient(90deg, transparent, black 30%, black 86%, transparent); }
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.terminal-label, .section-kicker { margin: 0 0 1.3rem; color: var(--muted); font: 11px/1.4 ui-monospace, monospace; letter-spacing: .06em; }
.hero-section h1 { margin: 0; color: var(--text); font-size: clamp(4rem, 8vw, 8.6rem); font-weight: 800; letter-spacing: -.085em; line-height: .88; }
.hero-role { display: flex; align-items: center; min-height: 2.2rem; margin: 2.2rem 0 1rem; color: var(--cyan); font: clamp(1rem, 1.5vw, 1.3rem)/1.3 ui-monospace, monospace; }
.type-caret { display: inline-block; width: 8px; height: 1.3em; margin-left: .35rem; background: var(--lime); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-intro { max-width: 470px; margin: 0; color: #c5d0d7; font-size: clamp(1rem, 1.55vw, 1.25rem); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.1rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .8rem; min-height: 48px; padding: .8rem 1.1rem; border: 1px solid transparent; font: 12px ui-monospace, monospace; letter-spacing: .02em; transition: color .2s, border-color .2s, background .2s, transform .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--ink); background: var(--cyan); border-color: var(--cyan); }
.button-primary:hover { color: var(--ink); background: var(--lime); border-color: var(--lime); }
.button-ghost { color: var(--cyan); border-color: var(--line-strong); }
.button-ghost:hover { color: var(--text); border-color: var(--cyan); }
.hero-visual { position: relative; z-index: 1; min-height: 500px; display: grid; align-items: center; justify-items: center; color: rgba(39,217,239,.75); }
.signal-svg { width: min(100%, 620px); height: auto; opacity: .85; }
.hero-signal { position: absolute; z-index: 1; border: 1px solid rgba(201,244,73,.55); width: 7px; height: 7px; transform: rotate(45deg); }
.hero-signal-one { top: 22%; right: 8%; }
.hero-signal-two { bottom: 24%; left: 56%; }
.signal-meta, .visual-corner { position: absolute; color: var(--muted); font: 10px ui-monospace, monospace; }
.signal-meta { top: 1.7rem; left: 5%; }
.visual-corner { right: 5%; bottom: 2.5rem; color: var(--lime); }
.code-snippet { position: absolute; right: 4%; bottom: 16%; margin: 0; color: rgba(243,247,250,.5); font: 11px/1.8 ui-monospace, monospace; }
.hero-bottomline { position: absolute; right: clamp(2rem, 6vw, 6.5rem); bottom: 1.3rem; left: clamp(2rem, 6vw, 6.5rem); display: flex; justify-content: space-between; color: var(--muted); font: 10px ui-monospace, monospace; letter-spacing: .03em; text-transform: uppercase; }

.profile-section, .projects-section, .ebooks-section, .contact-section { padding: 6.5rem clamp(2rem, 6vw, 6.5rem); background: var(--ink-soft); }
.section-heading-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3.4rem; border-top: 1px solid var(--line-strong); padding-top: .85rem; }
.section-kicker { margin: 0; color: var(--cyan); text-transform: uppercase; }
.section-counter { margin: 0; color: var(--muted); font: 10px ui-monospace, monospace; }
.profile-intro, .projects-heading, .services-header { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(280px, 1fr); gap: 5rem; align-items: end; }
h2 { margin: 0; color: var(--text); font-size: clamp(2.4rem, 5vw, 5rem); font-weight: 760; letter-spacing: -.075em; line-height: .94; }
h2 span { color: var(--cyan); }
.lead-copy { margin: 0 0 1rem; max-width: 540px; color: var(--text); font-size: clamp(1.25rem, 2vw, 1.7rem); line-height: 1.35; }
.muted-copy { max-width: 510px; margin: 0; color: var(--muted); }
.skill-rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(180px, .7fr); margin-top: 5.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skill-column { min-height: 300px; padding: 1.7rem 1.4rem 1.7rem 0; border-right: 1px solid var(--line); }
.skill-column + .skill-column { padding-left: 1.4rem; }
.skill-icon, .service-icon { color: var(--cyan); }
.skill-icon .icon, .service-icon .icon { width: 1.55rem; height: 1.55rem; }
.skill-column h3 { margin: 1.2rem 0 .9rem; color: var(--lime); font-size: .95rem; font-weight: 650; }
.skill-column ul { list-style: none; padding: 0; margin: 0; color: var(--muted); font: 12px/2 ui-monospace, monospace; }
.skill-note { padding: 1.7rem 0 1.7rem 1.7rem; color: var(--muted); font: 12px/1.65 ui-monospace, monospace; }
.skill-note p { margin: 1.1rem 0 0; color: #c5d0d7; }

.projects-section { background: #070c13; }
.projects-heading { align-items: end; }
.projects-heading p { max-width: 360px; margin: 0 0 .3rem; color: var(--muted); }
.project-filters { display: flex; gap: .35rem; margin: 4.2rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.filter-button { position: relative; min-height: 42px; padding: 0 1rem; border: 0; color: var(--muted); background: transparent; font: 11px ui-monospace, monospace; cursor: pointer; }
.filter-button::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; }
.filter-button:hover, .filter-button.is-active { color: var(--text); }
.filter-button.is-active::after { background: var(--lime); }
.project-row { display: grid; grid-template-columns: 76px minmax(220px, .8fr) minmax(290px, 1.35fr) 130px; gap: 1.8rem; align-items: center; padding: 2.1rem 0; border-bottom: 1px solid var(--line); transition: opacity .2s, transform .2s; }
.project-row.is-hidden { display: none; }
.project-number { align-self: start; color: var(--text); font-size: 3.5rem; font-weight: 750; letter-spacing: -.1em; line-height: .8; }
.project-number span { display: block; width: 18px; height: 3px; margin-top: 1.2rem; background: var(--lime); }
.project-category { margin: 0; color: var(--cyan); font: 10px ui-monospace, monospace; text-transform: uppercase; }
.project-category span { color: var(--muted); }
.project-copy h3 { margin: .45rem 0 .65rem; color: var(--text); font-size: clamp(1.45rem, 2.3vw, 2rem); font-weight: 680; letter-spacing: -.045em; }
.project-copy > p:not(.project-category) { max-width: 330px; margin: 0; color: var(--muted); font-size: .9rem; }
.project-stack { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }
.project-stack span { color: #a9bac4; font: 10px ui-monospace, monospace; }
.project-stack span:not(:last-child)::after { content: " /"; color: var(--cyan); }
.text-link, .download-link { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1.35rem; color: var(--cyan); font: 11px ui-monospace, monospace; }
.text-link:hover, .download-link:hover { color: var(--lime); }
.text-link .icon { width: .95rem; height: .95rem; transition: transform .2s; }
.text-link:hover .icon { transform: translateX(4px); }
.download-link { margin-top: .7rem; color: var(--lime); }
.download-link .icon { width: .9rem; height: .9rem; }
.download-link span { color: var(--muted); }
.project-media { position: relative; min-height: 190px; border: 1px solid var(--line-strong); background: #0e1722; overflow: hidden; }
.project-media::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(39,217,239,.1), transparent 35%, rgba(201,244,73,.08)); mix-blend-mode: screen; }
.project-media img { display: block; width: 100%; height: 220px; object-fit: cover; opacity: .84; filter: saturate(.75) contrast(1.05); transition: transform .6s, opacity .3s; }
.project-row:hover .project-media img { opacity: 1; transform: scale(1.03); }
.media-corner { position: absolute; right: .55rem; bottom: .55rem; z-index: 1; color: var(--lime); font: 9px ui-monospace, monospace; }
.projects-footnote { margin: 1.5rem 0 0; color: var(--muted); font: 11px ui-monospace, monospace; }

.services-section { padding: 6.5rem clamp(2rem, 6vw, 6.5rem); background: #030506; border-bottom: 1px solid var(--line); }
.services-header { margin-bottom: 4.5rem; }
.services-header p { max-width: 390px; margin: 0; color: var(--muted); }
.service-list { border-top: 1px solid var(--line); }
.service-row { display: grid; grid-template-columns: 58px 46px minmax(0, 1fr) 30px; gap: 1rem; align-items: center; min-height: 118px; border-bottom: 1px solid var(--line); }
.service-index { color: var(--lime); font: 11px ui-monospace, monospace; }
.service-row h3 { margin: 0 0 .25rem; color: var(--text); font-size: 1.2rem; font-weight: 650; }
.service-row p { max-width: 540px; margin: 0; color: var(--muted); font-size: .9rem; }
.service-arrow { color: var(--cyan); }
.service-arrow .icon { width: 1.3rem; height: 1.3rem; transition: transform .2s; }
.service-row:hover .service-arrow .icon { transform: translateX(5px); }

.contact-section { background: var(--ink-soft); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); gap: 5rem; align-items: end; }
.contact-layout h2 { margin-bottom: 1.4rem; }
.contact-layout p:not(.terminal-label) { max-width: 390px; margin: 0 0 1.7rem; color: var(--muted); }
.contact-terminal { min-height: 260px; border: 1px solid var(--line-strong); background: #05080d; box-shadow: 14px 14px 0 rgba(39,217,239,.04); }
.terminal-top { display: flex; align-items: center; gap: .35rem; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
.terminal-top > span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.terminal-top > span:first-child { background: var(--lime); }
.terminal-top small { margin-left: auto; color: var(--muted); font: 9px ui-monospace, monospace; }
.contact-terminal pre { margin: 0; padding: 1.5rem; color: #b8c8d1; font: 12px/1.9 ui-monospace, monospace; white-space: pre-wrap; }

.site-footer { margin-left: var(--sidebar); background: #05080d; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding: 1.3rem clamp(2rem, 6vw, 6.5rem); color: var(--muted); font: 10px ui-monospace, monospace; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; align-items: center; gap: 1.2rem; }
.footer-links a:hover { color: var(--cyan); }
.footer-back-top { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); color: var(--cyan); font-size: 1rem; }

@media (max-width: 1180px) {
    :root { --sidebar: 238px; }
    .hero-section { grid-template-columns: minmax(0, 1fr) minmax(290px, .8fr); padding-right: 3rem; padding-left: 3rem; }
    .profile-section, .projects-section, .ebooks-section, .contact-section, .services-section { padding-right: 3rem; padding-left: 3rem; }
    .hero-bottomline { right: 3rem; left: 3rem; }
    .project-row { grid-template-columns: 60px minmax(190px, .85fr) minmax(240px, 1.2fr) 100px; gap: 1rem; }
}
@media (max-width: 900px) {
    :root { --sidebar: 220px; }
    .hero-section { grid-template-columns: 1fr; min-height: auto; padding-top: 7rem; }
    .hero-content { max-width: 680px; }
    .hero-visual { min-height: 290px; margin-top: -1rem; }
    .hero-bottomline { position: relative; right: auto; bottom: auto; left: auto; grid-column: 1; padding-top: 1rem; }
    .profile-intro, .projects-heading, .services-header, .contact-layout { grid-template-columns: 1fr; gap: 1.8rem; }
    .skill-rail { grid-template-columns: repeat(2, 1fr); }
    .skill-column:nth-child(2) { border-right: 0; }
    .skill-note { grid-column: 1 / -1; padding-left: 0; border-top: 1px solid var(--line); }
    .project-row { grid-template-columns: 56px minmax(0, 1fr) 110px; }
    .project-media { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 700px) {
    :root { --sidebar: 0px; }
    .mobile-nav-toggle { display: flex; }
    .site-sidebar { width: min(86vw, 310px); transform: translateX(-101%); transition: transform .25s ease; box-shadow: 20px 0 40px rgba(0,0,0,.35); }
    body.nav-open .site-sidebar { transform: translateX(0); }
    body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.65); }
    .site-main, .site-footer { margin-left: 0; }
    .hero-section, .profile-section, .projects-section, .ebooks-section, .contact-section, .services-section { padding-right: 1.25rem; padding-left: 1.25rem; }
    .hero-section { padding-top: 6.2rem; }
    .hero-section h1 { font-size: clamp(3.4rem, 16vw, 5.5rem); }
    .hero-role { margin-top: 1.7rem; }
    .hero-visual { min-height: 250px; }
    .hero-bottomline { flex-wrap: wrap; gap: .6rem 1rem; padding-top: .5rem; }
    .hero-bottomline span:last-child { width: 100%; }
    .section-heading-row { margin-bottom: 2.6rem; }
    h2 { font-size: clamp(2.7rem, 13vw, 4.2rem); }
    .skill-rail { grid-template-columns: 1fr; margin-top: 3.5rem; }
    .skill-column, .skill-column + .skill-column { min-height: auto; padding: 1.5rem 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .skill-note { grid-column: auto; padding: 1.5rem 0; border-top: 0; }
    .project-filters { overflow-x: auto; margin-top: 2.8rem; }
    .filter-button { flex: 0 0 auto; padding-right: .75rem; padding-left: .75rem; }
    .project-row { grid-template-columns: 44px minmax(0, 1fr); gap: .8rem; padding: 1.8rem 0; }
    .project-number { font-size: 2.5rem; }
    .project-media { grid-column: 1 / -1; grid-row: auto; }
    .project-media { margin-top: .7rem; }
    .service-row { grid-template-columns: 34px 34px minmax(0, 1fr) 20px; gap: .6rem; min-height: 125px; }
    .service-row h3 { font-size: 1.05rem; }
    .service-row p { font-size: .82rem; }
    .contact-terminal { margin-top: 1rem; }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 1rem; padding-right: 1.25rem; padding-left: 1.25rem; }
}

/* Responsive portfolio architecture */
.hero-section h1 {
    max-width: 720px;
    font-family: var(--font-display);
    font-size: clamp(3.8rem, 6.5vw, 6.7rem);
    font-weight: 650;
    letter-spacing: -.055em;
    line-height: .92;
}
.profile-about { max-width: 620px; }
.profile-about .muted-copy { margin-top: 1.25rem; }
.profile-focus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 4.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-focus-item { min-width: 0; padding: 1.7rem; border-right: 1px solid var(--line); }
.profile-focus-item:first-child { padding-left: 0; }
.profile-focus-item:last-child { border-right: 0; }
.profile-focus-item > span { color: var(--lime); font: 10px ui-monospace, monospace; }
.profile-focus-item h3 { margin: 1.4rem 0 .65rem; font-size: clamp(1.1rem, 1.8vw, 1.45rem); line-height: 1.2; }
.profile-focus-item p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.profile-summary { display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding-top: 2rem; }
.profile-summary p { max-width: 540px; margin: 0; color: var(--muted); }
.profile-summary .button { flex: none; }
.project-loading { min-height: 1.3rem; margin: .7rem 0 0; color: var(--muted); font: 10px ui-monospace, monospace; }
.projects-section.is-loading .project-list { opacity: .35; pointer-events: none; }
.project-list { transition: opacity .2s ease; }
.projects-section [data-project-list] { max-height: min(900px, 72vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: .7rem; border-top: 1px solid var(--line); scrollbar-color: var(--line-strong) transparent; }
.projects-section [data-project-list]::-webkit-scrollbar { width: 8px; }
.projects-section [data-project-list]::-webkit-scrollbar-thumb { background: var(--line-strong); }
.projects-section [data-project-list]::-webkit-scrollbar-track { background: transparent; }
.project-row { grid-template-columns: 64px minmax(0, 1.25fr) minmax(280px, .75fr); gap: clamp(1rem, 2.5vw, 2.5rem); }
.project-copy { min-width: 0; }
.project-copy > p:not(.project-category) { max-width: 700px; overflow-wrap: anywhere; }
.project-media, .project-media picture { width: 100%; aspect-ratio: 16 / 9; }
.project-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portfolio-more { display: flex; justify-content: flex-end; padding-top: 2rem; }
.ebook-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.8rem); margin-top: 3.5rem; }
.ebook-card { display: flex; flex-direction: column; gap: .9rem; min-width: 0; padding: 0; border: 0; background: transparent; }
.ebook-cover { display: block; aspect-ratio: 943 / 1500; overflow: hidden; border: 1px solid var(--line-strong); background: #05080d; }
.ebook-cover img, .ebook-card img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; border: 0; transition: transform .45s ease, opacity .25s ease; }
.ebook-cover:hover img { transform: scale(1.025); opacity: .9; }
.ebook-copy h3 { margin: 0; color: var(--text); font-size: .88rem; line-height: 1.45; letter-spacing: 0; }
.ebook-copy .text-link { margin-top: .65rem; }
.zoom-media { position: relative; overflow: hidden; cursor: zoom-in; }
.zoom-media-inline { display: block; width: min(100%, 760px); margin: 2rem 0; padding: 0; border: 0; background: transparent; }
.zoom-media-inline img, .project-body .zoom-media-inline img { width: 100%; height: auto; margin: 0; }
.zoom-overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; color: var(--text); background: rgba(5,8,13,.7); opacity: 0; transition: opacity .22s ease; font: 10px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .1em; }
.zoom-overlay .icon { width: 2rem; height: 2rem; color: var(--lime); }
.zoom-media:hover .zoom-overlay, .zoom-media:focus-visible .zoom-overlay { opacity: 1; }
.detail-preview-button { aspect-ratio: 16 / 9; }
.detail-preview { width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: center; }
.detail-category-ebook .detail-preview-button { width: min(100%, 320px); aspect-ratio: 943 / 1500; justify-self: end; }
.project-compatibility { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.4rem; }
.project-compatibility-label { color: var(--muted); font: 10px ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.project-compatibility-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.project-compatibility-list li { padding: .3rem .55rem; border: 1px solid var(--line-strong); color: var(--cyan); font: 10px ui-monospace, monospace; }
.portfolio-page, .cv-page { min-height: 100vh; padding: 6rem clamp(2rem, 6vw, 6.5rem); background: var(--ink-soft); }
.portfolio-page-heading, .cv-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .75fr); gap: 4rem; align-items: end; margin-bottom: 3rem; }
.portfolio-page-heading h1, .cv-heading h1 { margin: 0; font-family: var(--font-display); font-size: clamp(3rem, 6vw, 6rem); line-height: .95; letter-spacing: -.055em; }
.portfolio-page-heading h1 span, .cv-heading h1 span { color: var(--cyan); }
.category-nav { display: flex; gap: .25rem; overflow-x: auto; margin-bottom: 1rem; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.category-nav .filter-button { display: inline-flex; align-items: center; flex: 0 0 auto; }
.cv-heading > div:last-child p { margin: 0 0 1rem; color: var(--muted); line-height: 1.7; }
.cv-block { padding: 4rem 0 0; }
.cv-block > h2 { margin-bottom: 2rem; font-size: clamp(2rem, 4vw, 3.6rem); }
.cv-skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cv-skill-grid article { padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cv-skill-grid article:nth-child(even) { border-right: 0; }
.cv-skill-grid h3, .cv-experience-grid h3 { margin: 0 0 .7rem; color: var(--lime); font-size: 1rem; }
.cv-skill-grid p, .cv-experience-grid p, .cv-experience-grid li, .cv-stack-grid p { color: var(--muted); font-size: .9rem; line-height: 1.7; }
.cv-experience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.cv-experience-grid article { padding: 1.5rem; border: 1px solid var(--line); background: rgba(9,15,23,.4); }
.cv-experience-grid p { margin: 0 0 .7rem; }
.cv-experience-grid ul { margin: 0; padding-left: 1.1rem; }
.cv-stack-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cv-stack-grid > div { padding: 1.3rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cv-stack-grid > div:last-child { border-right: 0; }
.cv-stack-grid strong { color: var(--cyan); font: 10px ui-monospace, monospace; text-transform: uppercase; }
.cv-stack-grid p { margin: .6rem 0 0; }

@media (max-width: 1100px) {
    :root { --sidebar: 0px; }
    .mobile-nav-toggle { display: flex; }
    .site-sidebar { width: min(86vw, 320px); transform: translateX(-101%); transition: transform .25s ease; box-shadow: 20px 0 40px rgba(0,0,0,.35); }
    body.nav-open .site-sidebar { transform: translateX(0); }
    body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.65); }
    .site-main, .site-footer { margin-left: 0; }
    .hero-section, .profile-section, .projects-section, .ebooks-section, .contact-section, .services-section, .portfolio-page, .cv-page { padding-right: clamp(1.5rem, 5vw, 3.5rem); padding-left: clamp(1.5rem, 5vw, 3.5rem); }
    .hero-bottomline { right: clamp(1.5rem, 5vw, 3.5rem); left: clamp(1.5rem, 5vw, 3.5rem); }
    .hero-section h1 { font-size: clamp(3.6rem, 8vw, 6rem); }
    .cv-stack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .hero-section { grid-template-columns: 1fr; min-height: auto; padding-top: 7rem; }
    .hero-visual { min-height: 240px; }
    .hero-bottomline { position: static; grid-column: 1; margin-top: 1rem; }
    .profile-intro, .projects-heading, .services-header, .contact-layout, .portfolio-page-heading, .cv-heading { grid-template-columns: 1fr; gap: 1.8rem; }
    .profile-focus { grid-template-columns: 1fr; }
    .profile-focus-item, .profile-focus-item:first-child { padding: 1.35rem 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .profile-focus-item:last-child { border-bottom: 0; }
    .project-row { grid-template-columns: 48px minmax(0, 1fr); gap: 1rem; }
    .project-media { grid-column: 1 / -1; grid-row: auto; }
    .ebook-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-heading { grid-template-columns: 1fr; gap: 2rem; }
    .detail-category-ebook .detail-preview-button { justify-self: start; }
    .cv-experience-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    body { font-size: 15px; }
    .hero-section, .profile-section, .projects-section, .ebooks-section, .contact-section, .services-section, .portfolio-page, .cv-page, .detail-section { padding-right: 1rem; padding-left: 1rem; }
    .hero-section { padding-top: 5.7rem; padding-bottom: 3rem; }
    .hero-section h1 { font-size: clamp(3rem, 15vw, 4.4rem); line-height: .94; }
    .hero-visual { min-height: 180px; }
    .code-snippet { display: none; }
    .hero-bottomline { display: grid; grid-template-columns: 1fr; gap: .35rem; }
    .section-heading-row { margin-bottom: 2.2rem; }
    h2 { font-size: clamp(2.45rem, 12vw, 3.6rem); }
    .profile-summary { align-items: stretch; flex-direction: column; }
    .profile-summary .button { width: 100%; }
    .project-filters { gap: 0; margin-top: 2.5rem; }
    .filter-button { padding: 0 .72rem; }
    .project-row { grid-template-columns: 38px minmax(0, 1fr); padding: 1.55rem 0; }
    .project-number { font-size: 2.2rem; }
    .project-copy h3 { font-size: 1.35rem; }
    .project-media { aspect-ratio: 16 / 9; margin-top: .5rem; }
    .project-media picture { aspect-ratio: 16 / 9; }
    .project-media picture img { object-fit: cover; }
    .portfolio-more { justify-content: stretch; }
    .portfolio-more .button { width: 100%; }
    .ebook-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem .8rem; }
    .ebook-copy h3 { font-size: .76rem; }
    .ebook-copy .text-link { font-size: 9px; }
    .service-row { grid-template-columns: 28px 28px minmax(0, 1fr); }
    .service-arrow { display: none; }
    .service-row p { overflow-wrap: anywhere; }
    .testimonial-grid { grid-template-columns: 1fr; }
    .contact-terminal pre { padding: 1rem; font-size: 10px; overflow-wrap: anywhere; word-break: break-word; }
    .footer-links { flex-wrap: wrap; }
    .image-lightbox { width: 96vw; padding: 2.2rem .6rem .6rem; }
    .cv-skill-grid, .cv-stack-grid { grid-template-columns: 1fr; }
    .cv-skill-grid article, .cv-stack-grid > div { padding: 1.2rem 0; border-right: 0; }
}
@media (max-width: 420px) {
    .hero-actions { flex-direction: column; align-items: stretch; }
    .button { width: 100%; }
    .code-snippet { right: 0; font-size: 9px; }
    .signal-meta { left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.profile-details { margin-top: 3rem; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.profile-details summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 0; cursor: pointer; color: var(--cyan); font: 11px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .12em; list-style: none; }
.profile-details summary::-webkit-details-marker { display: none; }
.profile-details summary .icon { width: 16px; transition: transform .2s ease; }
.profile-details[open] summary .icon { transform: rotate(90deg); }
.profile-details-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4rem; padding: 1rem 0 2rem; }
.profile-details-grid-secondary { border-top: 1px solid var(--line); }
.subsection-title { margin: 0 0 1.2rem; color: var(--text); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .08em; }
.detail-list-block { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.detail-list-block strong { color: var(--lime); font: 10px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .1em; }
.detail-list-block p, .experience-item p, .experience-item li { color: var(--muted); font-size: .88rem; line-height: 1.65; }
.detail-list-block p { margin: .4rem 0 0; }
.experience-item { padding: 0 0 1.5rem; }
.experience-item h4 { margin: 0 0 .35rem; color: var(--text); font-size: 1rem; }
.experience-item p { margin: 0 0 .5rem; }
.experience-item ul { margin: 0; padding-left: 1.1rem; }
.ebook-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.ebook-card { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 1.2rem; padding: 1rem; border: 1px solid var(--line); background: rgba(9,15,23,.75); }
.ebook-card img { width: 110px; height: 150px; object-fit: cover; border: 1px solid var(--line-strong); }
.ebook-card h3 { margin: .35rem 0 1rem; font-size: 1.05rem; line-height: 1.25; }
.detail-section { min-height: 100vh; padding: 7rem clamp(2rem, 6vw, 6.5rem) 6rem; }
.detail-shell { max-width: 1180px; margin: 0 auto; }
.detail-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr); gap: 4rem; align-items: center; margin-bottom: 4rem; }
.detail-heading h1 { max-width: 760px; margin: .6rem 0 1.2rem; color: var(--text); font-size: clamp(2.7rem, 6vw, 6rem); line-height: .95; letter-spacing: -.06em; }
.detail-lead { max-width: 650px; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.detail-preview { display: block; width: 100%; height: auto; max-height: 360px; object-fit: contain; border: 1px solid var(--line-strong); background: #05080d; }
.project-body { max-width: 820px; color: #c7d2d8; font-size: 1rem; line-height: 1.8; }
.project-body p { margin: 0 0 1.3rem; }
.project-body h2, .project-body h3 { margin: 2rem 0 .8rem; color: var(--text); }
.project-body ul, .project-body ol { padding-left: 1.3rem; }
.project-body img { display: block; width: min(100%, 760px); height: auto; margin: 2rem 0; border: 1px solid var(--line-strong); }
.project-body a { color: var(--cyan); }
.detail-actions { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.testimonials-block { margin-top: 5rem; }
.testimonial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.testimonial-card { margin: 0; padding: 1.4rem; border: 1px solid var(--line); background: rgba(9,15,23,.55); }
.testimonial-card p { margin: 0 0 1.2rem; color: var(--muted); line-height: 1.7; }
.testimonial-card footer { display: flex; flex-direction: column; gap: .2rem; font: 10px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.testimonial-card footer strong { color: var(--lime); }
.testimonial-card footer span { color: var(--muted); }
@media (max-width: 900px) { .ebook-grid, .testimonial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .profile-details-grid, .detail-heading { grid-template-columns: 1fr; gap: 2rem; } }
@media (max-width: 700px) { .ebooks-section, .detail-section { padding-right: 1.25rem; padding-left: 1.25rem; } .ebook-grid, .testimonial-grid { grid-template-columns: 1fr; } .ebook-card { grid-template-columns: 90px minmax(0, 1fr); } .ebook-card img { width: 90px; height: 125px; } .detail-heading { margin-bottom: 2.5rem; } .detail-heading h1 { font-size: clamp(2.8rem, 14vw, 4.4rem); } }
.project-filters { scrollbar-width: none; -ms-overflow-style: none; }
.project-filters::-webkit-scrollbar { display: none; }

/* Refined content layouts */
.project-row { grid-template-columns: 76px minmax(0, 1.25fr) minmax(260px, .85fr); }
.project-copy > p:not(.project-category) { max-width: 620px; }
.project-links { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.project-links .text-link { margin-top: 1.1rem; }
.project-media { min-height: 0; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.project-media img { width: 100%; height: 100%; object-fit: contain; background: #05080d; }
.project-media-link { color: inherit; }
.profile-skill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; padding: 1rem 0 2.4rem; }
.profile-skill-card { min-height: 190px; padding: 1.2rem; border: 1px solid var(--line); background: rgba(9,15,23,.48); }
.profile-skill-card h3 { margin: 1rem 0 .55rem; color: var(--lime); font-size: .95rem; }
.profile-skill-card p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.65; }
.profile-details-block { padding: 1rem 0 2rem; }
.experience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.experience-item { height: 100%; padding: 1.2rem; border: 1px solid var(--line); background: rgba(9,15,23,.38); }
.testimonial-card footer { flex-direction: row; align-items: center; gap: .7rem; }
.testimonial-avatar { width: 48px; height: 48px; flex: 0 0 48px; border: 1px solid var(--line-strong); border-radius: 50%; object-fit: cover; filter: saturate(.7); }
.testimonial-card footer span { display: flex; flex-direction: column; gap: .2rem; }
.testimonial-card footer small { color: var(--muted); font: inherit; }
.network-section { padding: 6.5rem clamp(2rem, 6vw, 6.5rem); background: #070c13; border-bottom: 1px solid var(--line); }
.network-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr); gap: 4rem; align-items: end; margin-bottom: 4rem; }
.network-heading p { max-width: 460px; margin: 0 0 .3rem; color: var(--muted); line-height: 1.7; }
.network-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.network-card { display: grid; grid-template-columns: minmax(190px, .9fr) minmax(0, 1.1fr); border: 1px solid var(--line); background: rgba(9,15,23,.58); }
.network-card.is-featured { grid-column: 1 / -1; grid-template-columns: minmax(320px, 1.1fr) minmax(0, .9fr); }
.network-card-media { position: relative; min-width: 0; overflow: hidden; border-right: 1px solid var(--line); background: #05080d; }
.network-card-media picture, .network-card-media img { display: block; width: 100%; height: 100%; }
.network-card-media img { aspect-ratio: 16 / 9; object-fit: cover; opacity: .86; transition: transform .5s, opacity .3s; }
.network-card:hover .network-card-media img { opacity: 1; transform: scale(1.025); }
.network-card-copy { display: flex; flex-direction: column; align-items: flex-start; padding: 1.4rem; }
.network-card-copy h3 { margin: .45rem 0 .7rem; color: var(--text); font-size: clamp(1.2rem, 2vw, 1.7rem); letter-spacing: -.04em; }
.network-card-copy > p:not(.project-category) { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.65; }
.network-card-copy .text-link { margin-top: auto; }
.detail-preview-button { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.detail-preview-button:focus-visible, [data-zoomable]:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.detail-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.button-link { display: inline-flex; align-items: center; gap: .5rem; padding: .72rem .95rem; border: 1px solid var(--cyan); color: var(--cyan); font: 10px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.button-link:hover { border-color: var(--lime); color: var(--lime); }
.button-link-muted { border-color: var(--line-strong); color: var(--muted); }
.button-link .icon { width: 1rem; height: 1rem; }
.video-preview { max-width: 820px; margin-top: 4rem; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--line-strong); background: #05080d; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.image-lightbox { width: min(94vw, 1200px); max-width: none; padding: 2.5rem; border: 1px solid var(--line-strong); background: #05080d; color: var(--text); }
.image-lightbox::backdrop { background: rgba(0,0,0,.82); backdrop-filter: blur(4px); }
.lightbox-image { display: block; width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox-close { position: absolute; top: .55rem; right: .75rem; width: 2rem; height: 2rem; border: 1px solid var(--line); color: var(--cyan); background: rgba(5,8,13,.75); font-size: 1.4rem; line-height: 1; cursor: pointer; }
@media (max-width: 1180px) {
    .project-row { grid-template-columns: 60px minmax(0, 1.15fr) minmax(230px, .85fr); }
    .network-section { padding-right: 3rem; padding-left: 3rem; }
}
@media (max-width: 900px) {
    .profile-skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .experience-grid { grid-template-columns: 1fr; }
    .network-heading { grid-template-columns: 1fr; gap: 1.5rem; }
    .network-grid, .network-card.is-featured { grid-template-columns: 1fr; }
    .network-card-media { border-right: 0; border-bottom: 1px solid var(--line); }
    .network-card-media img { aspect-ratio: 16 / 9; }
}
@media (max-width: 700px) {
    .network-section { padding: 5rem 1.25rem; }
    .network-card, .network-card.is-featured { display: block; }
    .network-card-media { border-right: 0; border-bottom: 1px solid var(--line); }
    .network-card-media img { aspect-ratio: 4 / 5; object-fit: cover; }
    .profile-skill-grid { grid-template-columns: 1fr; }
    .project-row { grid-template-columns: 44px minmax(0, 1fr); }
    .project-media { grid-column: 1 / -1; }
    .image-lightbox { padding: 2rem .65rem .65rem; }
}

/* Final component overrides: keep these after legacy compatibility rules. */
.ebook-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.8rem); margin-top: 3.5rem; }
.ebook-card { display: flex; flex-direction: column; gap: .9rem; min-width: 0; padding: 0; border: 0; background: transparent; }
.ebook-cover { display: block; aspect-ratio: 943 / 1500; overflow: hidden; border: 1px solid var(--line-strong); background: #05080d; }
.ebook-cover img, .ebook-card img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; border: 0; transition: transform .45s ease, opacity .25s ease; }
.ebook-copy h3 { margin: 0; color: var(--text); font-size: .88rem; line-height: 1.45; letter-spacing: 0; }
.zoom-media-inline { display: block; width: min(100%, 760px); margin: 2rem 0; padding: 0; border: 0; background: transparent; }
.project-body .zoom-media-inline img { width: 100%; height: auto; margin: 0; }
.detail-preview-button { aspect-ratio: 16 / 9; }
.detail-preview { width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: center; }
.detail-category-ebook .detail-preview-button { width: min(100%, 320px); aspect-ratio: 943 / 1500; justify-self: end; }
.project-media img { object-fit: cover; }
.detail-heading h1 { font-size: clamp(2.7rem, 4.8vw, 4.8rem); line-height: .98; }

@media (max-width: 1100px) {
    .ebook-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .detail-category-ebook .detail-preview-button { justify-self: start; }
}
@media (max-width: 620px) {
    .ebook-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem .8rem; }
    .ebook-card img { width: 100%; height: 100%; }
    .ebook-copy h3 { font-size: .76rem; }
    .detail-heading h1 { font-size: clamp(2.35rem, 11vw, 3.25rem); }
}
