/* ===== Variables ===== */
:root {
  --bg: #0a0a0c;
  --bg-card: rgba(18, 18, 22, 0.8);
  --bg-card-hover: rgba(28, 28, 35, 0.9);
  --text: #e8e8ec;
  --text-muted: #8888a0;
  --accent-cyan: #00e5cc;
  --accent-magenta: #e040b0;
  --accent-amber: #f0a020;
  --border: rgba(255, 255, 255, 0.06);
  --border-solid: rgba(255, 255, 255, 0.08);
  --glow-cyan: 0 0 40px rgba(0, 229, 204, 0.2);
  --glow-magenta: 0 0 40px rgba(224, 64, 176, 0.2);
  --font-heading: 'Unbounded', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --radius: 16px;
  --radius-lg: 24px;
  --header-h: 72px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ===== Background effects ===== */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.gradient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.gradient-orb--1 {
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 60%);
  top: -20vmax;
  right: -15vmax;
  animation: float 20s ease-in-out infinite;
}
.gradient-orb--2 {
  width: 45vmax;
  height: 45vmax;
  background: radial-gradient(circle, var(--accent-magenta) 0%, transparent 60%);
  bottom: -15vmax;
  left: -10vmax;
  animation: float 25s ease-in-out infinite reverse;
}
.gradient-orb--3 {
  width: 30vmax;
  height: 30vmax;
  background: radial-gradient(circle, var(--accent-amber) 0%, transparent 60%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float 18s ease-in-out infinite 2s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(5%, -5%); }
  66% { transform: translate(-5%, 5%); }
}

/* ===== Layout ===== */
.header, main, .footer {
  position: relative;
  z-index: 1;
}
body.menu-open { overflow: hidden; }

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 102;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 24px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ===== Logo dot ===== */
.logo-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 204, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(0, 229, 204, 0); }
}

.nav {
  display: flex;
  gap: 32px;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav a:hover { color: var(--accent-cyan); }
.nav-lang {
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.nav-lang:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }

.burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.burger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ===== Sections ===== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 100px;
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.section__subtitle {
  color: var(--text-muted);
  margin: 0 0 48px;
  font-size: 1.05rem;
}

/* ===== Section tag ===== */
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-tag::before {
  content: '// ';
  opacity: 0.5;
}

/* ===== Section header (services flex layout) ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0;
  gap: 2rem;
  flex-wrap: wrap;
}

/* ===== Hero ===== */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* ===== Hero grid background ===== */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black 25%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black 25%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero__label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  margin: 0 0 20px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
  position: relative;
  z-index: 1;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.hero__title-line {
  display: block;
  opacity: 0;
  transform: translateY(1em);
  animation: fadeUp 0.8s ease forwards;
}
.hero__title-line:nth-child(1) { animation-delay: 0.15s; }
.hero__title-line:nth-child(2) { animation-delay: 0.3s; }
.hero__title-line:nth-child(3) { animation-delay: 0.45s; }

.hero__title-line--accent {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 1.15rem;
  margin: 0 0 40px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.6s forwards;
  position: relative;
  z-index: 1;
}

.hero__cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.75s forwards;
  position: relative;
  z-index: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00b8a8);
  color: var(--bg);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.hero__scroll {
  margin-top: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 1s forwards;
  position: relative;
  z-index: 1;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent-cyan), transparent);
  border-radius: 1px;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.5; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ===== Services ===== */
.services .section-header {
  margin-bottom: 0;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5px;
  background: var(--border-solid);
  margin-top: 40px;
}

.service-card {
  background: var(--bg);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: background 0.4s ease;
}

.service-card:hover {
  background: var(--bg-card-hover);
}

.service-card:hover .service-arrow {
  opacity: 1;
  transform: translate(0, 0);
}

.service-card:hover .service-card__icon {
  color: var(--accent-cyan);
  transform: scale(1.1) rotate(-5deg);
}

/* ===== Service number ===== */
.service-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-bottom: 16px;
  opacity: 0.6;
}

.service-card__icon {
  font-size: 1.8rem;
  color: var(--accent-cyan);
  margin-bottom: 16px;
  opacity: 0.8;
  display: block;
  transition: color 0.4s ease, transform 0.4s ease;
}

.service-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
}

.service-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 380px;
}

/* ===== Service arrow (appears on hover) ===== */
.service-arrow {
  position: absolute;
  top: 28px;
  right: 28px;
  font-size: 1.4rem;
  color: var(--accent-cyan);
  opacity: 0;
  transform: translate(-8px, 8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

/* ===== Marquee section ===== */
.marquee-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-solid);
  border-bottom: 1px solid var(--border-solid);
  overflow: hidden;
}

.marquee-track {
  display: flex;
  animation: marquee-scroll 28s linear infinite;
  width: max-content;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-item {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  white-space: nowrap;
  padding: 0 1.5rem;
  color: rgba(255, 255, 255, 0.07);
  letter-spacing: -0.02em;
  transition: color 0.3s;
  user-select: none;
}

.marquee-item:hover {
  color: rgba(255, 255, 255, 0.18);
}

.marquee-sep {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--accent-cyan);
  opacity: 0.45;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

/* ===== Projects ===== */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 260px;
  transition: transform 0.3s ease, border-color 0.3s, box-shadow 0.3s;
  will-change: transform;
}

.project-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(224, 64, 176, 0.3);
  box-shadow: var(--glow-magenta);
}

.project-card--featured {
  grid-column: span 12;
  min-height: 320px;
}

.project-card__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 229, 204, 0.08), rgba(224, 64, 176, 0.08));
  opacity: 0;
  transition: opacity 0.3s;
}
.project-card:hover .project-card__bg { opacity: 1; }

.project-card__content {
  position: relative;
  z-index: 1;
  padding: 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
}

.project-card__tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-magenta);
  margin-bottom: 10px;
}

.project-card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.project-card--featured h3 { font-size: 1.75rem; }

.project-card p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.project-card__link {
  margin-top: auto;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-cyan);
  opacity: 0.9;
  text-decoration: none;
  transition: opacity 0.2s;
}
.project-card__link:hover {
  opacity: 1;
  color: var(--accent-cyan);
}
.project-card__link--muted {
  color: var(--text-muted);
  cursor: default;
}
.project-card__link--muted:hover {
  color: var(--text-muted);
}

/* Grid: 2 cols on tablet, 3 on desktop */
@media (min-width: 768px) {
  .project-card { grid-column: span 6; }
}
@media (min-width: 1024px) {
  .project-card { grid-column: span 4; }
}

/* ===== Contact ===== */
.contact {
  position: relative;
  overflow: hidden;
}

.cta-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 70% at 50% 100%, rgba(0, 229, 204, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.contact .section-tag,
.contact .section__title,
.contact__text,
.contact__links {
  position: relative;
  z-index: 1;
}

.contact__text {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 0 32px;
  font-size: 1.05rem;
}

.contact__links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  padding: 16px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.contact-link:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
}

/* ===== Footer ===== */
.footer {
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== Scroll-triggered animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 101;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: var(--header-h) 24px 24px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
  }
  .nav.open { transform: translateX(0); }
  .nav a {
    font-size: 1.25rem;
    display: block;
    width: 100%;
    max-width: 280px;
    padding: 16px 20px;
    text-align: center;
    min-height: 48px;
    line-height: 1.4;
    margin: 0 auto;
    box-sizing: border-box;
  }
  .burger { display: flex; }
  .burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .burger.open span:nth-child(2) { opacity: 0; }
  .burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

  .hero__cta { flex-direction: column; }
  .btn { width: 100%; }

  .services__grid {
    grid-template-columns: 1fr;
  }

  .projects__grid { grid-template-columns: 1fr; }
  .project-card--featured,
  .project-card:not(.project-card--featured) { grid-column: span 1; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (min-width: 768px) {
  .nav { display: flex !important; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .gradient-orb { animation: none; }
  .marquee-track { animation: none; }
}

.tg-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  background: #2AABEE;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 999;
  transition: transform 0.2s, box-shadow 0.2s;
}
.tg-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(42,171,238,0.4);
}
