/* ════════════════════════════════════════════════════════════════
   SimLab WebGL — shared stylesheet (webgl-viewer + webgl-gallery)
   Design language matched to simlab-soft.com and the
   SimLab Composer landing page:
   Space Grotesk headings · IBM Plex Sans body · dark #1a1a1a
   warm gold #e0b63f → #fbd144 · warm card gradients · 16px radii
════════════════════════════════════════════════════════════════ */

:root {
  --bg: #1a1a1a;
  --bg-raised: #141414;
  --bg-card: #201d16;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --card-border: rgba(224, 182, 63, 0.16);
  --card-border-hover: rgba(251, 209, 68, 0.42);
  --text: #f4f1ea;
  --text-muted: #b3ac9f;
  --text-faint: #8f887c;
  --gold: #e0b63f;
  --gold-hover: #fbd144;
  --gold-bright: #fbd144;
  --gold-deep: #c79f28;
  --gold-grad: linear-gradient(135deg, #e0b63f, #fbd144);
  --card-grad: linear-gradient(160deg, #242017, #1a1813);
  --teal: #b9d2d8;
  --radius: 8px;
  --radius-lg: 16px;
  --container: 1140px;
  --shadow-card: 0 20px 44px -18px rgba(0, 0, 0, 0.62);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Shared header/footer compatibility ─────────────────────────
   Bootstrap 4 + style3.css load before this sheet (they style the
   injected SimLab header/footer). Both impose site-wide fonts,
   colors and margins on bare elements — restore this page's
   baseline inside <main>; class-level rules still win as before. */
main h1, main h2, main h3, main h4, main h5, main h6,
main p, main ul, main ol {
  margin: 0;
}

main h1, main h2, main h3, main h4, main h5, main h6,
main p, main div, main span, main a, main li, main button {
  color: inherit;
  line-height: inherit;
}

main p, main div, main span, main li, main ul, main ol, main button {
  font-family: inherit !important;
  font-weight: inherit;
}

main h1, main h2, main h3, main h4, main h5, main h6 { font-weight: 700; }

main a, main a:hover { text-decoration: none; }

/* Images inside the injected header/footer keep their default inline
   flow (this sheet sets img/svg to display:block globally). */
#includedHeader img, #includedFooter img { display: inline-block; }

/* The header's language switcher is a bare <ul class="mainFlag"> that relies on
   the browser-default 40px list padding: style3.css pulls its .item back with
   margin-left:-36px and clips the list with overflow:hidden. The `*` reset above
   strips that padding, so the flag images land at -36px and get clipped away —
   restore it, or the language selector shows up without any flags. */
.mainFlag { padding-left: 40px; }

/* Display type for all headings — matches the SimLab Composer landing page */
h1, h2, h3, h4 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 26px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn-gold {
  background: var(--gold-grad);
  color: #141414;
  box-shadow: 0 6px 18px rgba(224, 182, 63, 0.24);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #fbd144, #ffdf6b);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(251, 209, 68, 0.34);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

.btn-sm { padding: 8px 18px; font-size: 13px; }

/* ── Hero ───────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: 80px 0 70px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 620px;
  background: radial-gradient(ellipse at center,
    rgba(251, 209, 68, 0.16) 0%,
    rgba(224, 182, 63, 0.06) 42%,
    transparent 72%);
  pointer-events: none;
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(224, 182, 63, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 182, 63, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 100%);
  pointer-events: none;
}

.hero .container { position: relative; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #e6c463;
  border: 1px solid rgba(224, 182, 63, 0.28);
  background: rgba(224, 182, 63, 0.1);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 26px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.hero h1 .accent {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}

.hero-tagline {
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 300;
  color: var(--teal);
  margin-bottom: 22px;
}

.hero-copy {
  max-width: 720px;
  margin: 0 auto 34px;
  font-size: 15.5px;
  font-weight: 300;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-points {
  display: flex;
  justify-content: center;
  gap: 34px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-faint);
}

.hero-points span { display: inline-flex; align-items: center; gap: 8px; }
.hero-points svg { width: 15px; height: 15px; color: var(--gold); flex-shrink: 0; }

/* ── Section scaffolding ────────────────────────────────────── */

section { padding: 84px 0; }
section.tight { padding: 60px 0; }
section.raised { background: var(--bg-raised); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }

.section-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 14px;
}

.section-head p {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-muted);
}

/* ── Model embed slots ──────────────────────────────────────── */

.model-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(226, 182, 57, 0.05), transparent 65%),
    var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* When a real iframe/canvas is embedded, it fills the slot */
.model-embed iframe,
.model-embed canvas,
.model-embed embed,
.model-embed object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 36px 36px;
}

.embed-placeholder .cube {
  width: 64px; height: 64px;
  color: var(--gold);
  opacity: 0.9;
  animation: cube-float 4.5s ease-in-out infinite;
}

@keyframes cube-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.embed-placeholder .ph-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

.embed-placeholder .ph-sub {
  font-size: 12.5px;
  font-weight: 300;
  color: var(--text-faint);
  max-width: 340px;
}

.embed-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.embed-note svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--teal); }

/* ── Feature cards ──────────────────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.feature-card {
  background: var(--card-grad);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-card);
}

.feature-card .icon {
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(224, 182, 63, 0.14);
  border: 1px solid rgba(224, 182, 63, 0.28);
  border-radius: 10px;
  margin-bottom: 18px;
}
.feature-card .icon svg { width: 22px; height: 22px; color: var(--gold); }

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13.5px;
  font-weight: 300;
  color: var(--text-muted);
}

/* ── Navigation manual ──────────────────────────────────────── */

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.controls-panel {
  background: var(--card-grad);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 30px;
}

.controls-panel h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 22px;
  color: var(--teal);
}
.controls-panel h3 svg { width: 20px; height: 20px; }

.control-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.control-row .c-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(224, 182, 63, 0.08);
  border: 1px solid rgba(224, 182, 63, 0.2);
  border-radius: 10px;
}
.control-row .c-icon svg { width: 20px; height: 20px; color: var(--gold); }

.control-row .c-label {
  font-size: 14px;
  font-weight: 600;
  width: 74px;
  flex-shrink: 0;
}

.control-row .c-desc {
  font-size: 13.5px;
  font-weight: 300;
  color: var(--text-muted);
}

/* ── Workflow steps ─────────────────────────────────────────── */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  counter-reset: step;
}

.step-card {
  position: relative;
  background: var(--card-grad);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 34px 28px 28px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.step-card:hover {
  transform: translateY(-5px);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-card);
}

.step-card .step-num {
  position: absolute;
  top: -16px; left: 26px;
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-grad);
  color: #141414;
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(226, 182, 57, 0.35);
}

.step-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.step-card p { font-size: 13.5px; font-weight: 300; color: var(--text-muted); }

/* ── CTA band ───────────────────────────────────────────────── */

.cta-band {
  position: relative;
  text-align: center;
  padding: 80px 0;
  background:
    radial-gradient(ellipse 60% 100% at 50% 100%, rgba(226, 182, 57, 0.1), transparent 70%),
    var(--bg-raised);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.cta-band h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  margin-bottom: 12px;
}

.cta-band p {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 30px;
}

.cta-band .fine-print {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ── Gallery cards ──────────────────────────────────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.model-card {
  background: var(--card-grad);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.model-card:hover {
  transform: translateY(-5px);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-card);
}

.model-card .model-embed {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: 16 / 10;
}

/* Wide card: spans the full grid width, with a wider embed aspect ratio */
.model-card--wide { grid-column: 1 / -1; }
.model-card--wide .model-embed { aspect-ratio: 21 / 9; }

/* Divider between gallery segments */
.segment-divider {
  height: 2px;
  border: 0;
  max-width: 720px;
  margin: 64px auto;
  background: linear-gradient(90deg, transparent, var(--border-strong) 15%, var(--border-strong) 85%, transparent);
}
.gallery-grid + .segment-divider { margin-top: 72px; }

.model-card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.model-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.model-card h3 { font-size: 17px; font-weight: 600; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 100px;
  flex-shrink: 0;
}

.badge svg { width: 11px; height: 11px; }

.badge-interactive {
  color: var(--gold);
  background: rgba(226, 182, 57, 0.1);
  border: 1px solid rgba(226, 182, 57, 0.35);
}

.badge-view {
  color: var(--teal);
  background: rgba(185, 210, 216, 0.08);
  border: 1px solid rgba(185, 210, 216, 0.25);
}

/* Simulation — green */
.badge-simulation {
  color: #5fd08a;
  background: rgba(95, 208, 138, 0.12);
  border: 1px solid rgba(95, 208, 138, 0.32);
}

/* Fly mode — light purple */
.badge-fly {
  color: #bda8f7;
  background: rgba(189, 168, 247, 0.12);
  border: 1px solid rgba(189, 168, 247, 0.32);
}

.model-card p {
  font-size: 13.5px;
  font-weight: 300;
  color: var(--text-muted);
  flex: 1;
}

.model-card .model-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-faint);
}
.model-card .model-meta span { display: inline-flex; align-items: center; gap: 5px; }
.model-card .model-meta svg { width: 13px; height: 13px; }

/* Compact controls strip (gallery page) */
.controls-strip {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  background: var(--card-grad);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px 30px;
}

.controls-strip .strip-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.controls-strip .strip-item svg { width: 22px; height: 22px; color: var(--gold); flex-shrink: 0; }
.controls-strip .strip-item strong { color: var(--text); font-weight: 600; margin-right: 4px; }

/* ── Scroll reveal ──────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .embed-placeholder .cube { animation: none; }
  html { scroll-behavior: auto; }
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 991px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 767px) {
  section { padding: 60px 0; }
  .hero { padding: 56px 0 50px; }
  .controls-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-points { gap: 16px; }
  .controls-strip { flex-direction: column; gap: 16px; align-items: flex-start; }
}
