/* =========================================================================
   Ahmad Shaabaninejad — Portfolio
   Terminal / developer aesthetic. Complements Tailwind (loaded via CDN).
   ========================================================================= */

:root {
  --term-green: #3ddc84;
  --term-amber: #ffbd2e;
  --term-red: #ff5f56;
  --term-blue: #57c7ff;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* offset for sticky nav */
}

body {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    Menlo, monospace;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Persian typography + RTL ------------------------------------------------ */
html[lang="fa"] body {
  font-family: "Vazirmatn", "JetBrains Mono", ui-monospace, monospace;
}
html[dir="rtl"] .flip-x {
  transform: scaleX(-1);
}
/* Keep the terminal prompt glyphs LTR even inside RTL text */
html[dir="rtl"] .force-ltr {
  direction: ltr;
  unicode-bidi: embed;
  display: inline-block;
}

/* Terminal window chrome -------------------------------------------------- */
.terminal {
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  display: inline-block;
}
.dot-red { background: var(--term-red); }
.dot-amber { background: var(--term-amber); }
.dot-green { background: var(--term-green); }

.prompt::before {
  content: "$ ";
  color: var(--term-green);
  font-weight: 700;
}

/* Blinking caret for the typing effect ------------------------------------ */
.caret {
  display: inline-block;
  width: 0.6ch;
  animation: blink 1s steps(1) infinite;
  color: var(--term-green);
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* Scroll-reveal ----------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.reveal.revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .caret { animation: none; }
}

/* Timeline ---------------------------------------------------------------- */
.timeline-item::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 0.35rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background: var(--term-green);
  box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.18);
}
html[dir="rtl"] .timeline-item::before {
  left: auto;
  right: -0.5rem;
}

/* Utility: subtle grid background for the hero ---------------------------- */
.grid-bg {
  background-image:
    linear-gradient(rgba(61, 220, 132, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 220, 132, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Nav link underline animation ------------------------------------------- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 0;
  background: var(--term-green);
  transition: width 0.25s ease;
}
.nav-link:hover::after {
  width: 100%;
}
