/* Copyright (c) 2026 Almaru. All rights reserved.
   Proprietary and confidential. Part of ALMARU HSE Tools (almaruhsetools.com).
   No part of this file may be copied, modified or distributed without Almaru's written permission. See LICENSE. */
:root {
  --bg: #0a0f15;
  --panel: rgba(14, 20, 28, 0.88);
  --panel-hi: rgba(22, 31, 43, 0.95);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9eef4;
  --muted: #c3ccd7;
  --accent: #ff8a1f;
  --ok: #3ee08a;
  --off: #6b7684;
  --radius: 16px;
  --wide: 1640px;
  --gutter: clamp(16px, 4vw, 64px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Anything marked hidden stays hidden, even when a rule below gives it a display (e.g. the preview bar). */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }

#scene {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  background: radial-gradient(ellipse at 70% 20%, #16263a 0%, var(--bg) 65%);
}

/* Shade over the 3D scene so text stays readable. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 12, 18, .92) 0%, rgba(8, 12, 18, .8) 35%, rgba(8, 12, 18, .35) 60%, rgba(8, 12, 18, .1) 80%);
}
/* Darkens the scene as you scroll down to the cards (--dim is set from main.js). */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: rgba(8, 12, 18, .82);
  opacity: var(--dim, 0);
}
@media (max-width: 900px) {
  body::before { background: rgba(8, 12, 18, .78); }
}

.top, main, footer { position: relative; z-index: 1; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--wide); margin: 0 auto; padding: 22px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: .02em; }
.brand svg { width: 30px; height: 30px; }
.brand b { color: var(--accent); font-weight: 800; }
.top nav { display: flex; gap: 22px; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.top nav a:hover { color: var(--text); }
.top nav { align-items: center; }
.top nav a.admin-link { color: var(--accent); font: 700 12px "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; border: 1px dashed rgba(255, 138, 31, .6); border-radius: 999px; padding: 5px 10px; }
.top nav a.admin-link:hover { background: rgba(255, 138, 31, .14); }
.preview-bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px;
  padding: 10px 16px; background: #ff8a1f; color: #1a0d00; font-size: .92rem; text-align: center;
}
.preview-bar a { color: #1a0d00; font-weight: 700; }
.apps-menu { position: relative; }
.apps-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font: 600 14px Inter, system-ui, sans-serif; color: var(--text);
  background: rgba(61, 220, 132, .12); border: 1px solid rgba(61, 220, 132, .55); border-radius: 999px; padding: 7px 14px;
}
.apps-btn svg { width: 17px; height: 17px; color: #3ddc84; }
.apps-btn:hover, .apps-btn:focus-visible, .apps-btn[aria-expanded="true"] { background: #3ddc84; color: #04170c; outline: none; }
.apps-btn:hover svg, .apps-btn:focus-visible svg, .apps-btn[aria-expanded="true"] svg { color: #04170c; }
.apps-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; width: min(340px, calc(100vw - 32px));
  padding: 14px; border-radius: 14px; background: rgba(14, 20, 28, .97); border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.apps-pop-head { margin: 2px 6px 10px; font: 700 11px/1 "JetBrains Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: #3ddc84; }
.apps-pop ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.apps-pop li a {
  --c: var(--accent);
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "dot n dl" "dot tg dl"; column-gap: 10px; align-items: center;
  padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none;
}
.apps-pop li a:hover, .apps-pop li a:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
.apps-pop .dot { grid-area: dot; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.apps-pop .n { grid-area: n; font-weight: 600; font-size: .95rem; }
.apps-pop .tg { grid-area: tg; font: 500 11px "JetBrains Mono", monospace; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.apps-pop .dl { grid-area: dl; font: 600 12px Inter, system-ui, sans-serif; color: #3ddc84; white-space: nowrap; }
.apps-pop-note { margin: 10px 6px 2px; font-size: .8rem; line-height: 1.45; color: var(--muted); }

main { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

.hero { min-height: calc(100vh - 160px); display: flex; flex-direction: column; justify-content: center; max-width: 720px; padding: 40px 0 80px; }
.eyebrow { font: 700 12px/1 "JetBrains Mono", monospace; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 22px; font-weight: 800; }
.hero h1 span { color: #aebccb; font-weight: 700; }
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0 -120px 0 -80px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(8, 12, 18, .92), rgba(8, 12, 18, .78) 55%, rgba(8, 12, 18, 0));
}
.hero, .section-head, .about { text-shadow: 0 2px 14px rgba(0, 0, 0, .85), 0 1px 3px rgba(0, 0, 0, .9); }
.hero .btn, .live b { text-shadow: none; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 34px; max-width: 600px; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.btn { display: inline-block; padding: 13px 24px; border-radius: 999px; text-decoration: none; font-weight: 600; }
.btn.primary { background: var(--accent); color: #1a0d00; box-shadow: 0 8px 30px rgba(255, 138, 31, .3); }
.btn.primary:hover { filter: brightness(1.08); }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .95rem; }
.live b { color: var(--text); }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(62, 224, 138, .6); animation: pulse 2s infinite; }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 26px; }
.section-head h2, .about h2 { font-size: 2rem; letter-spacing: -.02em; margin: 0; }
.section-head p { color: var(--muted); margin: 0; font-size: .95rem; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-bottom: 90px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, 1fr); } }

.card {
  --c: var(--accent);
  position: relative; display: flex; flex-direction: column;
  padding: 24px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  text-decoration: none;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--c), transparent);
}
.card:hover, .card:focus-within { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: var(--panel-hi); outline: none; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font: 700 15px "JetBrains Mono", monospace; }
.status { display: inline-flex; align-items: center; gap: 7px; font: 500 12px "JetBrains Mono", monospace; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--off); }
.status.on i { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status.on { color: var(--ok); }
.card .tag { font: 500 12px "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--c); margin: 0 0 4px; }
.card h3 { margin: 0 0 10px; font-size: 1.3rem; letter-spacing: -.01em; }
.card p.desc { margin: 0 0 20px; color: var(--muted); font-size: .95rem; flex: 1; }
.card .go { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--line); font: 500 13px "JetBrains Mono", monospace; color: var(--muted); }
.card h3 a.stretch { color: inherit; text-decoration: none; outline: none; }
.card h3 a.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.card h3 a.stretch:focus-visible::after { outline: 2px solid var(--c); outline-offset: -2px; }
.card .go { flex-wrap: wrap; gap: 10px 14px; }
.card .actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px 14px; margin-left: auto; }
.card .open { color: var(--text); transition: transform .25s; white-space: nowrap; }
.watch { white-space: nowrap; }
.card:hover .open { transform: translateX(4px); color: var(--c); }
.watch {
  position: relative; z-index: 2; cursor: pointer;
  font: 600 12px Inter, system-ui, sans-serif; color: var(--text);
  background: color-mix(in srgb, var(--c) 22%, transparent); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  border-radius: 999px; padding: 6px 12px;
}
.watch:hover, .watch:focus-visible { background: var(--c); color: #120a02; outline: none; }
/* QR code: a small button on each card, and the panel it opens */
.qr-btn {
  position: relative; z-index: 2; display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; cursor: pointer;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text);
}
.qr-btn svg { width: 17px; height: 17px; }
.qr-btn:hover, .qr-btn:focus-visible { background: #fff; color: #0a0f15; border-color: #fff; outline: none; }
.qr-dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); }
.qr-dialog::backdrop { background: rgba(4, 7, 11, .78); backdrop-filter: blur(4px); }
.qr-card {
  --c: var(--accent);
  position: relative; width: min(400px, calc(100vw - 32px)); padding: 26px 26px 22px; border-radius: 20px; text-align: center;
  background: var(--panel-hi); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.qr-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: 20px 20px 0 0; background: var(--c); }
.qr-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.qr-close:hover, .qr-close:focus-visible { background: rgba(255, 255, 255, .08); color: var(--text); outline: none; }
.qr-tag { margin: 0 0 4px; font: 500 12px "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.qr-card h2 { margin: 0 0 16px; font-size: 1.35rem; letter-spacing: -.01em; }
.qr-code { width: min(280px, 100%); margin: 0 auto; border-radius: 14px; overflow: hidden; background: #fff; }
.qr-code svg { display: block; width: 100%; height: auto; }
.qr-url { margin: 14px 0 2px; font: 500 14px "JetBrains Mono", monospace; overflow-wrap: anywhere; }
.qr-hint { margin: 0 0 18px; color: var(--muted); font-size: .9rem; }
.qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.qr-actions .btn { padding: 10px 18px; font-size: .92rem; border: 0; cursor: pointer; font-family: inherit; }
.qr-actions .btn.ghost { border: 1px solid var(--line); background: transparent; color: var(--text); }
.qr-actions .btn.ghost:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

.android {
  position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font: 600 12px Inter, system-ui, sans-serif; color: var(--text); text-decoration: none;
  border: 1px solid rgba(61, 220, 132, .55); border-radius: 999px; padding: 5px 11px;
}
.android svg { width: 15px; height: 15px; color: #3ddc84; }
.android:hover, .android:focus-visible { background: #3ddc84; color: #04170c; outline: none; }
.android:hover svg, .android:focus-visible svg { color: #04170c; }
/* A Windows program to download */
.android.windows { border-color: rgba(56, 182, 255, .6); }
.android.windows svg { color: #38b6ff; }
.android.windows:hover, .android.windows:focus-visible { background: #38b6ff; color: #03121c; }
.android.windows:hover svg, .android.windows:focus-visible svg { color: #03121c; }
/* A tool to install rather than open: no status light */
.status.dl-badge { color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); border-radius: 999px; padding: 2px 9px; }
.card.download .go { flex-wrap: wrap; gap: 8px; }

/* ---- Videos ---- */
.videos { padding: 10px 0 90px; }
.video-main { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 28px; align-items: center; }
.frame { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); aspect-ratio: 16 / 9; }
.frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-info { --c: var(--accent); padding: 26px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.video-info h3 { margin: 0 0 10px; font-size: 1.5rem; letter-spacing: -.01em; }
.video-info p { margin: 0 0 22px; color: var(--muted); }
.btn.ghost { border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); color: var(--text); padding: 10px 18px; font-size: .95rem; }
.btn.ghost:hover { background: var(--c); color: #120a02; }
.video-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 22px; }
.thumb { --c: var(--accent); display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.thumb .pic { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); background: var(--panel); margin-bottom: 6px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .len { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .75); font: 600 12px "JetBrains Mono", monospace; }
.thumb .t { font-weight: 600; font-size: .95rem; }
.thumb .s { font: 500 12px "JetBrains Mono", monospace; color: var(--c); text-transform: uppercase; letter-spacing: .05em; }
.thumb:hover .pic, .thumb:focus-visible .pic { border-color: color-mix(in srgb, var(--c) 70%, transparent); }
.thumb[aria-current="true"] .pic { border-color: var(--c); }
.thumb:focus-visible { outline: none; }
.thumb.soon { cursor: default; }
.thumb.soon b { color: var(--text); }
.admin-note { margin: 26px 0 -8px; font: 500 12px "JetBrains Mono", monospace; color: var(--accent); }
.thumb.soon .pic { border-style: dashed; color: var(--muted); text-align: center; font-size: .9rem; }
@media (max-width: 900px) { .video-main { grid-template-columns: 1fr; } }

.about { display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 1fr); gap: 28px 56px; align-items: start; padding: 20px 0 90px; }
.about p { color: var(--muted); font-size: 1.05rem; }
.about-map { padding: 24px 26px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); text-shadow: none; }
.about-map h3 { margin: 0 0 16px; font: 700 12px/1 "JetBrains Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 24px; }
.area b { display: block; font-size: .95rem; margin-bottom: 6px; }
.area ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.area a { --c: var(--accent); display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.area a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.area a:hover, .area a:focus-visible { color: var(--text); }
@media (max-width: 1100px) { .about { grid-template-columns: 1fr; } }

.support { max-width: 760px; padding: 0 0 90px; text-shadow: 0 2px 14px rgba(0, 0, 0, .85), 0 1px 3px rgba(0, 0, 0, .9); }
.support h2 { font-size: 2rem; letter-spacing: -.02em; margin: 0 0 12px; }
.support p { color: var(--muted); font-size: 1.05rem; margin: 0 0 22px; }
.support .btn { text-shadow: none; overflow-wrap: anywhere; }
footer a { color: var(--text); text-decoration: none; }
footer a:hover { color: var(--accent); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 26px; flex-basis: 100%; }
.foot-links a { color: var(--muted); }

footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  max-width: var(--wide); margin: 0 auto; padding: 26px var(--gutter) 34px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 224, 138, .55); }
  70% { box-shadow: 0 0 0 9px rgba(62, 224, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 224, 138, 0); }
}

@media (max-width: 640px) {
  .top { padding: 18px 16px; }
  .top nav { gap: 14px; }
  .top { gap: 12px; flex-wrap: wrap; }
  .top nav { width: 100%; }
  .apps-menu { margin-left: auto; }
  .brand span { white-space: nowrap; }
  .apps-btn { padding: 6px 11px; font-size: 13px; white-space: nowrap; }
  .apps-btn .long { display: none; }
  main { padding: 0 16px; }
  footer { padding: 22px 16px 30px; }
  .grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 50px 0 70px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live i { animation: none; }
  .card, .card .open { transition: none; }
}

/* Demo question (main.js) */
.demo-card { text-align: left; width: min(440px, calc(100vw - 32px)); }
.demo-card h2 { margin: 0 0 10px; }
.demo-text { margin: 0 0 18px; color: var(--muted); }
.demo-card .qr-actions { justify-content: flex-start; }
.demo-form label { display: block; margin: 0 0 10px; font-size: .9rem; color: var(--muted); }
.demo-form small { color: var(--off); }
.demo-form input, .demo-form textarea { display: block; margin-top: 4px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 400 15px Inter, system-ui, sans-serif; resize: vertical; }
.demo-form input:focus-visible, .demo-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.demo-err { min-height: 1.2em; margin: 0 0 8px; color: #ff6b6b; font-size: .9rem; }
.demo-err:empty { min-height: 0; margin: 0; }
.demo-note { margin: 10px 0 0; color: var(--off); font-size: .8rem; }
.demo-support { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.demo-support a { color: var(--accent); }
.demo-dialog { max-height: calc(100dvh - 24px); overflow-x: hidden; overflow-y: auto; }
.demo-dialog .qr-card { max-width: 100%; }

/* A private video: its cover with a lock and "Ask to watch" */
.vlock { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: linear-gradient(rgba(5, 8, 14, .35), rgba(5, 8, 14, .8)); }
.vlock-card { display: grid; justify-items: center; gap: 8px; max-width: 340px; padding: 18px 20px; text-align: center; border-radius: 14px; background: rgba(10, 14, 22, .82); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px); }
.vlock-ic { font-size: 26px; line-height: 1; }
.vlock-card b { font-size: 1.05rem; }
.vlock-t { font-size: .9rem; color: var(--muted, #aab); }
.vlock-b[disabled] { opacity: .75; cursor: default; }
@media (max-width: 520px) { .vlock { padding: 8px; } .vlock-card { padding: 10px 14px; gap: 6px; } .vlock-t { display: none; } .vlock-ic { font-size: 20px; } .vlock-card .btn { padding: 8px 16px; } }

/* Private video: Sign in to watch, or Ask to watch */
.vlock-bs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.vlock-bs .btn { padding: 10px 18px; font-size: .92rem; }
.vlock-bs .btn.ghost { --c: var(--accent); }
@media (max-width: 520px) { .vlock-bs { gap: 6px; } .vlock-bs .btn { padding: 7px 12px; font-size: .82rem; } .vlock-card b { font-size: .95rem; } }


/* The page background after the 3D scene: each tool's sign-in background in turn (main.js). Full screen, above the
   3D scene (which it hides while a tool is showing, so they never overlap), under the page. */
.tool-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: #05080c; opacity: 0; transition: opacity 1.8s cubic-bezier(.4, 0, .2, 1); }
.tool-bg.on { opacity: 1; }
.tb-shot { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s cubic-bezier(.4, 0, .2, 1); }
.tb-shot.on { opacity: 1; }
.tb-shot video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); -webkit-user-drag: none; }
.tb-shot.on video { transform: scale(1); transition: transform 12s cubic-bezier(.25, .1, .25, 1); }
.tool-bg.still .tb-shot video, .tool-bg.still .tb-shot.on video { transform: none; transition: none; }
/* Same shade as over the 3D scene, so the text on the left stays readable, plus soft film edges. */
.tb-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 12, 18, .9) 0%, rgba(8, 12, 18, .72) 35%, rgba(8, 12, 18, .25) 62%, rgba(8, 12, 18, .1) 80%), radial-gradient(ellipse at 60% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%), linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, transparent 18%, transparent 75%, rgba(5, 8, 12, .85) 100%); }
/* Which tool it is, bottom right, like a film credit. */
.tb-cap { position: absolute; right: clamp(16px, 3vw, 40px); bottom: clamp(18px, 4vh, 40px); display: grid; justify-items: end; gap: 4px; text-align: right; text-shadow: 0 2px 12px rgba(0, 0, 0, .9); }
.tb-cap > * { opacity: 0; transform: translateY(10px); filter: blur(5px); transition: opacity .9s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1), filter .9s ease, letter-spacing 1.4s ease; }
.tb-cap-k { font: 600 11px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
.tb-cap-n { font-size: clamp(1rem, 1.8vw, 1.5rem); font-weight: 800; color: #fff; letter-spacing: .14em; }
.tb-cap.in > * { opacity: 1; transform: none; filter: none; }
.tb-cap.in .tb-cap-n { letter-spacing: .02em; transition-delay: .12s; }
@media (max-width: 640px) { .tb-cap { right: 12px; bottom: 14px; } .tb-cap-n { font-size: .95rem; } }
@media (prefers-reduced-motion: reduce) { .tb-cap > * { transition: opacity .6s ease; transform: none; filter: none; } }
/* Next / back: the ‹ › buttons (bottom right), and the pointer shows which way a click on the top of the page goes. */
.tb-nav { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .4s ease; }
.tb-nav.on { opacity: 1; }
.tb-nav button { position: absolute; bottom: calc(clamp(18px, 4vh, 40px) + 62px); width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(8, 12, 18, .45); color: #fff; font: 400 30px/1 system-ui, sans-serif; padding: 0 0 4px; cursor: pointer; pointer-events: none; opacity: .55; transition: opacity .25s ease, background .25s ease, border-color .25s ease; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.tb-nav.on button { pointer-events: auto; }
.tb-nav button:hover, .tb-nav button:focus-visible { opacity: 1; background: rgba(8, 12, 18, .75); border-color: var(--accent); }
/* Bottom right, above the tool name: away from the text on the left. */
.tb-prev { right: calc(clamp(16px, 3vw, 40px) + 52px); } .tb-next { right: clamp(16px, 3vw, 40px); }
body[data-tb-side="next"], body[data-tb-side="next"] main, body[data-tb-side="next"] .hero { cursor: e-resize; }
body[data-tb-side="prev"], body[data-tb-side="prev"] main, body[data-tb-side="prev"] .hero { cursor: w-resize; }
@media (max-width: 640px) { .tb-nav { display: none; } }

/* A video with no description beside it (hidden for this viewer): the player takes the whole width. */
.video-main.no-info { grid-template-columns: minmax(0, 1fr); }
