/* fogostudio · POWER MIG 210 MP — visor 3D */

:root {
  --bg: #0f1214;
  --bg-2: #161b1e;
  --surface: #1b2124;
  --surface-2: #232a2e;
  --line: rgba(255, 255, 255, .08);
  --text: #eef1f2;
  --muted: #9aa5ab;
  --faint: #66727a;
  --red: #d2202f;
  --red-2: #ff3b47;
  --radius: 14px;
  --gutter: 16px;
  --panel-w: 440px;
  --font-head: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------- layout (mobile first) ---------------- */

.app { min-height: 100svh; }

.stage {
  position: relative;
  height: 64svh;
  min-height: 360px;
  background:
    radial-gradient(120% 80% at 50% 38%, #2a3237 0%, #171c1f 55%, var(--bg) 100%);
  overflow: hidden;
}

model-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: transparent;
  outline: none;
}

.panel {
  position: relative;
  z-index: 2;
  margin-top: -22px;
  padding: 14px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, .35);
}

.panel__grip { width: 40px; height: 4px; border-radius: 4px; background: var(--surface-2); margin: 0 auto 18px; }

@media (min-width: 960px) {
  .app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--panel-w);
    height: 100dvh;
    min-height: 0;
  }
  .stage { height: 100%; min-height: 0; }
  .panel {
    margin: 0;
    border-radius: 0;
    overflow-y: auto;
    padding: 56px 40px 40px;
    border-left: 1px solid var(--line);
    box-shadow: none;
    background: linear-gradient(180deg, var(--bg-2), var(--bg));
    scrollbar-width: thin;
    scrollbar-color: var(--surface-2) transparent;
  }
  .panel__grip { display: none; }
}

/* ---------------- top bar ---------------- */

.topbar {
  position: absolute;
  z-index: 5;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 12px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 22px; height: 22px; border-radius: 4px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 62% 100%, 0 100%);
}
.brand__name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.topbar__actions { display: flex; gap: 8px; }

.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(20, 25, 28, .6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.icon-btn:hover { background: rgba(40, 48, 53, .8); }
.icon-btn[aria-pressed="true"] { color: var(--red-2); border-color: rgba(210, 32, 47, .45); }
.icon-btn:focus-visible, .chip:focus-visible, .ar-btn:focus-visible, .hotspot:focus-visible { outline: 2px solid var(--red-2); outline-offset: 2px; }

/* ---------------- viewer overlays ---------------- */

.hint {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: calc(64px + env(safe-area-inset-top));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 18, 20, .65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .5s;
}
.hint svg { width: 16px; height: 16px; }
.hint.is-hidden { opacity: 0; }

.views {
  position: absolute;
  z-index: 4;
  left: 0; right: 0;
  bottom: 34px;
}
.views__track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px var(--gutter);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.views__track::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  scroll-snap-align: start;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 25, 28, .7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.chip:hover { background: rgba(40, 48, 53, .85); }
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); }

/* AR button lives in the chip row on mobile */
.ar-btn {
  position: absolute;
  right: var(--gutter);
  bottom: 86px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.ar-btn svg { width: 18px; height: 18px; }

@media (min-width: 960px) {
  .views { bottom: 28px; }
  .views__track { justify-content: center; }
  .hint { top: auto; bottom: 92px; }
  .ar-btn { top: 76px; bottom: auto; right: 24px; }
}

/* open / close toggle (inside model-viewer so it also shows in WebXR AR) */
.open-btn {
  position: absolute;
  left: var(--gutter);
  bottom: 86px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(20, 25, 28, .75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  transition: background .2s, border-color .2s;
}
.open-btn[hidden] { display: none; }
.open-btn:hover { background: rgba(40, 48, 53, .9); }
.open-btn svg { width: 18px; height: 18px; }
.open-btn .door { transition: transform .4s; transform-origin: 14px 12px; }
.open-btn[aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.open-btn[aria-pressed="true"] .door { transform: scaleX(-1); }
.open-btn:focus-visible { outline: 2px solid var(--red-2); outline-offset: 2px; }
.open-btn:disabled { opacity: .6; cursor: progress; }

/* hotspots sit on parts that move when the machine opens */
model-viewer.is-open .hotspot { opacity: 0; pointer-events: none; }

/* loader */
.loader {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(240px, 60%);
  text-align: center;
  transition: opacity .4s;
}
.loader.is-done { opacity: 0; pointer-events: none; }
.loader__bar { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--red-2); transition: width .2s; }
.loader__label { margin-top: 10px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.loader__label b { color: var(--text); font-weight: 600; }

/* hotspots */
.hotspot {
  --size: 28px;
  display: grid; place-items: center;
  width: var(--size); height: var(--size);
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
  transition: opacity .3s, transform .2s;
}
/* pulse ring: transform + opacity only, so it stays on the compositor */
.hotspot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(255, 59, 71, .8);
  animation: pulse 2.4s infinite;
  pointer-events: none;
}
.hotspot:hover { transform: scale(1.12); }
.hotspot:not([data-visible]) { opacity: 0; pointer-events: none; }
.hotspot:not([data-visible])::after { animation: none; }
.hotspot.is-active { background: #fff; color: var(--red); }

@keyframes pulse {
  0% { transform: scale(1); opacity: .9; }
  70%, 100% { transform: scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .hotspot::after { animation: none; display: none; } }

/* Touch devices: backdrop blur on top of a live WebGL canvas is re-computed
   every frame and is the most expensive thing on the page. Use solid tints. */
@media (pointer: coarse) {
  .icon-btn, .chip, .open-btn, .hint {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .icon-btn { background: rgba(20, 25, 28, .82); }
  .chip { background: rgba(20, 25, 28, .86); }
  .chip[aria-pressed="true"] { background: var(--red); }
  .open-btn { background: rgba(20, 25, 28, .9); }
  .open-btn[aria-pressed="true"] { background: var(--red); }
  .hint { background: rgba(15, 18, 20, .82); }
}

/* ---------------- panel content ---------------- */

.eyebrow {
  margin: 0 0 6px;
  color: var(--red-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(40px, 11vw, 56px);
  line-height: .95;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.title sup { font-size: .35em; vertical-align: super; color: var(--muted); }
.title span { display: block; color: var(--red-2); }

.lede { margin: 14px 0 22px; color: var(--muted); font-size: 15px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 30px;
}
.stat {
  padding: 12px 12px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.stat dt { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.stat dd { margin: 2px 0 0; font-family: var(--font-head); font-weight: 600; font-size: 26px; line-height: 1.1; white-space: nowrap; }
.stat dd small { font-size: .6em; color: var(--muted); font-weight: 500; }
.stat .stat__sub { font-family: var(--font-body); font-size: 11px; color: var(--muted); font-weight: 400; white-space: normal; line-height: 1.3; margin-top: 3px; }

.section-title {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.feature {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.feature:hover { background: var(--surface-2); }
.feature.is-active { border-color: rgba(255, 59, 71, .6); background: linear-gradient(90deg, rgba(210, 32, 47, .14), var(--surface) 70%); }
.feature__n { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--red-2); line-height: 1.3; }
.feature h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.foot {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

/* fullscreen: viewer only */
.stage:fullscreen { height: 100%; }
.stage.is-fs-fallback { position: fixed; inset: 0; z-index: 50; height: 100dvh; }
