/* ==========================================================================
   BIOS THEME STYLESHEET - FELIPE MATURANA PERSONAL BLOG
   Pure Vanilla CSS - Award/Phoenix BIOS Aesthetic
   ========================================================================== */

:root {
  /* Classic EGA/VGA BIOS Color Palette */
  --bios-blue: #0000aa;
  --bios-dark-blue: #000055;
  --bios-black: #000000;
  --bios-white: #ffffff;
  --bios-gray: #aaaaaa;
  --bios-dark-gray: #555555;
  --bios-yellow: #ffff55;
  --bios-cyan: #55ffff;
  --bios-green: #55ff55;
  --bios-red: #ff5555;
  
  /* Highlight selection bar: classic Award BIOS uses red background with white text, or cyan */
  --bios-highlight-bg: #aa0000;
  --bios-highlight-text: #ffffff;
  --bios-selected-alt-bg: #ffffff;
  --bios-selected-alt-text: #0000aa;

  /* Typography */
  --bios-font: 'VT323', 'Share Tech Mono', 'Courier New', Courier, monospace;
}

/* Base Reset & CRT Screen Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: #050510;
  color: var(--bios-white);
  font-family: var(--bios-font);
  font-size: 20px;
  line-height: 1.3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CRT Scanline & Screen Glow Effects */
.crt-overlay {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.03),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.03)
  );
  background-size: 100% 4px, 6px 100%;
  opacity: 0.85;
}

body.crt-enabled .bios-screen {
  box-shadow: 0 0 40px rgba(0, 0, 170, 0.6), inset 0 0 100px rgba(0, 0, 0, 0.4);
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.6);
}

body:not(.crt-enabled) .crt-overlay {
  display: none;
}

/* Outer Monitor / BIOS Chassis */
.bios-wrapper {
  width: 96vw;
  max-width: 1040px;
  height: 92vh;
  max-height: 780px;
  background-color: var(--bios-dark-blue);
  border: 4px solid #333333;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  padding: 6px;
}

/* The BIOS Screen */
.bios-screen {
  width: 100%;
  height: 100%;
  background-color: var(--bios-blue);
  border: 3px double var(--bios-white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
.bios-header {
  border-bottom: 2px solid var(--bios-white);
  padding: 8px 14px 6px 14px;
  background-color: var(--bios-blue);
}

.bios-header-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 19px;
  color: var(--bios-yellow);
  letter-spacing: 1px;
}

.bios-datetime {
  color: var(--bios-white);
  font-variant-numeric: tabular-nums;
}

/* Title Banner Centered with = delimiters */
.bios-title-banner {
  text-align: center;
  margin-top: 4px;
}

.bios-title {
  color: var(--bios-yellow);
  font-size: 32px;
  letter-spacing: 3px;
  font-weight: bold;
  text-transform: uppercase;
  margin: 0;
  display: inline-block;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

.bios-subtitle {
  color: var(--bios-cyan);
  font-size: 18px;
  letter-spacing: 2px;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   CONTENT AREA & VIEW MANAGEMENT
   -------------------------------------------------------------------------- */
.bios-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  overflow: hidden;
  position: relative;
}

.bios-view {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

.bios-view.active {
  display: flex;
  animation: biosFadeIn 0.08s ease-in;
}

@keyframes biosFadeIn {
  0% { opacity: 0; transform: scaleY(0.99); }
  100% { opacity: 1; transform: scaleY(1); }
}

/* --------------------------------------------------------------------------
   MAIN MENU LAYOUT (Centered BIOS Options Box)
   -------------------------------------------------------------------------- */
.menu-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.menu-panel {
  border: 2px solid var(--bios-white);
  background-color: var(--bios-blue);
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.panel-header {
  color: var(--bios-yellow);
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  border-bottom: 1px dashed var(--bios-white);
  padding-bottom: 8px;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

/* Menu items list */
.bios-menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 24px;
  cursor: pointer;
  letter-spacing: 2px;
  color: var(--bios-white);
  text-decoration: none;
  transition: background-color 0.05s ease;
  outline: none;
}

.menu-item .pointer {
  opacity: 0;
  color: var(--bios-yellow);
  width: 16px;
  font-weight: bold;
}

.menu-item .item-number {
  color: var(--bios-cyan);
}

.menu-item.selected,
.menu-item:hover {
  background-color: var(--bios-highlight-bg);
  color: var(--bios-highlight-text);
  text-decoration: none;
}

.menu-item.selected .pointer,
.menu-item:hover .pointer {
  opacity: 1;
  animation: blinkPointer 0.8s infinite steps(1);
}

@keyframes blinkPointer {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   SUBVIEWS: SOBRE MÍ, ENSAYOS, CONTACTO
   -------------------------------------------------------------------------- */
.subview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--bios-white);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.subview-title {
  color: var(--bios-yellow);
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 1px;
}

.bios-back-btn {
  background-color: var(--bios-highlight-bg);
  color: var(--bios-white);
  font-family: var(--bios-font);
  font-size: 18px;
  border: 1px solid var(--bios-white);
  padding: 4px 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.bios-back-btn:hover {
  background-color: var(--bios-white);
  color: var(--bios-blue);
  text-decoration: none;
}

.subview-body {
  border: 2px solid var(--bios-white);
  padding: 12px 16px;
  flex: 1;
  overflow-y: auto;
  background-color: var(--bios-blue);
}

.subview-body.scrollable::-webkit-scrollbar {
  width: 8px;
}
.subview-body.scrollable::-webkit-scrollbar-track {
  background: var(--bios-dark-blue);
}
.subview-body.scrollable::-webkit-scrollbar-thumb {
  background: var(--bios-white);
}

/* Field Groups in Sobre Mí */
.bios-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bios-row {
  display: flex;
  font-size: 20px;
}

.field-label {
  width: 200px;
  color: var(--bios-cyan);
}

.field-value {
  color: var(--bios-white);
  flex: 1;
}

.field-value.highlight {
  color: var(--bios-yellow);
  font-weight: bold;
}

.bios-separator {
  color: var(--bios-dark-gray);
  margin: 10px 0;
  overflow: hidden;
  white-space: nowrap;
}

.bios-bio-text {
  font-size: 19px;
  line-height: 1.45;
}

.section-title {
  color: var(--bios-yellow);
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 6px;
}

.bios-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

.spec-title {
  color: var(--bios-cyan);
  font-weight: bold;
  display: block;
  margin-bottom: 4px;
}

.spec-col ul {
  list-style: none;
  font-size: 18px;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   ENSAYOS TABLE & INDIVIDUAL ARTICLE STYLES
   -------------------------------------------------------------------------- */
.table-legend {
  color: var(--bios-yellow);
  font-size: 19px;
  margin-bottom: 12px;
}

.essay-list-container {
  border: 2px solid var(--bios-white);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  background-color: var(--bios-dark-blue);
}

.bios-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.bios-table th {
  background-color: var(--bios-blue);
  color: var(--bios-yellow);
  padding: 10px 14px;
  border-bottom: 2px solid var(--bios-white);
  font-size: 19px;
  letter-spacing: 1px;
}

.bios-table td {
  padding: 12px 14px;
  font-size: 21px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
}

.essay-row {
  cursor: pointer;
  outline: none;
  transition: background-color 0.05s ease;
}

.essay-row.selected,
.essay-row:hover {
  background-color: var(--bios-highlight-bg);
  color: var(--bios-white);
}

/* Individual Essay Article Styles */
.essay-article {
  max-width: 840px;
  margin: 10px auto;
  padding: 10px 16px;
}

.essay-article-header {
  margin-bottom: 8px;
}

.essay-article-title {
  color: var(--bios-yellow);
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 10px;
  line-height: 1.35;
}

.essay-article-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 19px;
  color: var(--bios-gray);
  margin-top: 6px;
}

.essay-article-meta .meta-row {
  display: flex;
  gap: 10px;
}

.essay-article-meta .meta-label {
  color: var(--bios-cyan);
  width: 220px;
}

.essay-article-meta .meta-val {
  color: var(--bios-white);
  font-weight: bold;
}

.essay-article-body {
  font-size: 22px;
  line-height: 1.5;
  color: var(--bios-white);
  margin-top: 14px;
}

/* --------------------------------------------------------------------------
   CONTACTO SECTION: COMMUNICATION CHANNELS
   -------------------------------------------------------------------------- */
.contact-channels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 30px auto;
  max-width: 860px;
  width: 100%;
}

.channel-card {
  border: 2px solid var(--bios-white);
  padding: 24px 16px;
  background-color: var(--bios-dark-blue);
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: border-color 0.1s ease, background-color 0.1s ease;
}

.channel-card:hover {
  border-color: var(--bios-yellow);
  background-color: #000077;
}

.channel-port {
  display: block;
  color: var(--bios-yellow);
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.channel-val .bios-link {
  color: var(--bios-cyan);
  text-decoration: none;
  font-size: 20px;
  display: inline-block;
  padding: 4px 10px;
  border: 1px dashed transparent;
  transition: all 0.08s ease;
}

.channel-val .bios-link:hover {
  border-color: var(--bios-yellow);
  background-color: var(--bios-white);
  color: var(--bios-blue);
}

/* --------------------------------------------------------------------------
   FOOTER KEYBINDINGS BAR
   -------------------------------------------------------------------------- */
.bios-footer {
  border-top: 2px solid var(--bios-white);
  padding: 8px 14px;
  background-color: var(--bios-blue);
}

.key-help-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 18px;
}

.key-item {
  color: var(--bios-white);
}

.key-item .key {
  color: var(--bios-yellow);
  font-weight: bold;
}

.key-item.interactive {
  cursor: pointer;
  padding: 2px 6px;
  border: 1px solid transparent;
}

.key-item.interactive:hover {
  border-color: var(--bios-yellow);
  background-color: var(--bios-dark-blue);
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN (Tablets / Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  html, body {
    font-size: 17px;
  }

  .bios-wrapper {
    width: 98vw;
    height: 98vh;
    padding: 2px;
  }

  .bios-title {
    font-size: 24px;
  }

  .bios-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 16px;
  }

  .menu-layout {
    grid-template-columns: 1fr;
    gap: 8px;
    overflow-y: auto;
  }

  .contact-channels {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bios-specs-grid {
    grid-template-columns: 1fr;
  }

  .key-help-grid {
    font-size: 15px;
    gap: 6px;
  }
}
