.site-loader { display: none; }
.site-loading .site-loader { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: #03050b; color: #d9edff; }
.site-loader__panel { width: min(320px, 80vw); display: grid; justify-items: center; gap: 1.2rem; }
.site-loader__panel > img { width: 84px; height: 90px; }
.site-loader__brand { font: 600 1.6rem var(--font-display); letter-spacing: -.04em; }
.site-loader__label { font: .68rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: #8cb5d2; }
.site-loader__track { width: 100%; height: 3px; overflow: hidden; background: #152235; }
.site-loader__track i { position: relative; display: block; width: calc(var(--load-progress,.15) * 100%); height: 100%; background: #4fd4ff; transition: width .45s ease; }
.site-loader__track i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,transparent,#e5faff,transparent); animation: loader-scan 1.6s ease-in-out infinite; }
.site-loader .link-button { color: #8cb5d2; font-size: .72rem; }
.site-loading .emblem-flight-layer { visibility: hidden; }
@keyframes loader-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .site-loader__track i { transition: none; } .site-loader__track i::after { animation: none; } }
@media print { .site-loading .site-loader { display: none; } }
.project-card[hidden], .project-filters[hidden], .admin [hidden] { display: none; }
.project-filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.project-filters .field { flex: 1; min-width: 180px; }
[data-filter-count] { color: var(--text-muted); margin-bottom: 1.5rem; }
.project-gallery { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.project-gallery figure { margin: 0; min-width: 0; }
.project-gallery img, .project-gallery video { width: 100%; max-height: 540px; object-fit: contain; background: #07101e; border: 1px solid var(--border); }
.project-gallery figcaption { color: var(--text-muted); padding-top: .75rem; line-height: 1.6; }
.project-updates { list-style: none; padding: 0; margin-top: 1.5rem; }
.project-updates li { border-left: 1px solid #3675b1; padding: 0 0 2rem 1.5rem; }
.project-updates time { color: #80d4ef; font: .75rem var(--font-mono); }
.project-updates h3 { margin-block: .6rem; }
.project-updates p { line-height: 1.7; white-space: pre-line; }
.version-controls { border: 1px solid var(--border); padding: 1rem; display: grid; gap: .8rem; margin-block: 1rem; }
[data-gallery-editor], [data-updates-editor] { display: grid; gap: 1rem; margin-block: 1rem; }
.draft-banner { position: relative; z-index: 40; padding: 1rem; margin-top: 100px; color: #e0f4ff; background: #18304d; text-align: center; }
.pixel-canvases { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.pixel-canvases canvas { display: block; width: 100%; height: auto; border: 1px solid var(--border); }
.playground { display: grid; gap: 1.4rem; }
@media (max-width: 700px) { .pixel-canvases { grid-template-columns: 1fr; } }
/* Content-led presentation. No hidden content is required for these effects. */
body { background: var(--bg); }
body::before, body::after { display: none; }
.hero { isolation: isolate; }
.hero__stage,
.hero__stage[data-scene-state] { inset: 0; opacity: 1; transition: none; }
.hero__stage::before, .hero__stage::after { display: none; }
.hero__emblem-static {
  position: absolute; width: min(48vw, 640px); height: auto;
  left: 77%; top: 41%; transform: translate(-50%, -50%); opacity: 1;
}
.hero__stage[data-scene-state="live"] .hero__emblem-static { opacity: 0; }
.hero__copy { max-width: min(57%, 45rem); }
.hero__title { font-size: clamp(2.6rem, 1rem + 4vw, 4.4rem); line-height: 1.02; }
.hero__line { text-shadow: none; }
.hero__intro { max-width: 36rem; }
.hero__features { position: relative; }
.hero__stage { contain: layout style; }
/* Pointer hits are raycast against the R, as on production; keep a keyboard target. */
.emblem-interaction { position: absolute; top: 0; left: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; pointer-events: none; }
.emblem-interaction:focus-visible { outline: 1px solid #80d4ef; outline-offset: 4px; }
.hero__welcome-dot { animation: none; box-shadow: none; }
.hero__welcome { box-shadow: none; }
/* Keep the landing target measurable, but show only the name until the live R arrives. */
.page--home .site-header .brand__mark { visibility: hidden; }
.brand__mark { filter: none; }
.brand__mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand__mark::before { opacity: .24; }
.brand__mark::after { display: none; }
.header__inner { background: rgba(7, 11, 20, .96); backdrop-filter: none; -webkit-backdrop-filter: none; }
.site-header.is-stuck { padding-top: .9rem; }
@media (max-width: 900px) { .site-header.is-stuck { padding-top: .7rem; } }
.section-head { position: relative; }
.section-head h2 { text-wrap: balance; }
.section--divided::before { transition: none; }
.section--band { background: linear-gradient(122deg, #091124, #060a13); }
:is(.card, .terminal, .project-card, .skill-group, .feature-card, .contact-link, .cta-band) {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: inset 0 1px rgba(204, 231, 255, .04);
}
.btn--primary, .btn--primary:hover, .btn--glow, .btn--glow:hover { box-shadow: inset 0 1px rgba(233, 243, 255, .22); }
.card--spot::after, .card--glow::after { display: none; }
.btn--glow::after { display: none; }
.project-card:hover { transform: none; box-shadow: none; }
.project-card:hover .graphic__svg, .project-card:hover .graphic img { transform: none; }
.project-card__link:focus-visible { outline-offset: -4px; }
/* One home presentation; the full collection lives on /projects. */
body { overflow-x: clip; }
.project-story { --story-progress: 0; display: block; }
.project-story__pin { position: relative; }
.project-story__toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.project-story__caption { color: #a5c6dc; font: .7rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.project-story__caption > span { color: var(--text-muted); }
.project-story__browse { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; text-align: right; }
.project-story__chapters, .project-story__status, .project-story__guide { display: none; }
.project-story__viewport { position: relative; }
.project-card { --build-frame: 1; --build-image: 1; --build-copy: 1; --build-details: 1; --build-surface: 1; isolation: isolate; }
.project-build { display: none; position: absolute; inset: 0; z-index: 5; pointer-events: none; user-select: none; }
.project-build__frame { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; overflow: visible; }
.project-build__frame path { stroke: #80d4ef; stroke-width: 1.2px; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--build-frame)); }
.project-build__scan { position: absolute; left: 4%; right: 4%; top: 8%; height: 76%; transform: translateY(calc(var(--build-copy) * 100%)); opacity: calc((1 - var(--build-details)) * .5); }
.project-build__scan::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(79,227,255,.5), transparent); }
.project-build__index { position: absolute; right: 1.3rem; top: 1rem; color: #8fc9e4; font: .6rem var(--font-mono); letter-spacing: .12em; opacity: calc(1 - var(--build-details)); }
.builder-cursor { position: absolute; left: 0; top: 0; color: #64daef; opacity: 0; pointer-events: none; }
.builder-cursor svg { display: block; }
.builder-cursor > span { position: absolute; left: 13px; top: 24px; white-space: nowrap; font: .58rem var(--font-mono); padding: .25rem .4rem; border: 1px solid currentColor; color: inherit; background: #07101e; clip-path: polygon(0 0,calc(100% - 5px) 0,100% 5px,100% 100%,0 100%); }
.builder-cursor--image { color: #7299f4; }
.builder-cursor--copy { color: #b9d6ec; }
.builder-cursor--image > span, .builder-cursor--frame > span { left: auto; right: 0; }

/* The presentation's runway stays independent of adaptive rendering quality. */
@media (min-height: 620px) and (prefers-reduced-motion: no-preference) {
  .project-story[data-project-mode="cinematic"] {
    height: calc((var(--project-count) * 9.5 + 1) * 100svh);
    min-height: 0;
  }
  .project-story[data-project-mode="cinematic"] .project-story__pin {
    position: sticky; top: 88px; height: calc(100svh - 104px);
    display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; gap: 1rem;
  }
  .project-story[data-project-mode="cinematic"] .project-story__toolbar { margin: 0; }
  .project-story[data-project-mode="cinematic"] .project-story__browse { display: block; }
  .project-story[data-project-mode="cinematic"] .project-story__chapters { display: flex; gap: .6rem; min-width: 0; }
  .project-story__chapters button { position: relative; display: flex; flex: 1; min-width: 0; align-items: baseline; gap: .6rem; padding: .55rem .65rem .65rem; text-align: left; color: var(--text-muted); border: 0; border-bottom: 1px solid #26374c; background: transparent; cursor: pointer; }
  .project-story__chapters button::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: #64daef; transform: scaleX(var(--chapter-progress,0)); transform-origin: left; }
  .project-story__chapters button[aria-current="step"] { color: var(--text); }
  .project-story__chapters span { color: #68a3c6; font: .68rem var(--font-mono); }
  .project-story__chapters b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .75rem; font-weight: 500; }
  .project-story[data-project-mode="cinematic"] .project-story__viewport { min-height: 0; perspective: 1400px; overflow: clip; }
  .project-story[data-project-mode="cinematic"] .project-grid { display: grid; grid-template-columns: 1fr; height: 100%; gap: 0; perspective: none; }
  .project-story[data-project-mode="cinematic"] .project-card {
    grid-area: 1 / 1; min-width: 0; min-height: 0; height: 100%; width: 100%;
    display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); align-items: stretch;
    padding: 0; border-radius: 0; clip-path: none; border: 0; background: none; box-shadow: none;
    opacity: 0; visibility: hidden; translate: none; rotate: none; transform-origin: 50% 50%;
    transition: none; contain: layout style;
  }
  .project-story[data-project-mode="cinematic"] .project-card.is-story-active { will-change: transform, opacity; }
  .project-story[data-project-mode="cinematic"] .project-card::before { display: none; }
  .project-story[data-project-mode="cinematic"] .project-card__link { display: grid; place-items: center; padding: 2.1rem 1.5rem; min-width: 0; opacity: var(--build-image); transform: translate3d(calc((1 - var(--build-image)) * -38px),0,calc((1 - var(--build-image)) * 90px)) rotateY(calc((1 - var(--build-image)) * 8deg)); transition: none; }
  .project-story[data-project-mode="cinematic"] .graphic { width: 100%; max-height: 100%; border: 1px solid #293e58; clip-path: polygon(0 0,calc(100% - 18px) 0,100% 18px,100% 100%,0 100%); opacity: 1; transform: none; transition: none; }
  .project-story[data-project-mode="cinematic"] .project-card__body { justify-content: center; min-width: 0; padding: clamp(1.3rem,3vw,2.8rem); gap: 1rem; }
  .project-story[data-project-mode="cinematic"] .project-card__meta { flex-wrap: wrap; }
  .project-story[data-project-mode="cinematic"] .project-card__title { font-size: clamp(1.6rem,3.3vw,2.6rem); line-height: 1.08; gap: .5rem; }
  .project-story[data-project-mode="cinematic"] .project-card__summary { font-size: clamp(.85rem,1.1vw,1rem); }
  .project-story[data-project-mode="cinematic"] :is(.project-card__meta,.project-card__title,.project-card__summary) { opacity: var(--build-copy); transform: translate3d(0,calc((1 - var(--build-copy)) * 20px),0); transition: none; }
  .project-story[data-project-mode="cinematic"] :is(.tags,.project-card__footer) { opacity: var(--build-details); transform: translate3d(0,calc((1 - var(--build-details)) * 15px),0); transition: none; }
  .project-story[data-project-mode="cinematic"] .project-card__footer { margin-top: .2rem; flex-wrap: wrap; }
  .project-story[data-project-mode="cinematic"] .project-build { display: block; }
  .project-story[data-project-mode="cinematic"] .project-build__frame { opacity: calc(1 - var(--build-details) * .65); }
  .project-story[data-project-mode="cinematic"] .project-card::after { content: ""; position: absolute; inset: 1px; z-index: -1; opacity: calc(var(--build-surface) * .9); background: linear-gradient(122deg,#0e1c31,#060c17); clip-path: polygon(0 0,calc(100% - 22px) 0,100% 22px,100% 100%,22px 100%,0 calc(100% - 22px)); }
  .project-story[data-project-mode="cinematic"] .project-story__guide { display: block; position: absolute; inset: 0; pointer-events: none; border: 1px solid #1b2c40; background: linear-gradient(122deg,rgba(30,59,94,.12),transparent 55%); transform: rotateY(var(--scene-turn,0deg)); }
  .project-story__guide span { position: absolute; width: 30px; height: 30px; border-top: 1px solid #4e7999; border-left: 1px solid #4e7999; }
  .project-story__guide span:nth-child(1) { top: 0; left: 0; }
  .project-story__guide span:nth-child(2) { bottom: 0; right: 0; rotate: 180deg; }
  .project-story__guide span:nth-child(3) { top: 50%; left: 50%; width: 8px; height: 8px; opacity: .5; }
  .project-story[data-project-mode="cinematic"] .project-story__status { display: flex; align-items: center; gap: 1rem; color: #8ab1c9; font: .67rem var(--font-mono); letter-spacing: .04em; }
  .project-story__status > span:first-child { width: 13rem; }
  .project-story__track { flex: 1; height: 1px; background: #26374c; }
  .project-story__track i { display: block; height: 1px; background: #64daef; transform: scaleX(var(--story-progress)); transform-origin: left; }
}
/* Focus must expose the real information immediately, regardless of playhead. */
.project-story[data-project-mode="cinematic"] .project-card:focus-within { --build-image: 1 !important; --build-copy: 1 !important; --build-details: 1 !important; --build-frame: 1 !important; --build-surface: 1 !important; }
.project-story[data-project-mode="cinematic"] .project-card:focus-within .project-build { visibility: hidden; }
@media (max-width: 700px) and (min-height: 620px) {
  .project-story__caption { font-size: .6rem; }
  .project-story__caption > span { display: none; }
  .project-story__chapters { gap: .3rem !important; }
  .project-story__chapters button { justify-content: center; padding-inline: .3rem; min-height: 35px; }
  .project-story__chapters b { display: none; }
  .project-story[data-project-mode="cinematic"] .project-card { grid-template-columns: 1fr; grid-template-rows: minmax(0,.65fr) minmax(0,1fr); }
  .project-story[data-project-mode="cinematic"] .project-card__link { padding: .8rem 1rem .4rem; }
  .project-story[data-project-mode="cinematic"] .graphic { width: 100%; height: 100%; max-width: 100%; }
  .project-story[data-project-mode="cinematic"] .graphic__svg { object-fit: contain; }
  .project-story[data-project-mode="cinematic"] .project-card__body { min-height: 0; justify-content: safe center; overflow-y: auto; scrollbar-width: thin; padding: .8rem 1.2rem 1.3rem; gap: .6rem; }
  .project-story[data-project-mode="cinematic"] .project-card__body > * { flex-shrink: 0; }
  .project-story[data-project-mode="cinematic"] .project-card__title { font-size: 1.6rem; }
  .project-story[data-project-mode="cinematic"] .project-card__kind { font-size: .6rem; letter-spacing: .06em; }
  .project-story[data-project-mode="cinematic"] .project-card__summary { font-size: .8rem; line-height: 1.55; }
  .project-story[data-project-mode="cinematic"] .project-card__meta { gap: .4rem; }
  .project-story[data-project-mode="cinematic"] .status { font-size: .65rem; }
  .project-story[data-project-mode="cinematic"] .tag { font-size: .6rem; padding: .2rem .4rem; }
  .project-story__status > span:first-child { width: auto; }
  .builder-cursor > span { font-size: .5rem; }
}

.philosophy__item {
  position: relative; padding-left: 1.2rem;
  border-left: 1px solid rgba(104, 170, 221, calc(.08 + var(--section-progress, .5) * .3));
}
.philosophy__index { color: #6fa6c7; }
.contact-link { transition: border-color .2s, transform .2s; }
.contact-link:hover { transform: translateX(3px); }
.motion-toggle { font-family: var(--font-mono); font-size: .72rem; }
.motion-toggle:disabled { color: var(--text-muted); cursor: default; }
html[data-motion="static"] [data-reveal], html[data-motion="low"] [data-reveal] { opacity: 1; transform: none; transition: none; }
@media (max-width: 980px) {
  .hero__stage, .hero__stage[data-scene-state] { position: relative; inset: auto; height: clamp(240px, 62vw, 340px); margin-bottom: .4rem; }
  .hero__emblem-static { width: min(82vw, 440px); top: 46%; left: 50%; }
  .hero__copy { max-width: 100%; }
  .builder-cursor > span { font-size: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .project-build, .project-build-note { display: none; }
  .project-card { translate: none; rotate: none; }
  .project-card :is(.graphic, .project-card__meta, .project-card__title, .project-card__summary, .tags, .project-card__footer) { transform: none; opacity: 1; }
  .contact-link:hover { transform: none; }
  .section--divided::before { transform: none; }
}
@media print {
  .project-build, .project-build-note, .emblem-flight-layer, .motion-toggle { display: none; }
  .project-story[data-project-mode="cinematic"] { height: auto; }
  .project-story[data-project-mode="cinematic"] .project-story__pin { position: static; height: auto; display: block; }
  .project-story[data-project-mode="cinematic"] .project-grid { display: grid; height: auto; }
  .project-story[data-project-mode="cinematic"] .project-card { grid-area: auto; height: auto; visibility: visible !important; opacity: 1 !important; transform: none !important; }
  .project-story .project-card :is(.project-card__link,.project-card__meta,.project-card__title,.project-card__summary,.tags,.project-card__footer) { opacity: 1; transform: none; }
}
