@font-face {
  font-family: 'Terminal';
  src: url('../fonts/FreeSerif.woff2') format('woff');
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #ffffff;
  --secondary: #666666;
  --warning: #ff3300;
  --text: #ffffff;
  --glow: rgba(255, 255, 255, 0.5);
  --background: #000000;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 10px 30px rgba(0,0,0,0.35);
  --ui-font: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
  background-color: var(--background);
  color: var(--text);
  font-family: 'Terminal', monospace;
  margin: 0;
  padding: 20px;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.boot-sequence,
main {
  position: relative;
  z-index: 1;
}

body.ready {
  overflow: auto;
  height: auto;
}

.boot-sequence {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  font-family: Terminal !important;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeIn 1s forwards;
}

.logo {
  margin-bottom: 20px;
  text-align: center;
}

.logo img {
  max-width: 200px;
  height: auto;
}

.version {
  color: var(--text);
  font-size: 0.9em;
  opacity: 0.8;
}

.system-info {
  color: var(--text);
  font-size: 0.85em;
  margin-top: 10px;
  font-family: monospace;
  letter-spacing: 1px;
  opacity: 0.7;
}

#boot-logs {
  margin-top: 10px;
}

.boot-log {
  font-size: 1em;
  line-height: 1.5;
  opacity: 0;
  padding-left: 10px;
  border-left: 2px solid var(--primary);
  margin: 5px 0;
  text-shadow: 0 0 5px var(--glow);
  font-family: 'Terminal', monospace !important;
}

.boot-log.show {
  animation: fadeIn 0.5s forwards;
}

.boot-log.success::before {
  content: "[OK] ";
  color: var(--primary);
  font-weight: bold;
}

.boot-log.warning::before {
  content: "[!!] ";
  color: var(--warning);
  text-shadow: 0 0 5px rgba(255, 51, 0, 0.5);
}

.boot-log.info::before {
  content: "[--] ";
  color: var(--text);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.memory-check {
  margin: 20px 0;
  font-family: monospace;
}

.memory-block {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 1px;
  background: var(--secondary);
  opacity: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: memoryTest 0.15s ease-in-out forwards;
}

@keyframes memoryTest {
  0% { 
    background: #ff0000; 
    opacity: 1;
    box-shadow: 0 0 3px #ff0000;
  }
  50% { 
    background: #ff9999;
    opacity: 0.9;
    box-shadow: 0 0 4px #ff9999;
  }
  100% { 
    background: #ffffff;
    opacity: 0.8;
    box-shadow: 0 0 5px #ffffff;
  }
}

.progress {
  width: 100%;
  height: 2px;
  background: var(--secondary);
  margin: 30px 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-bar {
  width: 100%;
  height: 100%;
  background: var(--primary);
  box-shadow: 0 0 20px var(--glow);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  animation: progress 4s linear forwards;
}

@keyframes progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.status {
  text-align: center;
  color: var(--primary);
  font-size: 1.2em;
  margin-top: 20px;
  opacity: 0;
  animation: fadeIn 1s forwards;
  animation-delay: 4s;
  text-shadow: 0 0 10px var(--glow);
  font-weight: bold;
  letter-spacing: 2px;
}

.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #fff;
  mix-blend-mode: screen;
  opacity: 0.9;
  z-index: 9999;
  pointer-events: none;
  animation: scanline 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: 3.8s;
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}

.scanline::before,
.scanline::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.scanline::before {
  top: -3px;
  height: 6px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(255,255,255,0));
  filter: blur(0.3px);
}

.scanline::after {
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,0,76,0.25), rgba(0,242,255,0.25));
  mix-blend-mode: screen;
}

@keyframes scanline {
  0%   { transform: translateY(0) translateX(0); opacity: 0.95; }
  10%  { transform: translateY(10vh) translateX(0.3px); }
  20%  { transform: translateY(20vh) translateX(-0.3px); }
  30%  { transform: translateY(30vh) translateX(0.25px); }
  40%  { transform: translateY(40vh) translateX(-0.25px); }
  50%  { transform: translateY(50vh) translateX(0.2px); }
  60%  { transform: translateY(60vh) translateX(-0.2px); }
  70%  { transform: translateY(70vh) translateX(0.15px); }
  80%  { transform: translateY(80vh) translateX(-0.15px); }
  90%  { transform: translateY(90vh) translateX(0.1px); }
  100% { transform: translateY(100vh) translateX(0); opacity: 0; }
}

.click-prompt {
  text-align: center;
  color: var(--primary);
  font-size: 1em;
  margin-top: 15px;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
  animation-delay: 4.5s;
  text-shadow: 0 0 5px var(--glow);
}

.hidden { display: none !important; }

.menu {
  padding: 20px;
  opacity: 0;
  transform: translateY(10px);
}
.menu.show {
  animation: fadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.12s;
}

.menu-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  justify-content: center;
  text-align: center;
  transform: translateY(8px);
  opacity: 0;
}
.menu-header.show {
  animation: fadeIn 0.6s ease-out forwards;
  animation-delay: 0.22s;
}


.nick {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 2.5rem;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(255,255,255,0.4);
  overflow: hidden;
  white-space: nowrap;
}


.menu-header .nick {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #ffffff 0%, #aee9ff 50%, #ffffff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 6px rgba(255,255,255,0.25);
  animation: none;
  display: inline-block;
  position: relative;
}

.menu-header .nick.sync-glow {
  filter: drop-shadow(0 0 0 rgba(255,255,255,0));
  animation: logoPulse 3.5s ease-in-out infinite;
  will-change: filter;
}

.menu-header .nick::before,
.menu-header .nick::after {
  content: none;
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  display: none;
}

.menu-header .nick::before { content: none; animation: none; }

.menu-header .nick::after { content: none; animation: none; }


@keyframes shimmerGrad {
  0%   { background-position: 0% 0; }
  50%  { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}


@keyframes shiftFlicker {
  0%,40%,44%,58%,61%,65%,69%,73%,100% { transform: skewX(0deg) skewY(0deg); }
  41% { transform: skewX(10deg) skewY(0deg); }
  42% { transform: skewX(-10deg) skewY(0deg); }
  59% { transform: skewX(40deg) skewY(10deg); }
  60% { transform: skewX(-40deg) skewY(-10deg); }
  63% { transform: skewX(10deg) skewY(-5deg); }
  70% { transform: skewX(-50deg) skewY(-20deg); }
  71% { transform: skewX(10deg) skewY(-10deg); }
}

@keyframes glitchTop {
  0%   { clip-path: inset(0 0 90% 0); transform: translate(0,0) skewX(0deg); opacity: 0.8; }
  12%  { clip-path: inset(10% 0 70% 0); transform: translate(-1px,-1px) skewX(-0.4deg); opacity: 0.9; }
  24%  { clip-path: inset(6% 0 62% 0); transform: translate(1px,1px) skewX(0.3deg); }
  38%  { clip-path: inset(18% 0 56% 0); transform: translate(-1px,0) skewX(-0.3deg); }
  54%  { clip-path: inset(26% 0 48% 0); transform: translate(1px,-1px) skewX(0.4deg); }
  70%  { clip-path: inset(12% 0 70% 0); transform: translate(-1px,1px) skewX(-0.3deg); }
  86%  { clip-path: inset(6% 0 82% 0); transform: translate(0,1px) skewX(0.2deg); }
  100% { clip-path: inset(0 0 90% 0); transform: translate(0,0) skewX(0deg); opacity: 0.85; }
}

@keyframes glitchBottom {
  0%   { clip-path: inset(90% 0 0 0); transform: translate(0,0) skewX(0deg); opacity: 0.8; }
  12%  { clip-path: inset(70% 0 10% 0); transform: translate(1px,1px) skewX(0.4deg); opacity: 0.9; }
  24%  { clip-path: inset(62% 0 6% 0); transform: translate(-1px,-1px) skewX(-0.3deg); }
  38%  { clip-path: inset(56% 0 18% 0); transform: translate(1px,0) skewX(0.3deg); }
  54%  { clip-path: inset(48% 0 26% 0); transform: translate(-1px,1px) skewX(-0.4deg); }
  70%  { clip-path: inset(70% 0 12% 0); transform: translate(1px,-1px) skewX(0.3deg); }
  86%  { clip-path: inset(82% 0 6% 0); transform: translate(0,-1px) skewX(-0.2deg); }
  100% { clip-path: inset(90% 0 0 0); transform: translate(0,0) skewX(0deg); opacity: 0.85; }
}

@keyframes tvSkew {
  0%, 10%  { transform: skewX(0deg) translateX(0); }
  11%      { transform: skewX(-0.4deg) translateX(-0.3px); }
  12%      { transform: skewX(0.4deg) translateX(0.3px); }
  13%, 50% { transform: skewX(0deg) translateX(0); }
  51%      { transform: skewX(0.35deg) translateX(0.2px); }
  52%      { transform: skewX(-0.35deg) translateX(-0.2px); }
  53%,100% { transform: skewX(0deg) translateX(0); }
}

@keyframes noiseClipA {
  0%   { clip-path: inset(0 0 92% 0); }
  5%   { clip-path: inset(12% 0 60% 0); }
  10%  { clip-path: inset(6% 0 70% 0); }
  15%  { clip-path: inset(22% 0 50% 0); }
  20%  { clip-path: inset(14% 0 62% 0); }
  25%  { clip-path: inset(30% 0 40% 0); }
  30%  { clip-path: inset(44% 0 32% 0); }
  35%  { clip-path: inset(36% 0 44% 0); }
  40%  { clip-path: inset(52% 0 26% 0); }
  45%  { clip-path: inset(62% 0 20% 0); }
  50%  { clip-path: inset(70% 0 14% 0); }
  55%  { clip-path: inset(58% 0 22% 0); }
  60%  { clip-path: inset(76% 0 10% 0); }
  65%  { clip-path: inset(82% 0 6% 0); }
  70%  { clip-path: inset(68% 0 18% 0); }
  75%  { clip-path: inset(40% 0 40% 0); }
  80%  { clip-path: inset(24% 0 56% 0); }
  85%  { clip-path: inset(10% 0 76% 0); }
  90%  { clip-path: inset(4% 0 84% 0); }
  100% { clip-path: inset(0 0 92% 0); }
}

@keyframes noiseClipB {
  0%   { clip-path: inset(92% 0 0 0); }
  5%   { clip-path: inset(60% 0 12% 0); }
  10%  { clip-path: inset(70% 0 6% 0); }
  15%  { clip-path: inset(50% 0 22% 0); }
  20%  { clip-path: inset(62% 0 14% 0); }
  25%  { clip-path: inset(40% 0 30% 0); }
  30%  { clip-path: inset(32% 0 44% 0); }
  35%  { clip-path: inset(44% 0 36% 0); }
  40%  { clip-path: inset(26% 0 52% 0); }
  45%  { clip-path: inset(20% 0 62% 0); }
  50%  { clip-path: inset(14% 0 70% 0); }
  55%  { clip-path: inset(22% 0 58% 0); }
  60%  { clip-path: inset(10% 0 76% 0); }
  65%  { clip-path: inset(6% 0 82% 0); }
  70%  { clip-path: inset(18% 0 68% 0); }
  75%  { clip-path: inset(40% 0 40% 0); }
  80%  { clip-path: inset(56% 0 24% 0); }
  85%  { clip-path: inset(76% 0 10% 0); }
  90%  { clip-path: inset(84% 0 4% 0); }
  100% { clip-path: inset(92% 0 0 0); }
}

.menu-items {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
}
.menu-items.show {
  animation: fadeIn 0.6s ease-out forwards;
  animation-delay: 0.32s;
}

.menu-item {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 14px;
  font-family: 'Terminal', monospace;
  font-size: 0.95rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(255,255,255,0.08);
  opacity: 0;
  transform: translateY(6px);
  will-change: transform, opacity;
  position: relative;
  overflow: hidden;
}

.menu-item:hover, .menu-item:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--glow);
  transform: translateY(-1px);
}

.menu-item:active {
  transform: translateY(0) scale(0.98);
}

.menu-item.show {
  animation: fadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.menu-item.show:nth-child(1) { animation-delay: 0.42s; }
.menu-item.show:nth-child(2) { animation-delay: 0.54s; }

.menu-panel {
  border: 1px solid rgba(255,255,255,0.2);
  padding: 16px;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 0 16px var(--glow);
  display: none;
}

.menu-panel.show { opacity: 1; transform: none; pointer-events: auto; display: block; }

.panel-content { display: flex; gap: 24px; }
.team-list { min-width: 220px; }
.team-list h2 { margin: 0 0 8px 0; font-size: 1.1rem; }
.nick-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: block;
}

.nick-list li {
  display: block;
  width: fit-content;
  padding: 6px 12px;
  margin: 6px 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 4px var(--glow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.nick-list li:hover {
  box-shadow: 0 0 7px var(--glow);
  border-color: var(--primary);
}

.story pre {
  margin: 10px 0 0 0;
  padding: 12px 14px;
  background: #0e0e0f;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #e6e6e6;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre;
  overflow-x: auto;
  box-shadow: 0 0 12px var(--glow);
}

.story code { font-family: monospace; }
.story { flex: 1; opacity: 0.9; }

#boot-logo { max-width: 200px; height: auto; }

#boot-logo,
.logo img {
  filter: drop-shadow(0 0 0 rgba(255,255,255,0));
  animation: logoPulse 3.5s ease-in-out infinite;
}

@keyframes logoPulse {
  0%   { filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  50%  { filter: drop-shadow(0 0 16px rgba(255,255,255,0.8)); }
  100% { filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
}

.menu,
.menu-header .nick,
.menu-item,
.menu-panel,
.team-list,
.team-list h2,
.nick-list,
.nick-list li,
.story {
  font-family: var(--ui-font);
}

.menu-panel,
.menu-panel .team-list,
.menu-panel .team-list h2,
.menu-panel .nick-list li,
.menu-panel .story,
.menu-item { font-weight: 700; }

.glitch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(255,255,255,0.06) 2px,
    rgba(255,255,255,0.06) 3px
  );
  animation: flicker 4s ease-in-out infinite;
  will-change: opacity;
}


@keyframes flicker {
  0%, 100% { opacity: 0.12; }
  10% { opacity: 0.18; }
  20% { opacity: 0.10; }
  30% { opacity: 0.20; }
  40% { opacity: 0.14; }
  50% { opacity: 0.22; }
  60% { opacity: 0.12; }
  70% { opacity: 0.18; }
  80% { opacity: 0.16; }
  90% { opacity: 0.20; }
}

.proof-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 220ms ease;
}

.proof-overlay.show { display: flex; opacity: 1; }

#proof-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(255,255,255,0.25);
  transform: scale(0.98);
  transition: transform 220ms ease;
}

.proof-overlay.show #proof-img { transform: scale(1); }

.proof-highlight {
  color: #bffcff;
  text-decoration: none;
  text-shadow: 0 0 8px #4ffaff, 0 0 16px #4ffaff, 0 0 24px rgba(79,250,255,0.7);
  cursor: zoom-in;
  transition: text-shadow 180ms ease, color 180ms ease, opacity 180ms ease;
  animation: linkPulse 2.2s ease-in-out infinite;
}
.proof-highlight:hover { text-shadow: 0 0 12px #88fdff, 0 0 24px #88fdff, 0 0 34px rgba(136,253,255,0.8); color: #eaffff; opacity: 1; }

@keyframes linkPulse {
  0% { text-shadow: 0 0 6px #42eaff, 0 0 12px #42eaff, 0 0 18px rgba(66,234,255,0.6); }
  50% { text-shadow: 0 0 10px #4ffaff, 0 0 20px #4ffaff, 0 0 30px rgba(79,250,255,0.8); }
  100% { text-shadow: 0 0 6px #42eaff, 0 0 12px #42eaff, 0 0 18px rgba(66,234,255,0.6); }
}


.proof-overlay { transition: opacity 320ms cubic-bezier(0.22, 1, 0.36, 1); cursor: zoom-out; }
#proof-img {
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  filter: blur(6px);
  transition: none;
  will-change: transform, opacity, filter;
}
.proof-overlay.show #proof-img { animation: iosProofPop 420ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.proof-overlay:not(.show) #proof-img {
  opacity: 0;
  transform: translateY(6px) scale(0.985);
  filter: blur(6px);
  transition: transform 180ms ease, opacity 180ms ease, filter 180ms ease;
}
@keyframes iosProofPop {
  0% { opacity: 0; transform: translateY(12px) scale(0.985); filter: blur(6px); }
  60% { opacity: 1; transform: translateY(0) scale(1.02); filter: blur(2px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.menu-panel .team-list h2,
.menu-panel .story,
.menu-panel .nick-list li,
.menu-panel .story p,
.menu-panel .story pre {
  opacity: 0;
  transform: translateY(6px);
}

.menu-panel.show .team-list h2 { animation: fadeIn 0.45s ease-out forwards; animation-delay: 0.06s; }
.menu-panel.show .story { animation: fadeIn 0.5s ease-out forwards; animation-delay: 0.22s; }
.menu-panel.show .story p { animation: fadeIn 0.5s ease-out forwards; animation-delay: 0.26s; }
.menu-panel.show .story pre { animation: fadeIn 0.5s ease-out forwards; animation-delay: 0.32s; }
.menu-panel.show .nick-list li { animation: fadeIn 0.4s ease-out forwards; }
.menu-panel.show .nick-list li:nth-child(1) { animation-delay: 0.10s; }
.menu-panel.show .nick-list li:nth-child(2) { animation-delay: 0.16s; }
.menu-panel.show .nick-list li:nth-child(3) { animation-delay: 0.22s; }
.menu-panel.show .nick-list li:nth-child(4) { animation-delay: 0.28s; }
.menu-panel.show .nick-list li:nth-child(5) { animation-delay: 0.34s; }
.menu-panel.show .nick-list li:nth-child(6) { animation-delay: 0.40s; }
.menu-panel.show .nick-list li:nth-child(7) { animation-delay: 0.46s; }
.menu-panel.show .nick-list li:nth-child(8) { animation-delay: 0.52s; }

@media (prefers-reduced-motion: reduce) {
  .scanline { animation-duration: 0.01s !important; }
  .glitch-overlay { animation: none !important; }
  .progress-bar { animation-duration: 0.2s !important; }
  .memory-block { animation-duration: 0.05s !important; }
  #proof-img { filter: none !important; }
}
