.hero-mobile-visual { display: none; }
@media (max-width: 768px) {
    .hero-mobile-visual { display: block; }
    .village-stage, .village-panel, .village-instructions, #villageAnnouncement { display: none !important; }
}
@media (min-width: 769px) {
/* Fade the glass itself so the navbar has no hard lower blur edge. */
#mainNav { isolation: isolate; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
#mainNav::before { content: ""; position: absolute; inset: 0 0 -44px; z-index: -1; pointer-events: none; background: linear-gradient(180deg,#0a0a0aeb 0%,#0a0a0ac2 40%,#0a0a0a66 68%,transparent 100%); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); mask-image: linear-gradient(#000 35%,#000000b3 62%,transparent 100%); -webkit-mask-image: linear-gradient(#000 35%,#000000b3 62%,transparent 100%); }
/* A miniature village lives entirely inside the existing hero. */
.hero.village-hero { isolation: isolate; background: #0a0a0a; min-height: 740px; }
.village-stage { --village-center-x: 64%; position: absolute; inset: 0; width: 100%; height: 100%; }
.village-stage { z-index: 1; overflow: hidden; }
.village-loader[hidden] { display: none; }
.village-loader {
    /* Share the visible game's center instead of centering the remaining hero space. */
    position: absolute; inset: 0 auto 0 var(--village-center-x); width: 66%; z-index: 5;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 32px; text-align: center; pointer-events: none;
    font-family: var(--font-body,sans-serif);
    background: radial-gradient(ellipse 260px 240px at 50% 47%,#8cb89a0d,transparent 80%);
    transition: opacity .35s ease, transform .35s ease;
}
.village-loader.is-complete { opacity: 0; transform: translate(-50%,-8px); }
.village-loader-eyebrow { margin-bottom: 28px; color: #a0b7a5; font-size: 9px; font-weight: 500; line-height: 1.5; letter-spacing: .24em; text-transform: uppercase; }
.village-loader-art { position: relative; display: grid; place-items: center; width: 172px; height: 172px; margin-bottom: 27px; }
.village-loader-art::before { content: ""; position: absolute; inset: 25px; border-radius: 50%; background: radial-gradient(circle,#a3d8b710,transparent 72%); box-shadow: 0 0 70px 15px #a3d8b708; }
.village-loader-progress { position: absolute; inset: 6px; width: 160px; height: 160px; overflow: visible; transform: rotate(-90deg); }
.village-loader-track { stroke: #a3d8b71c; stroke-width: 1; }
.village-loader-ring { stroke: #c6dfa9; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--village-progress,0)); filter: drop-shadow(0 0 4px #c6dfa950); transition: stroke-dashoffset .65s cubic-bezier(.22,1,.36,1); }
.village-loader-orbit { position: absolute; inset: 0; border: 1px dashed #a3d8b719; border-radius: 50%; animation: village-loader-spin 9s linear infinite; }
.village-loader-orbit::after { content: ""; position: absolute; top: -3px; left: calc(50% - 3px); width: 5px; height: 5px; border-radius: 50%; background: #c6dfa9; box-shadow: 0 0 12px #c6dfa970; }
.village-loader-scene { position: relative; width: 112px; height: 112px; animation: village-loader-float 3.6s ease-in-out infinite; }
.village-loader-spark { animation: village-loader-twinkle 3.6s ease-in-out infinite; }
.village-loader-label { color: #ecede4; font-size: clamp(20px,2vw,26px); font-weight: 500; line-height: 1.3; letter-spacing: -.035em; }
.village-loader-detail { display: inline-flex; align-items: center; gap: 8px; min-height: 20px; margin-top: 11px; color: #9daa9f; font-size: 12px; line-height: 1.6; }
.village-loader-detail::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #a3d8b7; box-shadow: 0 0 8px #a3d8b740; }
.village-loader-note { display: inline-flex; align-items: center; gap: 8px; max-width: 270px; margin-top: 35px; color: #89928b; font-size: 11px; line-height: 1.7; }
.village-loader-note > span { color: #c6dfa980; font-size: 15px; }
#villageCanvas { opacity: 1; transition: opacity .65s ease; }
.village-loading #villageCanvas { opacity: 0; visibility: hidden; }
.village-loading .village-markers { visibility: hidden; }
.village-loading .village-sign { visibility: hidden !important; }
@keyframes village-loader-spin { to { transform: rotate(360deg); } }
@keyframes village-loader-float { 0%,100% { transform: translateY(2px); } 50% { transform: translateY(-3px); } }
@keyframes village-loader-twinkle { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .village-loader-orbit, .village-loader-scene, .village-loader-spark { animation: none; }
    .village-loader, .village-loader-ring, #villageCanvas { transition: none; }
}
/* Blur only the outer scene; the central world and overlaid name stay crisp. */
.village-stage::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); mask-image: radial-gradient(ellipse 40% 56% at var(--village-center-x) 50%,transparent 56%,#00000066 78%,#000 100%); -webkit-mask-image: radial-gradient(ellipse 40% 56% at var(--village-center-x) 50%,transparent 56%,#00000066 78%,#000 100%); }
.village-stage::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(90deg,#0a0a0a 20%,#0a0a0ae0 27%,#0a0a0a59 34%,transparent 44%),linear-gradient(0deg,#0a0a0a 0%,#0a0a0a99 5%,transparent 20%,transparent 80%,#0a0a0a99 95%,#0a0a0a 100%); }
#villageCanvas { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; mask-image: radial-gradient(ellipse 40% 56% at var(--village-center-x) 50%,#000 58%,#000000d9 74%,#00000059 88%,transparent 100%); -webkit-mask-image: radial-gradient(ellipse 40% 56% at var(--village-center-x) 50%,#000 58%,#000000d9 74%,#00000059 88%,transparent 100%); }
#villageCanvas:focus-visible { outline: 1px solid #b0da9850; outline-offset: -8px; }
.village-hero .hero-content { pointer-events: none; padding-top: 110px; padding-bottom: 170px; }
.village-hero .hero-content a, .village-hero .hero-content button, .village-hero .hero-tagline-cycler { pointer-events: auto; }
.village-hero .hero-title { width: 33%; }
.village-hero .hero-title-line { font-size: clamp(5rem,min(10vw,20svh),10rem); color: #f2f2ed; }
.village-hero .hero-title-line:nth-child(2) { color: transparent; -webkit-text-stroke-color: #f2f2ed; }
.village-hero .hero-actions { flex-wrap: nowrap; gap: 25px; }
.village-hero .hero-work-btn, .village-hero .hero-contact-btn, .village-hero .hero-location { color: #eaece8; }
.village-hero .hero-tagline-cycler { max-width: 30vw; color: #959c9f; }
.village-hero .hero-scroll-indicator { position: relative; right: -20px; }
.village-hero::after { height: 70px; background: linear-gradient(0deg,#0a0a0a,transparent); z-index: 2; }
.village-markers { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.village-sign { position: absolute; transform: translate(-50%,-50%); width: 66px; height: 64px; display: block; border: 0; border-radius: 50%; background: transparent; cursor: pointer; pointer-events: auto; }
.village-sign:focus-visible { outline: 2px solid #d6f3d1b0; outline-offset: 4px; }
.village-sign:hover { background: transparent; }
.village-static .village-sign::after { content: attr(title); position: absolute; padding: 10px; color: #fff4db; background: #142326; white-space: nowrap; border-radius: 4px; }
.village-panel[hidden] { display: none; }
.village-panel { position: absolute; z-index: 12; right: 5%; top: 95px; bottom: 100px; width: min(440px,90%); padding: 28px; overflow: auto; background: #111b20f5; color: #f0f0e4; border: 1px solid #c4c39d4a; border-radius: 12px; box-shadow: -15px 20px 80px #0008; backdrop-filter: blur(18px); font-family: var(--font-body,sans-serif); }
.village-panel { scrollbar-width: thin; scrollbar-color: #689b80 transparent; scrollbar-gutter: stable; overscroll-behavior: contain; }
.village-panel::-webkit-scrollbar { width: 8px; }
.village-panel::-webkit-scrollbar-track { background: transparent; margin-block: 18px; }
.village-panel::-webkit-scrollbar-thumb { background: #689b80; border: 2px solid transparent; background-clip: padding-box; border-radius: 99px; }
.village-panel::-webkit-scrollbar-thumb:hover { background-color: #a3d8b7; }
.village-panel::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
@supports selector(::-webkit-scrollbar) {
    .village-panel { scrollbar-width: auto; scrollbar-color: auto; }
}
.village-panel-close { position: sticky; top: 0; z-index: 2; float: right; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #cfceb54a; border-radius: 50%; background: #27352e; color: #fff3da; font-size: 25px; cursor: pointer; }
.village-panel .village-panel-eyebrow { color: #a3d8b7; font: 12px/1.5 monospace; text-transform: uppercase; letter-spacing: .12em; margin: 2px 0 14px; }
.village-panel h2 { margin: 0 45px 24px 0; font: 500 32px/1.15 var(--font-body,sans-serif); letter-spacing: -.04em; }
.village-panel h3 { margin: 24px 0 10px; font: 500 19px/1.4 var(--font-body,sans-serif); }
.village-panel p { margin: 0 0 15px; color: #bbc6bf; font-size: 15px; line-height: 1.7; }
.village-panel .village-meta { color: #c5dba0; font: 12px/1.5 monospace; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.village-content-item { border-top: 1px solid #c8c5a123; padding: 22px 0; }
.village-content-item h3 { margin-top: 0; }
.village-project-image { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; border-radius: 6px; margin: 0 0 18px; }
.village-content-link { display: inline-flex; align-items: center; min-height: 44px; padding: 5px 0; margin-right: 15px; color: #d9e5be; font-size: 14px; line-height: 1.5; text-decoration: underline; text-underline-offset: 4px; }
.village-skills { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.village-skills span { border: 1px solid #bfcbab30; border-radius: 5px; padding: 6px 10px; color: #dbe2c8; font-size: 14px; }
.village-panel ul { padding-left: 20px; margin: 13px 0; color: #bdc7be; }
.village-panel li { margin: 8px 0; font-size: 14px; line-height: 1.6; }
.village-panel blockquote { padding-left: 15px; border-left: 2px solid #c5dba060; margin: 23px 0; }
.village-panel blockquote p { font-size: 14px; }
.village-panel cite { font-size: 12px; color: #9fb59e; font-style: normal; }
.village-message-button { min-height: 44px; padding: 11px 17px; background: #bdd9a9; color: #182a22; border: 0; border-radius: 5px; font: 500 14px/1.5 var(--font-body,sans-serif); cursor: pointer; }
body.village-pointer .cursor-dot, body.village-pointer .cursor-ring { opacity: 0 !important; }
@media (max-width: 1100px) and (min-width: 769px) {
    .village-hero .hero-title-line { font-size: 9vw; }
    .village-hero .hero-actions { flex-direction: column; align-items: flex-start; gap: 5px; }
    .village-hero .hero-tagline-cycler { max-width: 29vw; font-size: 13px; }

}

}

/* ---------- Desktop hero layout ----------
   The name, a one-line role, the career captions and the actions read as one
   group beside the village, and a small guide shows how to explore it.
   Mobile and tablet keep their existing hero. */
.hero-eyebrow, .village-guide { display: none; }
@media (min-width: 1025px) {
    .village-hero .hero-content {
        justify-content: center;
        padding: 96px clamp(40px, 4.2vw, 72px) 88px;
    }
    .village-hero .hero-eyebrow {
        order: 0; display: inline-flex; align-items: center; gap: 10px;
        margin: 0 0 26px; padding: 8px 15px 8px 12px;
        border: 1px solid #ffffff1c; border-radius: 100px; background: #0a0a0a8c;
        color: #cdd6d0; font: 500 11px/1.4 var(--font-body, sans-serif); letter-spacing: .16em; text-transform: uppercase;
    }
    .village-hero .hero-eyebrow-dot {
        width: 7px; height: 7px; border-radius: 50%;
        background: var(--accent, #00ff88); box-shadow: 0 0 0 4px #00ff881f;
    }
    .village-hero .hero-title { order: 1; width: auto; }
    .village-hero .hero-title-line { font-size: clamp(4.25rem, min(7.6vw, 15.5svh), 8.5rem); }
    /* The caption row joins the main column, directly under the name. */
    .village-hero .hero-bottom { display: contents; }
    .village-hero .hero-tagline-cycler {
        order: 2; width: min(410px, 30vw); max-width: none; margin-top: 26px;
        color: #a3aaa6;
    }
    .village-hero .hero-tagline { max-width: none; font-size: 15px; line-height: 1.65; }
    .village-hero .hero-actions { order: 3; margin-top: 30px; }
    .village-hero .hero-scroll-indicator { position: absolute; right: 28px; bottom: 40px; }

    .village-guide {
        position: absolute; z-index: 6; left: var(--village-center-x); bottom: 30px;
        display: flex; align-items: center; gap: 18px;
        padding: 8px 18px 8px 10px; transform: translateX(-50%);
        border: 1px solid #ffffff1a; border-radius: 100px;
        background: #0b0f0dcc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
        color: #c7d1ca; font: 500 12px/1 var(--font-body, sans-serif); white-space: nowrap;
        pointer-events: none;
        transition: opacity .5s ease, transform .5s ease;
    }
    .village-guide-item { display: inline-flex; align-items: center; gap: 9px; }
    .village-guide-item + .village-guide-item::before {
        content: ""; width: 1px; height: 14px; margin-right: 9px; background: #ffffff21;
    }
    .village-guide-keys { display: inline-flex; gap: 3px; }
    .village-guide kbd {
        display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
        border: 1px solid #ffffff2e; border-bottom-width: 2px; border-radius: 6px;
        background: #ffffff0d; color: #eef2ee; font: 600 10.5px/1 var(--font-body, sans-serif);
    }
    /* Shown once the world is ready; retired after the first walk. */
    .village-loading .village-guide,
    .village-static .village-guide,
    .village-hero.village-explored .village-guide { opacity: 0; transform: translate(-50%, 8px); }
}
@media (min-width: 1025px) and (max-height: 700px) {
    .village-hero .hero-eyebrow { margin-bottom: 18px; }
    .village-hero .hero-tagline-cycler { margin-top: 18px; }
    .village-hero .hero-actions { margin-top: 22px; }
}
@media (min-width: 1025px) and (prefers-reduced-motion: reduce) {
    .village-guide { transition: none; }
}
