@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap');

:root{
  --fg: #00e6e6;
  --accent: #ff00ff;
}

body {
  margin: 0;
  background: #000;
  color: var(--fg);
  font-family: 'Ubuntu', sans-serif;
  font-size: 22px;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../images/gibson-bg.png') center center / cover no-repeat;
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

header, footer { text-align: center; padding: 1rem; }
nav { text-align: center; margin-bottom: 0.5rem; }
nav { display: flex; justify-content: center; align-items: center; gap: 1.25rem; }
nav a { color: var(--accent); text-decoration: none; }
nav a:hover { text-decoration: underline; }
nav a.nav-active { color: #40b0ff; text-shadow: 0 0 5px #40b0ff; }
.nav-separator {
  display: inline-block;
  width: 0.9rem;
  height: 7px;
  background: linear-gradient(
    to bottom,
    #0040ff 0px,
    #0040ff 2px,
    transparent 2px,
    transparent 5px,
    #00d0ff 5px,
    #00d0ff 7px
  );
}
.small { opacity: 0.9; }

/* HOME hero panel (unchanged) */
.hero {
  max-width: 1100px;
  margin: 1.25rem auto 0.5rem auto;
  background: rgba(0,0,0,0.85);
  border: 2px solid #0040ff;
}
.hero img { width: 100%; display: block; }
.hero-inner { padding: 1rem 1.25rem 1.25rem 1.25rem; }

/* REAL CRT FRAME (4:3) */
.monitor {
  width: min(92vw, 1440px);
  aspect-ratio: 4 / 3;
  margin: 2rem auto;
  position: relative;
  background: url("../images/crt-frame.png") center / contain no-repeat;
}

/* screen area placement (tuned for the chosen frame image) */
.screen {
  position: absolute;
  left: 21.2%;
  top: 19.8%;
  width: 55.1%;
  height: 47%;
  padding: 1.1rem 1.2rem;
  overflow: auto;
  color: var(--fg);
}

/* darken the baked-in content on the frame's screen, then add CRT effects */
.screen::before{
  content:"";
  position:absolute;
  inset:0;
  background:#000;
  opacity:1;
  pointer-events:none;
  z-index:0;
  border-radius: 18px;
}

/* scanlines + vignette */
.screen::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index: 10;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 75%, rgba(0,0,0,0.6) 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.25),
      rgba(0,0,0,0.25) 2px,
      transparent 2px,
      transparent 4px
    );
  border-radius: 18px;
}

/* content inside screen should be above overlays */
.screen > * { position: relative; z-index: 2; }

.panel {
  border: 2px solid rgba(0,230,230,0.55);
  padding: 0.5rem 1.25rem 1rem 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
  margin-right: 2rem;
  background: rgba(0,0,0,0.10);
  font-size: 18px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.gallery.single-column {
  grid-template-columns: 1fr;
}
.gallery img {
  width: 100%;
  border: 2px solid rgba(0,230,230,0.55);
}
.gallery.single-column img {
  width: 100%;
}

footer { padding-bottom: 2rem; }
footer.footer-close { padding-top: 0; margin-top: -3rem; }

.footer-pager {
  margin-top: 0.5rem;
}
.footer-pager img {
  height: 160px;
  opacity: 0.8;
}

.syncterm-line {
  font-size: 0.85rem;
  color: #0040ff;
  text-decoration: none;
}
.syncterm-line:visited, .syncterm-line:hover, .syncterm-line:active {
  color: #0040ff;
  text-decoration: none;
}
.sync-white {
  color: #ffffff;
}
.sync-light {
  color: #4da6ff;
}


/* --- CRT screen realism --- */
.screen{
  position: absolute;
  left: 21.2%;
  top: 19.8%;
  width: 55.1%;
  height: 47%;
  padding: 1.1rem 1.2rem;
  overflow: auto;
  color: var(--fg);
  border-radius: 18px; /* curvature */
  filter: contrast(1.05) saturate(1.05);
}

/* subtle glass highlight/reflection */
.screen-glass{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index: 3;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,0.08), transparent 45%),
    linear-gradient(135deg, rgba(255,255,255,0.05), transparent 45%);
  mix-blend-mode: screen;
  opacity: 0.65;
}

/* create a faint reflection under the monitor on the desk */
.monitor::after{
  content:"";
  position:absolute;
  left: 16.2%;
  right: 10%;
  bottom: -5%;
  height: 53.5%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.10), transparent 65%);
  filter: blur(8px);
  opacity: 0.35;
  pointer-events:none;
}

/* --- Virtual resolution scaling so content fits CRT --- */
.crt-viewport{
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 2;
}

.crt-canvas{
  width: 750px;
  height: 480px;
  transform-origin: top left;
  transform: scale(var(--crt-scale, 1));
}

/* keep text crisp-ish */
.crt-canvas, .crt-canvas *{
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}


/* ensure screen content is above overlays */
.screen > *{position:relative; z-index:2;}

.crt-canvas h1{
  margin: 0 0 1rem 0;
}

.in-screen-nav{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin: 0 0 0.5rem 0;
}
.in-screen-nav a{
  color: var(--accent);
  text-decoration:none;
}
.in-screen-nav a:hover{ text-decoration:underline; }

.hline{
  margin: 0.5rem 0 0.5rem 0;
}

/* CRT Glitch Title Effect */
.glitch-title {
  position: relative;
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #0040ff;
  text-shadow:
    0 0 5px #0040ff,
    0 0 10px #0040ff;
  animation: flicker 5s infinite;
}

.glitch-title .scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.5) 2px,
    rgba(0, 0, 0, 0.5) 3px
  );
  pointer-events: none;
  z-index: 10;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

.glitch-title::before {
  color: #00d0ff;
  animation: glitch-1 1.5s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch-title::after {
  color: #002080;
  animation: glitch-2 2s infinite linear alternate-reverse;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

/* Dark blue variant */
.glitch-title--dark {
  color: #0040ff;
  text-shadow:
    0 0 5px #0040ff,
    0 0 10px #0040ff;
  font-size: clamp(1rem, 4vw, 1.5rem);
}

.glitch-title--dark::before {
  color: #00d0ff;
}

.glitch-title--dark::after {
  color: #002080;
}

/* Stagger animations for different elements */
header h1.glitch-title {
  animation-delay: 0s;
}
header h1.glitch-title::before { animation-delay: 0s; }
header h1.glitch-title::after { animation-delay: 0s; }

header .small.glitch-title {
  animation-delay: 1.7s;
}
header .small.glitch-title::before { animation-delay: 0.5s; }
header .small.glitch-title::after { animation-delay: 0.8s; }

footer .glitch-title {
  animation-delay: 3.2s;
}
footer .glitch-title::before { animation-delay: 1.1s; }
footer .glitch-title::after { animation-delay: 1.4s; }

@keyframes flicker {
  0%, 92%, 96%, 100% {
    opacity: 1;
    text-shadow:
      0 0 5px #0040ff,
      0 0 10px #0040ff;
  }
  94% {
    opacity: 0.85;
    text-shadow: 0 0 5px #0040ff;
  }
}

@keyframes glitch-1 {
  0%, 60% { transform: translateX(0); }
  65% { transform: translateX(-1px); }
  70% { transform: translateX(1px); }
  75% { transform: translateX(-1px); }
  80%, 100% { transform: translateX(0); }
}

@keyframes glitch-2 {
  0%, 50% { transform: translateX(0); }
  55% { transform: translateX(1px); }
  60% { transform: translateX(-1px); }
  65% { transform: translateX(1px); }
  70%, 100% { transform: translateX(0); }
}

/* Mobile adjustments for screen positioning within monitor frame */
@media (max-width: 1024px) {
  .screen {
    left: 21.15% !important;
    top: 20.2% !important;
    width: 53% !important;
    height: 43% !important;
    border-radius: 12px !important;
  }
}

/* Narrow screen adjustments (e.g., Galaxy Fold folded) */
@media (max-width: 500px) {
  .screen {
    left: 22% !important;
    top: 21% !important;
    width: 47% !important;
    height: 37% !important;
    border-radius: 10px !important;
  }
}
