/* Websites section of the Work page. ws- is the Marketing / Websites switch, wg- the white gallery. */

/* the main choice: top left, larger than anything else, ringed in the NVISION gradient */
.ws {
  position: fixed; top: calc(var(--wg-top, 4.5rem) + 1rem); left: var(--space-inline); z-index: 60;
  display: flex; padding: 4px; border-radius: 99px; border: 2px solid transparent;
  background: linear-gradient(#08080c, #08080c) padding-box, linear-gradient(135deg, #38bdf8, #6366f1, #d946ef, #f97316) border-box;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.ws button { font: 700 0.78rem var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(244,244,245,0.7); background: none; border: 0; border-radius: 99px; padding: 0.75rem 1.35rem; cursor: pointer; }
.ws button[aria-pressed="true"] { background: #fff; color: #000; }
.ws button:focus-visible, .wg-nav button:focus-visible, .wg-visit:focus-visible { outline: 2px solid #6366f1; outline-offset: 3px; }

/* gallery / grid moves to the top right so the two choices never compete */
html.has-websites .cg-toggle { left: auto; right: var(--space-inline); top: calc(var(--cg-top, var(--wg-top, 4.5rem)) + 1.3rem); }

/* in the grid, the switches sit on their own strip so pictures scroll underneath instead of behind them */
html.has-websites:not(.cg-walking):not(.wg-on) main::before {
  content: ""; position: fixed; top: var(--wg-top, 4.5rem); left: 0; right: 0; height: 5.2rem; z-index: 45;
  background: #000; border-bottom: 1px solid rgba(255,255,255,0.08);
}
html.has-websites .cg-grid { padding-top: 6.8rem; }

/* ---------- websites: a white room ---------- */
html.wg-on, html.wg-on body { overflow: hidden; background: #fff; }
html.wg-on .cg { display: none; }
html.wg-on nav { background: rgba(255,255,255,0.92); border-bottom-color: rgba(0,0,0,0.07); }
html.wg-on nav .logo { color: #0b0b10; }
html.wg-on nav .nav-links a { color: rgba(11,11,16,0.55); }
html.wg-on nav .nav-links a.active, html.wg-on nav .nav-links a:hover { color: #0b0b10; }
html.wg-on nav .nav-cta { color: #0b0b10; }
html.wg-on nav .nav-cta::after { background: #fff; }
html.wg-on .ws { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #38bdf8, #6366f1, #d946ef, #f97316) border-box; box-shadow: 0 8px 28px rgba(20, 24, 40, 0.14); }
html.wg-on .ws button { color: rgba(11,11,16,0.6); }
html.wg-on .ws button[aria-pressed="true"] { background: #0b0b10; color: #fff; }

.wg { --wg-h: calc(100vh - var(--wg-top, 4.5rem)); position: relative; height: var(--wg-h); overflow: hidden; user-select: none; color: #0b0b10; outline: none; background: #f7f7f9; }
@supports (height: 100svh) { .wg { --wg-h: calc(100svh - var(--wg-top, 4.5rem)); } }
.wg[hidden] { display: none; }
.wg-room { position: absolute; inset: 0; }
.wg-room canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; opacity: 0; transition: opacity 0.9s ease; }
.wg.ready .wg-room canvas { opacity: 1; }
.wg-room canvas.over { cursor: pointer; }
.wg-room canvas:active { cursor: grabbing; }
/* shown only if the 3D room cannot start */
.wg-flat { position: absolute; inset: 6rem 0 12rem; overflow: auto; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 1.5rem; padding: 0 1.5rem; }
.wg-flat[hidden] { display: none; }
.wg-flat a { width: min(100%, 360px); color: #0b0b10; text-decoration: none; font-weight: 600; text-align: center; }
.wg-flat img { display: block; width: 100%; border-radius: 10px; margin-bottom: 0.6rem; box-shadow: 0 20px 40px -20px rgba(20,24,40,0.4); }

.wg-hud { position: absolute; left: 0; right: 0; bottom: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; padding: 3.5rem 1.25rem 1.5rem; text-align: center; pointer-events: none;
  background: linear-gradient(rgba(250,250,252,0), rgba(250,250,252,0.86) 60%); }
.wg-hud a, .wg-hud button { pointer-events: auto; }
.wg-name { font-family: var(--font-display); font-size: clamp(1.6rem, 2.8vw, 2.25rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; color: #1d1d1f; }
.wg-name.in { animation: wg-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes wg-rise { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.wg-visit { font: 500 0.92rem var(--font-body); text-decoration: none; color: #fff; background: #1d1d1f; border-radius: 99px; padding: 0.7rem 1.45rem; transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.35s ease; }
.wg-visit:hover { transform: scale(1.035); background: #000; }
.wg-nav { display: flex; align-items: center; gap: 1.1rem; margin-top: 0.2rem; }
.wg-arrow { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(20,24,40,0.09); background: rgba(255,255,255,0.75); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #1d1d1f; cursor: pointer; transition: background 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.wg-arrow:hover { background: #fff; transform: scale(1.07); }
.wg-dots { display: flex; align-items: center; gap: 9px; }
.wg-dots button { position: relative; width: 8px; height: 8px; border: 0; border-radius: 99px; background: rgba(29,29,31,0.2); cursor: pointer; transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease; }
.wg-dots button::after { content: ""; position: absolute; inset: -10px -4px; }   /* easier to tap */
.wg-dots button[aria-current="true"] { width: 28px; background: #1d1d1f; }
@media (prefers-reduced-motion: reduce) { .wg-name.in { animation: none; } .wg-room canvas { transition: none; } }

@media (max-width: 760px) {
  .ws, html.has-websites .cg-toggle { top: calc(var(--wg-top, 4.5rem) + 0.8rem); }
  .ws { left: 0.75rem; padding: 3px; }
  .ws button { padding: 0.55rem 0.65rem; font-size: 0.6rem; letter-spacing: 0.1em; }
  html.has-websites .cg-toggle { right: 0.75rem; left: auto; margin-top: 3px; }
  html.has-websites .cg-toggle button { padding: 0.5rem 0.65rem; font-size: 0.6rem; letter-spacing: 0.1em; }
  html.has-websites:not(.cg-walking):not(.wg-on) main::before { height: 4.3rem; }
  html.has-websites .cg-grid { padding-top: 5.8rem; }
}
/* very narrow phones: no room side by side */
@media (max-width: 349px) {
  html.has-websites .cg-toggle { top: calc(var(--wg-top, 4.5rem) + 4rem); right: auto; left: 0.75rem; }
  html.has-websites:not(.cg-walking):not(.wg-on) main::before { height: 7.4rem; }
  html.has-websites .cg-grid { padding-top: 8.8rem; }
}
