/* Project explorer. Scoped styles keep the portfolio and certificate modal independent. */
.section-work .project-card[data-hud-ready] { cursor: pointer; }
.section-work .project-card[data-hud-ready]:focus-within { border-color: var(--hud-accent, #c6a876); }
.section-work .project-card[data-hud-project="cfdi"] { --accent: #e3a8cb; }
.section-work .project-card[data-hud-project="wifi"] { --accent: #77d1e5; }
.section-work .project-card[data-hud-project="esrgan"] { --accent: #bea8ff; }
.section-work .project-card[data-hud-ready] .card-link--primary { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; color: var(--accent); }
.section-work .project-card[data-hud-ready] .card-link--primary::after { content: '↗'; font-size: 18px; transition: transform .2s; }
.section-work .project-card[data-hud-ready]:hover .card-link--primary::after { transform: translate(2px, -2px); }
.project-hud-open { overflow: hidden !important; }
.project-hud-open #custom-cursor, .project-hud-open #cursor-follower { visibility: hidden; }
.project-hud {
    --hud-accent: #8fdfb7;
    --hud-line: rgba(223, 236, 232, .13);
    --hud-muted: #a1afa9;
    position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh;
    max-width: none; max-height: none; margin: 0; padding: 24px;
    border: 0; color: #eef2ef; background: transparent; overflow: hidden;
    font-family: var(--font-body, 'Inter', sans-serif);
}
.project-hud:not([open]) { display: none; }
.project-hud[open] { display: grid; place-items: center; }
.project-hud::backdrop { background: transparent; }
.project-hud, .project-hud * { box-sizing: border-box; cursor: auto; }
.project-hud button, .project-hud a, .project-hud button *, .project-hud a * { cursor: pointer; }
.project-hud button, .project-hud a { -webkit-tap-highlight-color: transparent; }
.project-hud button { font: inherit; color: inherit; border-radius: 0; }
.project-hud button:focus-visible, .project-hud a:focus-visible { outline: 2px solid var(--hud-accent); outline-offset: -4px; }
.hud-backdrop { position: absolute; inset: 0; background: linear-gradient(rgba(126, 161, 143, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(126, 161, 143, .035) 1px, transparent 1px), rgba(3, 7, 6, .83); background-size: 48px 48px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.hud-panel { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(1200px, 100%); height: min(850px, calc(100dvh - 48px)); min-width: 0; background: #0c1210; border: 1px solid #3b4941; box-shadow: 0 32px 100px #0009; overflow: hidden; }
.hud-panel::before { content: ''; position: absolute; top: 0; left: 0; width: 88px; height: 2px; background: var(--hud-accent); z-index: 2; }
.hud-header { display: flex; align-items: center; justify-content: space-between; min-height: 79px; padding: 0 28px; border-bottom: 1px solid var(--hud-line); gap: 16px; }
.hud-wordmark { display: flex; align-items: center; gap: 14px; font-size: 11px; font-weight: 500; letter-spacing: 2.1px; }
.hud-monogram { width: 35px; height: 35px; border: 1px solid #b69f76; display: grid; place-items: center; font: 22px/1 Georgia, serif; color: #d4bb8f; letter-spacing: -3px; padding-right: 3px; }
.hud-wordmark small { display: block; font: 9px/1.7 var(--font-mono, monospace); letter-spacing: 1.4px; color: var(--hud-muted); margin-top: 3px; }
.hud-close { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 0 8px 12px; background: transparent; border: 0; font-size: 12px !important; }
.hud-close kbd { font: 10px var(--font-mono, monospace); padding: 5px 6px; border: 1px solid var(--hud-line); color: var(--hud-muted); }
.hud-close > span:last-child { font-size: 26px; font-weight: 300; }
.hud-close:hover { color: var(--hud-accent); }
.hud-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 270px; overflow: hidden; min-height: 0; }
.hud-detail { overflow: auto; overscroll-behavior: contain; min-width: 0; scrollbar-width: thin; scrollbar-color: #53675b #0c1210; }
.hud-detail::-webkit-scrollbar { display: block; width: 5px; }
.hud-detail::-webkit-scrollbar-thumb { background: #53675b; }
.hud-visual { min-height: 270px; height: clamp(245px, 32vh, 350px); position: relative; overflow: hidden; background: #141e19; border-bottom: 1px solid var(--hud-line); }
.hud-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: .72; }
.hud-image--previous { opacity: 0; }
.hud-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 9, 6, .35), rgba(3, 9, 6, .05) 30%, rgba(3, 9, 6, .92)); pointer-events: none; }
.hud-reticle { position: absolute; inset: 18px; z-index: 1; pointer-events: none; background: linear-gradient(var(--hud-accent), var(--hud-accent)) left top / 20px 1px no-repeat, linear-gradient(var(--hud-accent), var(--hud-accent)) left top / 1px 20px no-repeat, linear-gradient(var(--hud-accent), var(--hud-accent)) right top / 20px 1px no-repeat, linear-gradient(var(--hud-accent), var(--hud-accent)) right top / 1px 20px no-repeat, linear-gradient(var(--hud-accent), var(--hud-accent)) right bottom / 20px 1px no-repeat, linear-gradient(var(--hud-accent), var(--hud-accent)) right bottom / 1px 20px no-repeat; opacity: .55; }
.hud-scanline { position: absolute; inset: 0 0 auto; height: 1px; background: var(--hud-accent); box-shadow: 0 0 22px 3px var(--hud-accent); opacity: 0; z-index: 2; pointer-events: none; }
.hud-visual-meta { position: absolute; top: 30px; left: 32px; right: 32px; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 9px/1.5 var(--font-mono, monospace); letter-spacing: 1.5px; }
.hud-project-code { color: #e6efe9; }
.hud-status { color: var(--hud-accent); background: #080e0bdb; border: 1px solid var(--hud-line); padding: 5px 9px; letter-spacing: 1px; }
.hud-hero-copy { position: absolute; bottom: 28px; left: 32px; right: 32px; z-index: 2; }
.hud-category { color: var(--hud-accent); margin: 0 0 9px; font: 10px/1.5 var(--font-mono, monospace); letter-spacing: 2px; text-transform: uppercase; }
.project-hud #hud-title { font: 500 clamp(24px, 2.9vw, 37px)/1.15 var(--font-body, sans-serif); letter-spacing: -1.2px; color: #fff; max-width: 710px; margin: 0; text-wrap: balance; }
.hud-body { padding: 27px 32px 32px; }
.hud-description { font-size: 14px; line-height: 1.8; color: #c3ccc7; margin: 0 0 24px; max-width: 66ch; }
.hud-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 0 0 28px; border-top: 1px solid var(--hud-line); border-bottom: 1px solid var(--hud-line); }
.hud-metric { display: flex; flex-direction: column; padding: 19px 16px 18px 0; min-width: 0; }
.hud-metric dt { order: 2; }
.hud-metric dt { font: 9px/1.6 var(--font-mono, monospace); letter-spacing: .5px; color: var(--hud-muted); text-transform: uppercase; margin-top: 7px; }
.hud-metric dd { font: 400 clamp(19px, 2vw, 26px)/1.2 var(--font-mono, monospace); color: var(--hud-accent); white-space: nowrap; margin: 0; }
.hud-story { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.hud-story section { padding: 0; margin: 0; }
.project-hud h3 { font: 500 12px/1.6 var(--font-body, sans-serif); color: #eef2ef; letter-spacing: 0; margin: 0 0 10px; }
.hud-story h3 > span:first-child { color: var(--hud-accent); font: 10px var(--font-mono, monospace); padding-right: 6px; }
.hud-story p { font-size: 12px; line-height: 1.8; color: var(--hud-muted); margin: 0; }
.project-hud .hud-stack-section { border-top: 1px solid var(--hud-line); padding: 22px 0 0; margin: 25px 0 0; }
.hud-stack { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; }
.hud-stack li { font: 10px/1.5 var(--font-mono, monospace); border: 1px solid var(--hud-line); color: #c4cec8; padding: 6px 9px; background: #ffffff03; }
.hud-sidebar { border-left: 1px solid var(--hud-line); padding: 24px 18px; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; background: #101713; }
.hud-sidebar-heading { display: flex; justify-content: space-between; font: 9px/1.6 var(--font-mono, monospace); letter-spacing: 1px; color: #b4c1b9; margin: 0 7px 20px; }
.hud-total { color: #d4bb8f; }
.hud-nodes { display: grid; gap: 8px; }
.hud-node { display: grid; grid-template-columns: 40px minmax(0, 1fr) 13px; align-items: center; text-align: left; gap: 12px; width: 100%; padding: 15px 10px; background: transparent; border: 1px solid transparent; transition: border-color .2s, background .2s; }
.hud-node:hover { background: #ffffff06; border-color: #ffffff15; }
.hud-node[aria-current="true"] { background: #ffffff06; border-color: var(--hud-accent); }
.hud-node-thumb { width: 40px; height: 46px; background-position: center; background-size: cover; opacity: .6; filter: saturate(.5); }
.hud-node[aria-current="true"] .hud-node-thumb { opacity: 1; filter: none; }
.hud-node-title { display: block; color: #dbe4de; font-size: 12px; line-height: 1.5; }
.hud-node-code { display: block; color: var(--hud-muted); font: 9px/1.6 var(--font-mono, monospace); margin-bottom: 4px; }
.hud-node-arrow { color: var(--hud-muted); font-size: 14px; }
.hud-node[aria-current="true"] .hud-node-arrow { color: var(--hud-accent); }
.hud-sidebar-note { margin: auto 7px 0; padding-top: 32px; }
.hud-note-mark { display: block; font: 300 35px/1 var(--font-body, sans-serif); color: #bda77e; margin-bottom: 14px; }
.hud-sidebar-note p { color: var(--hud-muted); font-size: 12px; line-height: 1.8; margin: 0 0 24px; white-space: pre-line; }
.hud-sidebar-signature { display: block; border-top: 1px solid var(--hud-line); padding-top: 18px; font: 8px/1.5 var(--font-mono, monospace); letter-spacing: 1.8px; color: #a4b4aa; }
.hud-footer { padding: 17px 28px; min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--hud-line); background: #0c1210; }
.hud-pagination { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.hud-pagination button { width: 42px; height: 42px; background: transparent; border: 1px solid var(--hud-line); font-size: 19px; }
.hud-pagination button:hover { background: #ffffff08; border-color: var(--hud-accent); }
.hud-counter { font: 10px/1.5 var(--font-mono, monospace); color: #c1ccc5; min-width: 57px; text-align: center; }
.hud-actions { display: flex; align-items: center; gap: 24px; }
.project-hud .hud-repository { color: #c6d1ca; font-size: 11px; text-decoration: none; padding: 14px 0; }
.project-hud .hud-repository[hidden] { display: none; }
.project-hud .hud-repository:hover { color: #fff; text-decoration: underline; }
.project-hud .hud-case { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--hud-accent); color: #0b1610; font-weight: 600; font-size: 12px; text-decoration: none; padding: 15px 20px; min-height: 46px; transition: filter .2s; }
.project-hud .hud-case:hover { filter: brightness(1.12); }
.project-hud .hud-case:focus-visible { outline-color: white; }
.hud-case > span:last-child { font-size: 18px; line-height: 1; }
.hud-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 850px) {
    .project-hud { padding: 14px; }
    .hud-panel { height: calc(100dvh - 28px); }
    .hud-workspace { grid-template-columns: minmax(0, 1fr) 210px; }
    .hud-sidebar { padding: 20px 10px; }
    .hud-node { gap: 8px; padding: 12px 8px; grid-template-columns: 30px minmax(0, 1fr) 12px; }
    .hud-node-thumb { width: 30px; height: 38px; }
    .hud-hero-copy, .hud-visual-meta { left: 24px; right: 24px; }
    .hud-body { padding: 24px; }
    .hud-story { gap: 22px; grid-template-columns: 1fr; }
    .hud-actions { gap: 14px; }
    .hud-header, .hud-footer { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 640px) {
    .project-hud { padding: 8px; }
    .hud-panel { height: calc(100dvh - 16px); }
    .hud-header { min-height: 64px; padding: 6px 15px; }
    .hud-wordmark { font-size: 9px; letter-spacing: 1.5px; gap: 9px; }
    .hud-wordmark small { font-size: 7px; letter-spacing: .7px; }
    .hud-monogram { width: 30px; height: 30px; font-size: 20px; }
    .hud-close { gap: 7px; font-size: 11px !important; }
    .hud-close kbd { display: none; }
    .hud-workspace { display: flex; flex-direction: column; }
    .hud-sidebar { order: -1; flex-shrink: 0; padding: 9px 12px; border-left: 0; border-bottom: 1px solid var(--hud-line); overflow: hidden; }
    .hud-sidebar-heading, .hud-sidebar-note, .hud-node-thumb, .hud-node-arrow, .hud-node-code { display: none; }
    .hud-nodes { display: flex; overflow-x: auto; gap: 6px; overscroll-behavior: contain; }
    .hud-node { display: block; width: auto; flex: 0 0 auto; padding: 11px 12px; min-height: 44px; border-color: var(--hud-line); }
    .hud-node-title { font-size: 11px; white-space: nowrap; }
    .hud-detail { flex: 1; min-height: 0; }
    .hud-visual { height: 270px; min-height: 270px; }
    .hud-hero-copy { bottom: 23px; left: 20px; right: 20px; }
    .hud-visual-meta { top: 23px; left: 20px; right: 20px; font-size: 8px; letter-spacing: .8px; }
    .hud-status { padding: 4px 6px; font-size: 8px; }
    .hud-reticle { inset: 11px; }
    .hud-category { font-size: 9px; letter-spacing: 1.3px; }
    .project-hud #hud-title { font-size: 27px; letter-spacing: -.6px; }
    .hud-body { padding: 22px 20px; }
    .hud-description { font-size: 13px; }
    .hud-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
    .hud-metric { padding-right: 0; }
    .hud-metric dd { font-size: 21px; }
    .hud-story { gap: 23px; }
    .hud-footer { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px 15px max(12px, env(safe-area-inset-bottom)); }
    .hud-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; order: -1; gap: 14px; }
    .hud-case { grid-column: 1; grid-row: 1; padding: 13px 14px !important; gap: 12px !important; font-size: 11px !important; }
    .hud-repository { grid-column: 2; font-size: 10px !important; }
    .hud-pagination { justify-content: space-between; gap: 8px; }
    .hud-pagination button { width: 44px; height: 44px; }
}
@media (max-height: 580px) and (min-width: 641px) {
    .hud-header { min-height: 58px; }
    .hud-footer { min-height: 62px; padding-top: 8px; padding-bottom: 8px; }
    .hud-sidebar-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .project-hud *, .section-work .project-card[data-hud-ready], .section-work .project-card[data-hud-ready] * { transition: none !important; animation: none !important; }
    .hud-scanline { display: none; }
}
