/* ── Variables ── */
:root {
  --font: YekanBakhFamily, system-ui, sans-serif;
  --bg: #0a0e17;
  --bg-card: #111827;
  --bg-elevated: #1a2234;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf5;
  --text-muted: #8b9ab8;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --container: min(1120px, 92vw);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font-family: inherit; }

.container { width: var(--container); margin-inline: auto; }

/* ── Background glow ── */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(34, 211, 238, 0.12), transparent),
    radial-gradient(ellipse 50% 40% at 10% 60%, rgba(167, 139, 250, 0.1), transparent);
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(10, 14, 23, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
}

.logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--gradient);
  color: #0a0e17;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.nav-cta {
  background: rgba(34, 211, 238, 0.12) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Hero ── */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding-block: 5rem 4rem;
  min-height: calc(100vh - 70px);
}

.hero-content {
  min-width: 0;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 32rem;
  margin-bottom: 1.25rem;
}

.hero-tech {
  margin-bottom: 1.75rem;
  max-width: 36rem;
  min-width: 0;
  width: 100%;
}

.hero-tech-lead {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.tech-marquee {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  direction: ltr;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  margin-bottom: 0.65rem;
  contain: layout paint;
}

.tech-marquee-inner {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
  will-change: transform;
}

.tech-marquee-track {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  padding-inline: 0.25rem;
}

.tech-marquee-track span {
  flex-shrink: 0;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .tech-marquee { display: none; }
  .tech-list-static { display: flex; flex-wrap: wrap; justify-content: center; }
}

.tech-list-static {
  display: none;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.tech-list-static li {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.15);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient);
  color: #0a0e17;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(34, 211, 238, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: rgba(255,255,255,0.05); }
.btn-full { width: 100%; }

.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Code window */
.hero-visual { display: flex; justify-content: center; }

.code-window {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.code-window-bar {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.code-window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #374151;
}

.code-window-bar span:nth-child(1) { background: #ef4444; }
.code-window-bar span:nth-child(2) { background: #f59e0b; }
.code-window-bar span:nth-child(3) { background: #22c55e; }

.code-snippet {
  padding: 1.25rem;
  font-size: 0.82rem;
  line-height: 1.8;
  direction: ltr;
  text-align: left;
  overflow-x: auto;
}

.c-keyword { color: #c084fc; }
.c-prop { color: #67e8f9; }
.c-str { color: #86efac; }

/* ── Sections ── */
.section { position: relative; z-index: 1; padding-block: 4.5rem; }

.section-header { margin-bottom: 2.5rem; }

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
}

.section-sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.4rem;
}

/* ── Services ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.service-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition);
}

.service-card:hover {
  border-color: rgba(34, 211, 238, 0.3);
  transform: translateY(-3px);
}

.service-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }

.service-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.service-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ── Projects (expandable boxes) ── */
.projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  border-color: rgba(34, 211, 238, 0.25);
}

.project-card.open {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.08);
}

.project-card-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
  font: inherit;
  color: inherit;
  transition: background var(--transition);
}

.project-header-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.project-card-header:hover { background: rgba(255, 255, 255, 0.03); }
.project-card-header:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.5);
  outline-offset: -2px;
}

.project-thumb {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.project-head-text {
  flex: 1;
  min-width: 0;
}

.project-head-text h3 {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}

.project-head-text .project-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-right: calc(38px + 0.65rem);
}

.project-tag {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.project-tag--cat {
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.project-tag--stack {
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.15);
}

.project-chevron {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), color var(--transition);
}

.project-card.open .project-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.project-card-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card.open .project-card-body {
  grid-template-rows: 1fr;
}

.project-card-inner {
  overflow: hidden;
  min-height: 0;
}

.project-card-content {
  padding: 0 0.85rem 0.9rem;
  border-top: 1px solid transparent;
  transition: border-color 0.3s ease 0.1s;
}

.project-card.open .project-card-content {
  border-top-color: var(--border);
  padding-top: 0.75rem;
}

.project-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.65rem;
}

.project-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.project-features li {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-right: 0.9rem;
  position: relative;
}

.project-features li::before {
  content: "•";
  position: absolute;
  right: 0;
  color: var(--accent-2);
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text h2 {
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  font-weight: 800;
  margin: 0.5rem 0 1rem;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.about-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.about-features li {
  padding-right: 1.4rem;
  position: relative;
  font-size: 0.92rem;
}

.about-features li::before {
  content: "✓";
  position: absolute;
  right: 0;
  color: var(--accent);
  font-weight: 700;
}

.about-tools-wrap {
  display: flex;
  flex-direction: column;
}

.about-tools-lead {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.about-tools {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.about-tool-card {
  padding: 1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.about-tool-card:hover {
  border-color: rgba(34, 211, 238, 0.25);
}

.about-tool-label {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.about-tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.about-tool-tags span {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Contact ── */
.contact-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-info h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 800;
  margin: 0.5rem 0 0.75rem;
}

.contact-info > p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-link {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
  direction: ltr;
  text-align: left;
}

.contact-link span {
  font-size: 0.75rem;
  color: var(--text-muted);
  direction: rtl;
  text-align: right;
}

.contact-link:hover { border-color: rgba(34, 211, 238, 0.3); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-form label span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.contact-form input,
.contact-form textarea {
  padding: 0.7rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.4);
}

.contact-form textarea { resize: vertical; min-height: 100px; }

.form-note {
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.form-note.success {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.back-top {
  color: var(--accent);
  font-size: 0.85rem;
}

.back-top:hover { text-decoration: underline; }

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Mobile ── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-block: 3rem 2.5rem;
    min-height: auto;
    text-align: center;
  }

  .hero-desc { margin-inline: auto; }
  .hero-tech { margin-inline: auto; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { order: -1; }
  .code-window { max-width: 300px; }

  .about-grid,
  .contact-box {
    grid-template-columns: 1fr;
  }

  .about-tools {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 62px;
    right: 0;
    left: 0;
    flex-direction: column;
    background: rgba(10, 14, 23, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.25rem;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform var(--transition), opacity var(--transition);
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

  .projects-list {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.6rem;
  }

  .project-head-text .project-sub { display: none; }

  .tech-marquee { display: none; }

  .tech-list-static {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 0;
  }

  .tech-list-static li {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }

  .hero-tech {
    max-width: 100%;
    margin-bottom: 1.25rem;
    overflow: hidden;
  }

  .hero-tech-lead {
    font-size: 0.72rem;
    line-height: 1.5;
    margin-bottom: 0.4rem;
  }

  .about-tools {
    grid-template-columns: 1fr;
  }

  .about-tool-card {
    padding: 0.85rem 0.95rem;
  }

  .about-tool-tags span {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
  }

  .project-tags-row { padding-right: 0; }

  .contact-box { padding: 1.5rem; }
  .section { padding-block: 3rem; }
}

@media (max-width: 480px) {
  .tech-list-static li {
    font-size: 0.6rem;
    padding: 0.12rem 0.38rem;
  }

  .hero-tech-lead {
    font-size: 0.68rem;
  }
}

@media (max-width: 380px) {
  .hero-stats { gap: 1.25rem; }
  .stat strong { font-size: 1.3rem; }
}
