/* ── Terminal theme ── */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --green:        #00ff41;
  --green-dim:    #00cc33;
  --green-dark:   #004d14;
  --bg:           #0d0d0d;
  --titlebar-bg:  #1e1e1e;
  --titlebar-border: #333;
  --window-border: #2a2a2a;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #111;
  background-image: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 100%);
  color: var(--green);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

/* Scanline overlay */
body::after {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.10) 2px,
    rgba(0, 0, 0, 0.10) 4px
  );
  z-index: 9999;
}

/* ── Window chrome ── */

.terminal-window {
  width: 100%;
  max-width: 820px;
  border: 1px solid var(--window-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px #000,
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(0, 255, 65, 0.04);
}

/* Title bar */
.terminal-titlebar {
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--titlebar-border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.titlebar-buttons {
  display: flex;
  gap: 6px;
  margin-right: 0.75rem;
}

.titlebar-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.btn-close   { background: #ff5f57; }
.btn-min     { background: #febc2e; }
.btn-max     { background: #28c840; }

.titlebar-title {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  letter-spacing: 0.05em;
  /* offset for the buttons so text appears truly centred */
  margin-right: calc(3 * 12px + 2 * 6px + 0.75rem);
}

/* Terminal body */
.terminal-body {
  background: var(--bg);
  padding: 1.5rem 1.75rem 2rem;
  overflow-y: auto;
}

/* ASCII logo */
#logo {
  white-space: pre;
  font-size: clamp(0.42rem, 1.4vw, 0.82rem);
  line-height: 1.2;
  color: var(--green);
  text-shadow: 0 0 8px var(--green);
  margin: 0 0 1.5rem;
}

/* Prompt line */
.prompt::before {
  content: '> ';
  color: var(--green-dim);
}

/* Cursor blink */
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  background-color: var(--green);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

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

/* Section headings */
.section-heading {
  color: var(--green-dim);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--green-dark);
}

.section-heading::before {
  content: '## ';
}

/* Links */
a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid var(--green-dark);
  transition: color 0.15s, border-color 0.15s;
}

a:hover {
  color: #fff;
  border-bottom-color: var(--green);
}

/* Terminal command styling */
.cmd::before {
  content: '$ ';
  color: var(--green-dim);
  user-select: none;
}

/* Section reveal (htmx lazy load) */
.section-reveal {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.section-reveal.loaded {
  opacity: 1;
}

section {
  margin-bottom: 2.5rem;
}

/* Glow on hero text */
.glow {
  text-shadow: 0 0 6px var(--green);
}
