/*
Theme Name: Golkov Terminal
Theme URI: https://golkov.net
Author: Daniel Golkov
Description: Terminal-style portfolio theme
Version: 1.1.4
License: GNU General Public License v2 or later
Text Domain: golkov-terminal
*/

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

/* Dark mode (default) */
html {
  --bg:          #0e0e0e;
  --bg-panel:    #141414;
  --bg-hover:    #1a1a1a;
  --border:      #2a2a2a;
  --green:       #39d353;
  --green-dim:   #1e6b2e;
  --amber:       #f0a500;
  --red:         #ff5f57;
  --blue:        #58a6ff;
  --muted:       #888;
  --text:        #c9d1d9;
  --text-bright: #e6edf3;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius:      6px;
  --transition:  0.15s ease;
}

/* Light mode – higher specificity wins over html {} above */
html[data-theme="light"] {
  --bg:          #f5f5f0;
  --bg-panel:    #ececе7;
  --bg-hover:    #e2e2dc;
  --border:      #d0d0c8;
  --green:       #1a7f37;
  --green-dim:   #4caf6f;
  --amber:       #b45309;
  --red:         #cf222e;
  --blue:        #0969da;
  --muted:       #666;
  --text:        #24292f;
  --text-bright: #1c2128;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ─── Layout ────────────────────────────────────────────────────── */
#terminal-root {
  display: flex;
  flex-direction: column;
  height: 100vh;          /* fallback for old browsers */
  height: 100dvh;         /* dynamic viewport height – accounts for mobile browser chrome */
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}
/* ─── SEO Content Layer (off-screen, indexed by Google) ─────────── */
.seo-content {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

/* Allow text selection in output, prevent it on UI chrome */
#output, #output * {
  user-select: text;
  -webkit-user-select: text;
}

#title-bar, #prompt-area, .quick-btn {
  user-select: none;
  -webkit-user-select: none;
}

::selection {
  background: var(--green-dim);
  color: var(--text-bright);
}

/* ─── Title Bar ─────────────────────────────────────────────────── */
#title-bar {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#title-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
}

/* ─── Output Area ───────────────────────────────────────────────── */
#output {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 0 1rem;
  scroll-behavior: smooth;
}

#output::-webkit-scrollbar {
  width: 4px;
}
#output::-webkit-scrollbar-track {
  background: transparent;
}
#output::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ─── Output Blocks ─────────────────────────────────────────────── */
.output-block {
  margin-bottom: 2rem;
  animation: fadeSlideIn 0.2s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Echo of typed command */
.cmd-echo {
  color: var(--green);
  margin-bottom: 0.75rem;
  font-size: 13px;
}
.cmd-echo::before {
  content: 'daniel@golkov:~$ ';
  color: var(--green-dim);
}

/* General output text */
.output-text {
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.8;
  max-width: 72ch;
}

/* Section heading inside output */
.output-heading {
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Rich text block – for about/music/page content */
.output-rich {
  max-width: 68ch;
  line-height: 1.85;
  color: var(--text);
}

.output-rich p {
  margin-bottom: 1rem;
}

.output-rich p:last-child {
  margin-bottom: 0;
}

.output-rich strong, .output-rich b {
  color: var(--text-bright);
  font-weight: 700;
}

.output-rich em, .output-rich i {
  color: var(--blue);
  font-style: normal;       /* keep mono feel, just recolor */
}

.output-rich a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.output-rich ul,
.output-rich ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.output-rich li {
  margin-bottom: 0.3rem;
  color: var(--text);
}

.output-rich ul li::marker {
  content: '▸  ';
  color: var(--green-dim);
}

/* Highlighted key-value lines */
.kv-table {
  border-collapse: collapse;
  margin-bottom: 1.25rem;
}

.kv-row {
  display: flex;
  gap: 1.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}
.kv-row:last-of-type {
  border-bottom: none;
}

.kv-key {
  color: var(--amber);
  min-width: 130px;
  flex-shrink: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.kv-val {
  color: var(--text-bright);
}

/* Divider between kv-block and prose */
.output-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0 1.25rem;
}

/* Tag chips */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.tag {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--blue);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius);
  font-size: 11px;
  letter-spacing: 0.03em;
}

/* Error / warning messages */
.output-error {
  color: var(--red);
}
.output-error::before {
  content: '✗  ';
}

/* Help table */
.help-table {
  width: 100%;
  border-collapse: collapse;
}
.help-table tr {
  border-bottom: 1px solid var(--border);
}
.help-table tr:last-child {
  border-bottom: none;
}
.help-table td {
  padding: 0.4rem 0.5rem;
}
.help-table td:last-child {
  color: var(--muted);
  font-size: 13px;
}

.help-cmd-btn {
  background: none;
  border: none;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--green-dim);
  transition: color var(--transition), text-decoration-color var(--transition);
}
.help-cmd-btn:hover {
  color: var(--text-bright);
  text-decoration-color: var(--green);
}

/* ─── Photo Gallery ─────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 0.75rem;
}

.photo-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.photo-thumb:hover {
  border-color: var(--green);
  transform: scale(1.02);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85);
  transition: filter var(--transition);
}

.photo-thumb:hover img {
  filter: saturate(1);
}

/* Lightbox */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox.open {
  display: flex;
}
#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
}

/* ─── Prompt / Input Area ───────────────────────────────────────── */
#prompt-area {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0 1rem;
  flex-shrink: 0;
}

/* Quick command buttons */
#quick-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.quick-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.quick-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Input row */
#input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#prompt-label {
  color: var(--green-dim);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 14px;
  caret-color: var(--green);
}

#cmd-input::placeholder {
  color: var(--muted);
}

/* ─── About Section Buttons ─────────────────────────────────────── */
.about-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.about-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.about-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.about-btn--active {
  border-color: var(--green);
  color: var(--green);
  background: var(--bg-hover);
}

.about-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
}
.about-detail--open {
  max-height: 800px;
  margin-top: 1.25rem;
}

/* ─── Timeline ───────────────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tl-item {
  display: flex;
  gap: 1.25rem;
  padding: 0.6rem 0;
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  position: relative;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.tl-active::before {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.tl-year {
  color: var(--amber);
  font-size: 12px;
  min-width: 52px;
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.tl-body {
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}
.tl-sub {
  color: var(--muted);
  font-size: 12px;
}

/* ─── Stack groups ───────────────────────────────────────────────── */
.stack-group {
  margin-bottom: 0.9rem;
}
.stack-label {
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.4rem;
}
.boot-line {
  color: var(--muted);
  font-size: 12px;
  opacity: 0;
  animation: bootFade 0.3s ease forwards;
}
.boot-ok {
  color: var(--green);
}

@keyframes bootFade {
  to { opacity: 1; }
}

/* ─── Legal footer links ────────────────────────────────────────── */
#legal-links {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.legal-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.legal-btn:hover {
  color: var(--text);
}

.legal-sep {
  color: var(--border);
  font-size: 11px;
  user-select: none;
}

/* ─── Scrollbar ─────────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ─── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  html { font-size: 14px; }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kv-key {
    min-width: 110px;
  }

  #quick-cmds {
    gap: 0.3rem;
  }

  .quick-btn {
    font-size: 12px;
    padding: 0.2rem 0.55rem;
  }
}

/* ─── Large / 4K screens ────────────────────────────────────────── */
@media (min-width: 1920px) {
  html { font-size: 17px; }
  #terminal-root { max-width: 1200px; }
}

@media (min-width: 2560px) {
  html { font-size: 20px; }
  #terminal-root { max-width: 1400px; }
}
