/* The painted rim belongs to the opening. Once past it the 3D fire takes over. */
.redx-landing, .redx-catalog, .support-inferno {
  --inferno-rim: url('assets/crater/inferno-rim.webp');
  --iron-line: #614238;
  --iron-surface: #211917;
  --iron-texture: url('assets/crater/scoria.webp');
}

.crater-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 82% at 50% 49%,
    transparent 50%, rgb(29 9 6 / 18%) 76%, rgb(10 4 5 / 76%) 100%);
}
.hero-intro-playing .crater-stage::before { opacity: .5; }

.crater-rim {
  --rim-exit: calc(1 - var(--crater-copy-opacity, 1));
  position: absolute;
  z-index: -2;
  inset: auto 0 -1px;
  height: min(32vw, 43svh);
  pointer-events: none;
  background: var(--inferno-rim) center bottom / 100% 100% no-repeat;
  opacity: calc(1 - var(--rim-exit));
  transform: translateY(calc(36% * var(--rim-exit)));
}
.hero-cinema .crater-rim { --rim-exit: var(--hero-exit, 0); }
.hero-cinema-pending .crater-rim,
.hero-intro-playing .crater-rim,
.crater-opening:has(.hero-epilogue:not([hidden])) .crater-rim { visibility: hidden; }

.rim-flame { display: none; }
@supports (width: 1cqw) {
  @media (prefers-reduced-motion: no-preference) {
    .crater-rim {
      container-type: size;
      background: none;
    }
    /* Cut the four tips out of the still. Each patch meets it at a fixed root. */
    .crater-rim::before {
      content: '';
      position: absolute;
      inset: 0;
      background: var(--inferno-rim) center / 100% 100% no-repeat;
      clip-path: polygon(0 0, 6.5% 0, 6.5% 54%, 10.4% 54%, 10.4% 0,
        18.2% 0, 18.2% 75%, 20.2% 75%, 20.2% 0, 78.6% 0, 78.6% 58%,
        86.6% 58%, 86.6% 0, 89.7% 0, 89.7% 32%, 97% 32%, 97% 0, 100% 0, 100% 100%, 0 100%);
    }
    .rim-flame {
      display: block;
      position: absolute;
      left: calc(var(--left) * 1cqw);
      top: calc(var(--top) * 1cqh);
      width: calc(var(--width) * 1cqw);
      height: calc(var(--height) * 1cqh + .45px);
      background: var(--inferno-rim) calc(var(--left) * -1cqw) calc(var(--top) * -1cqh) / 100cqw 100cqh no-repeat;
      transform-origin: 50% 100%;
    }
    .rim-flame:nth-child(1) { --left: 6.5; --top: 42; --width: 3.9; --height: 12; --period: 1.51s; --phase: -.4s; }
    .rim-flame:nth-child(2) { --left: 18.2; --top: 66; --width: 2; --height: 9; --period: 1.23s; --phase: -.8s; }
    .rim-flame:nth-child(3) { --left: 78.6; --top: 29; --width: 8; --height: 29; --period: 1.93s; --phase: -1.1s; }
    .rim-flame:nth-child(4) { --left: 89.7; --top: 0; --width: 7.3; --height: 32; --period: 2.31s; --phase: -.3s; }
    .hero-header-sync:not(.hero-intro-playing) .crater-opening:not(:has(.hero-epilogue:not([hidden]))) .rim-flame {
      animation: rim-flame-sway var(--period) ease-in-out var(--phase) infinite;
    }
    @keyframes rim-flame-sway {
      0%, 100% { transform: skewX(-2.8deg) scaleY(.98); }
      27% { transform: skewX(3.9deg) scaleY(1.055); }
      54% { transform: skewX(.6deg) scaleY(.965); }
      78% { transform: skewX(-4.2deg) scaleY(1.025); }
    }
  }
}

.rim-embers {
  position: absolute;
  left: 5%;
  bottom: 21%;
  width: 2px;
  height: 3px;
  border-radius: 60%;
  color: #f6a064;
  background: currentColor;
  box-shadow: 18px 12px 0 -0.4px #db6a41, 47px -9px 0 -0.6px #f5bb70, -21px 29px 0 -0.3px #b74d2e;
  opacity: 0;
}
.rim-embers + .rim-embers { left: auto; right: 9%; bottom: 39%; }
@media (prefers-reduced-motion: no-preference) {
  .hero-header-sync:not(.hero-intro-playing) .rim-embers {
    animation: rim-updraft 3.8s ease-out -1.4s infinite;
  }
  .hero-header-sync:not(.hero-intro-playing) .rim-embers + .rim-embers {
    animation-duration: 4.7s;
    animation-delay: -3s;
  }
  @keyframes rim-updraft {
    0% { opacity: 0; transform: translate(0, 0); }
    21% { opacity: .87; }
    62% { transform: translate(-7px, -44px); }
    100% { opacity: 0; transform: translate(9px, -92px); }
  }
}

/* Burnished iron carries the colour of the cavern into the reading sections. */
.redx-landing {
  --bg-deep: #100c0c;
  --bg-surface: var(--iron-surface);
  --accent: #ff876b;
  --accent-cyan: #eeb590;
  --text-main: #f4e7dc;
  --text-dim: #d0bdb1;
  --text-muted: #b59d91;
  --border-subtle: rgb(213 164 133 / 23%);
}
.redx-landing .crater-world { background-color: #1a1110; }
.redx-landing .section-header-cinema > .section-cinema-title {
  color: var(--crater-paper);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.redx-landing .section-header-cinema .hero-line-red {
  color: #f19c77;
  background: none;
  -webkit-text-fill-color: currentColor;
  filter: none;
}
.redx-landing .section-code-label {
  padding: 0;
  border: none;
  background: none;
  color: #e5ae88;
  letter-spacing: .13em;
}
.redx-landing :is(.redx-features-board, .bento-card, .pillar-card, .review-bubble,
    .telemetry-card, .plan-card, .faq-item, .contact-box) {
  background: linear-gradient(145deg, rgb(53 35 29 / 90%), rgb(23 17 17 / 97%) 72%),
    var(--iron-texture) center / 288px 142px repeat;
  border-color: var(--iron-line);
  border-radius: 6px;
  box-shadow: inset 0 1px rgb(255 204 158 / 6%), 0 10px 25px rgb(10 4 4 / 22%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.redx-landing .redx-features-board { overflow: clip; }
.redx-landing .plan-card.plan-featured {
  border-top: 2px solid #e48a65;
  background: linear-gradient(155deg, rgb(89 44 31 / 89%), #211715 78%),
    var(--iron-texture) center / 288px 142px;
}
.redx-landing :is(.galaxy-search-input-box, .pillar-console-box, .contact-form-input) {
  background: #1a1414;
  border-color: var(--iron-line);
}
.redx-landing :is(.bento-card, .pillar-card, .review-bubble, .telemetry-card):hover,
.redx-landing .galaxy-search-input-box:focus-within { border-color: #b67c60; }
.redx-landing .section-cinema-desc { color: var(--text-dim); }
.redx-landing .bento-stat { color: #f69b79; }
.redx-landing .bento-icon-box {
  color: #ffc5a2;
  background: #38241e;
  border-color: var(--iron-line);
}
.redx-landing footer {
  isolation: isolate;
  border-top-color: transparent;
  background: linear-gradient(180deg, transparent, rgb(23 12 12 / 83%) 14%, #160f0f 45%, #0f0b0b);
}
.redx-landing footer::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--inferno-rim) center bottom / 100% min(96%, 36vw) no-repeat;
  opacity: .53;
  pointer-events: none;
}

/* Related public pages keep the centre clear for search and support forms. */
.redx-catalog .hero {
  background: radial-gradient(ellipse at 84% 80%, var(--catalog-firelight), var(--g) 68%);
  border-bottom: 1px solid var(--bf);
}
.redx-catalog .hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--inferno-rim) center bottom / 100% min(55%, 26vw) no-repeat;
  opacity: var(--catalog-fire-strength);
}
.redx-catalog .hero :is(.slabel, h1 em) { color: var(--catalog-accent-ink); }

.support-body.support-inferno {
  --sp-bg-deep: #150f10;
  --sp-bg-card: #211917;
  --sp-bg-surface: #261c19;
  --sp-accent: #ee735b;
  --sp-accent-glow: rgb(183 72 47 / 24%);
  --sp-cyan: #efb48c;
  --sp-cyan-glow: rgb(230 157 106 / 20%);
  --sp-text-dim: #d0bdb1;
  --sp-text-muted: #b4a198;
  --sp-border: #594138;
}
.support-body.support-inferno::before {
  background: var(--inferno-rim) center bottom / 100% min(33vw, 35svh) no-repeat,
    radial-gradient(ellipse at 50% 24%, #38231d, #170f10 66%, #100c0c);
}
.support-inferno .support-hero h1 {
  font: 500 clamp(32px, 3.4vw, 48px)/1.12 Georgia, serif;
  color: #f6e7dc;
  background: none;
  -webkit-text-fill-color: currentColor;
}
.support-inferno :is(.form-input, .form-select, .form-textarea) { background-color: #171211; }

@media (max-width: 720px) {
  .redx-landing, .redx-catalog, .support-inferno {
    --inferno-rim: url('assets/crater/inferno-rim-small.webp');
  }
  .crater-stage::before {
    background: radial-gradient(ellipse 88% 73% at 50% 48%,
      transparent 54%, rgb(25 8 6 / 16%) 80%, rgb(11 5 6 / 62%) 100%);
  }
  .crater-rim { height: min(39vw, 23svh); }
  .redx-catalog .hero::before { background-size: 100% 19%; }
}
@media (max-width: 560px) {
  .support-inferno .support-header {
    display: grid;
    height: auto;
    gap: 10px;
    padding: 10px 20px;
    grid-template-columns: minmax(0, 1fr);
  }
  .support-inferno .brand-container { gap: 10px; }
  .support-inferno .brand-logo-img { width: 30px; height: 30px; }
  .support-inferno .brand-title { font-size: 15px; line-height: 1.2; }
  .support-inferno .brand-subtitle { font-size: 10px; letter-spacing: .06em; }
  .support-inferno .header-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .support-inferno .header-actions .btn-cyber {
    justify-content: center;
    min-height: 40px;
    padding: 5px 8px;
    font-size: 11px;
  }
}
@media (forced-colors: active), print {
  .crater-stage::before, .crater-rim, .redx-landing footer::before, .support-body.support-inferno::before { display: none; }
}
