/* ============================================================
   PORTFOLIO BIOS STYLESHEET
   Revised: variables, mobile, performance, aesthetics, buttons
   ============================================================ */

/* 0. GOOGLE FONTS — must be first */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=VT323&display=swap');

:root {

  /* COLORS */
  --color-bg:            #000000;
  --color-bios-blue:     #0200AD;
  --color-bios-gray:     #B6B7AF;
  --color-bios-border:   #000088;

  --color-text:          #FFFFFF;
  --color-text-dark:     #000000;

  --color-success:       #00FF41;
  --color-warning:       #FFFF00;
  
  --color-black:         #000000;
  --color-shadow:        rgba(0, 0, 0, 0.8);
  --color-highlight:     #000080;

  /* TYPOGRAPHY */
  --font-display: "Orbitron", sans-serif;
  --font-body:    "VT323", monospace;

  /* EFFECTS */
  --blink-speed: 1s;

  /* SIZING */
  --base-font-size: 24px;

}

/* 2. CORE RESET */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--base-font-size);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* 3. BIOS TITLE BAR */
.bios-title-bar {
  position: relative;
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.blocks-row {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: 0;
}

.blocks-row .block { flex: 1; }
.block1 { background-color: #0101A8; }
.block2 { background-color: #0002F4; }
.block3 { background-color: #0101F9; }
.block4 { background-color: #000096; }
.block5 { background-color: #00024D; }
.block6 { background-color: #000000; }
.block7 { background-color: #000000; }
.block8 { background-color: #010052; }

.title-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.title-content h1.title-head {
  font-family: var(--font-display);
  font-size: var(--base-font-size);
  margin: 0;
  color: var(--color-text);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.55),
               0 0 20px rgba(100, 140, 255, 0.3);
}

/* 4. NAVIGATION BAR */
.bios-navbar {
  background-color: var(--color-bios-blue);
  width: 100%;
  padding: 10px 0;
  border-bottom: 2px solid var(--color-bios-gray);
}

.navbar {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;    /* wraps on mobile */
  gap: 15px;
}

.navbar a {
  text-decoration: none;
  text-transform: uppercase;
  color: var(--color-bios-gray);
  padding: 5px 15px;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
  will-change: background-color, color;
}

.navbar a.selectednav,
.navbar a:hover {
  background-color: var(--color-bios-gray);
  color: var(--color-highlight);
  transform: scale(1.05);
}

.navbar a:focus-visible {
  outline: 2px solid var(--color-warning);
  outline-offset: 2px;
}

/* Blinking underscore on hover */
.navbar a:hover::after {
  content: "_";
  animation: bios-blink var(--blink-speed) infinite;
  will-change: opacity;
  margin-left: 5px;
}

/* 5. CONTENT SECTION (Gray BIOS Box) */
.bios-section {
  display: flex;
  flex-direction: row;
  flex: 1;
  background-color: var(--color-bios-gray);
  color: var(--color-text-dark);
  width: 100%;
  padding: 20px;
  gap: 20px;
}

.bios-left {
  flex: 1;
  border: 2px solid var(--color-bios-border);
  padding: 15px;
}

.bios-right {
  flex: 0 0 5%;
  border: 2px solid var(--color-bios-border);
  padding: 15px;
}

#sidebar-controls {
    flex: 0 0 250px;
}

/* BIOS-style list markers */
.bios-right ul {
  list-style: none;
  padding: 0;
}

.bios-right ul li::before {
  content: "> ";
  color: var(--color-bios-border);
  font-weight: bold;
}

/* 6. BUTTONS */

/* Base button — works for any <button> or <a class="btn"> */
.btn,
button {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 20px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  padding: 8px 24px;
  border: 2px solid var(--color-bios-gray);
  background-color: var(--color-bios-blue);
  color: var(--color-bios-gray);
  transition: background-color 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s;
  letter-spacing: 0.05em;
  will-change: background-color, color;
}

.btn:hover,
button:hover {
  background-color: var(--color-bios-gray);
  color: var(--color-highlight);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn:active,
button:active {
  background-color: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
  transform: translateY(0);
}

.btn:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-warning);
  outline-offset: 2px;
}

/* reveal-btn — invites interaction before click */
.reveal-btn {
  position: relative;
  border-color: var(--color-bios-gray);
  color: var(--color-bios-gray);
  padding-left: 36px;  /* room for the blinking prefix */
  transition: all 0.2s;
}

/* Blinking ">" prefix — signals something is hidden */
.reveal-btn::before {
  content: ">";
  position: absolute;
  left: 14px;
  animation: bios-blink var(--blink-speed) infinite;
  will-change: opacity;
}

.reveal-btn:hover {
  background-color: var(--color-bios-gray);
  color: var(--color-highlight);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Revealed state — add .revealed via JS when content is shown */
.reveal-btn.revealed {
  border-color: #00FF41;  /* classic terminal green = success */
  color: #00FF41;
  animation: none;
}

.reveal-btn.revealed::before {
  content: "✓";
  animation: none;
}

.reveal-btn.revealed:hover {
  background-color: #00FF41;
  color: var(--color-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 255, 65, 0.3);
}

/* Modal overlay */
.modal {
  position: fixed;
  inset: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  background: rgba(0, 0, 0, 0.7);

  z-index: 10000;
}

.hidden {
  display: none !important; 
}

/* Modal content box */
.modal-inner {
  background-color: var(--color-bios-blue);
  border: 2px solid var(--color-bios-gray);

  padding: 20px;
  width: min(400px, 90%);

  /* Hard, offset BIOS-style shadow */
  box-shadow: 8px 8px 0 0 #000, 12px 12px 0 0 #B6B7AF;
  
  color: white;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.captcha-help {
  color: var(--color-bios-gray);
  font-size: 0.9rem;
  margin: 0;
}

.captcha-label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  color: var(--color-text);
}

/* Make captcha heading and equation white for contrast */
#captcha-modal h3,
#captcha-modal #captcha-question {
  color: #fff;
  text-shadow: none;
}

.captcha-feedback {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  color: var(--color-bios-gray);
  font-size: 0.9rem;
}

.captcha-feedback[data-state="error"] {
  color: var(--color-warning);
}

.captcha-feedback[data-state="success"] {
  color: var(--color-success);
}

.captcha-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.captcha-actions button {
  flex: 1;
}

/* 6.2 BOOT MENU/Loader */
.boot-menu-lead {
  color: var(--color-bios-gray);
  font-size: 16px;
}

.boot-menu-sublead {
  color: var(--color-warning);
  font-size: 12px;
}

.boot-menu {
  margin-top: 30px;
  padding-left: 40px;

  display: flex;
  flex-direction: column;
  gap: 8px;

  user-select: none;
}

/* Individual option row */
.boot-option {
  display: flex;
  align-items: center;

  width: fit-content;

  padding: 2px 10px;

  color: var(--color-text);
}

/* The selectable arrow area */
.boot-pointer {
  width: 24px;
  display: inline-block;
}

/* Selected option */
.boot-option.selected {
  background-color: var(--color-bios-gray);
  color: var(--color-bios-blue);
}

/* Blink ONLY the arrow */
.boot-option.selected .boot-pointer {
  animation: bios-blink var(--blink-speed) infinite;
}

/* 7. RETRO UTILITIES */

/* Blink animation */
@keyframes bios-blink {
  0%,  49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes crt-flicker {

  0%   { opacity: 1; }
  50%  { opacity: 0.985; }
  100% { opacity: 1; }

}

.crt-flicker {
  animation: crt-flicker 0.12s infinite;
}

/* Keyboard accessibility */
:focus-visible {

  outline: 2px solid var(--color-warning);
  outline-offset: 2px;

}

/* Logo/icon symbol */
.logo-blink::before {
  content: "☰";
  animation: bios-blink var(--blink-speed) infinite;
  will-change: opacity;
  display: inline-block;
  margin-right: 10px;
}

/* General blink utility */
.blink {
  animation: bios-blink var(--blink-speed) infinite;
  will-change: opacity;
}

/* 8. CRT SCANLINE OVERLAY */
.scanlines::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* 9. CUSTOM BIOS SCROLLBAR */
::-webkit-scrollbar       { width: 12px; }
::-webkit-scrollbar-track { background: var(--color-bios-blue); }
::-webkit-scrollbar-thumb {
  background: var(--color-bios-gray);
  border: 2px solid var(--color-black);
}

/* ============================================================
   PRELOADER
   ============================================================ */

#preloader {
  position: fixed;
  inset: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  background-color: var(--color-bg);

  z-index: 20000;

  transition: opacity 0.2s ease;
}

#preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Main content box */
.preloader-inner {
  width: min(600px, 90%);

  border: 2px solid var(--color-bios-gray);

  background-color: var(--color-bios-blue);

  padding: 30px;
}

/* Title */
.preloader-title {
  font-size: 36px;

  margin-bottom: 20px;

  color: var(--color-text);

  text-transform: uppercase;

  letter-spacing: 0.08em;
}

/* Status text */
.preloader-status {
  margin-bottom: 20px;

  color: var(--color-bios-gray);
}

/* Progress bar outer */
.preloader-bar-container {
  width: 100%;
  height: 32px;

  border: 2px solid var(--color-bios-gray);

  background-color: var(--color-black);

  overflow: hidden;
}

/* Progress bar fill */
.preloader-bar {
  width: 0%;
  height: 100%;

  background-color: var(--color-bios-gray);

  transition: width 0.08s linear;
}

/* Percentage text */
.preloader-percent {
  margin-top: 12px;

  text-align: right;

  color: var(--color-bios-gray);
}

/* ============================================================
   SETTINGS MODIFIERS
   ============================================================ */

/* Reduced motion */
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {

  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;

}

/* Disable blinking */
.no-blink .blink,
.no-blink .boot-option.selected .boot-pointer,
.no-blink .logo-blink::before,
.no-blink .reveal-btn::before,
.no-blink .navbar a:hover::after {

  animation: none !important;

}

/* Large text mode */
.large-text {
  font-size: 30px !important;
}

.large-text .title-content h1.title-head {
  font-size: 48px !important;
}

.large-text .btn,
.large-text button {
  font-size: 24px !important;
}

.large-text .preloader-title {
  font-size: 48px !important;
}

/* High contrast */
.high-contrast {
  --color-bg: #000000;
  --color-text: #FFFFFF;
  --color-text-dark: #FFFFFF;
  --color-bios-blue: #000000;
  --color-bios-gray: #FFFFFF;
  --color-bios-border: #FFFFFF;
  --color-success: #FFFFFF;
  --color-warning: #FFFFFF;
  --color-highlight: #FFFFFF;
}

.high-contrast .bios-title-bar {
  background-color: #000000;
  border: 3px solid #FFFFFF;
}

.high-contrast .blocks-row .block {
  background-color: #000000 !important;
  border: 2px solid #FFFFFF;
}

.high-contrast .modal-inner {
  background-color: #000000;
  border: 3px solid #FFFFFF;
}

.high-contrast .setup-item input[type="checkbox"] {
  border: 2px solid #FFFFFF;
}

.high-contrast .preloader-inner {
  background-color: #000000;
  border: 3px solid #FFFFFF;
}

/* Disable scanlines */
.no-scanlines.scanlines::after {
  display: none;
}

/* Background ambience animation */
@keyframes ambient-pulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.15; }
}

.bg-ambience::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(100, 200, 255, 0.2), transparent 70%);
  animation: ambient-pulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

body.bg-ambience {
  position: relative;
}

/* Reduced motion - respect prefers-reduced-motion globally */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   DELL OPTIPLEX 7020 BOOT MENU THEME
   ============================================================ */

.dell-boot-theme {
  --color-bg: #000000;
  --color-text: #FFFFFF;
  --color-text-dark: #FFFFFF;
  
  /* Dell typically uses simpler blue or gray */
  --color-bios-blue: #1E3A5F;
  --color-bios-gray: #C0C0C0;
  --color-bios-border: #808080;
}

.dell-boot-theme .bios-title-bar {
  background: linear-gradient(90deg, #1E3A5F 0%, #2A4A7F 50%, #1E3A5F 100%);
  border-bottom: 3px solid var(--color-bios-border);
  padding: 10px;
  min-height: 50px;
}

/* Remove gradient blocks in Dell theme */
.dell-boot-theme .blocks-row {
  display: none;
}

.dell-boot-theme .title-content h1.title-head {
  text-shadow: none;
  font-weight: bold;
  letter-spacing: 2px;
}

.dell-boot-theme .boot-menu {
  border: 2px solid var(--color-bios-gray);
  background-color: var(--color-bg);
  padding: 15px;
  margin-top: 20px;
}

.dell-boot-theme .boot-option {
  padding: 8px 15px;
  border: 1px solid transparent;
}

.dell-boot-theme .boot-option.selected {
  background-color: #1E3A5F;
  color: var(--color-bios-gray);
  border: 1px solid var(--color-bios-gray);
}

.dell-boot-theme .modal-inner {
  background-color: #1E3A5F;
  border: 3px solid var(--color-bios-gray);
}

.dell-boot-theme .setup-item {
  color: var(--color-bios-gray);
}

.dell-boot-theme .setup-item input[type="checkbox"] {
  accent-color: var(--color-bios-gray);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.dell-boot-theme .setup-title {
  color: var(--color-bios-gray);
  font-weight: bold;
  font-size: 16px;
}

.dell-boot-theme button {
  background-color: #1E3A5F;
  border: 2px solid var(--color-bios-gray);
  color: var(--color-bios-gray);
}

.dell-boot-theme button:hover {
  background-color: var(--color-bios-gray);
  color: #1E3A5F;
}

.dell-boot-theme .boot-menu-lead,
.dell-boot-theme .boot-menu-sublead {
  color: var(--color-bios-gray);
  font-size: 16px;
}

.dell-boot-theme .boot-menu-sublead {
  color: #FFFF00;
}

/* ============================================================
   GALLERY
   ============================================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
  padding: 15px;
  border: 2px solid var(--color-bios-border);
  background-color: rgba(0, 0, 0, 0.3);
}

.gallery-item {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--color-bios-gray);
  overflow: hidden;
  background-color: var(--color-bg);
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(2, 0, 173, 0.5);
}

.gallery-thumb {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-caption {
  padding: 10px;
  font-size: 14px;
  color: var(--color-bios-gray);
  text-align: center;
  margin: 0;
  background-color: var(--color-highlight);
}

/* Lightbox modal */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9500;
  opacity: 0;
  transition: opacity 0.3s;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 2px solid var(--color-bios-gray);
}

.lightbox-title {
  color: var(--color-text);
  margin-top: 20px;
  text-align: center;
  font-size: 18px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  color: var(--color-text);
  cursor: pointer;
  padding: 20px;
  transition: color 0.2s;
  z-index: 10;
}

.lightbox-nav:hover {
  color: var(--color-bios-gray);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 36px;
  color: var(--color-text);
  cursor: pointer;
  transition: color 0.2s;
}

.lightbox-close:hover {
  color: var(--color-warning);
}

@media (max-width: 768px) {

  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .lightbox-nav {
    font-size: 24px;
    padding: 10px;
  }

  .lightbox-close {
    font-size: 28px;
  }

  /* Layout */
  .bios-section {
    flex-direction: column;
  }

  .bios-left,
  .bios-right {
    flex: none;
    width: 100%;
  }

}