:root {
  --bg: #0a0a0a;
  --text: #7ee787;
  --text-dim: #4ea95f;
  --text-dimmer: #2d5a33;
  --border: rgba(126, 231, 135, 0.08);
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;

  --page-px: clamp(1.5rem, 5vw, 5rem);
  --content-max: 1400px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* =========================
   HERO
   ========================= */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--page-px);
  position: relative;
}

.hero-content {
  max-width: var(--content-max);
  width: 100%;
}

.terminal-line {
  display: block;
  line-height: 1.1;
  margin-bottom: 0.35em;
}

.terminal-line:last-child {
  margin-bottom: 0;
}

.typed {
  display: inline-block;
  position: relative;
  min-height: 1em;
}

.hero-welcome {
  font-size: clamp(1.1rem, 2.4vw, 1.9rem);
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2.8rem, 9vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
  text-shadow: 0 0 40px rgba(126, 231, 135, 0.12);
}

/* Blinking cursor (applied via JS as it moves between lines) */
.cursor-after::after {
  content: '_';
  display: inline-block;
  margin-left: 0.08em;
  color: var(--text);
  animation: blink 1.1s step-end infinite;
  font-weight: 400;
}

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

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 1.2s ease;
  letter-spacing: 0.15em;
  text-transform: lowercase;
  pointer-events: none;
}

.scroll-hint.visible {
  opacity: 0.65;
}

.scroll-arrow {
  animation: bounce 2s ease infinite;
  font-size: 0.95rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* =========================
   PROJECTS
   ========================= */
.projects {
  padding: clamp(6rem, 15vh, 12rem) var(--page-px);
  max-width: var(--content-max);
}

.projects-header {
  margin-bottom: clamp(2.5rem, 5vh, 4rem);
}

.section-label {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-label.visible {
  opacity: 0.6;
  transform: translateY(0);
}

.project {
  display: grid;
  grid-template-columns: minmax(130px, 170px) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 0.1s, transform 0.8s ease 0.1s;
}

.project.visible .project-meta {
  opacity: 1;
  transform: translateY(0);
}

.project-number {
  color: var(--text-dim);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.project-status {
  color: var(--text-dimmer);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.project-body {
  max-width: 680px;
}

.project-title {
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 1.4rem;
  min-height: 1em;
}

.project-description {
  font-size: clamp(0.95rem, 1.3vw, 1.08rem);
  line-height: 1.7;
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s ease 0.55s, transform 0.9s ease 0.55s;
}

.project.visible .project-description {
  opacity: 0.85;
  transform: translateY(0);
}

/* =========================
   FOOTER
   ========================= */
footer {
  padding: 2.5rem var(--page-px) 3rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--content-max);
}

.footer-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  opacity: 0.45;
  letter-spacing: 0.03em;
}

/* =========================
   ACCESSIBILITY & RESPONSIVE
   ========================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 640px) {
  /* Force "tinker" and "studios" onto separate lines BEFORE typing starts,
     so the typewriter effect never triggers a mid-word reflow. */
  .hero-space {
    display: none;
  }

  .hero-word {
    display: block;
  }

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

  .project-meta {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding-top: 0;
  }

  .scroll-hint {
    bottom: 1.75rem;
  }
}

::selection {
  background: rgba(126, 231, 135, 0.2);
  color: var(--text);
}
