/* ================================================================
   SANCHO PORTFOLIO — style.css
   ================================================================ */

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Base ─────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: #000;
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.6;
}

/* Terminal fills the viewport and scrolls its own content */
#terminal {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 60px;
  scrollbar-width: thin;
  scrollbar-color: #222 #000;
}

#terminal::-webkit-scrollbar        { width: 4px; }
#terminal::-webkit-scrollbar-track  { background: #000; }
#terminal::-webkit-scrollbar-thumb  { background: #222; border-radius: 0; }
#terminal::-webkit-scrollbar-thumb:hover { background: #444; }

a {
  color: inherit;
}

/* ── Blinking cursor ──────────────────────────────────────────── */
@keyframes cursor-blink {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 0.9em;
  background: #fff;
  vertical-align: text-bottom;
  margin-bottom: 1px;
  animation: cursor-blink 1s step-end infinite;
}

/* ── Text lines ───────────────────────────────────────────────── */
.line {
  min-height: 1.6em;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Language picker ──────────────────────────────────────────── */
.lang-picker {
  display: block;
  white-space: pre;
  padding: 2px 0;
  min-height: 1.6em;
}

.lang-option {
  display: inline;
  padding: 1px 4px;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: #0000AA;
  color: #fff;
}

/* ── Project rows ─────────────────────────────────────────────── */
.project-row {
  display: block;
  padding: 1px 4px;
  margin-left: -4px;
  cursor: pointer;
  user-select: none;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.6em;
  outline: none;
}

.project-row:hover,
.project-row.active {
  background: #0000AA;
  color: #fff;
}

.project-row:focus-visible {
  background: #0000AA;
  color: #fff;
}

/* ── Accordion ────────────────────────────────────────────────── */
.accordion {
  display: none;
  padding: 6px 0 20px;
}

.accordion.open {
  display: block;
}

.acc-inner {
  padding-left: 4px;
}

.acc-title {
  font-weight: bold;
  margin-bottom: 1px;
}

.acc-type {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
}

.acc-desc {
  max-width: 700px;
  line-height: 1.65;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.acc-files-label {
  margin-bottom: 3px;
}

/* ── File items ───────────────────────────────────────────────── */
.file-item {
  display: block;
  padding: 1px 4px;
  margin-left: -4px;
  cursor: pointer;
  user-select: none;
  white-space: pre;
  outline: none;
}

.file-item:hover,
.file-item:focus-visible {
  background: #0000AA;
  color: #fff;
}

/* ── Contact grid ─────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 16px;
  margin-top: 4px;
}

.contact-col {
  line-height: 1.6;
}

.contact-label {
  margin-bottom: 2px;
}

.contact-col a {
  display: inline;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  outline: none;
}

.contact-col a:hover,
.contact-col a:focus-visible {
  background: #0000AA;
  text-decoration: none;
}

/* ── Modal / File viewer ──────────────────────────────────────── */
#modal {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#modal.open {
  display: flex;
  animation: modal-in 120ms ease-out;
}

@keyframes modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#modal-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  cursor: pointer;
  padding: 1px 4px;
  outline: none;
}

#modal-close:hover,
#modal-close:focus-visible {
  background: #0000AA;
}

#modal-inner {
  width: 90%;
  max-width: 960px;
}

#modal-path {
  font-size: 12px;
  color: #555;
  margin-bottom: 12px;
}

#modal-viewer {
  width: 100%;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Media elements inside modal */
.media-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  border: none;
  display: block;
}

.media-img {
  max-width: 100%;
  max-height: 72vh;
  display: block;
  margin: 0 auto;
}

.media-video {
  max-width: 100%;
  max-height: 72vh;
  display: block;
  margin: 0 auto;
}

/* Placeholder for missing files */
.modal-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  background: #090909;
  justify-content: center;
}

.modal-icon {
  font-size: 13px;
  color: #3a3a3a;
  letter-spacing: 0.05em;
}

.modal-label {
  font-size: 12px;
  color: #2a2a2a;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  body {
    font-size: 13px;
  }

  #terminal {
    padding: 14px 16px 50px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 12px 0;
  }

  #modal-close {
    top: 14px;
    right: 16px;
  }
}

@media (max-width: 380px) {
  body {
    font-size: 12px;
  }

  #terminal {
    padding: 12px 14px 40px;
  }
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
    opacity: 1;
  }

  #modal.open {
    animation: none;
  }
}
