/* ===========================================
   TERMINAL PORTFOLIO — Design System & Styles
   Samuel Kouřil — Personal Portfolio
   =========================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,700;1,400&family=Fira+Code:wght@400;500&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Backgrounds */
  --bg-deep: #0c1117;
  --bg-terminal: #151d27;
  --bg-terminal-bar: #1c2533;

  /* Primary accent — neon green */
  --green-primary: #22c55e;
  --green-dim: #16a34a;
  --green-glow: rgba(34, 197, 94, 0.4);

  /* Secondary accent — phosphor amber */
  --amber: #e2b340;
  --amber-glow: rgba(226, 179, 64, 0.3);

  /* Text */
  --text-primary: #c9d1d9;
  --text-muted: #8b949e;
  --text-dim: #484f58;

  /* Surfaces */
  --border: #21262d;
  --surface-hover: rgba(34, 197, 94, 0.08);

  /* Error */
  --red: #f85149;

  /* Typography */
  --font-display: 'IBM Plex Mono', monospace;
  --font-body: 'Fira Code', monospace;

  /* Spacing */
  --section-pad: 6rem;
  --terminal-pad: 1.5rem;
  --max-width: 900px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 52px;
  font-size: 15px;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--green-primary);
  color: var(--bg-deep);
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--green-dim);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-primary);
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--green-dim) transparent;
}

/* ---------- CRT Scan-line Overlay ---------- */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.03) 1px,
    rgba(0, 0, 0, 0.03) 2px
  );
  animation: scanline 8s linear infinite;
}

.crt-overlay.crt-off {
  display: none;
}

.crt-overlay.crt-intense {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.12) 1px,
    rgba(0, 0, 0, 0.12) 2px
  );
}

@keyframes scanline {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 4px;
  }
}

/* ---------- Tab Bar Navigation ---------- */
.tab-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  background: rgba(12, 17, 23, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
}

.tab-items {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  overflow-x: auto;
}

.tab-item {
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-muted);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  position: relative;
}

.tab-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.tab-item.active {
  color: var(--green-primary);
  border-bottom-color: var(--green-primary);
  text-shadow: 0 0 8px var(--green-glow);
}

.tab-bar-status {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  padding-left: 1rem;
}

/* ---------- Terminal Window ---------- */
.terminal-window {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.terminal-window.in-view {
  opacity: 1;
  transform: translateY(0);
}

.terminal-header {
  background: var(--bg-terminal-bar);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
}

.terminal-dots {
  display: flex;
  gap: 8px;
}

.terminal-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

.terminal-dots span:nth-child(1) {
  background: #ff5f57;
}

.terminal-dots span:nth-child(2) {
  background: #febc2e;
}

.terminal-dots span:nth-child(3) {
  background: #28c840;
}

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 52px; /* offset for dots on left */
}

.terminal-body {
  padding: var(--terminal-pad);
}

/* ---------- Sections — General ---------- */
.section {
  padding: var(--section-pad) 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---------- Hero Section ---------- */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 44px;
  text-align: center;
}

#hero .terminal-window {
  width: 100%;
  max-width: 720px;
  opacity: 1;
  transform: none;
}

.boot-log {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
  text-align: left;
  min-height: 2em;
}

.boot-line {
  opacity: 0;
  transition: opacity 0.1s;
}

.boot-line.visible {
  opacity: 1;
}

.boot-line.success {
  color: var(--green-primary);
}

.boot-line.warn {
  color: var(--amber);
}

.boot-line.error {
  color: var(--red);
}

.hero-reveal {
  margin-top: 2.5rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--green-primary);
  letter-spacing: -0.02em;
  text-shadow: 0 0 20px var(--green-glow), 0 0 40px rgba(34, 197, 94, 0.15);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  animation: none;
}

.hero-name.revealed {
  opacity: 1;
  transform: translateY(0);
  animation: glow-pulse 4s ease-in-out infinite;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

.hero-tagline.revealed {
  opacity: 1;
  transform: translateY(0);
}

.hero-cta {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--green-primary);
  border: 1px solid var(--green-primary);
  background: transparent;
  padding: 0.6rem 1.5rem;
  margin-top: 2rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s, background 0.25s, color 0.25s, box-shadow 0.25s;
}

.hero-cta.revealed {
  opacity: 1;
  transform: translateY(0);
}

.hero-cta:hover {
  background: var(--green-primary);
  color: var(--bg-deep);
  box-shadow: 0 0 20px var(--green-glow);
}

@keyframes glow-pulse {
  0%, 100% {
    text-shadow: 0 0 20px var(--green-glow), 0 0 40px rgba(34, 197, 94, 0.15);
  }
  50% {
    text-shadow: 0 0 30px var(--green-glow), 0 0 60px rgba(34, 197, 94, 0.25);
  }
}

/* ---------- Cursor Blink ---------- */
.cursor-blink {
  display: inline-block;
  color: var(--amber);
  animation: blink 1s step-end infinite;
}

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

/* ---------- Prompt Lines ---------- */
.prompt-line {
  color: var(--green-primary);
  font-family: var(--font-display);
  font-size: 14px;
  margin-bottom: 1rem;
}

.prompt-prefix {
  color: var(--green-dim);
}

/* ---------- About Section ---------- */
#about {
  padding-top: 2rem;
}

.about-content p {
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.8;
}

.about-content .highlight {
  color: var(--green-primary);
  font-weight: 500;
}

/* ---------- Projects Section ---------- */
#projects {
  padding-top: 2rem;
}

.project-list {
  margin-top: 0.5rem;
}

.project-listing-header {
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.project-entry {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.project-file-line {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  transition: color 0.2s;
  display: flex;
  gap: 1rem;
}

.project-file-line:hover {
  color: var(--green-primary);
}

.project-permissions {
  color: var(--text-dim);
  min-width: 100px;
}

.project-date {
  color: var(--text-muted);
  min-width: 80px;
}

.project-name-col {
  color: var(--green-primary);
  font-weight: 500;
}

.project-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 0 0 1.5rem;
}

.project-details.expanded {
  max-height: 500px;
  padding: 1rem 0 0.5rem 1.5rem;
}

.project-cat-line {
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 13px;
  margin-bottom: 0.75rem;
}

.project-desc {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tech-tag {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--green-dim);
  border: 1px solid var(--green-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  white-space: nowrap;
}

.project-links {
  margin-top: 0.75rem;
}

.project-links a {
  color: var(--green-primary);
  text-decoration: none;
  margin-right: 1.5rem;
  font-size: 13px;
  transition: text-shadow 0.2s;
}

.project-links a:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px var(--green-glow);
}

/* ---------- Skills / Neofetch Section ---------- */
#skills {
  padding-top: 2rem;
}

.neofetch-container {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: flex-start;
}

.neofetch-ascii {
  flex-shrink: 0;
}

.neofetch-ascii pre {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--green-primary);
  line-height: 1.15;
  white-space: pre;
  text-shadow: 0 0 6px var(--green-glow);
}

.neofetch-info {
  flex-grow: 1;
  min-width: 0;
}

.neofetch-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--green-primary);
  margin-bottom: 0.2rem;
}

.neofetch-title-underline {
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.neofetch-line {
  font-family: var(--font-body);
  font-size: 13px;
  margin-bottom: 0.35rem;
  display: flex;
}

.neofetch-label {
  color: var(--green-primary);
  font-weight: 500;
  min-width: 130px;
  flex-shrink: 0;
}

.neofetch-value {
  color: var(--text-primary);
}

.neofetch-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.75rem 0;
}

.neofetch-colors {
  display: flex;
  gap: 0;
  margin-top: 0.75rem;
}

.color-block {
  width: 28px;
  height: 28px;
  display: inline-block;
}

/* Terminal standard colors */
.color-block:nth-child(1) { background: #282c34; }
.color-block:nth-child(2) { background: #e06c75; }
.color-block:nth-child(3) { background: #98c379; }
.color-block:nth-child(4) { background: #e5c07b; }
.color-block:nth-child(5) { background: #61afef; }
.color-block:nth-child(6) { background: #c678dd; }
.color-block:nth-child(7) { background: #56b6c2; }
.color-block:nth-child(8) { background: #abb2bf; }

/* ---------- Contact Section ---------- */
#contact {
  padding-top: 2rem;
}

.contact-prompt {
  font-family: var(--font-display);
  color: var(--green-primary);
  font-size: 14px;
  margin-bottom: 1.5rem;
}

.contact-links {
  margin-top: 1rem;
}

.contact-link-line {
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.contact-arrow {
  color: var(--amber);
  margin-right: 0.75rem;
  font-weight: 500;
}

.contact-link-line a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-link-line a:hover {
  color: var(--green-primary);
  text-decoration: underline;
}

.contact-message {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
}

/* ---------- CRT Toggle ---------- */
.crt-toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1001;
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 11px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s, border-color 0.2s;
}

.crt-toggle:hover {
  color: var(--green-primary);
  border-color: var(--green-primary);
}

/* ---------- Utility Classes ---------- */
.hidden {
  display: none !important;
}

.visible {
  opacity: 1 !important;
}

.text-green {
  color: var(--green-primary);
}

.text-amber {
  color: var(--amber);
}

.text-muted {
  color: var(--text-muted);
}

/* ---------- Responsive — Tablet & Below ---------- */
@media (max-width: 768px) {
  :root {
    --section-pad: 3rem;
    --terminal-pad: 1rem;
  }

  .tab-bar-status {
    display: none;
  }

  .tab-item {
    font-size: 11px;
    padding: 0.4rem 0.6rem;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-tagline {
    font-size: 0.95rem;
  }

  .neofetch-container {
    flex-direction: column;
  }

  .neofetch-ascii pre {
    font-size: 8px;
  }

  .neofetch-label {
    min-width: 100px;
  }

  .section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .terminal-body {
    padding: var(--terminal-pad);
  }

  .project-file-line {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .project-permissions {
    display: none;
  }
}

/* ---------- Responsive — Mobile ---------- */
@media (max-width: 480px) {
  .hero-name {
    font-size: 1.5rem;
  }

  .tab-items {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-item {
    font-size: 10px;
    padding: 0.35rem 0.5rem;
  }

  .neofetch-ascii pre {
    font-size: 6px;
  }

  .neofetch-line {
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.5rem;
  }

  .neofetch-label {
    min-width: unset;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }

  .terminal-window {
    opacity: 1;
    transform: none;
  }

  .hero-name,
  .hero-tagline,
  .hero-cta {
    opacity: 1;
    transform: none;
  }

  .boot-line {
    opacity: 1;
  }
}

/* ---------- Print ---------- */
@media print {
  .tab-bar,
  .crt-overlay,
  .crt-toggle,
  .boot-log {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .terminal-window {
    opacity: 1;
    transform: none;
    border: 1px solid #ccc;
    background: white;
  }

  .hero-name,
  .hero-tagline,
  .hero-cta {
    opacity: 1;
    transform: none;
  }

  .hero-name {
    color: black;
    text-shadow: none;
  }

  .project-details {
    max-height: none;
  }
}
