/* SINE Lab · Security, Intelligence, Networks & Edge */
:root {
  --ink: #0F1D19;
  --muted: #4A5D57;
  --line: #D9E3DF;
  --bg: #F7F9F8;
  --alt: #EEF3F1;
  --surface: #FFFFFF;
  --deep: #0A1F19;
  --deep-2: #0F2B23;
  --green: #154734;
  --teal: #12705F;       /* text-safe accent on light */
  --teal-bright: #3FD0B8; /* accent on dark */
  --gold: #E3C46A;
  --coral: #E07A5F;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(10, 31, 25, .06), 0 8px 24px rgba(10, 31, 25, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.65; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--green); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 12px; }
:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 2px; }

.eyebrow, .kicker { font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: .9em; font-weight: 500; }
.section { padding: 96px 0; }
.section-alt { background: var(--alt); }
.section-lead { font-size: 1.1rem; color: var(--muted); max-width: 760px; margin-bottom: 40px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .98rem; text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.btn-primary { background: var(--teal-bright); color: var(--deep); }
.btn-primary:hover { background: #69E0CC; color: var(--deep); }
.section .btn-primary, .join-card .btn-primary { background: var(--green); color: #fff; }
.section .btn-primary:hover { background: var(--teal); color: #fff; }
.btn-ghost { border: 1.5px solid rgba(255, 255, 255, .35); color: #EAF5F2; }
.btn-ghost:hover { border-color: var(--teal-bright); color: #fff; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247, 249, 248, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: .06em; }
.brand-name span { font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .2em; color: var(--teal); margin-left: 4px; }
.brand-sub { font-family: var(--mono); font-size: .66rem; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.brand-shield { width: 50px; height: 52px; filter: drop-shadow(0 2px 4px rgba(10, 31, 25, .18)); }
.brand-sub { margin-top: 4px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { text-decoration: none; color: var(--ink); font-size: .95rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { background: var(--alt); color: var(--green); }
.site-nav a.active { color: var(--teal); }
.site-nav .nav-cta { background: var(--green); color: #fff; margin-left: 8px; padding: 8px 16px; border-radius: 999px; }
.site-nav .nav-cta:hover { background: var(--teal); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle .bar { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .2s; }

/* Hero */
.hero { position: relative; background: radial-gradient(1200px 600px at 75% 30%, #123A30 0%, var(--deep) 60%); color: #DCEBE6; padding: 88px 0 56px; overflow: hidden; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(63, 208, 184, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(63, 208, 184, .06) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(180deg, #000 30%, transparent 100%); }
.hero-wave { position: absolute; left: 0; right: 0; bottom: 150px; height: 120px; overflow: hidden; pointer-events: none; }
.hero-wave svg { width: 200%; height: 100%; animation: waveSlide 24s linear infinite; }
.hero-wave path { fill: none; stroke: rgba(63, 208, 184, .16); stroke-width: 2; vector-effect: non-scaling-stroke; }
.hero-wave .w2 { stroke: rgba(227, 196, 106, .10); transform: translateY(14px); }
@keyframes waveSlide { to { transform: translateX(-50%); } }
.hero-inner { position: relative; display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.hero .kicker { color: var(--teal-bright); }
.hero h1 { font-size: clamp(3.2rem, 7vw, 5.4rem); color: #F4FAF8; font-weight: 700; letter-spacing: .02em; margin-bottom: .1em; }
.hero-expand { font-family: var(--serif); font-size: clamp(1.2rem, 2.2vw, 1.6rem); color: #CFE4DD; margin-bottom: 1.1em; }
.hero-expand b { color: var(--gold); font-weight: 700; }
.hero-lead { font-size: 1.15rem; max-width: 540px; color: #B9D1C9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-visual { position: relative; margin: 0; background: rgba(15, 43, 35, .55); border: 1px solid rgba(63, 208, 184, .18); border-radius: 20px; padding: 20px 20px 16px; }
.hero-visual svg { width: 100%; height: auto; display: block; }
.net { padding: 14px 14px 12px; }
.net .link { fill: none; stroke: rgba(63, 208, 184, .28); stroke-width: 1.6; }
.net .link-core { stroke: rgba(63, 208, 184, .55); stroke-width: 2.2; stroke-dasharray: 5 6; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -22; } }
.net .node { cursor: pointer; outline: none; }
.net .node rect { fill: rgba(10, 31, 25, .92); stroke: rgba(255, 255, 255, .14); stroke-width: 1; transition: stroke .2s, fill .2s; }
.net .node:hover rect, .net .node:focus-visible rect, .net .node.on rect { stroke: var(--teal-bright); fill: #12352C; }
.net .n-code { font-family: var(--mono); font-size: 10px; fill: #8FB0A6; letter-spacing: .08em; }
.net .n-name { font-family: var(--sans); font-size: 12.5px; font-weight: 600; fill: #EAF5F2; }
.net .node-core circle { fill: #0E3A2F; stroke: var(--teal-bright); stroke-width: 1.6; transition: fill .2s; }
.net .node-core .halo { fill: rgba(63, 208, 184, .08); stroke: rgba(63, 208, 184, .25); stroke-width: 1; animation: halo 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { 50% { transform: scale(1.08); opacity: .5; } }
.net .node-core:hover circle:not(.halo), .net .node-core.on circle:not(.halo), .net .node-core:focus-visible circle:not(.halo) { fill: #145244; }
.net .c-name { font-family: var(--sans); font-size: 11.5px; font-weight: 600; fill: #F4FAF8; text-anchor: middle; }
.net .c-sub { font-family: var(--mono); font-size: 9.5px; fill: #9DC9BD; text-anchor: middle; }
.net .node-data rect { fill: rgba(227, 196, 106, .10); stroke: rgba(227, 196, 106, .55); }
.net .node-data:hover rect, .net .node-data.on rect { fill: rgba(227, 196, 106, .18); stroke: var(--gold); }
.net .d-wave { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; }
.net-tip { margin: 6px 4px 0; padding: 12px 14px; border-radius: 12px; background: rgba(10, 31, 25, .8); border: 1px solid rgba(63, 208, 184, .2); min-height: 74px; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; color: #B9D1C9; }
.net-tip b { color: #F4FAF8; font-weight: 600; }
.net-tip .hw { font-family: var(--mono); font-size: .76rem; color: var(--teal-bright); }
.net figcaption { display: flex; flex-wrap: wrap; gap: 16px; margin: 10px 4px 0; font-size: .8rem; color: #8FB0A6; }
.legend { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-fill { background: var(--teal-bright); }
.lg-ring { border: 2px solid #8FB8FF; }
.lg-gold { background: var(--gold); }
.facts { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 64px 0 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.facts div { padding: 22px 20px 0 0; }
.facts dt { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; color: #F4FAF8; line-height: 1; }
.facts dd { margin: 8px 0 0; color: #A9C4BB; font-size: .95rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: start; }
.about-grid > div > p:not(.eyebrow) { font-size: 1.08rem; color: #2B3E38; max-width: 640px; }
.why-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); border-top: 4px solid var(--teal); }
.why-wave { width: 100%; max-width: 240px; height: auto; margin: 4px 0 16px; }
.why-card p:last-child { margin: 0; color: var(--muted); }

/* Research */
.research-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.r-card { display: grid; grid-template-columns: 72px 1fr auto; gap: 24px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow); transition: border-color .2s, transform .2s; }
.r-card:hover { border-color: #A9CFC5; transform: translateY(-2px); }
.r-num { font-family: var(--mono); font-size: 1.5rem; color: var(--teal); font-weight: 500; padding-top: 2px; }
.r-body h3 { font-size: 1.35rem; margin-bottom: .4em; }
.r-body p { color: var(--muted); margin-bottom: 14px; max-width: 760px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-family: var(--mono); font-size: .75rem; padding: 4px 10px; border-radius: 6px; background: var(--alt); color: var(--green); border: 1px solid var(--line); }
.status { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status-active { border-color: #9AD3C6; color: var(--teal); background: #E4F5F0; }

/* Testbed */
.pipeline { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr 28px 1fr; align-items: stretch; margin-bottom: 56px; }
.p-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.p-step h3 { font-size: 1.1rem; margin: 14px 0 6px; }
.p-step p { font-size: .95rem; color: var(--muted); margin: 0; }
.p-n { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: var(--deep); color: var(--teal-bright); font-family: var(--mono); font-weight: 500; align-items: center; justify-content: center; }
.p-arrow { position: relative; }
.p-arrow::before { content: ""; position: absolute; top: 50%; left: 4px; right: 4px; border-top: 2px dashed #9DBDB4; }
.p-arrow::after { content: ""; position: absolute; top: calc(50% - 5px); right: 2px; border-left: 8px solid #9DBDB4; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.sub-h { font-size: 1.5rem; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 40px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 760px; }
.data-table th { text-align: left; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #F3F7F5; }
.data-table td { padding: 14px 18px; border-bottom: 1px solid #E8EFEC; vertical-align: top; }
.data-table td b { font-family: var(--mono); color: var(--teal); font-weight: 500; margin-right: 6px; }
.data-table tfoot td { font-size: .9rem; color: var(--muted); border-bottom: 0; background: #F3F7F5; }
.tb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.tb-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow); }
.check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check li { position: relative; padding-left: 26px; color: #2E423B; font-size: .98rem; }
.check li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 10px; height: 6px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg); }
.limits { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.limits summary { cursor: pointer; padding: 20px 30px; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.limits summary::-webkit-details-marker { display: none; }
.limits summary::after { content: "+"; font-family: var(--mono); font-size: 1.3rem; color: var(--teal); }
.limits[open] summary::after { content: "−"; }
.limits-body { padding: 0 30px 24px; color: var(--muted); }
.limits-body ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* Team */
.pi-card { display: grid; grid-template-columns: 200px 1fr; gap: 36px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); margin-bottom: 32px; }
.pi-card img { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; border: 4px solid var(--alt); }
.pi-card h3 { font-size: 1.7rem; margin-bottom: .2em; }
.role { font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: .4em; }
.pi-title { color: var(--muted); font-size: .98rem; }
.pi-contact { font-size: .95rem; margin: 0; }
.team-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.member { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px 22px; text-align: center; box-shadow: var(--shadow); }
.member img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; border: 3px solid var(--alt); }
.member h3 { font-size: 1.08rem; margin-bottom: .25em; }
.m-role { font-size: .85rem; color: var(--muted); margin-bottom: .3em; }
.m-focus { font-family: var(--mono); font-size: .72rem; color: var(--teal); margin: 0; line-height: 1.4; }

/* Gallery */
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 260px; grid-auto-flow: dense; gap: 16px; }
.gallery .g-wide { grid-column: span 2; }
.g-item { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: var(--deep); text-align: left; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s; }
.g-item:hover img { transform: scale(1.04); }
.g-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px; background: linear-gradient(180deg, transparent, rgba(6, 20, 16, .88)); color: #EDF6F3; font-size: .9rem; line-height: 1.45; }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5, 15, 12, .94); display: flex; align-items: center; justify-content: center; padding: 24px 72px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 1200px; }
.lightbox img { max-height: 80vh; width: auto; margin: 0 auto; border-radius: 10px; }
.lightbox figcaption { color: #DCEBE6; text-align: center; margin-top: 14px; font-size: .98rem; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .2); width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(63, 208, 184, .25); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Outputs */
.outputs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.planned { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow); }

/* Join */
.join-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.join-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 36px; box-shadow: var(--shadow); }
.join-card h2 { font-size: 1.9rem; }
.join-card p:not(.eyebrow) { color: #2E423B; }
.addr { font-size: 1.05rem; line-height: 1.6; }
.hours { border-collapse: collapse; margin: 8px 0 20px; }
.hours caption { text-align: left; font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.hours th { text-align: left; padding: 6px 28px 6px 0; font-weight: 600; }
.hours td { padding: 6px 0; color: #2E423B; }
.note { font-size: .92rem; color: var(--muted) !important; margin: 0; }

/* Footer */
.site-footer { background: var(--deep); color: #A9C4BB; padding: 36px 0; font-size: .9rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-row p { margin: 0; }
.f-brand { display: flex; align-items: center; gap: 12px; }
.f-brand { gap: 16px; }
.f-shield { width: 72px; height: 76px; }
.f-name { font-family: var(--serif); font-weight: 700; color: #F4FAF8; font-size: 1.1rem; letter-spacing: .05em; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 1080px) {
  .team-grid { grid-template-columns: repeat(4, 1fr); }
  .pipeline { grid-template-columns: 1fr 1fr; gap: 16px; }
  .p-arrow { display: none; }
}
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 24px 20px; display: none; }
  .site-nav.open { display: flex; }
  .site-nav .nav-cta { margin: 8px 0 0; text-align: center; }
  .hero-inner, .about-grid, .join-grid, .tb-cols { grid-template-columns: 1fr; }
  .hero { padding-top: 56px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 220px; }
  .r-card { grid-template-columns: 1fr; gap: 10px; }
  .r-num { font-size: 1.1rem; }
  .status { justify-self: start; }
  .pi-card { grid-template-columns: 1fr; text-align: center; }
  .pi-card img { margin: 0 auto; width: 160px; height: 160px; }
  .section { padding: 72px 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: 1fr; }
  .gallery .g-wide { grid-column: auto; }
  .pipeline { grid-template-columns: 1fr; }
  .lightbox { padding: 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 20px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .net .packets { display: none; }
  .hero-wave svg { animation: none; }
  .net .link-core, .net .node-core .halo { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .r-card, .g-item img { transition: none; }
}

/* Header tools */
.header-tools { display: flex; align-items: center; gap: 6px; order: 3; }
.header-row { gap: 12px; }
.site-nav { margin-left: auto; }
.beetle-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; transition: border-color .2s, background .2s; }
.beetle-toggle:hover { border-color: #f7c62f; }
.beetle-toggle svg { width: 22px; height: 22px; overflow: visible; }
.beetle-toggle .legs path, .beetle-toggle .ant { fill: none; stroke: #2a2200; stroke-width: 1.4; stroke-linecap: round; }
.beetle-toggle .hd, .beetle-toggle .spot { fill: #2a2200; }
.beetle-toggle .bd { fill: #f7c62f; stroke: #2a2200; stroke-width: .6; }
.beetle-toggle .seam { stroke: #2a2200; stroke-width: .8; }
.beetle-toggle.is-home { background: #FBF3D6; border-color: #E8D48A; }
.beetle-toggle:hover svg { animation: wobble2 .5s ease; }
@keyframes wobble2 { 30% { transform: rotate(-14deg); } 70% { transform: rotate(12deg); } }

/* The yellow beetle that wanders the page */
.roamer { position: fixed; left: 0; top: 0; width: 26px; height: 26px; z-index: 40; pointer-events: none; will-change: transform; transform: translate(-100px, -100px); filter: drop-shadow(0 2px 2px rgb(0 0 0 / .25)); transition: opacity .25s ease; }
.roamer svg { display: block; width: 100%; height: 100%; overflow: visible; }
.roamer .legs path, .roamer .ant { fill: none; stroke: #2a2200; stroke-width: 1.4; stroke-linecap: round; }
.roamer .hd, .roamer .spot { fill: #2a2200; }
.roamer .bd { fill: #f7c62f; stroke: #2a2200; stroke-width: .6; }
.roamer .seam { stroke: #2a2200; stroke-width: .8; }
.roamer .legs path { transform-box: fill-box; transform-origin: center; }
.roamer.walk .legs path:first-child { animation: legL .16s ease-in-out infinite alternate; }
.roamer.walk .legs path:last-child { animation: legR .16s ease-in-out infinite alternate; }
.roamer.run .legs path { animation-duration: .08s !important; }
.roamer.inside { opacity: 0; }
@keyframes legL { to { transform: translateY(1px) rotate(-6deg); } }
@keyframes legR { to { transform: translateY(-1px) rotate(6deg); } }

/* The beetle's home: drag it anywhere */
.bughome { position: fixed; top: 0; left: 0; width: 56px; height: 52px; z-index: 39; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; transform: translate(var(--hx, 14px), var(--hy, calc(100vh - 74px))); will-change: transform; }
.bughome svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bh-ground { fill: rgba(15, 29, 25, .1); }
.bh-wall { fill: #fff; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.bh-roof { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bh-roof-fill { fill: #f7c62f; }
.bh-chim { fill: #fff; stroke: var(--ink); stroke-width: 1.4; }
.bh-door { fill: #2a2200; stroke: var(--ink); stroke-width: 1.4; }
.bh-knob { fill: #f7c62f; }
.bh-win { fill: #CDEBE3; stroke: var(--ink); stroke-width: 1.2; transition: fill .4s; }
.bh-zzz { font: 700 9px var(--mono); fill: var(--muted); opacity: 0; }
.bughome.home .bh-win { fill: #f7c62f; }
.bughome.home .bh-zzz { animation: zzz 2.4s ease-in-out infinite; }
.bughome.home .bh-zzz.z2 { animation-delay: 1.2s; }
.bughome.knock svg { animation: knock .35s ease; }
.bughome:hover svg { filter: drop-shadow(0 3px 6px var(--shadow-c, rgba(0,0,0,.2))); }
.bughome.dragging { cursor: grabbing; }
.bughome.dragging svg { transform: scale(1.12) rotate(-4deg); transition: transform .15s; }
.bughome::after { content: "Drag me"; position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); font: 600 .66rem var(--mono); white-space: nowrap; padding: 2px 7px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); opacity: 0; transition: opacity .2s; pointer-events: none; }
.bughome:hover::after { opacity: 1; }
.bughome.dragging::after { opacity: 0; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translate(6px, -8px); } }
@keyframes knock { 30% { transform: rotate(-4deg); } 70% { transform: rotate(3deg); } }
@media (max-width: 560px) { .bughome { width: 42px; height: 39px; } }

/* Beetle cursor (mouse and trackpad only) */
@media (pointer: fine) {
  html, body { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cg transform='rotate(-35 12 12)'%3E%3Cg fill='none' stroke='%232a2200' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M8.2 10.5 4 8.2M7.6 13.6H3.4M8.2 16.6 4 19M15.8 10.5 20 8.2M16.4 13.6h4.2M15.8 16.6 20 19M10.6 5.4 8.8 2.4M13.4 5.4l1.8-3'/%3E%3C/g%3E%3Ccircle cx='12' cy='6.6' r='2.6' fill='%232a2200'/%3E%3Cellipse cx='12' cy='14.2' rx='4.8' ry='6.3' fill='%23f7c62f' stroke='%232a2200' stroke-width='.9'/%3E%3Cpath d='M12 8.6v11.6' stroke='%232a2200' stroke-width='.9'/%3E%3Ccircle cx='10' cy='12.4' r='1' fill='%232a2200'/%3E%3Ccircle cx='14' cy='12.4' r='1' fill='%232a2200'/%3E%3Ccircle cx='10.2' cy='16.6' r='.9' fill='%232a2200'/%3E%3Ccircle cx='13.8' cy='16.6' r='.9' fill='%232a2200'/%3E%3C/g%3E%3C/svg%3E") 9 6, auto; }
  a, button, summary, .node, .g-item { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cg transform='rotate(-35 12 12)'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23f7c62f' fill-opacity='.25'/%3E%3Cg fill='none' stroke='%232a2200' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M8.2 10.5 4 8.2M7.6 13.6H3.4M8.2 16.6 4 19M15.8 10.5 20 8.2M16.4 13.6h4.2M15.8 16.6 20 19M10.6 5.4 8.8 2.4M13.4 5.4l1.8-3'/%3E%3C/g%3E%3Ccircle cx='12' cy='6.6' r='2.6' fill='%232a2200'/%3E%3Cellipse cx='12' cy='14.2' rx='4.8' ry='6.3' fill='%23f7c62f' stroke='%232a2200' stroke-width='.9'/%3E%3Cpath d='M12 8.6v11.6' stroke='%232a2200' stroke-width='.9'/%3E%3Ccircle cx='10' cy='12.4' r='1' fill='%232a2200'/%3E%3Ccircle cx='14' cy='12.4' r='1' fill='%232a2200'/%3E%3Ccircle cx='10.2' cy='16.6' r='.9' fill='%232a2200'/%3E%3Ccircle cx='13.8' cy='16.6' r='.9' fill='%232a2200'/%3E%3C/g%3E%3C/svg%3E") 9 6, pointer; }
  .bughome { cursor: grab; } .bughome.dragging { cursor: grabbing; }
}
.click-pop { position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2px solid #f7c62f; pointer-events: none; z-index: 60; animation: clickPop .45s ease-out forwards; }
@keyframes clickPop { from { transform: var(--p) scale(.3); opacity: .9; } to { transform: var(--p) scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .roamer, .bughome { display: none; } .beetle-toggle { display: none; } }
