/* ── Variables ───────────────────────────────────────────────── */
:root {
  --bg-deep:    #1E0B2C;
  --bg-dark:    #0F0718;
  --bg-surface: #2A1440;
  --gold:       #D4A853;
  --gold-light: #E8C87A;
  --mint:       #4ECDC4;
  --text:       #F5F0E8;
  --muted:      #9B8FA8;
  --border:     #3D2552;

  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-body:    'Plus Jakarta Sans', sans-serif;
  --ff-mono:    'JetBrains Mono', monospace;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--ff-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(42, 20, 64, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.logo-mark {
  width: 30px;
  height: 36px;
  flex-shrink: 0;
}
.logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-name {
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  color: var(--text);
}
.logo-sub {
  font-family: var(--ff-body);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-cta {
  color: var(--gold) !important;
  border: 1px solid rgba(212, 168, 83, 0.4);
  padding: 0.4rem 1.1rem;
  border-radius: 4px;
  transition: background 0.2s !important;
}
.nav-cta:hover {
  background: rgba(212, 168, 83, 0.1) !important;
  color: var(--gold-light) !important;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 6rem;
  overflow: hidden;
}
.circuit-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cp {
  stroke: var(--gold);
  stroke-width: 1;
  fill: none;
  opacity: 0.18;
}
.cn {
  fill: var(--gold);
  opacity: 0.3;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--mint);
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  flex-shrink: 0;
  animation: dotPulse 2.5s ease-in-out infinite;
}
.hero-title {
  font-family: var(--ff-display);
  font-size: clamp(2.8rem, 7.5vw, 5.75rem);
  font-weight: 800;
  line-height: 1.04;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}
.title-white { color: var(--text); }
.title-gold  { color: var(--gold); }
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--muted);
  max-width: 460px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 1;
}
.hero-scroll span {
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollDrop 2.2s ease-in-out infinite;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold);
  color: #0F0718;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.85rem 1.7rem;
  border-radius: 4px;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(155, 143, 168, 0.35);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}
.btn-large {
  font-size: 1rem;
  padding: 1rem 2.2rem;
}

/* ── Section shared ──────────────────────────────────────────── */
.section-eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 0.75rem;
}
.section-header {
  margin-bottom: 3rem;
}
.section-header h2 {
  font-family: var(--ff-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.section-desc {
  color: var(--muted);
  max-width: 500px;
  line-height: 1.65;
}

/* ── About ───────────────────────────────────────────────────── */
.about {
  background: var(--bg-dark);
  padding: 7rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.about-text h2 {
  font-family: var(--ff-display);
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}
.about-text p {
  color: var(--muted);
  margin-bottom: 0.9rem;
  line-height: 1.7;
  font-size: 0.975rem;
}
.about-stats {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  border-left: 1px solid var(--border);
  padding-left: 3rem;
}
.stat-value {
  display: block;
  font-family: var(--ff-display);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ── Portfolio ───────────────────────────────────────────────── */
.portfolio {
  padding: 7rem 0;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}
.portfolio-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 260px;
  transition: border-color 0.25s, transform 0.2s;
}
.portfolio-card:hover {
  border-color: rgba(212, 168, 83, 0.45);
  transform: translateY(-3px);
}
.portfolio-card.featured {
  border-color: rgba(212, 168, 83, 0.28);
}
.portfolio-card.coming-soon {
  border-style: dashed;
  border-color: var(--border);
  justify-content: center;
  align-items: center;
}
.portfolio-card.coming-soon:hover {
  border-color: rgba(212, 168, 83, 0.25);
  transform: none;
}
.card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tag {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.lang-ts   { background: rgba(49, 120, 198, 0.18); color: #60A5FA; }
.tag-live  { background: rgba(78, 205, 196, 0.15); color: var(--mint); }
.tag-agro  { background: rgba(100, 180, 80, 0.18); color: #86EFAC; }
.tag-chat  { background: rgba(168, 85, 247, 0.18); color: #C084FC; }
.tag-ecom  { background: rgba(251, 146, 60, 0.18); color: #FB923C; }
.portfolio-card h3 {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
}
.portfolio-card > p {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
  flex: 1;
}
.card-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 0.2s;
}
.card-link:hover { color: var(--text); }
.card-link-primary {
  margin-left: auto;
  color: var(--gold);
}
.card-link-primary:hover { color: var(--gold-light); }
.coming-soon-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}
.coming-icon { opacity: 0.45; margin-bottom: 0.25rem; }
.coming-label {
  font-family: var(--ff-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}
.coming-sub {
  font-size: 0.75rem;
  color: rgba(155, 143, 168, 0.55);
}

/* ── Services ────────────────────────────────────────────────── */
.services {
  background: var(--bg-dark);
  padding: 7rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.service-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.25s, transform 0.2s;
}
.service-card:hover {
  border-color: rgba(78, 205, 196, 0.35);
  transform: translateY(-2px);
}
.service-icon {
  margin-bottom: 1.25rem;
  width: 48px;
  height: 48px;
  background: rgba(78, 205, 196, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-card h3 {
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}
.service-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Contact ─────────────────────────────────────────────────── */
.contact {
  padding: 8rem 0;
  text-align: center;
}
.contact-inner {
  max-width: 580px;
  margin: 0 auto;
}
.contact-inner h2 {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.1;
}
.contact-inner p {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 1rem;
  line-height: 1.7;
}
.contact-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.contact-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--mint);
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid rgba(78, 205, 196, 0.35);
  padding: 0.85rem 1.5rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.contact-phone:hover {
  background: rgba(78, 205, 196, 0.08);
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-copy {
  font-size: 0.78rem;
  color: var(--muted);
}
.footer-github {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s;
}
.footer-github:hover { color: var(--text); }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes drawCircuit {
  to { stroke-dashoffset: 0; }
}
@keyframes dotPulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%       { opacity: 0.4; transform: scale(0.75); }
}
@keyframes scrollDrop {
  0%        { transform: scaleY(0); transform-origin: top;    opacity: 1; }
  50%       { transform: scaleY(1); transform-origin: top;    opacity: 1; }
  50.01%    { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100%      { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .about-grid { gap: 3rem; }
}

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .about-stats {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .services-grid  { grid-template-columns: 1fr; }
  .hero { padding: 7rem 1.5rem 5rem; }
  .hero-scroll { display: none; }
  .about,
  .portfolio,
  .services,
  .contact { padding: 5rem 0; }
  .contact-inner h2 { font-size: 2.2rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .nav { padding: 1rem 1.25rem; }
  .hero { padding: 6rem 1.25rem 4rem; }
}

/* ── Fade-in (JS-driven) ─────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cp  { animation: none !important; stroke-dashoffset: 0 !important; }
  .eyebrow-dot { animation: none; }
  .scroll-line { animation: none; height: 0; }
  .btn-primary:hover,
  .service-card:hover,
  .portfolio-card:hover { transform: none; }
}
