/* Echo Resonance Research — Rift Distortion Lab */

/* theme */
:root {
  --bg1: #050012;
  --bg2: #020009;
  --panel: rgba(10, 6, 26, 0.96);
  --border: rgba(190,140,255,0.22);
  --accent-teal: #27f2ff;
  --accent-violet: #c866ff;
  --text-main: #e7e3ff;
  --text-muted: #9a8fc0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 0% 0%, rgba(135,66,255,0.3), transparent 65%),
    radial-gradient(circle at 100% 0%, rgba(0,230,255,0.22), transparent 70%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
}

/* noise / scanline overlay */
.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("assets/noise.png"),
    url("assets/scanline.png");
  opacity: 0.1;
  mix-blend-mode: soft-light;
}

/* layout */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1150px;
  margin: 18px auto 40px;
  padding: 0 14px;
}

/* header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.logo {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.12em;
}

.logo .accent {
  color: var(--accent-teal);
}

.logo .sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent-teal);
}

/* panels */
.panel,
.hero-panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.9);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.panel::before,
.hero-panel::before {
  content: "";
  position: absolute;
  inset: -40%;
  background-image: url("assets/gradient-bg.png");
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  animation: drift 24s linear infinite;
  pointer-events: none;
}

@keyframes drift {
  0% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(12px,-18px,0); }
  100% { transform: translate3d(0,0,0); }
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
}

.hero-panel h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.muted {
  color: var(--text-muted);
}

/* hero tags */
.hero-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(5,2,12,0.9);
}

/* rift widget */
.hero-right {
  display: flex;
  justify-content: flex-end;
}

.rift-shell {
  max-width: 260px;
  width: 100%;
  background: radial-gradient(circle at top, rgba(135,66,255,0.4), rgba(5,3,16,0.96));
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(180,140,255,0.6);
}

.rift-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rift-orbit {
  margin-top: 8px;
  position: relative;
  height: 90px;
}

.rift-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-teal), var(--accent-violet));
  box-shadow: 0 0 18px rgba(39,242,255,0.9);
}

.rift-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.4);
  transform: translate(-50%, -50%);
}

.rift-ring-1 {
  width: 56px;
  height: 56px;
  animation: orbit 10s linear infinite;
}

.rift-ring-2 {
  width: 80px;
  height: 80px;
  animation: orbit 16s linear infinite reverse;
}

@keyframes orbit {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.rift-read {
  font-size: 11px;
  margin-top: 6px;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* panel headers */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.panel-sub {
  font-size: 12px;
}

/* frequency grids */
.freq-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 10px;
}

.freq-card {
  position: relative;
  border-radius: 12px;
  padding: 10px 11px;
  background: radial-gradient(circle at top, rgba(80,255,240,0.16), rgba(5,3,16,0.98));
  border: 1px solid rgba(119,205,255,0.4);
  overflow: hidden;
}

.freq-card.emotional {
  background: radial-gradient(circle at top, rgba(200,120,255,0.22), rgba(5,3,16,0.98));
  border-color: rgba(225,155,255,0.4);
}

.freq-title {
  font-size: 13px;
  font-weight: 700;
}

.freq-tagline {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.freq-body {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-main);
}

.freq-body p {
  margin: 0 0 4px;
}

.freq-body .mini-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* study */
.study-body {
  font-size: 13px;
}

.bullet {
  padding-left: 18px;
}

.bullet li {
  margin-bottom: 6px;
}

/* simulator */
.sim-layout {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,1.4fr);
  gap: 14px;
  align-items: stretch;
}

.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-btn {
  width: 100%;
  text-align: left;
}

.btn {
  padding: 7px 10px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-violet));
  color: #050509;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn.ghost {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.16);
}

.sim-display {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(123,204,255,0.5);
  background: radial-gradient(circle at top, rgba(58,35,98,0.8), rgba(3,1,10,0.98));
  padding: 10px;
  overflow: hidden;
}

.sim-wave {
  position: relative;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(39,242,255,0.1), rgba(200,102,255,0.1));
}

.sim-wave::before,
.sim-wave::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at 0% 50%, rgba(39,242,255,0.8), transparent 60%),
              radial-gradient(circle at 100% 50%, rgba(200,102,255,0.8), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.6;
  transform-origin: center;
}

.sim-wave::before {
  animation: waveCalm 10s linear infinite;
}

.sim-wave::after {
  animation: waveCalm 14s linear infinite reverse;
}

.sim-wave-edge::before {
  animation: waveEdge 4s linear infinite;
}

.sim-wave-edge::after {
  animation: waveEdge 7s linear infinite reverse;
}

.sim-wave-rift::before {
  animation: waveRift 3.4s linear infinite;
}

.sim-wave-rift::after {
  animation: waveRift 5.1s linear infinite reverse;
}

@keyframes waveCalm {
  0%   { transform: translate3d(-10%,0,0) scale(1,0.8); }
  50%  { transform: translate3d(10%,0,0) scale(1,1); }
  100% { transform: translate3d(-10%,0,0) scale(1,0.8); }
}

@keyframes waveEdge {
  0%   { transform: translate3d(-20%,0,0) scale(1.1,1.1); }
  50%  { transform: translate3d(20%,0,0) scale(1.2,0.7); }
  100% { transform: translate3d(-20%,0,0) scale(1.1,1.1); }
}

@keyframes waveRift {
  0%   { transform: translate3d(0,-5%,0) scale(1.2,1.4) rotate(0deg); }
  25%  { transform: translate3d(10%,5%,0) scale(1.4,0.8) rotate(6deg); }
  50%  { transform: translate3d(-12%,-3%,0) scale(1.5,1.1) rotate(-4deg); }
  75%  { transform: translate3d(8%,-8%,0) scale(1.3,1.3) rotate(8deg); }
  100% { transform: translate3d(0,-5%,0) scale(1.2,1.4) rotate(0deg); }
}

.sim-label {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* symptoms */
.symptom-list {
  list-style: none;
  padding-left: 0;
  font-size: 12px;
}

.symptom-list li {
  margin-bottom: 8px;
  padding-left: 14px;
  position: relative;
}

.symptom-list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-teal);
}

/* anomaly node */
.anomaly {
  border-color: rgba(255,120,160,0.7);
  box-shadow: 0 0 28px rgba(255,60,140,0.4);
}

.anomaly-body {
  font-size: 12px;
}

.flag {
  color: #ff9fb3;
}

.hidden {
  display: none;
}

/* footer */
.footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 16px 0 28px;
}

/* responsive */
@media (max-width: 900px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }
  .hero-right {
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  .site-header {
    flex-direction: column;
    gap: 6px;
  }
  .nav {
    margin-top: 4px;
  }
  .sim-layout {
    grid-template-columns: 1fr;
  }
}