/* HIBRIDA-HUB
   Structure: classic 2000s portal
   Atmosphere: Locomotion digital + liminal dreamcore + living glitch
*/

:root {
  --bg: #07070c;
  --bg-panel: #0e0e16;
  --bg-box: #12121c;
  --bg-inset: #08080f;
  --border: #2a2a3a;
  --border-light: #3a3a50;
  --text: #c8c8d8;
  --text-dim: #7a7a90;
  --text-mute: #4a4a5c;
  --accent: #7ec8c8;
  --accent2: #c97b9a;
  --accent3: #d4b85a;
  --ok: #6aaa7a;
  --link: #8ab4e8;
  --link-visited: #a88ad0;
  --glow: rgba(126, 200, 200, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  font-family: "Verdana", "Arial", "Helvetica", sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(ellipse at 15% 10%, rgba(126, 200, 200, 0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 90%, rgba(201, 123, 154, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(212, 184, 90, 0.03) 0%, transparent 60%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: filter 0.08s;
}

/* living grain + scan */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.035) 2px,
      rgba(0, 0, 0, 0.035) 4px
    );
  z-index: 9998;
  opacity: 0.55;
  animation: scanMove 8s linear infinite;
}

body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  z-index: 9999;
  opacity: 0.6;
  animation: noiseShift 0.4s steps(2) infinite;
}

@keyframes scanMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

@keyframes noiseShift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, -1px); }
}

/* GLITCH STATES triggered by JS */
body.glitching {
  filter: hue-rotate(15deg) contrast(1.15) saturate(1.3);
}
body.glitching::before {
  opacity: 0.9;
  animation: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(126, 200, 200, 0.08),
    rgba(126, 200, 200, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
}

body.glitching-strong {
  filter: hue-rotate(40deg) contrast(1.4) saturate(1.6) blur(0.4px);
  animation: hardGlitch 0.28s steps(3);
}

@keyframes hardGlitch {
  0% { transform: translate(0); }
  20% { transform: translate(-4px, 1px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, -1px); }
  100% { transform: translate(0); }
}

/* outer frame */
.page-table {
  width: 100%;
  max-width: 940px;
  margin: 14px auto;
  border-collapse: collapse;
  background: var(--bg-panel);
  border: 2px outset #3a3a50;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.65), 0 0 90px var(--glow);
  position: relative;
  animation: framePulse 7s ease-in-out infinite;
}

@keyframes framePulse {
  0%, 100% { box-shadow: 0 0 40px rgba(0, 0, 0, 0.65), 0 0 90px var(--glow); }
  50% { box-shadow: 0 0 40px rgba(0, 0, 0, 0.65), 0 0 110px rgba(126, 200, 200, 0.28); }
}

/* HEADER */
.header-cell {
  background: linear-gradient(180deg, #161622 0%, #0e0e16 100%);
  border-bottom: 2px solid var(--border);
  padding: 11px 14px;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
}

.header-cell::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(126, 200, 200, 0.06), transparent);
  animation: headerSweep 9s ease-in-out infinite;
}

@keyframes headerSweep {
  0%, 100% { left: -100%; }
  50% { left: 120%; }
}

.header-cell table {
  width: 100%;
  border-collapse: collapse;
  position: relative;
  z-index: 1;
}

.logo-cell {
  width: 54px;
  vertical-align: middle;
}

.logo-cell img {
  width: 44px;
  height: 44px;
  display: block;
  border: 1px solid var(--border-light);
  box-shadow: 0 0 14px var(--glow);
  filter: drop-shadow(0 0 5px rgba(126, 200, 200, 0.45));
  transition: filter 0.3s, transform 0.3s;
  animation: eyeFloat 5.5s ease-in-out infinite;
}

.logo-cell img.eye-pulse {
  animation: eyePulse 0.6s ease-out;
  filter: drop-shadow(0 0 12px rgba(201, 123, 154, 0.8)) brightness(1.3);
}

@keyframes eyeFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.03); }
}

@keyframes eyePulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.18) rotate(-3deg); }
  100% { transform: scale(1); }
}

.title-cell {
  vertical-align: middle;
  padding-left: 12px;
}

.site-name {
  font-family: "Courier New", Courier, monospace;
  font-size: 21px;
  font-weight: bold;
  color: #eef0f8;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 18px var(--glow);
  position: relative;
  display: inline-block;
}

/* glitch text on hover for title */
.site-name:hover {
  animation: textGlitch 0.35s steps(2) infinite;
}

@keyframes textGlitch {
  0% { text-shadow: 2px 0 #c97b9a, -2px 0 #7ec8c8; transform: translate(0); }
  25% { text-shadow: -2px 0 #c97b9a, 2px 0 #7ec8c8; transform: translate(1px, -1px); }
  50% { text-shadow: 2px 0 #7ec8c8, -2px 0 #c97b9a; transform: translate(-1px, 1px); }
  75% { text-shadow: -1px 0 #d4b85a, 1px 0 #c97b9a; transform: translate(1px, 0); }
  100% { text-shadow: 2px 0 #c97b9a, -2px 0 #7ec8c8; transform: translate(0); }
}

.site-sub {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 1.5px;
  margin-top: 3px;
  opacity: 0.9;
  animation: subFlicker 4s ease-in-out infinite;
}

@keyframes subFlicker {
  0%, 90%, 100% { opacity: 0.9; }
  92% { opacity: 0.4; }
  94% { opacity: 1; }
  96% { opacity: 0.5; }
}

/* STATUS */
.status-row {
  background: #0a0a12;
  border-bottom: 1px solid var(--border);
  padding: 5px 12px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  color: var(--ok);
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.status-row .blink {
  animation: blink 1.1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* SIDEBAR */
.sidebar {
  width: 168px;
  background: linear-gradient(90deg, #0c0c14 0%, #101018 100%);
  border-right: 2px solid var(--border);
  padding: 0;
  vertical-align: top;
  position: relative;
}

.nav-title {
  background: #181824;
  color: var(--accent);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  position: relative;
}

.nav-title::before {
  content: "▶ ";
  animation: navPulse 2.2s steps(1) infinite;
  color: var(--accent2);
}

@keyframes navPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  border-bottom: 1px solid #15151f;
}

.nav-list a {
  display: block;
  padding: 8px 11px;
  color: #b0b0c4;
  text-decoration: none;
  font-size: 11px;
  font-family: "Verdana", Arial, sans-serif;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s, text-shadow 0.12s;
  position: relative;
}

.nav-list a:hover {
  background: #161622;
  color: #ffffff;
  border-left-color: var(--accent);
  text-shadow: 0 0 8px var(--glow);
}

.nav-list a.active {
  background: #161622;
  color: #ffffff;
  border-left-color: var(--accent2);
  font-weight: bold;
  box-shadow: inset 0 0 20px rgba(201, 123, 154, 0.08);
}

.nav-section {
  margin-top: 10px;
}

.sidebar-box {
  margin: 12px 9px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  padding: 8px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: "Courier New", Courier, monospace;
  line-height: 1.45;
  position: relative;
  overflow: hidden;
}

.sidebar-box::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(126, 200, 200, 0.04) 100%);
  pointer-events: none;
  animation: boxBreath 6s ease-in-out infinite;
}

@keyframes boxBreath {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.sidebar-box .title {
  color: var(--accent);
  margin-bottom: 5px;
  border-bottom: 1px dotted var(--border);
  padding-bottom: 4px;
  letter-spacing: 1px;
}

/* CONTENT */
.content {
  padding: 16px 18px 32px 18px;
  background: var(--bg-panel);
  vertical-align: top;
  position: relative;
}

.page-title {
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  color: #eef0f8;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 7px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  text-shadow: 0 0 12px var(--glow);
  position: relative;
  display: inline-block;
}

.page-title:hover {
  animation: textGlitch 0.4s steps(2) infinite;
}

.page-intro {
  color: var(--text-dim);
  font-size: 11px;
  margin-bottom: 16px;
  max-width: 500px;
  line-height: 1.55;
}

/* BOXES */
.box {
  border: 2px outset var(--border-light);
  background: var(--bg-box);
  padding: 11px 12px;
  margin-bottom: 14px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.box:hover {
  border-color: #4a4a65;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25), 0 0 20px rgba(126, 200, 200, 0.06);
}

.box-inset {
  border: 2px inset #252535;
  background: var(--bg-inset);
  padding: 9px 11px;
  margin-bottom: 13px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  color: #a0a0b8;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

.box-inset::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.35;
  animation: lineScan 3.5s linear infinite;
}

@keyframes lineScan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.box-title {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 7px;
  border-bottom: 1px dotted var(--border);
  padding-bottom: 4px;
}

/* WORK CARDS */
.work-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.work-table td {
  border: 1px solid var(--border);
  background: #10101a;
  padding: 9px 10px;
  vertical-align: top;
  width: 50%;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  position: relative;
}

.work-table td:hover {
  border-color: var(--accent);
  background: #141428;
  box-shadow: inset 0 0 25px rgba(126, 200, 200, 0.06);
}

.work-table td:hover .work-title {
  color: #ffffff;
  text-shadow: 0 0 8px var(--glow);
}

.work-meta {
  font-family: "Courier New", Courier, monospace;
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.6px;
  margin-bottom: 3px;
}

.work-title {
  font-size: 12px;
  color: #e8e8f0;
  margin-bottom: 3px;
  transition: color 0.15s, text-shadow 0.15s;
}

.work-desc {
  font-size: 10px;
  color: var(--text-dim);
}

/* DIARY */
.entry {
  border-bottom: 1px dotted var(--border);
  padding: 9px 0;
  margin-bottom: 3px;
  transition: background 0.15s;
}

.entry:hover {
  background: rgba(126, 200, 200, 0.03);
}

.entry-date {
  font-family: "Courier New", Courier, monospace;
  font-size: 9px;
  color: var(--accent3);
  letter-spacing: 0.5px;
}

.entry-title {
  font-size: 12px;
  color: #e0e0ec;
  margin: 3px 0;
}

.entry-text {
  font-size: 11px;
  color: var(--text-dim);
}

/* LINKS */
a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.12s, text-shadow 0.12s;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px var(--glow);
}

/* MONO */
.mono {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  background: #06060c;
  border: 1px solid var(--border);
  padding: 9px 11px;
  color: #a8a8c0;
  white-space: pre-wrap;
  margin: 10px 0;
  line-height: 1.45;
  position: relative;
}

.mono .hl { color: #eef0f8; }
.mono .ok { color: var(--ok); }
.mono .err { color: #c07070; }
.mono .accent { color: var(--accent); }

/* PRODUCTS */
.product {
  border: 2px outset var(--border-light);
  background: var(--bg-box);
  padding: 11px 12px;
  margin-bottom: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.product:hover {
  border-color: #4a4a65;
  box-shadow: 0 0 18px rgba(126, 200, 200, 0.07);
}

.product-id {
  font-family: "Courier New", Courier, monospace;
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.8px;
}

.product-name {
  font-size: 13px;
  color: #eef0f8;
  margin: 4px 0;
}

.product-desc {
  font-size: 11px;
  color: var(--text-dim);
}

.product-price {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  color: var(--ok);
  margin-top: 7px;
}

/* LAB */
.lab-frame {
  border: 2px inset #252535;
  background: #05050a;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  margin: 9px 0;
  position: relative;
  overflow: hidden;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(126, 200, 200, 0.05) 0%, transparent 65%);
}

.lab-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(126, 200, 200, 0.02) 8px,
    rgba(126, 200, 200, 0.02) 16px
  );
  animation: labShift 12s linear infinite;
}

@keyframes labShift {
  0% { transform: translateX(0); }
  100% { transform: translateX(22px); }
}

/* FOOTER */
.footer-cell {
  background: #0c0c14;
  border-top: 2px solid var(--border);
  padding: 9px 14px;
  font-family: "Courier New", Courier, monospace;
  font-size: 9px;
  color: var(--text-mute);
  text-align: center;
  letter-spacing: 0.4px;
}

.footer-cell a {
  color: var(--text-dim);
}

/* construction */
.construction {
  border: 1px dashed #4a4a30;
  background: rgba(40, 35, 10, 0.5);
  color: #c8b86a;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  padding: 7px 10px;
  margin: 12px 0;
  text-align: center;
  letter-spacing: 0.5px;
  animation: constructionPulse 3.5s ease-in-out infinite;
}

@keyframes constructionPulse {
  0%, 100% { opacity: 0.75; border-color: #4a4a30; }
  50% { opacity: 1; border-color: #6a6a40; }
}

/* floating particles (decorative, pure CSS) */
.particles {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.25;
  animation: floatUp linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-duration: 14s; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; animation-duration: 18s; animation-delay: 2s; background: var(--accent2); }
.particle:nth-child(3) { left: 45%; animation-duration: 12s; animation-delay: 4s; }
.particle:nth-child(4) { left: 65%; animation-duration: 16s; animation-delay: 1s; background: var(--accent3); }
.particle:nth-child(5) { left: 80%; animation-duration: 20s; animation-delay: 3s; }
.particle:nth-child(6) { left: 90%; animation-duration: 13s; animation-delay: 5s; background: var(--accent2); }

@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0.5); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-20px) scale(1.2); opacity: 0; }
}

/* helpers */
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.small { font-size: 10px; }
.mt { margin-top: 11px; }
.mb { margin-bottom: 11px; }
.center { text-align: center; }

hr.dotted {
  border: none;
  border-top: 1px dotted var(--border);
  margin: 13px 0;
}

/* responsive */
@media (max-width: 680px) {
  .page-table {
    margin: 0;
    border: none;
    box-shadow: none;
    animation: none;
  }
  .sidebar {
    width: 100% !important;
    border-right: none;
    border-bottom: 2px solid var(--border);
  }
  .nav-list {
    display: flex;
    flex-wrap: wrap;
  }
  .nav-list li {
    border-bottom: none;
    border-right: 1px solid #15151f;
  }
  .nav-list a {
    padding: 7px 9px;
    font-size: 10px;
  }
  .work-table td {
    display: block;
    width: 100%;
  }
  body::before, body::after {
    opacity: 0.35;
  }
  .particles { display: none; }
}

/* ========== GALLERY (CHANNELS) ========== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.gallery-item {
  border: 1px solid var(--border);
  background: #0c0c14;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.gallery-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(126, 200, 200, 0.12);
  transform: translateY(-2px);
}

.gallery-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #08080f;
  filter: contrast(1.05) saturate(0.95);
  transition: filter 0.25s, transform 0.4s;
}

.gallery-item:hover .gallery-thumb {
  filter: contrast(1.15) saturate(1.1) brightness(1.05);
  transform: scale(1.03);
}

.gallery-info {
  padding: 7px 9px 9px;
  border-top: 1px solid var(--border);
  background: #101018;
}

.gallery-meta {
  font-family: "Courier New", Courier, monospace;
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.gallery-title {
  font-size: 11px;
  color: #e0e0ec;
  line-height: 1.3;
}

.gallery-item:hover .gallery-title {
  color: #ffffff;
  text-shadow: 0 0 6px var(--glow);
}

/* empty state */
.gallery-empty {
  border: 1px dashed var(--border);
  padding: 28px 16px;
  text-align: center;
  color: var(--text-mute);
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* larger featured on channels index if needed */
.gallery-item.featured {
  grid-column: span 2;
}
.gallery-item.featured .gallery-thumb {
  aspect-ratio: 16 / 9;
}

@media (max-width: 500px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .gallery-item.featured {
    grid-column: span 2;
  }
}
