/*
  style.css
  Dead Pixel — personal profile site
  Written by Dead Pixel (iamreal.dpx@gmail.com)
*/

:root {
  --bg: #0a0b0d;
  --surface: #14161a;
  --surface-2: #1b1e24;
  --text: #e7e9ec;
  --muted: #8b909a;
  --cyan: #4fe3c1;
  --magenta: #ff4fa3;
  --border: #24272d;

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --max-width: 720px;
  --topbar-height: 3.25rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 0.5rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.6;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Scroll progress bar ---------- */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  z-index: 100;
  transition: width 0.1s linear;
}

/* ---------- Top bar / nav ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 1.25rem;
  background: rgba(10, 11, 13, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  font-size: 0.95rem;
}

.topbar__nav {
  display: flex;
  gap: 1.5rem;
}

.topbar__nav a {
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  padding: 0.25rem 0.1rem;
}

.topbar__nav a:hover {
  color: var(--text);
}

.topbar__nav a.is-active {
  color: var(--cyan);
  border-color: var(--cyan);
}

.topbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.topbar__toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

@media (max-width: 640px) {
  .topbar__toggle {
    display: flex;
  }

  .topbar__nav {
    position: absolute;
    top: var(--topbar-height);
    right: 0;
    left: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .topbar__nav.is-open {
    max-height: 16rem;
  }

  .topbar__nav a {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
}

/* ---------- Hero / terminal ---------- */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.terminal__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.terminal__dot--r { background: #ff5f56; }
.terminal__dot--y { background: #ffbd2e; }
.terminal__dot--g { background: #27c93f; }

.terminal__path {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.terminal__body {
  padding: 1rem 1rem 0.5rem;
  min-height: 9rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.terminal__line {
  margin: 0 0 0.4rem;
}

.terminal__line--muted { color: var(--muted); }
.terminal__line--cyan { color: var(--cyan); }
.terminal__line--magenta { color: var(--magenta); }

.terminal__cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--cyan);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.terminal__input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.terminal__prompt {
  color: var(--cyan);
  font-size: 0.85rem;
  white-space: nowrap;
}

.terminal__input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.terminal__input::placeholder {
  color: var(--muted);
}

.terminal__input:focus {
  outline: none;
}

.terminal__input-row:focus-within {
  background: var(--surface-2);
}

/* ---------- Sections ---------- */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
}

.section__label {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--cyan);
  margin: 0 0 1rem;
  font-weight: 600;
}

.section__lead {
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

.section__body {
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.section__note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* Scroll reveal: sections fade/slide in once, on first view */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- What I Make: empty state + future cards ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.empty-card,
.project-card {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 1.25rem;
}

.project-card {
  border-style: solid;
  cursor: pointer;
}

.project-card__details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.project-card.is-expanded .project-card__details {
  max-height: 20rem;
}

.empty-card__title {
  margin: 0 0 0.4rem;
  color: var(--text);
}

.empty-card__body {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Skills tags (interactive) ---------- */

.focus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--cyan);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag:hover {
  border-color: var(--cyan);
}

.tag.is-active {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
}

/* ---------- Footer ---------- */

.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ---------- Device-mode hooks (set by main.ts) ---------- */

body.is-mobile .hero {
  padding-top: 1.5rem;
}

body.is-desktop .section {
  padding-left: 2rem;
  padding-right: 2rem;
}
