/* ==========================================================================
   home-globe.css — 3D scrollytelling globe homepage (ported from /lab/globe.html)
   Home-content rules ONLY. The site shell (body/html reset, nav, navmenu,
   nav-burger, footer, skip-link) is provided by base.html + global.css and is
   intentionally NOT duplicated here. Every selector below is home-only
   (.scene*, .cyber*, .ipsec*, .svc*, .writing*, .netbp*, .bp-grid, .glabel,
   .hk*, .loader, #bg, [data-static]) so it cannot leak into other pages.

   Brand-token mapping: the site's brand-tokens.css already defines the same
   names the lab used (--accent, --accent-hover, --accent-link, --accent-line,
   --accent-soft, --border, --border-strong, --text, --text-soft, --text-muted,
   --text-dim, --bg, --bg-glass, --success, --font-display, --font-mono,
   --radius-lg). Two tokens have no site equivalent and are defined locally:
     --bp   : the blueprint rgb tuple (lab-only)
     --ease : the lab's signature easing curve (site uses raw cubic-beziers)
   ========================================================================== */
:root { --bp: 124,150,255; --ease: cubic-bezier(0.16, 1, 0.3, 1); }

#bg { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1s var(--ease); }
[data-ready="true"] #bg { opacity: 1; }

.bp-grid { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 0.6s var(--ease);
  background:
    linear-gradient(rgba(109,133,255,0.10) 1px, transparent 1px) 0 0 / 46px 46px,
    linear-gradient(90deg, rgba(109,133,255,0.10) 1px, transparent 1px) 0 0 / 46px 46px,
    radial-gradient(130% 90% at 60% 40%, #0b1330, #0a0a0a 72%); }

.netbp { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.32; transition: opacity 0.6s var(--ease); }
.netbp svg.diagram { position: absolute; inset: 0; width: 100%; height: 100%; }
.netbp text { font-family: var(--font-mono); fill: rgba(var(--bp),0.85); }
.netbp .lbl { font-size: 13px; letter-spacing: 0.01em; }
.netbp .sub { font-size: 10.5px; fill: rgba(var(--bp),0.52); }
.netbp .cidr { font-size: 10px; fill: rgba(var(--bp),0.6); }
.netbp .zone-lbl { font-size: 12px; fill: rgba(var(--bp),0.55); letter-spacing: 0.16em; }
.netbp .link { fill: none; stroke: rgba(var(--bp),0.42); stroke-width: 1.4; }
.netbp .link.dash { stroke-dasharray: 5 5; stroke: rgba(var(--bp),0.34); }
.netbp .link.inet { stroke-dasharray: 2 5; stroke: rgba(var(--bp),0.3); }
.netbp .link.priv { stroke: rgba(var(--bp),0.78); stroke-width: 3; }
.netbp .priv-lbl { font-size: 11px; fill: rgba(var(--bp),0.85); letter-spacing: 0.04em; }
.netbp .glyph { fill: none; stroke: rgba(var(--bp),0.85); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.netbp .glyph .soft { fill: rgba(var(--bp),0.08); }
.netbp .dot { fill: rgba(var(--bp),0.9); }
.netbp .zone { fill: rgba(var(--bp),0.018); stroke: rgba(var(--bp),0.34); stroke-width: 1.3; }
.netbp .zone.dashed { stroke-dasharray: 6 5; fill: none; }
.netbp .zone.region { fill: rgba(var(--bp),0.012); stroke: rgba(var(--bp),0.4); }
.netbp .frame { stroke: rgba(var(--bp),0.4); fill: none; stroke-width: 1.4; }
.netbp .frame.inner { stroke: rgba(var(--bp),0.18); }
.netbp .titleblock { stroke: rgba(var(--bp),0.42); fill: rgba(8,9,13,0.5); stroke-width: 1.2; }
.netbp .callout { stroke: rgba(var(--bp),0.42); stroke-width: 1; fill: none; }
.netbp .dim { stroke: rgba(var(--bp),0.3); stroke-width: 1; }

.loader { position: fixed; right: clamp(1rem,4vw,2rem); bottom: clamp(1rem,4vw,2rem); z-index: 90;
  display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.9rem; border-radius: 999px;
  background: rgba(10,10,12,0.7); border: 1px solid var(--border-strong); backdrop-filter: blur(8px);
  font-family: var(--font-mono); color: var(--text-dim); font-size: 0.74rem; letter-spacing: 0.08em; transition: opacity 0.6s var(--ease); }
[data-ready="true"] .loader { opacity: 0; pointer-events: none; }
.loader span::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%;
  background: var(--accent); animation: blink 1s steps(2) infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0.2; } }

.scroll { position: relative; z-index: 3; }
.scene { position: relative; min-height: 100svh; display: grid; align-content: center;
  padding: 6rem clamp(1.5rem, 8vw, 7rem) 4rem; max-width: 1400px; margin: 0 auto; }
.scene.right { justify-items: end; text-align: right; }
.scene .eyebrow { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; color: var(--accent-link); margin-bottom: 1rem;
  /* override the site-wide bordered pill: plain text label, no bar that stretches across the globe */
  display: inline-block; justify-self: start; width: max-content; max-width: 100%; padding: 0; background: none; border: 0; border-radius: 0; }
.scene h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: 0.98; letter-spacing: -0.04em; margin: 0; text-wrap: balance; color: #fafafa; }
.scene h1 em, .scene h2 em { font-style: normal; background: linear-gradient(120deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.scene h2 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -0.035em; margin: 0; max-width: 15ch; text-wrap: balance; }
.scene h2.end-title { font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: 0.98; letter-spacing: -0.04em; max-width: none; }
.scene p { color: var(--text-muted); font-size: clamp(1rem, 1.5vw, 1.18rem); max-width: 40ch; margin: 1.1rem 0 0; }
.scene.right p { margin-left: auto; }
.scene .cta { margin-top: 1.8rem; display: flex; gap: 0.8rem; flex-wrap: wrap; }
.scene.right .cta { justify-content: flex-end; }
.scene .tags { margin-top: 1.3rem; display: flex; gap: 0.5rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-dim); }
.scene .tags span::before { content: '+ '; color: var(--accent-link); }

.fact .big { font-family: var(--font-display); font-weight: 700; font-size: clamp(3rem, 9vw, 7rem); line-height: 0.9; letter-spacing: -0.04em; }

/* recent writing: a cobalt glass panel (sibling of the cyan cybersecurity card) with a quiet divider list */
.writingcard { position: relative; max-width: 33rem; padding: 1.7rem 1.9rem 1.9rem; border-radius: var(--radius-lg);
  border: 1px solid rgba(109,133,255,0.22); overflow: hidden;
  background: linear-gradient(158deg, rgba(15,24,56,0.84), rgba(9,11,17,0.62));
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 28px 80px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.07); }
.writingcard::before { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(130% 100% at 100% 0%, rgba(6,45,244,0.22), transparent 56%); }
.writingcard > * { position: relative; }
.writingcard h2 { font-size: clamp(1.7rem, 3vw, 2.25rem); line-height: 1.04; max-width: none; }
.writing { list-style: none; margin: 1.25rem 0 0; padding: 0; width: 100%; }
.writing li + li { border-top: 1px solid var(--border); }
.writing a { display: grid; grid-template-columns: 6rem 1fr auto; align-items: baseline; gap: 0.2rem 1.2rem;
  padding: 0.95rem 0.25rem; color: var(--text-soft); transition: color 0.25s var(--ease), padding-left 0.25s var(--ease); }
.writing a:hover, .writing a:focus-visible { color: #fff; padding-left: 0.55rem; }
.w-date { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-dim); letter-spacing: 0.04em; white-space: nowrap; }
.w-title { font-size: clamp(1.02rem, 1.5vw, 1.28rem); line-height: 1.3; }
.w-go { font-family: var(--font-mono); color: var(--accent-link); justify-self: end; opacity: 0; transform: translateX(-5px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.writing a:hover .w-go, .writing a:focus-visible .w-go { opacity: 1; transform: none; }
.writing-all { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.4rem;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-link); transition: color 0.2s var(--ease); }
.writing-all:hover, .writing-all:focus-visible { color: var(--accent-hover); }
.writing-all span { transition: transform 0.2s var(--ease); }
.writing-all:hover span { transform: translateX(3px); }
@media (hover: none) { .w-go { opacity: 0.55; transform: none; } }
@media (max-width: 760px) {
  .writing a { grid-template-columns: 1fr auto; }
  .w-date { grid-column: 1 / -1; margin-bottom: 0.15rem; }
}

.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; width: 100%; max-width: 1100px; margin-top: 2rem; }
.svc-card { position: relative; display: flex; flex-direction: column; gap: 0.4rem; padding: 1.6rem 1.5rem 1.6rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-glass); backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.svc-card:hover { border-color: var(--accent-line); transform: translateY(-6px);
  box-shadow: 0 28px 70px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08); }
.svc-card .n { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); }
.svc-card h3 { font-size: 1.2rem; }
.svc-card p { font-size: 0.9rem; margin: 0.2rem 0 0; }
.svc-card .go { margin-top: auto; padding-top: 0.9rem; display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-link); }
.svc-card .go .arr2 { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem;
  border-radius: 999px; background: var(--accent-soft); transition: transform 0.3s var(--ease), background 0.3s var(--ease); }
.svc-card:hover .go .arr2 { transform: translateX(3px); background: var(--accent-line); }
.svc-card.featured { border-color: var(--accent-line); background: linear-gradient(160deg, rgba(6,45,244,0.10), var(--bg-glass)); box-shadow: 0 22px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 1px rgba(6,45,244,0.18); }
.svc-card.featured .go { color: var(--accent-hover); }
/* the globe hero's primary-CTA arrow capsule (.btn-primary .arr) — scoped to .scene so it
   does not override the site shell's own .btn-primary. Mirrors the lab's button affordance. */
.scene .btn-primary { position: relative; padding-right: 0.6rem; }
.scene .btn-primary .arr { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem;
  border-radius: 999px; background: rgba(255,255,255,0.16); font-size: 0.82rem; transition: transform 0.25s var(--ease), background 0.25s var(--ease); }
.scene .btn-primary:hover .arr { transform: translate(2px,-1px); background: rgba(255,255,255,0.26); }
.scene .btn-primary:active { transform: translateY(1px) scale(0.985); }
.scene .btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
  padding: 0.8rem 1.3rem; border-radius: var(--radius); transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.scene .btn-ghost:hover { border-color: var(--accent-line); background: var(--accent-faint); }
@media (max-width: 760px) { .svc-grid { grid-template-columns: 1fr; } .scene.right { justify-items: start; text-align: left; } .scene.right p { margin-left: 0; } .scene.right .cta { justify-content: flex-start; } .cyber-stage .cybercard h2 { font-size: 1.6rem; } }
/* mobile: legibility scrim behind the text, so headlines read cleanly over the centered globe */
@media (max-width: 760px) { .scene, .ipsec-stage { background: radial-gradient(135% 76% at 40% 46%, rgba(8,8,11,0.80), rgba(8,8,11,0.42) 46%, transparent 78%); } }

/* ---- IPSEC tunnel beat ---------------------------------------------- */
.ipsec { min-height: 230vh; }
.ipsec-stage { position: sticky; top: 0; height: 100svh; display: grid; align-content: center; z-index: 3;
  max-width: 1400px; margin: 0 auto; padding: 6rem clamp(1.5rem, 8vw, 7rem) 4rem; }
.ipsec-wrap { display: grid; justify-items: start; gap: 1.1rem; max-width: 32ch; text-align: left; }
.ipsec-eyebrow { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; color: #ff7d8f; }
.ipsec-title { font-family: var(--font-mono); font-weight: 500; font-size: clamp(2.4rem, 7vw, 5rem);
  letter-spacing: 0.28em; color: #fff; text-shadow: 0 0 26px rgba(255,40,70,0.45); padding-left: 0.28em; }
.lock { width: clamp(116px, 15vw, 176px); height: auto; filter: drop-shadow(0 0 14px rgba(107,133,255,0.5)); }
.lock path, .lock rect, .lock circle { stroke: var(--accent-link); stroke-width: 4.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ipsec-labels { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: flex-start; font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-soft); letter-spacing: 0.06em; }
.ipsec-labels span { padding: 0.25rem 0.7rem; border: 1px solid var(--border-strong); border-radius: 999px; }
.ipsec-secured { font-family: var(--font-mono); font-size: 0.84rem; color: var(--success); letter-spacing: 0.06em; }
.ipsec-secured::before { content: '\25CF  '; }

#labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.glabel { position: absolute; top: 0; left: 0; will-change: transform, opacity; font-family: var(--font-mono); appearance: none; -webkit-appearance: none;
  font-size: 0.72rem; letter-spacing: 0.03em; color: var(--text-dim); white-space: nowrap; cursor: pointer;
  padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; background: rgba(10,10,10,0.45);
  transform: translate(-50%, -50%); transition: opacity 0.18s, color 0.18s, border-color 0.18s, background 0.18s; }
.glabel:hover { color: #fff; border-color: var(--accent); background: rgba(6,45,244,0.18); }
.glabel.strong { color: var(--text); border-color: var(--accent-line); background: rgba(10,10,10,0.6); }

/* ---- the hacker's terminal -------------------------------------------- */
.hk { position: fixed; left: clamp(1rem, 4vw, 2rem); bottom: clamp(1rem, 4vw, 2rem); z-index: 5; width: min(330px, 78vw);
  background: rgba(9, 8, 11, 0.85); border: 1px solid #3a2030; border-radius: 9px; overflow: hidden;
  font-family: var(--font-mono); font-size: 0.7rem; opacity: 0; pointer-events: none;
  transition: opacity 0.45s var(--ease); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55); }
.hk.show { opacity: 1; }
.hk-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.7rem; border-bottom: 1px solid #2a1820;
  color: #ff7d8f; letter-spacing: 0.05em; }
.hk-bar .hk-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3a4f; box-shadow: 0 0 8px #ff3a4f; }
.hk-out { padding: 0.55rem 0.7rem; min-height: 84px; color: #8a8f98; line-height: 1.55; }
.hk-out .cmd { color: #d4dbff; } .hk-out .cmd::before { content: '$ '; color: #ff7d8f; }
.hk-out .drop { color: #ff5466; }

/* ---- cybersecurity card (datacenter beat): premium glass, cyan security theme ---- */
.cybercard { position: relative; max-width: 31rem; padding: 1.9rem 2rem 2.1rem; border-radius: var(--radius-lg);
  border: 1px solid rgba(125,205,255,0.20); overflow: hidden;
  background: linear-gradient(158deg, rgba(18,30,62,0.86), rgba(9,11,17,0.64));
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 28px 80px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08); }
.cybercard::before { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(130% 100% at 100% 0%, rgba(57,208,255,0.18), transparent 56%); }
.cybercard > * { position: relative; }
.cybercard .eyebrow { display: inline-flex; align-items: center; margin-bottom: 1rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; color: #7fe9ff; }
.cybercard h2 { margin: 0; font-size: clamp(1.95rem, 3.1vw, 2.6rem); line-height: 1.04; letter-spacing: -0.035em; color: #fafafa; }
.cybercard h2 em { font-style: normal; background: linear-gradient(118deg, #5fe0ff, #6B85FF);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cybercard p { margin: 0.95rem 0 0; max-width: 40ch; color: var(--text-muted);
  font-size: clamp(0.95rem, 1.15vw, 1.05rem); line-height: 1.62; }
.cyber-vendors { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.4rem; }
.cyber-vendors span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.02em; color: #cfe9f5;
  padding: 0.36rem 0.78rem; border: 1px solid rgba(125,205,255,0.26); border-radius: 999px;
  background: rgba(57,208,255,0.07); transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.cyber-vendors span:hover { border-color: rgba(125,205,255,0.5); background: rgba(57,208,255,0.13); }

/* the cyber beat is PINNED: the card holds while the shield deploys and the attack plays out */
.cyber { position: relative; min-height: 240vh; }
.cyber-stage { position: sticky; top: 0; height: 100svh; display: grid; align-content: center; z-index: 3;
  max-width: 1400px; margin: 0 auto; padding: 6rem clamp(1.5rem, 8vw, 7rem) 4rem; }

/* free-drag the globe once "Pick where to start" is reached */
body.grabbable { cursor: grab; }
body.grabbable :is(a, button, .svc-card, .glabel) { cursor: pointer; }
body.grabbing, body.grabbing * { cursor: grabbing !important; user-select: none; }

[data-static="true"] #bg, [data-static="true"] .bp-grid, [data-static="true"] #labels, [data-static="true"] .hk { display: none; }
[data-static="true"] .loader { display: none; }
[data-static="true"] .netbp { opacity: 0.34; }
@media (max-width: 760px) { .netbp { display: none; } }
[data-static="true"] .cyber, [data-static="true"] .ipsec { min-height: 100svh; }
@media (prefers-reduced-transparency: reduce) {
  .cybercard, .writingcard, .svc-card, .hk, .loader { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .cybercard, .writingcard { background: rgba(12,16,28,0.97); }
  .svc-card { background: rgba(14,14,18,0.97); }
}
