/* ==========================================================================
   karcz.net // Stylesheet
   Artistic Retro-Futuristic Terminal & Geometric Coming Soon Website
   Fonts: Noto Mono (Main) + PixelZone (Accent)
   ========================================================================== */

/* --- LOCAL FONT DECLARATIONS --- */
@font-face {
  font-family: 'Noto Mono';
  src: url('../fonts/NotoMono-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PixelZone';
  src: url('../fonts/Pixelzone.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --- ROOT VARIABLES: MINIMAL VOID (LIGHT MODE - DEFAULT) --- */
:root {
  /* Default: Reversed Minimal Void (Light Mode) */
  --bg-color: #f7f7f9;
  --bg-gradient: radial-gradient(circle at 50% 50%, #ffffff 0%, #ececee 100%);
  --text-main: #0c0d10;
  --text-dim: #70717a;
  --text-glow: rgba(0, 0, 0, 0.08);
  --accent-color: #0c0d10;
  --accent-glow: 0 0 10px rgba(0, 0, 0, 0.2);
  --accent-secondary: #4a4b52;
  --ok-color: #0c0d10;
  --warn-color: #666666;
  --border-color: rgba(12, 13, 16, 0.18);
  --border-hover: rgba(12, 13, 16, 0.85);

  /* Particle Canvas Colors (Light Mode) */
  --canvas-node: #0c0d10;
  --canvas-line: rgba(12, 13, 16, 0.12);
  --canvas-shape: rgba(12, 13, 16, 0.42);
  --canvas-mesh: rgba(12, 13, 16, 0.035);

  /* Fonts */
  --font-mono: 'Noto Mono', 'Courier New', Courier, monospace;
  --font-term: 'Noto Mono', monospace;
  --font-display: 'Noto Mono', monospace;
  --font-accent: 'PixelZone', 'Noto Mono', monospace;
}

/* Theme: Minimal Void (Dark Mode) */
body.theme-dark {
  --bg-color: #000000;
  --bg-gradient: radial-gradient(circle at 50% 50%, #0d0d10 0%, #000000 100%);
  --text-main: #f0f0f4;
  --text-dim: #6e7078;
  --text-glow: rgba(255, 255, 255, 0.22);
  --accent-color: #ffffff;
  --accent-glow: 0 0 12px rgba(255, 255, 255, 0.6);
  --accent-secondary: #aaaaaa;
  --ok-color: #ffffff;
  --warn-color: #cccccc;
  --border-color: rgba(255, 255, 255, 0.22);
  --border-hover: rgba(255, 255, 255, 0.85);

  /* Particle Canvas Colors (Dark Mode) */
  --canvas-node: #ffffff;
  --canvas-line: rgba(255, 255, 255, 0.14);
  --canvas-shape: rgba(255, 255, 255, 0.45);
  --canvas-mesh: rgba(255, 255, 255, 0.03);
}

/* --- BASE RESETS & STYLING --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  background: var(--bg-gradient);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background: var(--accent-color);
  color: var(--bg-color);
}

/* --- BACKGROUND CANVAS --- */
#art-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

body.show-canvas #art-canvas {
  opacity: 1;
  visibility: visible;
}

/* --- CRT SCANLINES & SCREEN FX (TONED DOWN BY 20%) --- */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

body.crt-enabled .crt-overlay {
  opacity: 0.8; /* Toned down 20% from 1.0 */
}

.crt-scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.08) 50%
  ),
  linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.015),
    rgba(0, 0, 0, 0.005),
    rgba(0, 0, 0, 0.015)
  );
  background-size: 100% 3px, 6px 100%;
}

body.theme-dark .crt-scanlines {
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%,
    rgba(0, 0, 0, 0.28) 50%
  ),
  linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.02),
    rgba(0, 255, 0, 0.008),
    rgba(0, 0, 255, 0.02)
  );
  background-size: 100% 3px, 6px 100%;
}

.crt-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 70%,
    rgba(0, 0, 0, 0.12) 100%
  );
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.08);
}

body.theme-dark .crt-vignette {
  background: radial-gradient(
    ellipse at center,
    transparent 65%,
    rgba(0, 0, 0, 0.64) 100%
  );
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.72);
}

.crt-flicker {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 28, 0.015);
  animation: flicker 0.18s infinite;
  opacity: 0.64; /* Toned down from 0.8 */
}

@keyframes flicker {
  0% { opacity: 0.6; }
  50% { opacity: 0.76; }
  100% { opacity: 0.6; }
}

/* --- MAIN CONTAINER & SCREENS --- */
#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
  pointer-events: none;
}

.screen.screen-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================================================
   STAGE 0: STANDBY SCREEN (ENTER BUTTON)
   ========================================================================== */
#screen-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070a;
  color: #f0f0f4;
  z-index: 20;
  transition: none;
}

.intro-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
  padding: 3.5rem 4.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(10, 13, 20, 0.85);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  max-width: 580px;
  width: 90%;
}

.intro-box:hover {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 45px rgba(255, 255, 255, 0.12), inset 0 0 30px rgba(255, 255, 255, 0.05);
}

.intro-header {
  font-family: var(--font-accent);
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  color: #8c8d96;
}

.intro-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.16em;
  color: #f5f5f7;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
}

.intro-action {
  margin-top: 0.5rem;
}

.btn-enter {
  font-size: 1.75rem;
  padding: 0.8rem 2.6rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  letter-spacing: 0.25em;
  color: #ffffff;
  animation: enterPulse 2s infinite alternate ease-in-out;
  cursor: pointer;
  transition: all 0.25s ease;
}

@keyframes enterPulse {
  0% {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.85);
  }
}

.btn-enter:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

.intro-hint {
  font-family: var(--font-accent);
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  color: #8c8d96;
  opacity: 0.85;
}

/* ==========================================================================
   STAGE 1: BOOT SEQUENCE SCREEN
   ========================================================================== */
#screen-boot {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  background: #05070a;
  font-family: var(--font-term);
  overflow: hidden;
  color: #f0f0f4;
  z-index: 20;
  transition: none;
}

.terminal-wrapper {
  max-width: 940px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  height: calc(100vh - 6rem);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.terminal-tag {
  font-family: var(--font-accent);
  font-size: 1.35rem;
  letter-spacing: 0.14em;
}

.terminal-date {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: #a0a1aa;
}

.boot-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: #e5e5ea;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
  scrollbar-width: none;
}
.boot-log::-webkit-scrollbar {
  display: none;
}

.boot-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  opacity: 0;
  transform: translateY(3px);
  animation: lineAppear 0.1s forwards ease;
  word-break: break-word;
}

@keyframes lineAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.line-ts {
  color: #686970;
  font-size: 0.85em;
  flex-shrink: 0;
}

.line-msg {
  flex: 1;
  font-family: var(--font-mono);
}

.line-tag {
  font-family: var(--font-accent);
  font-weight: normal;
  padding: 0.05rem 0.5rem;
  border-radius: 2px;
  flex-shrink: 0;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.05);
}

.tag-ok {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}
.tag-warn {
  color: #cccccc;
}
.tag-conn {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1rem;
  color: #ffffff;
  padding-top: 0.5rem;
}

.terminal-input-line .prompt {
  color: #8c8d96;
  font-family: var(--font-accent);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.terminal-input-line .command-text {
  font-family: var(--font-mono);
  color: #ffffff;
}

.screen-hint {
  position: absolute;
  bottom: 1.5rem;
  right: 2rem;
}

.text-hint {
  font-family: var(--font-accent);
  font-size: 1.15rem;
  color: #8c8d96;
  letter-spacing: 0.12em;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  transition: all 0.2s ease;
}

.text-hint:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   STAGE 2: LOADING SCREEN
   ========================================================================== */
#screen-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070a;
  color: #f0f0f4;
  z-index: 20;
}

.loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 620px;
  width: 90%;
  padding: 2.2rem 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 13, 20, 0.85);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
}

.loader-border-top,
.loader-border-bottom {
  color: #686970;
  font-family: var(--font-accent);
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  margin-bottom: 0.8rem;
}
.loader-border-bottom {
  margin-top: 0.8rem;
  margin-bottom: 0;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  width: 100%;
}

.loader-header {
  font-family: var(--font-accent);
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  color: #8c8d96;
}

.pulse-indicator {
  color: #ffffff;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  0% { opacity: 0.3; }
  100% { opacity: 1; text-shadow: 0 0 10px rgba(255, 255, 255, 0.6); }
}

.loader-title {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: #f5f5f7;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
  text-align: center;
}

.progress-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.progress-bar-ascii {
  font-family: var(--font-accent);
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.progress-bar-ascii .fill {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.progress-bar-ascii .bracket {
  color: #686970;
}

.progress-bar-ascii .percent {
  color: #f5f5f7;
  font-family: var(--font-mono);
  min-width: 50px;
  text-align: right;
  font-size: 1rem;
}

.loader-status {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #8c8d96;
  letter-spacing: 0.05em;
  min-height: 1.3em;
  text-align: center;
}

/* ==========================================================================
   STAGE 3: MAIN "COMING SOON" SCREEN
   ========================================================================== */
#screen-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.2rem 3rem;
  pointer-events: none;
}

#screen-main .center-content,
#screen-main .hud-bottom {
  pointer-events: auto;
}

/* Center Content */
.center-content {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  max-width: 1050px;
}

.logo-wrapper {
  position: relative;
  display: inline-block;
}

.main-title {
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 10vw, 8.2rem);
  font-weight: 300; /* Thin, elegant weight */
  letter-spacing: 0.16em;
  color: var(--text-main);
  text-shadow: 0 0 16px var(--text-glow);
  margin-left: 0.16em;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), text-shadow 0.3s ease;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle glitch effect on title hover */
.main-title:hover {
  transform: scale(1.015);
  font-weight: 300;
  text-shadow: 
    -2px 0 rgba(0, 0, 0, 0.4),
    2px 0 rgba(100, 100, 100, 0.4),
    0 0 20px rgba(0, 0, 0, 0.25);
  cursor: default;
}

body.theme-dark .main-title:hover {
  text-shadow: 
    -2px 0 rgba(255, 255, 255, 0.7),
    2px 0 rgba(180, 180, 180, 0.7),
    0 0 25px rgba(255, 255, 255, 0.6);
}

.title-underline {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent 0%, var(--accent-color) 50%, transparent 100%);
  opacity: 0.4;
  margin-top: 0.6rem;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-accent);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  letter-spacing: 0.22em;
  color: var(--accent-color);
  font-weight: normal;
  margin-top: 0.5rem;
}

.status-badge .bracket {
  color: var(--text-dim);
}

.status-text {
  text-shadow: 0 0 10px var(--text-glow);
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  max-width: 500px;
  line-height: 1.6;
}

.interactive-hint {
  font-family: var(--font-accent);
  font-size: 1.15rem;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  opacity: 0.7;
  margin-top: 0.5rem;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.interactive-hint:hover {
  color: var(--accent-color);
  opacity: 1;
}

/* Cursor Blink */
.cursor {
  display: inline-block;
  color: var(--accent-color);
  animation: blink 0.9s infinite step-start;
  font-weight: bold;
}

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

/* --- FOOTER HUD CONTROLS --- */
.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.retro-btn {
  background: transparent;
  border: none;
  font-family: var(--font-accent);
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 2px;
  transition: color 0.2s ease, text-shadow 0.2s ease, background 0.2s ease;
}

.retro-btn .btn-bracket {
  color: var(--border-color);
  transition: color 0.2s ease;
}

.retro-btn:hover,
.retro-btn.active {
  color: var(--accent-color);
  text-shadow: var(--accent-glow);
  background: rgba(0, 0, 0, 0.06);
}

body.theme-dark .retro-btn:hover,
body.theme-dark .retro-btn.active {
  background: rgba(255, 255, 255, 0.08);
}

.retro-btn:hover .btn-bracket,
.retro-btn.active .btn-bracket {
  color: var(--accent-color);
}

.retro-btn:focus-visible {
  outline: 1px solid var(--accent-color);
  color: var(--accent-color);
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
  #screen-boot {
    padding: 1.5rem;
  }

  .terminal-wrapper {
    height: calc(100vh - 4.5rem);
  }

  .boot-log {
    font-size: 0.82rem;
  }

  #screen-main {
    padding: 1.5rem;
  }

  .main-title {
    font-size: clamp(2.6rem, 11vw, 4.5rem);
    font-weight: 300;
  }

  .status-badge {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    letter-spacing: 0.16em;
  }

  .retro-btn {
    font-size: 1rem;
    padding: 0.35rem 0.65rem;
  }

  .tagline {
    font-size: 0.85rem;
  }

  .hud-bottom {
    justify-content: center;
    gap: 0.6rem;
  }

  .controls-left,
  .controls-right {
    justify-content: center;
    gap: 0.8rem;
  }

  .loader-box {
    padding: 1.4rem 1rem;
  }

  .loader-title {
    font-size: 1.25rem;
  }
}

/* Reduced Motion Mode for Accessibility */
@media (prefers-reduced-motion: reduce) {
  .crt-flicker {
    display: none !important;
  }
  .cursor {
    animation: none !important;
    opacity: 1 !important;
  }
  .main-title:hover {
    transform: none !important;
  }
  .pulse-indicator, .indicator-green {
    animation: none !important;
    opacity: 1 !important;
  }
}
