:root {
  --ember-black: #080204;
  --ember-deep: #130305;
  --ember-burgundy: #4a0d10;
  --ember-red: #b52816;
  --ember-orange: #ff5a23;
  --ember-saffron: #ffb04d;
  --ember-ivory: #f2e8da;
  --ember-muted: #c9ac9b;
  --ember-line: rgba(255, 90, 35, 0.36);
  --ember-glass: rgba(32, 6, 9, 0.72);
  --ember-grid:
    linear-gradient(rgba(132, 22, 18, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 22, 18, 0.18) 1px, transparent 1px);
  --bhairava-progress: 0;
  --bhairava-overlay-opacity: 0;
  --bhairava-canvas-brightness: 1;
  --bhairava-canvas-contrast: 1;
  --bhairava-canvas-saturation: 1;
  --bhairava-canvas-sepia: 0;
  --bhairava-canvas-hue: 0deg;
  --home-ink: #040404;
  --home-accent: #441210;
  --home-accent-soft: rgba(255, 74, 22, 0.08);
  --home-menu-surface: rgba(255, 255, 255, 0.94);
  --home-glass-surface: rgba(255, 255, 255, 0.38);
  --home-icon-filter: brightness(0);
}

html {
  background: var(--ember-black) !important;
}

body {
  accent-color: var(--ember-orange);
}

body.index-page-body {
  background:
    linear-gradient(0deg, #b4cbf5, #f7faff),
    linear-gradient(0deg, #96bbff, #edf4ff) !important;
}

body:not(.index-page-body) {
  background-color: var(--ember-black) !important;
  background-image:
    radial-gradient(
      circle at 72% 14%,
      rgba(255, 74, 22, 0.17),
      transparent 31rem
    ),
    radial-gradient(
      circle at 14% 80%,
      rgba(116, 13, 16, 0.28),
      transparent 38rem
    ),
    var(--ember-grid) !important;
  background-attachment: fixed !important;
  background-size:
    auto,
    auto,
    8px 8px,
    8px 8px !important;
  color-scheme: dark;
  color: var(--ember-ivory);
}

body:not(.index-page-body) ::selection {
  background: var(--ember-orange);
  color: var(--ember-black);
}

body:not(.index-page-body) :is(h1, h2, h3, h4, h5, h6, p, li, label) {
  color: var(--ember-ivory);
}

body:not(.index-page-body) a {
  color: var(--ember-ivory);
}

body:is(.index-page, .configurator-page) #builder-scene canvas {
  filter: none !important;
}

.work-page-body #works-scene canvas,
.music-demo-page #demo-scene canvas {
  filter: brightness(0.8) contrast(1.16) saturate(1.32) sepia(0.13)
    hue-rotate(-7deg);
}

body:not(.index-page-body) header .header .right-menu a,
body:not(.index-page-body) header .header .mobile-menu a {
  color: var(--ember-ivory) !important;
  text-shadow: 0 0 18px rgba(255, 90, 35, 0.16);
}

body:not(.index-page-body) header .header .header-logo img,
body:not(.index-page-body) .builder-header .logo img {
  filter: brightness(0) invert(1) sepia(0.28) saturate(1.45) hue-rotate(-9deg);
}

body:not(.index-page-body) header .header .menu-switch .line {
  background: var(--ember-ivory) !important;
}

body:not(.index-page-body) header .header .mobile-menu {
  background:
    var(--ember-grid),
    linear-gradient(180deg, rgba(8, 2, 4, 0.98), rgba(31, 5, 8, 0.94)) !important;
  background-size:
    9px 9px,
    auto !important;
  border-bottom: 1px solid var(--ember-line);
}

body:not(.index-page-body) #cursor .wrapper {
  border: 1px solid rgba(255, 90, 35, 0.28);
  box-shadow:
    inset 0 0 18px rgba(255, 90, 35, 0.12),
    0 0 24px rgba(255, 48, 16, 0.12);
}

body:not(.index-page-body) #cursor .wrapper {
  background: rgba(27, 5, 8, 0.72) !important;
}

body:not(.index-page-body) #cursor .wrapper .text {
  color: var(--ember-ivory) !important;
}

body:not(.index-page-body) .social-links-global .volume,
body:not(.index-page-body) .social-links-global .selected-menu,
body:not(.index-page-body) .social-links-global .options-menu .menu {
  background: rgba(20, 4, 7, 0.88) !important;
  border: 1px solid rgba(255, 90, 35, 0.32);
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.34);
}

body:not(.index-page-body) .social-links-global :is(p, a, .value) {
  color: var(--ember-ivory) !important;
}

body:not(.index-page-body) .social-links-global img {
  filter: brightness(0) invert(1) sepia(0.35) saturate(1.5) hue-rotate(-10deg);
}

body:not(.index-page-body) .transition-component {
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(255, 74, 22, 0.16),
      transparent 38%
    ),
    var(--ember-grid), var(--ember-black) !important;
  background-size:
    auto,
    8px 8px,
    auto !important;
}

body.privacy-policy-page-body .transition-component {
  clip-path: circle(0% at 50% 50%) !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body:not(.index-page-body) .transition-component .wrapper .logo {
  filter: brightness(0) invert(1) sepia(0.28) saturate(1.5) hue-rotate(-9deg);
}

body:not(.index-page-body) .transition-component .dots {
  filter: sepia(1) saturate(5.4) hue-rotate(326deg) brightness(0.42);
  opacity: 0.44;
}

body:not(.index-page-body)
  :is(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--ember-saffron) !important;
  outline-offset: 4px;
}

/* Homepage: keep the original pale opening, then scrub into Ember. */
body.index-page-body #home-scene {
  z-index: 2;
  filter: brightness(var(--bhairava-canvas-brightness))
    contrast(var(--bhairava-canvas-contrast))
    saturate(var(--bhairava-canvas-saturation))
    sepia(var(--bhairava-canvas-sepia)) hue-rotate(var(--bhairava-canvas-hue));
}

body.index-page-body .home-page::before {
  background:
    linear-gradient(rgba(132, 22, 18, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 22, 18, 0.18) 1px, transparent 1px),
    radial-gradient(
      circle at 50% 64%,
      rgba(255, 66, 19, 0.15),
      rgba(92, 8, 11, 0.08) 31%,
      transparent 57%
    ),
    radial-gradient(
      circle at 82% 85%,
      rgba(218, 32, 13, 0.22),
      transparent 35%
    ),
    linear-gradient(180deg, rgba(30, 5, 8, 0.05), rgba(2, 0, 1, 0.34));
  inset: 0;
  opacity: var(--bhairava-overlay-opacity);
  pointer-events: none;
  position: fixed;
  width: 100%;
  z-index: 3;
  content: "";
  background-size:
    8px 8px,
    8px 8px,
    auto,
    auto,
    auto;
}

body.index-page-body header .header .right-menu a,
body.index-page-body header .header .mobile-menu a,
body.index-page-body .scene-texts .right-bar .parent .progress,
body.index-page-body .scene-texts .left-bar .parent .value,
body.index-page-body .scene-texts .wrapper .left-text p,
body.index-page-body .scene-texts .wrapper .right-text p,
body.index-page-body .scene-texts .wrapper .bottom-texts .bottom-text {
  color: var(--home-ink) !important;
  text-shadow: 0 1px 14px var(--home-accent-soft);
}

body.index-page-body .scene-texts .left-bar .parent .cross,
body.index-page-body .scene-texts .left-bar .parent .cross::before,
body.index-page-body header .header .menu-switch .line {
  background: var(--home-ink) !important;
}

body.index-page-body header .header .header-logo img,
body.index-page-body .scene-texts .wrapper .bottom-texts .bottom-text img,
body.index-page-body .scene-texts .right-bar img {
  filter: var(--home-icon-filter) !important;
}

body.index-page-body header .header .mobile-menu {
  background: var(--ember-grid), var(--home-menu-surface) !important;
  background-size:
    9px 9px,
    auto !important;
  border-bottom: 1px solid var(--home-accent-soft);
}

body.index-page-body #cursor .wrapper {
  background: var(--home-glass-surface);
  border-color: var(--home-accent-soft);
  box-shadow:
    inset 0 0 18px var(--home-accent-soft),
    0 0 24px var(--home-accent-soft);
}

body.index-page-body #cursor .wrapper .text {
  color: var(--home-ink);
}

body.index-page-body .social-links-global .volume {
  border: 1px solid var(--home-accent-soft);
  box-shadow: 0 0 22px var(--home-accent-soft);
}

/* The real footer follows the 3D finale and stays fully Ember. */
.home-footer {
  background:
    radial-gradient(
      circle at 50% 10%,
      rgba(255, 90, 35, 0.15),
      transparent 38%
    ),
    rgba(8, 2, 4, 0.9) !important;
  border-top: 1px solid rgba(255, 90, 35, 0.42);
  box-shadow: 0 -30px 90px rgba(8, 2, 4, 0.72);
}

.home-footer .wrapper .points {
  filter: sepia(1) saturate(4.2) hue-rotate(326deg) brightness(0.56);
  opacity: 0.48;
}

.home-footer .wrapper :is(h4, a, p, .elem) {
  color: var(--ember-ivory) !important;
}

.home-footer .wrapper .send .child .circle {
  background: linear-gradient(145deg, var(--ember-orange), #7c130f) !important;
  box-shadow:
    inset 0 0 30px rgba(255, 195, 125, 0.25),
    0 0 52px rgba(255, 55, 15, 0.24);
}

.home-footer .wrapper .send .child .circle .inner-circle {
  border-color: rgba(255, 238, 220, 0.46) !important;
}

.home-footer .wrapper .send .child .circle .inner-circle p {
  color: var(--ember-black) !important;
}

/* Work */
.work-page-body .works-page,
.work-page-body .works-hero,
.work-page-body .works-space {
  background: transparent !important;
}

.work-page-body .works-page::before {
  background:
    radial-gradient(
      circle at 74% 18%,
      rgba(255, 68, 18, 0.28),
      transparent 34rem
    ),
    linear-gradient(rgba(35, 1, 6, 0.66), rgba(8, 1, 3, 0.78)),
    var(--ember-grid);
  background-size:
    auto,
    auto,
    8px 8px,
    8px 8px;
  content: "";
  inset: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
  position: fixed;
  z-index: 15;
}

.work-page-body .works-hero h1,
.work-page-body .works-hero .blur-parent h2 {
  color: var(--ember-ivory) !important;
  text-shadow: 0 0 34px rgba(255, 90, 35, 0.16);
}

.work-page-body .works-hero .blur-parent {
  background: rgba(20, 4, 7, 0.68) !important;
  border: 1px solid rgba(255, 90, 35, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 237, 221, 0.08),
    0 28px 80px rgba(0, 0, 0, 0.34);
}

.work-page-body .works-hero .blur-parent .back {
  background: linear-gradient(
    180deg,
    rgba(60, 8, 12, 0.18) 25%,
    rgba(8, 2, 4, 0.92)
  ) !important;
}

.work-page-body .works-hero .blur-parent .points {
  filter: sepia(1) saturate(5) hue-rotate(326deg) brightness(0.54);
  opacity: 0.62;
}

/* Contact */
.contact-page-body .contact-page,
.contact-page-body .contact-wrapper {
  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(255, 74, 22, 0.12),
      transparent 42%
    ),
    var(--ember-grid), transparent !important;
  background-size:
    auto,
    8px 8px,
    auto !important;
}

.contact-page-body .contact-form .input-wrapper {
  background: rgba(30, 5, 8, 0.62) !important;
  border-color: rgba(255, 232, 215, 0.34) !important;
  box-shadow:
    inset 0 0 42px rgba(255, 44, 14, 0.06),
    0 0 0 1px rgba(255, 90, 35, 0.08);
}

.contact-page-body .contact-form .input-wrapper .outline {
  border-color: var(--ember-orange) !important;
  box-shadow: 0 0 26px rgba(255, 74, 22, 0.18);
}

.contact-page-body .contact-form :is(input, textarea, select) {
  color: var(--ember-ivory) !important;
}

.contact-page-body .contact-form :is(input, textarea)::placeholder {
  color: rgba(242, 232, 218, 0.58) !important;
}

.contact-page-body .contact-form select {
  filter: none;
}

.contact-page-body .contact-form select option {
  background: var(--ember-deep);
  color: var(--ember-ivory);
}

.contact-page-body .contact-form .input-wrapper.send {
  background: linear-gradient(145deg, var(--ember-orange), #8f1710) !important;
  border-color: rgba(255, 185, 112, 0.72) !important;
}

.contact-page-body .contact-form .input-wrapper.send p {
  color: var(--ember-black) !important;
}

.contact-page-body .contact-form .input-wrapper.send:hover {
  background: var(--ember-ivory) !important;
}

.contact-page-body .contact-footer :is(.left, .right) {
  border-color: rgba(255, 90, 35, 0.46) !important;
}

.contact-page-body .contact-footer .wrapper :is(.title, .copy, .copy-m),
.contact-page-body .contact-footer .wrapper .right :is(.titles a, .bottom a) {
  color: var(--ember-ivory) !important;
}

/* Case studies */
body[class*="cases-"][class*="-page-body"] .case-page {
  background:
    radial-gradient(
      circle at 50% 12%,
      rgba(255, 74, 22, 0.12),
      transparent 36rem
    ),
    var(--ember-grid), var(--ember-black) !important;
  background-size:
    auto,
    8px 8px,
    auto !important;
}

body[class*="cases-"][class*="-page-body"] .case-info {
  background: linear-gradient(
    180deg,
    rgba(8, 2, 4, 0.1),
    rgba(8, 2, 4, 0.96) 28%
  ) !important;
}

body[class*="cases-"][class*="-page-body"] .case-info .wrapper {
  border-color: rgba(255, 90, 35, 0.34) !important;
}

body[class*="cases-"][class*="-page-body"] .case-info .wrapper .center .circle {
  background: linear-gradient(145deg, var(--ember-orange), #8f1710) !important;
  box-shadow: 0 0 44px rgba(255, 74, 22, 0.2);
}

body[class*="cases-"][class*="-page-body"]
  .case-info
  .wrapper
  .center
  .inner-circle {
  border-color: rgba(255, 237, 219, 0.46) !important;
}

body[class*="cases-"][class*="-page-body"]
  .case-info
  .wrapper
  .center
  .inner-circle
  p {
  color: var(--ember-black) !important;
}

body[class*="cases-"][class*="-page-body"] .case-info .tag,
body[class*="cases-"][class*="-page-body"] .case-info .awards {
  border-color: rgba(255, 90, 35, 0.35) !important;
  color: var(--ember-muted) !important;
}

body[class*="cases-"][class*="-page-body"]
  .case-info
  :is(.awards p, .wrapper .left h1, .wrapper .left h2),
body[class*="cases-"][class*="-page-body"]
  .case-info
  .wrapper
  .center
  .send
  .child
  .elem {
  color: var(--ember-ivory) !important;
}

body[class*="cases-"][class*="-page-body"] .case-info .awards img,
body[class*="cases-"][class*="-page-body"]
  .case-info
  .wrapper
  .right
  .next
  img {
  filter: brightness(0) invert(1) sepia(0.4) saturate(1.8) hue-rotate(-10deg);
}

body[class*="cases-"][class*="-page-body"] .case-info .wrapper .right .next {
  background: linear-gradient(145deg, var(--ember-orange), #7c130f) !important;
}

/* Configurator */
body:is(.index-page, .configurator-page) .configurator-page,
body:is(.index-page, .configurator-page) .customiser-page-no {
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(255, 74, 22, 0.12),
      transparent 42%
    ),
    var(--ember-grid), var(--ember-black) !important;
  background-size:
    auto,
    8px 8px,
    auto !important;
}

body:is(.index-page, .configurator-page) .builder-header .ex-link,
body:is(.index-page, .configurator-page) .lil-gui.root,
body:is(.index-page, .configurator-page) .lil-gui .controller,
body:is(.index-page, .configurator-page) .lil-gui .title,
body:is(.index-page, .configurator-page) .lil-gui input {
  background: rgba(26, 5, 8, 0.88) !important;
  border-color: rgba(255, 90, 35, 0.3) !important;
  color: var(--ember-ivory) !important;
}

body:is(.index-page, .configurator-page) .lil-gui .slider::before {
  background: rgba(255, 232, 215, 0.16) !important;
}

body:is(.index-page, .configurator-page) .lil-gui .slider .fill,
body:is(.index-page, .configurator-page)
  .lil-gui
  input[type="checkbox"]:checked::before {
  background: var(--ember-orange) !important;
}

body:is(.index-page, .configurator-page) .customiser-page-no .builder-header {
  background: rgba(25, 5, 8, 0.82) !important;
  border-color: rgba(255, 90, 35, 0.36) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.34);
}

body:is(.index-page, .configurator-page) #builder-scene .objects-list .item {
  background: rgba(25, 5, 8, 0.7) !important;
  border-color: rgba(255, 232, 215, 0.14) !important;
}

body:is(.index-page, .configurator-page)
  #builder-scene
  .objects-list
  .item.active {
  border-color: var(--ember-orange) !important;
  box-shadow: 0 0 28px rgba(255, 74, 22, 0.24);
}

body:is(.index-page, .configurator-page) .lil-gui .controller > .name,
body:is(.index-page, .configurator-page)
  .customiser-page-no
  .mobile-pro
  :is(.title, .desk) {
  color: var(--ember-ivory) !important;
}

body:is(.index-page, .configurator-page) .lil-gui.root > .title,
body:is(.index-page, .configurator-page)
  .lil-gui
  :is(.children, .word-input-wrapper) {
  border-color: rgba(255, 90, 35, 0.22) !important;
}

body:is(.index-page, .configurator-page)
  .lil-gui
  :is(.reset-button .reset, .upload-button .upload) {
  background: rgba(255, 90, 35, 0.16) !important;
  border: 1px solid rgba(255, 90, 35, 0.3);
}

body:is(.index-page, .configurator-page)
  .lil-gui
  :is(.reset-button .reset p, .upload-button .upload p, .word-text, .max-l) {
  color: var(--ember-ivory) !important;
}

/* Music demo and FWA keep their interactive content but share the grade. */
body.music-demo-page .demo-page,
body.fwa-page-body .fwa-page {
  background:
    radial-gradient(
      circle at 50% 45%,
      rgba(255, 74, 22, 0.14),
      transparent 40%
    ),
    var(--ember-grid), var(--ember-black) !important;
  background-size:
    auto,
    8px 8px,
    auto !important;
}

@media (max-width: 767px) {
  body:not(.index-page-body) {
    background-size:
      auto,
      auto,
      10px 10px,
      10px 10px !important;
  }

  body.index-page-body .home-page::before {
    background-size:
      10px 10px,
      10px 10px,
      auto,
      auto,
      auto;
  }

  body[class*="cases-"][class*="-page-body"] .case-info .wrapper {
    background: linear-gradient(
      180deg,
      rgba(8, 2, 4, 0),
      rgba(8, 2, 4, 0.98) 22%
    ) !important;
  }

  .home-footer {
    min-height: 58vh;
  }
}

@media (max-width: 1024px) {
  body:not(.index-page-body) {
    background-attachment: scroll !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.index-page-body .home-page::before,
  body.index-page-body #home-scene {
    transition: none !important;
  }
}

/* Privacy policy */
body.privacy-policy-page-body {
  color-scheme: dark;
  color: var(--ember-ivory);
  background: var(--ember-black);
}

.gm-privacy-page {
  position: relative;
  min-height: 100vh;
  padding: clamp(9rem, 16vw, 14rem) clamp(1.25rem, 7vw, 8rem) 8rem;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 74, 22, 0.15), transparent 32%),
    var(--ember-grid),
    var(--ember-black);
  background-size: auto, 8px 8px, auto;
}

.gm-privacy-hero,
.gm-privacy-content {
  width: min(100%, 74rem);
  margin-inline: auto;
}

.gm-privacy-kicker,
.gm-privacy-updated {
  color: var(--ember-orange);
  font-family: monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gm-privacy-hero h1 {
  max-width: 10ch;
  margin: 1rem 0;
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.83;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}

.gm-privacy-content {
  display: grid;
  grid-template-columns: minmax(12rem, 0.7fr) minmax(16rem, 1.6fr);
  gap: 1.25rem clamp(2rem, 8vw, 9rem);
  margin-top: clamp(5rem, 10vw, 10rem);
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 90, 35, 0.34);
}

.gm-privacy-content h2 {
  margin: 0;
  color: var(--ember-orange);
  font-size: clamp(1rem, 2vw, 1.45rem);
  text-transform: uppercase;
}

.gm-privacy-content p {
  max-width: 58ch;
  margin: 0 0 2.25rem;
  color: var(--ember-ivory);
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  line-height: 1.55;
}

.gm-privacy-content a {
  color: var(--ember-orange);
  text-underline-offset: 0.18em;
}

.gm-privacy-content .gm-privacy-note {
  grid-column: 2;
  color: rgba(255, 232, 215, 0.65);
  font-size: 0.9rem;
}

.contact-page-body .contact-form .input-wrapper.send {
  appearance: none;
  width: 100%;
  border: 0;
  font: inherit;
}

.contact-page-body .contact-form .input-wrapper.send:disabled {
  cursor: wait;
  opacity: 0.58;
}

.contact-page-body .gm-turnstile-wrap {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 210;
  width: min(320px, calc(100vw - 2.5rem));
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.contact-page-body .gm-form-status {
  margin: 1rem 0;
  color: #ff9a77;
  font-family: monospace;
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 720px) {
  .contact-page-body .gm-turnstile-wrap {
    right: 0.75rem;
    bottom: 0.75rem;
    width: calc(100vw - 1.5rem);
  }

  .gm-privacy-page {
    padding-top: 8rem;
  }

  .gm-privacy-content {
    grid-template-columns: 1fr;
  }

  .gm-privacy-content h2 {
    margin-top: 1.75rem;
  }

  .gm-privacy-content .gm-privacy-note {
    grid-column: 1;
  }
}
