/*
 * AI HOMEWORLD / WATCH
 * Observation Porthole visual layer.
 * This stylesheet contains no runtime or data logic.
 */

:root {
  --porthole-ink: #090b0d;
  --porthole-night: #0d1518;
  --porthole-deep: #10282c;
  --porthole-water: #16434a;
  --porthole-mist: #8fb5b2;
  --porthole-glass: rgba(137, 205, 198, 0.18);
  --porthole-metal: #4e5a5c;
  --porthole-metal-dark: #202a2c;
  --porthole-line: rgba(199, 222, 214, 0.21);
  --porthole-paper: #d5dfd8;
  --porthole-muted: #83938f;
  --porthole-accent: #aacfc5;
}

.watch-page {
  background:
    radial-gradient(circle at 75% 15%, rgba(38, 86, 89, 0.11), transparent 34rem),
    linear-gradient(180deg, #090b0d 0%, #0b1012 52%, #080a0b 100%);
  color: var(--porthole-paper);
}

.watch-page .site-nav {
  position: relative;
  z-index: 10;
}

.watch-page .site-nav .active {
  color: var(--porthole-paper);
}

.observatory-page {
  max-width: 1440px;
  padding-top: clamp(4.8rem, 9vw, 9.5rem);
  padding-bottom: clamp(4rem, 8vw, 8rem);
}

.observation-header {
  max-width: 54rem;
  margin-bottom: clamp(3.5rem, 7vw, 6rem);
}

.observation-header .eyebrow {
  color: var(--porthole-mist);
  letter-spacing: 0.2em;
}

.observation-header h1 {
  margin: 1rem 0 1.5rem;
  color: var(--porthole-paper);
  font-size: clamp(4rem, 10vw, 9.5rem);
  line-height: 0.87;
  letter-spacing: -0.075em;
}

.observation-header h1 em {
  color: var(--porthole-accent);
}

.observation-header .lede {
  max-width: 28rem;
  color: #b9c6c0;
}

.observation-header .lede span {
  color: var(--porthole-muted);
}

.observation-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(17rem, 0.48fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 9rem);
}

.porthole-shell {
  position: relative;
  width: min(100%, 770px);
  aspect-ratio: 1;
  justify-self: center;
  filter: drop-shadow(0 2.25rem 4.5rem rgba(0, 0, 0, 0.44));
}

.porthole-shell::before,
.porthole-shell::after {
  position: absolute;
  inset: 3.8%;
  z-index: 0;
  border: 1px solid rgba(203, 224, 217, 0.13);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.porthole-shell::after {
  inset: 5.8%;
  border-color: rgba(0, 0, 0, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.porthole-bezel {
  position: absolute;
  inset: 7%;
  z-index: 1;
  border: clamp(1.25rem, 3.2vw, 2.8rem) solid var(--porthole-metal-dark);
  border-radius: 50%;
  background:
    conic-gradient(from 16deg, #647174, #2a3537 10%, #586568 22%, #1e282a 35%, #738083 52%, #293436 67%, #556164 84%, #202a2b),
    var(--porthole-metal-dark);
  box-shadow:
    inset 0 0 0 1px rgba(220, 237, 228, 0.2),
    inset 0 0 0 0.65rem rgba(0, 0, 0, 0.18),
    inset 0 0 2.4rem rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(0, 0, 0, 0.92),
    0 1.25rem 2.5rem rgba(0, 0, 0, 0.28);
}

.porthole-bezel::before,
.porthole-bezel::after {
  position: absolute;
  inset: -1.15rem;
  border: 1px solid rgba(198, 220, 211, 0.19);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.porthole-bezel::after {
  inset: 1.3rem;
  border-color: rgba(3, 7, 8, 0.8);
  box-shadow: inset 0 0 0 1px rgba(224, 237, 229, 0.08);
}

.porthole-bolts {
  position: absolute;
  inset: -2.2rem;
  z-index: 5;
  pointer-events: none;
}

.porthole-bolt {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.24rem;
  height: 1.24rem;
  border: 1px solid rgba(220, 233, 225, 0.32);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #8c9b9b 0 8%, #4e5c5e 24%, #1c2527 72%);
  box-shadow: 0 0.22rem 0.4rem rgba(0, 0, 0, 0.46), inset 0 0 0 0.13rem rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
}

.porthole-bolt:nth-child(1) { top: 0%; left: 50%; }
.porthole-bolt:nth-child(2) { top: 6.7%; left: 75%; }
.porthole-bolt:nth-child(3) { top: 25%; left: 93.3%; }
.porthole-bolt:nth-child(4) { top: 50%; left: 100%; }
.porthole-bolt:nth-child(5) { top: 75%; left: 93.3%; }
.porthole-bolt:nth-child(6) { top: 93.3%; left: 75%; }
.porthole-bolt:nth-child(7) { top: 100%; left: 50%; }
.porthole-bolt:nth-child(8) { top: 93.3%; left: 25%; }
.porthole-bolt:nth-child(9) { top: 75%; left: 6.7%; }
.porthole-bolt:nth-child(10) { top: 50%; left: 0%; }
.porthole-bolt:nth-child(11) { top: 25%; left: 6.7%; }
.porthole-bolt:nth-child(12) { top: 6.7%; left: 25%; }

.porthole-window {
  position: absolute;
  inset: 10%;
  overflow: hidden;
  border: 1px solid rgba(183, 224, 213, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 47% 43%, rgba(72, 137, 133, 0.3), transparent 24%),
    radial-gradient(ellipse at 70% 88%, rgba(20, 97, 99, 0.35), transparent 40%),
    linear-gradient(155deg, #12292d 0%, #0b1b20 53%, #071013 100%);
  box-shadow:
    inset 0 0 0 0.24rem rgba(4, 12, 14, 0.52),
    inset 0 0 3.4rem rgba(0, 0, 0, 0.66),
    0 0 0 0.12rem rgba(223, 241, 230, 0.09);
  isolation: isolate;
  transform: translate3d(0, 0, 0);
  transition: transform 500ms ease-out;
}

.porthole-depth,
.porthole-stars,
.activity-stream,
.porthole-haze,
.porthole-scanline,
.glass-reflection,
.glass-mark {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.porthole-depth {
  z-index: -4;
  border-radius: inherit;
  opacity: 0.7;
}

.depth-one {
  background:
    radial-gradient(ellipse at 40% 12%, rgba(145, 212, 194, 0.13), transparent 23%),
    linear-gradient(166deg, transparent 43%, rgba(35, 108, 111, 0.13) 44%, transparent 51%);
}

.depth-two {
  inset: 16% -16% -12% 8%;
  border: 1px solid rgba(91, 178, 164, 0.13);
  border-radius: 48% 56% 44% 52%;
  box-shadow: 0 0 3rem rgba(35, 141, 139, 0.12);
  transform: rotate(-13deg);
}

.depth-three {
  inset: 48% -20% -20% -20%;
  border-top: 1px solid rgba(126, 193, 180, 0.2);
  border-radius: 50%;
  opacity: 0.55;
  transform: rotate(7deg);
}

.porthole-stars {
  z-index: -2;
  opacity: 0.38;
  background-image:
    radial-gradient(circle at 17% 24%, rgba(211, 236, 219, 0.8) 0 0.09rem, transparent 0.12rem),
    radial-gradient(circle at 76% 21%, rgba(181, 224, 212, 0.66) 0 0.07rem, transparent 0.11rem),
    radial-gradient(circle at 57% 31%, rgba(210, 233, 221, 0.55) 0 0.06rem, transparent 0.1rem),
    radial-gradient(circle at 31% 67%, rgba(168, 217, 203, 0.45) 0 0.07rem, transparent 0.12rem),
    radial-gradient(circle at 84% 62%, rgba(213, 235, 222, 0.55) 0 0.06rem, transparent 0.1rem),
    radial-gradient(circle at 69% 79%, rgba(166, 210, 201, 0.45) 0 0.09rem, transparent 0.13rem);
}

.activity-stream {
  z-index: 2;
  overflow: hidden;
}

.stream-far {
  opacity: 0.31;
  filter: blur(0.1rem);
}

.stream-mid {
  opacity: 0.58;
}

.stream-near {
  opacity: 0.78;
}

.echo-fragment {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: block;
  color: var(--fragment-color, rgba(184, 222, 208, 0.68));
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: var(--size, 0.82rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  opacity: var(--opacity, 0.5);
  text-shadow: 0 0 1rem rgba(94, 203, 187, 0.42);
  transform: translate3d(0, 0, 0) rotate(var(--rotation, 0deg)) scale(var(--scale, 1));
  animation: echoDrift var(--duration, 15s) ease-in-out var(--delay, 0s) infinite alternate;
}

.stream-far .echo-fragment {
  --fragment-color: rgba(140, 198, 195, 0.62);
}

.stream-mid .echo-fragment {
  --fragment-color: rgba(173, 222, 207, 0.72);
}

.stream-near .echo-fragment {
  --fragment-color: rgba(206, 233, 217, 0.83);
}

.porthole-haze {
  z-index: 3;
  background:
    radial-gradient(ellipse at 58% 37%, transparent 0 24%, rgba(140, 209, 198, 0.08) 49%, transparent 72%),
    linear-gradient(120deg, transparent 26%, rgba(180, 222, 212, 0.055) 46%, transparent 61%);
  mix-blend-mode: screen;
}

.porthole-scanline {
  z-index: 4;
  opacity: 0.15;
  background: repeating-linear-gradient(180deg, transparent 0 0.35rem, rgba(207, 238, 225, 0.12) 0.39rem, transparent 0.43rem);
  mix-blend-mode: overlay;
}

.glass-reflection {
  z-index: 6;
  background:
    linear-gradient(136deg, rgba(240, 255, 242, 0.15) 0%, rgba(240, 255, 242, 0.04) 17%, transparent 29%),
    linear-gradient(315deg, transparent 69%, rgba(208, 240, 224, 0.05) 76%, transparent 79%);
  mix-blend-mode: screen;
}

.glass-mark {
  z-index: 7;
  border: 1px solid rgba(208, 232, 222, 0.09);
  border-color: transparent rgba(208, 232, 222, 0.11) transparent transparent;
  border-radius: 50%;
  opacity: 0.7;
}

.mark-one {
  inset: 8% 11% 50% 48%;
  transform: rotate(-34deg);
}

.mark-two {
  inset: 45% 48% 8% 15%;
  transform: rotate(147deg);
}

.porthole-caption {
  position: absolute;
  right: 13%;
  bottom: 16%;
  left: 13%;
  z-index: 8;
  color: rgba(216, 235, 223, 0.8);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: clamp(0.52rem, 1.1vw, 0.72rem);
  letter-spacing: 0.22em;
  line-height: 1.7;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7), 0 0 1rem rgba(116, 207, 185, 0.28);
}

.porthole-caption small {
  display: block;
  color: rgba(163, 198, 189, 0.6);
  font-size: 0.68em;
  letter-spacing: 0.14em;
}

@keyframes echoDrift {
  0% { transform: translate3d(-0.35rem, 0.2rem, 0) rotate(var(--rotation, 0deg)) scale(var(--scale, 1)); }
  100% { transform: translate3d(0.5rem, -0.8rem, 0) rotate(var(--rotation, 0deg)) scale(var(--scale, 1.02)); }
}

.observation-readout {
  position: relative;
  align-self: center;
  max-width: 25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--porthole-line);
  border-bottom: 1px solid var(--porthole-line);
  background: linear-gradient(120deg, rgba(21, 33, 35, 0.35), rgba(8, 12, 13, 0.12));
}

.observation-readout::before,
.observation-readout::after {
  position: absolute;
  top: -1px;
  width: 4rem;
  height: 1px;
  background: var(--porthole-accent);
  content: "";
}

.observation-readout::before { left: 0; }
.observation-readout::after { right: 0; background: rgba(170, 207, 197, 0.24); }

.readout-heading,
.readout-live,
.readout-metric,
.activity-summary-line,
.boundary-status {
  display: flex;
  align-items: center;
}

.readout-heading {
  justify-content: space-between;
  margin-bottom: 2rem;
  color: var(--porthole-muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}

.readout-live {
  gap: 0.45rem;
  color: var(--porthole-accent);
}

.live-dot {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #9fe2c2;
  box-shadow: 0 0 0.8rem rgba(159, 226, 194, 0.7);
}

.readout-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem 1rem;
}

.readout-metric {
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding-bottom: 0.72rem;
  border-bottom: 1px solid rgba(199, 222, 214, 0.13);
}

.readout-metric span {
  color: var(--porthole-muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.readout-metric strong {
  color: var(--porthole-paper);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.metric-pulse strong {
  color: var(--porthole-accent);
  font-size: clamp(0.92rem, 1.8vw, 1.18rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.readout-rule {
  width: 100%;
  height: 1px;
  margin: 2rem 0 1.5rem;
  background: linear-gradient(90deg, var(--porthole-line), transparent);
}

.echo-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  color: var(--porthole-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.echo-note p {
  margin: 0;
}

.echo-note p + p {
  grid-column: 2;
  margin-top: -0.35rem;
  color: rgba(131, 147, 143, 0.74);
  font-size: 0.75rem;
}

.echo-note-mark {
  color: var(--porthole-accent);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 1.05rem;
}

.signal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.5rem;
}

.signal-strip span,
.safe-signal-list span {
  padding: 0.28rem 0.42rem;
  border: 1px solid rgba(170, 207, 197, 0.17);
  color: rgba(170, 207, 197, 0.7);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.observation-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(4rem, 10vw, 9rem);
  padding-top: 2rem;
  border-top: 1px solid rgba(199, 222, 214, 0.16);
}

.section-label {
  color: var(--porthole-muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
}

.section-label span {
  margin-right: 0.9rem;
  color: var(--porthole-accent);
}

.activity-summary-line {
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.activity-summary-line strong {
  color: var(--porthole-paper);
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.summary-beacon {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--porthole-accent);
  box-shadow: 0 0 1rem rgba(170, 207, 197, 0.72);
}

.activity-summary > p,
.observation-boundary p {
  max-width: 34rem;
  margin: 0.8rem 0 0;
  color: var(--porthole-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.safe-signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.45rem;
}

.observation-boundary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.4rem);
  margin-top: clamp(4rem, 9vw, 8rem);
  padding: 1.3rem 0;
  border-top: 1px solid rgba(199, 222, 214, 0.14);
  border-bottom: 1px solid rgba(199, 222, 214, 0.14);
}

.boundary-seal {
  display: grid;
  width: 3.6rem;
  height: 3.6rem;
  place-items: center;
  border: 1px solid rgba(170, 207, 197, 0.42);
  border-radius: 50%;
  color: var(--porthole-accent);
  font-size: 1.15rem;
}

.observation-boundary p {
  margin-top: 0.5rem;
}

.boundary-status {
  justify-content: flex-end;
  color: var(--porthole-accent);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  line-height: 1.55;
  text-align: right;
}

.boundary-status small {
  color: var(--porthole-muted);
  font-size: 0.7em;
}

.status-square {
  width: 0.46rem;
  height: 0.46rem;
  margin-right: 0.55rem;
  background: var(--porthole-accent);
  box-shadow: 0 0 0.7rem rgba(170, 207, 197, 0.72);
}

.noscript-notice {
  margin-top: 3rem;
  padding: 1rem;
  border: 1px solid rgba(170, 207, 197, 0.2);
  color: var(--porthole-muted);
}

.watch-page .site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1.2rem, 4vw, 4rem) 2.5rem;
  color: var(--porthole-muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .observation-stage {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .porthole-shell {
    width: min(92vw, 680px);
  }

  .observation-readout {
    width: min(100%, 38rem);
    max-width: none;
    justify-self: center;
  }
}

@media (max-width: 680px) {
  .observatory-page {
    padding-top: 3.5rem;
  }

  .observation-header {
    margin-bottom: 3rem;
  }

  .observation-header h1 {
    font-size: clamp(3.55rem, 18vw, 6rem);
  }

  .porthole-shell {
    width: 96vw;
  }

  .porthole-bezel {
    border-width: clamp(1rem, 4.8vw, 1.75rem);
  }

  .porthole-bolts {
    inset: -1.65rem;
  }

  .porthole-bolt {
    width: 0.9rem;
    height: 0.9rem;
  }

  .porthole-caption {
    right: 9%;
    bottom: 14%;
    left: 9%;
    font-size: 0.5rem;
  }

  .observation-lower {
    grid-template-columns: 1fr;
  }

  .observation-boundary {
    grid-template-columns: auto 1fr;
  }

  .boundary-status {
    grid-column: 2;
    justify-content: flex-start;
    text-align: left;
  }

  .watch-page .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .porthole-window {
    transition: none;
  }

  .echo-fragment,
  .live-dot,
  .summary-beacon {
    animation: none !important;
  }
}
