@import 'var.css';

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --text: #f8f8f6;
    --muted: #9ca3af;
    --accent: #023ea8;
  }
}

/* Header & Back Link (Remains as you liked it) */
header {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 100;
}

.back-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.15s ease;
  font-size: 0.95rem;
  position: relative;
  display: inline-block;
}

.back-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.1em;
  width: 0;
  height: 0.1em;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.back-link:hover {
  color: var(--accent);
}

.back-link:hover::after {
  width: 100%;
}

/* Projects Layout */
.projects-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
  min-height: 100vh;
}

.projects-main h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
}

.projects-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.project {
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(107, 114, 128, 0.2);
}

.project:last-child {
  border-bottom: none;
}

.project h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.project-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 400;
}

.project-description {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  /* background: var(--text); */
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* --- THE PERFECTED TYPING ANIMATION --- */
.typing-text-project {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  width: 0;
  /* Forcing specific font and spacing for mathematical character width alignment */
  font-family: 'Source Code Pro', monospace;
  letter-spacing: 0;
  animation: typing-final 1.5s steps(12, end) forwards;
}

.typing-text-project::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.6em;
  height: 0.15em;
  background-color: var(--text);
  animation: 
    blink-caret-final 0.4s step-end 4, 
    fade-out-final 0.1s ease-out 1.6s forwards;
}

@keyframes typing-final {
  from { width: 0; }
  to { width: 12ch; } /* "my projects." is exactly 12 characters */
}

@keyframes blink-caret-final {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes fade-out-final {
  to { opacity: 0; }
}