:root {
  --void: #050607;
  --black-green: #090f0e;
  --wall: #28302e;
  --wall-dark: #161d1c;
  --wall-light: #4a524e;
  --institutional: #9aa19a;
  --sick-yellow: #f0b846;
  --bulb-core: #ffe39c;
  --rust: #8a5734;
  --red: #b73925;
  --paper: #d7d0bd;
  --shadow: rgba(0, 0, 0, 0.76);
  --font-body: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Noto Kufi Arabic", "Cairo", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--void);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: #f3ead3;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 50% 12%, rgba(240, 184, 70, 0.14), transparent 24rem),
    linear-gradient(180deg, #030404 0%, #101615 50%, #050606 100%);
}

button,
input {
  font: inherit;
}

.facility {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: clamp(1rem, 2.5vw, 2.5rem);
  isolation: isolate;
  place-items: center;
}

.noise,
.scanlines,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.noise {
  z-index: 8;
  opacity: 0.09;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.26) 0 1px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(0, 0, 0, 0.8) 0 1px, transparent 1px);
  background-size: 8px 8px, 13px 13px, 10px 10px;
}

.scanlines {
  z-index: 7;
  opacity: 0.12;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 236, 174, 0.16) 0,
    rgba(255, 236, 174, 0.16) 1px,
    transparent 1px,
    transparent 5px
  );
}

.vignette {
  z-index: 6;
  background:
    radial-gradient(circle at 50% 40%, transparent 0 36%, rgba(0, 0, 0, 0.42) 62%, rgba(0, 0, 0, 0.92) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.88), transparent 18% 82%, rgba(0, 0, 0, 0.88));
}

.room {
  position: relative;
  width: min(1180px, 100%);
  min-height: min(780px, calc(100vh - 2rem));
  overflow: hidden;
  border: 1px solid rgba(225, 198, 124, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.58), transparent 26% 72%, rgba(0, 0, 0, 0.62)),
    linear-gradient(180deg, #1a2221 0%, #202b29 43%, #121817 44%, #080a0a 100%);
  box-shadow:
    0 2rem 6rem rgba(0, 0, 0, 0.72),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 0 6rem rgba(0, 0, 0, 0.7);
  contain: paint;
}

.ceiling {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  height: 34%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 90px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.58), transparent 82%);
  transform: skewX(-2deg);
  transform-origin: top;
}

.pipe {
  position: absolute;
  left: -5%;
  right: -5%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #050606, #59625c 18%, #101413 42%, #6b7169 54%, #070808);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
}

.pipe-one {
  top: 48px;
}

.pipe-two {
  top: 108px;
  opacity: 0.68;
}

.bulb {
  position: absolute;
  top: 0;
  width: 2px;
  height: clamp(120px, 19vh, 190px);
  background: rgba(140, 130, 98, 0.82);
  transform-origin: top center;
  animation: sway 6s ease-in-out infinite;
}

.bulb::before {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 230, 159, 0.6);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -1px);
  background:
    radial-gradient(circle at 48% 40%, var(--bulb-core), #f7c75c 38%, #7c5521 70%, rgba(0, 0, 0, 0.94) 100%);
  box-shadow:
    0 0 16px rgba(255, 208, 91, 0.82),
    0 0 74px rgba(237, 167, 50, 0.5),
    0 0 160px rgba(255, 189, 62, 0.34);
  animation: flicker 3.7s infinite;
}

.bulb::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: min(18rem, 30vw);
  height: 48vh;
  content: "";
  transform: translateX(-50%);
  opacity: 0.24;
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 192, 69, 0.42), rgba(230, 169, 56, 0.09) 48%, transparent 72%);
}

.bulb-one {
  left: 21%;
  animation-delay: -1s;
}

.bulb-two {
  left: 52%;
  height: clamp(155px, 24vh, 245px);
  animation-delay: -2.3s;
}

.bulb-three {
  left: 79%;
  height: clamp(105px, 17vh, 170px);
  animation-delay: -4s;
}

.back-wall {
  position: absolute;
  inset: 13% 4% 28%;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.045);
  background:
    linear-gradient(rgba(255, 255, 255, 0.03), transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028), transparent 1px),
    radial-gradient(circle at 50% 14%, rgba(230, 175, 72, 0.08), transparent 21rem),
    linear-gradient(180deg, #2f3935, #1c2422 63%, #111716);
  background-size: 100% 54px, 72px 100%, auto, auto;
  box-shadow:
    inset 0 -3rem 4rem rgba(0, 0, 0, 0.45),
    inset 0 0 1rem rgba(255, 255, 255, 0.025);
}

.tile-grid {
  position: absolute;
  inset: 0;
  opacity: 0.52;
  background:
    repeating-linear-gradient(0deg, transparent 0 58px, rgba(0, 0, 0, 0.28) 59px 60px),
    repeating-linear-gradient(90deg, transparent 0 86px, rgba(0, 0, 0, 0.22) 87px 88px);
}

.door,
.observation-window,
.warning-sign,
.case-number {
  position: absolute;
  display: grid;
  place-items: center;
}

.door {
  bottom: 0;
  width: 15%;
  min-width: 110px;
  height: 63%;
  border: 1px solid rgba(0, 0, 0, 0.48);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 15% 75%, rgba(0, 0, 0, 0.42)),
    linear-gradient(180deg, #303b37, #141b1a);
  box-shadow: inset 0 0 2rem rgba(0, 0, 0, 0.62), 0 1rem 2rem rgba(0, 0, 0, 0.42);
}

.door::after {
  position: absolute;
  top: 48%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  content: "";
  background: #17100a;
  box-shadow: 0 0 0 2px rgba(219, 185, 98, 0.28);
}

.door-left {
  left: 8%;
}

.door-left::after {
  right: 18px;
}

.door-right {
  right: 8%;
}

.door-right::after {
  left: 18px;
}

.observation-window {
  top: 28%;
  left: 50%;
  width: min(260px, 28vw);
  height: 72px;
  border: 8px solid #121615;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, rgba(255, 221, 129, 0.1), transparent 45%, rgba(255, 221, 129, 0.1)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.92) 0 9px, transparent 9px 24px),
    linear-gradient(180deg, #34403c, #131817);
  box-shadow:
    inset 0 0 2rem rgba(0, 0, 0, 0.82),
    0 0 2rem rgba(0, 0, 0, 0.52);
}

.warning-sign {
  top: 14%;
  right: 30%;
  width: 94px;
  min-height: 44px;
  padding: 0.25rem;
  border: 1px solid rgba(60, 18, 8, 0.8);
  color: #351007;
  font-weight: 1000;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #c9a54b, #7b5d24);
  box-shadow: 0 0.7rem 1.2rem rgba(0, 0, 0, 0.45);
  transform: rotate(-3deg);
}

.case-number {
  top: 17%;
  left: 30%;
  width: 110px;
  min-height: 36px;
  color: rgba(214, 208, 190, 0.45);
  border: 1px dashed rgba(214, 208, 190, 0.24);
  font-size: 0.82rem;
  transform: rotate(2deg);
}

.content-card {
  position: relative;
  z-index: 4;
  width: min(1180px, calc(100% - 2rem));
  margin: clamp(9rem, 22vh, 12rem) auto 0;
  padding: clamp(1rem, 2.5vw, 2.2rem);
  border: 1px solid rgba(240, 184, 70, 0.24);
  border-radius: 24px;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(9, 13, 12, 0.9), rgba(27, 35, 32, 0.74)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 9px);
  box-shadow:
    0 3rem 7rem rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 4rem rgba(0, 0, 0, 0.36);
}

.content-card::before,
.content-card::after {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 230, 159, 0.08);
  border-radius: 18px;
  content: "";
  pointer-events: none;
}

.content-card::after {
  inset: auto 50% -76px auto;
  width: 2px;
  height: 76px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(240, 184, 70, 0.62), transparent);
  box-shadow: 0 0 44px rgba(240, 184, 70, 0.54);
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: rgba(249, 222, 152, 0.75);
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
}

.logo-title {
  display: flex;
  margin: 0 0 0.45rem;
  justify-content: center;
  animation: titleGlitch 8s infinite;
}

.site-logo {
  display: block;
  width: min(100%, clamp(144px, 23.4vw, 334px));
  height: auto;
  filter:
    drop-shadow(0 0 18px rgba(250, 199, 86, 0.36))
    drop-shadow(0 10px 32px rgba(0, 0, 0, 0.92));
}

.domain-title {
  color: #fff6d9;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 7.2rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 0.98;
  text-shadow:
    0 0 18px rgba(250, 199, 86, 0.36),
    0 10px 32px rgba(0, 0, 0, 0.92),
    -2px 0 rgba(183, 57, 37, 0.45),
    2px 0 rgba(80, 128, 111, 0.4);
  animation: titleGlitch 8s infinite;
}

.subtitle {
  margin: 1rem auto 0;
  color: #f1c862;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.6vw, 2.15rem);
  font-weight: 600;
  text-shadow: 0 0 22px rgba(240, 184, 70, 0.34);
}

.description {
  max-width: 58ch;
  margin: 1.2rem auto 0;
  color: rgba(242, 235, 215, 0.78);
  font-size: clamp(0.98rem, 2.2vw, 1.16rem);
  font-weight: 400;
  line-height: 2;
}

.status-panel {
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 0 auto;
  padding: 0.68rem 1rem;
  border: 1px solid rgba(240, 184, 70, 0.22);
  border-radius: 999px;
  color: rgba(255, 245, 218, 0.82);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: inset 0 0 1.3rem rgba(240, 184, 70, 0.06);
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sick-yellow);
  box-shadow: 0 0 0 0 rgba(240, 184, 70, 0.7);
  animation: pulse 1.8s infinite;
}

.return-note {
  display: inline-block;
  margin: 0.65rem auto 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(240, 184, 70, 0.2);
  border-radius: 16px;
  color: rgba(255, 245, 218, 0.8);
  font-size: clamp(0.78rem, 1.55vw, 0.92rem);
  font-weight: 700;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 1.3rem rgba(240, 184, 70, 0.05);
}

.side-notes {
  position: absolute;
  right: clamp(1rem, 4vw, 4rem);
  bottom: clamp(5.5rem, 10vh, 7rem);
  z-index: 4;
  display: grid;
  gap: 0.45rem;
  color: rgba(218, 211, 190, 0.5);
  font-size: 0.78rem;
  writing-mode: vertical-rl;
}

.side-notes span {
  padding: 0.45rem 0.25rem;
  border-right: 1px solid rgba(218, 211, 190, 0.16);
}

.floor {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 36%;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 25%, rgba(230, 169, 56, 0.16), transparent 36%),
    linear-gradient(180deg, #101615, #050606 86%);
  transform-origin: top;
}

.floor-lines {
  position: absolute;
  inset: -22% -12% 0;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(255, 220, 142, 0.08) 50%, transparent 50.3%),
    repeating-linear-gradient(0deg, transparent 0 42px, rgba(255, 220, 142, 0.07) 43px 44px);
  transform: skewY(-5deg) scaleY(1.18);
  transform-origin: top;
}

.chair {
  position: absolute;
  bottom: 32%;
  width: 86px;
  height: 44px;
  border: 2px solid rgba(5, 6, 6, 0.92);
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #303a37, #0c100f);
  box-shadow: 0 1rem 1.3rem rgba(0, 0, 0, 0.62);
}

.chair::before,
.chair::after {
  position: absolute;
  top: 100%;
  width: 4px;
  height: 42px;
  content: "";
  background: #070908;
}

.chair::before {
  right: 14px;
}

.chair::after {
  left: 14px;
}

.chair-one {
  left: 14%;
  transform: rotate(2deg) skewX(-3deg);
}

.chair-two {
  right: 13%;
  transform: rotate(-3deg) skewX(4deg);
}

.shadow-pool {
  position: absolute;
  right: 19%;
  bottom: 2%;
  width: 62%;
  height: 46%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.28) 44%, transparent 72%);
}

@keyframes flicker {
  0%, 7%, 10%, 18%, 100% {
    opacity: 1;
  }

  8%, 11%, 19% {
    opacity: 0.52;
  }

  42% {
    opacity: 0.86;
  }

  44% {
    opacity: 0.35;
  }
}

@keyframes sway {
  0%, 100% {
    transform: rotate(-1deg);
  }

  50% {
    transform: rotate(1.3deg);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 184, 70, 0.62);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(240, 184, 70, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(240, 184, 70, 0);
  }
}

@keyframes titleGlitch {
  0%, 93%, 100% {
    transform: translate(0);
  }

  94% {
    transform: translate(2px, -1px);
  }

  95% {
    transform: translate(-2px, 1px);
  }

  96% {
    transform: translate(1px, 0);
  }
}

@media (max-width: 760px) {
  .facility {
    padding: 0;
  }

  .room {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .back-wall {
    inset: 10% 0 31%;
  }

  .content-card {
    width: calc(100% - 1.4rem);
    margin-top: 8.2rem;
    padding: 1.2rem;
  }

  .description {
    line-height: 1.85;
  }

  .side-notes,
  .chair,
  .case-number {
    display: none;
  }

  .door {
    min-width: 82px;
  }

  .observation-window {
    width: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
