/* ==========================================================================
   Sections — page-specific layout for each part of the site
   ========================================================================== */

/* ---- Hero ---- */

/* The hero is a permanent dark "brand moment" (like a title card),
   independent of the site's light/dark toggle — a light-mode galaxy
   doesn't read as premium, and the rest of the page still follows the
   visitor's theme. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: var(--nav-height);
  overflow: hidden;
  background: #0b0b0c;
  color: #f5f5f7;
  --dot-color: rgba(10, 124, 255, 0.4);
}

.hero .lead {
  color: #a1a1a6;
}

.hero .btn-ghost {
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* Full-bleed dot-grid backdrop, faded toward the edges so it reads as
   atmosphere rather than a hard grid. Base color is --dot-color (blue,
   forced above); a second white layer is masked to a spotlight that
   follows the cursor (--mx/--my, set by js/animations.js) so the field
   shimmers blue -> white under the pointer. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(var(--dot-color) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 45%, transparent 85%);
  mask-image: radial-gradient(ellipse at center, #000 45%, transparent 85%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.95) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(circle 220px at var(--mx, -9999px) var(--my, -9999px), #000 0%, transparent 70%);
  mask-image: radial-gradient(circle 220px at var(--mx, -9999px) var(--my, -9999px), #000 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.hero.is-dot-hover::after {
  opacity: 1;
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-6);
  width: 100%;
  min-height: 100dvh;
}

.hero__content {
  position: relative;
  justify-self: start;
  max-width: 560px;
}

.hero__content h1 {
  margin-bottom: var(--space-3);
}

.hero__content .lead {
  max-width: 46ch;
  margin-bottom: var(--space-4);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Its own grid column beside the text — never overlapping it, so hover
   reaches every particle and nothing sits on top of the copy. */
.hero__stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  justify-self: end;
}

.hero__mark {
  position: relative;
  width: min(80vh, 640px);
  max-width: 100%;
  will-change: transform;
  filter: drop-shadow(0 40px 90px rgba(10, 124, 255, 0.22));
}

/* Shared by every [data-particle-logo] instance (hero + about, currently).
   The <img> is the fallback/no-JS version; js/particle-logo.js hides it
   and shows the <canvas> once it can sample pixels from the image. */
.particle-img {
  display: block;
  width: 100%;
  height: auto;
}

.particle-canvas {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Spans the full hero (not just the logo's column) so it reads as
   ambient light behind the whole scene, centered on roughly where the
   mark sits — confining it to the logo's own column left a visible
   rectangular seam against the plain background beside it. */
.hero__glow {
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at 72% 45%, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 55%);
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 640px) {
  .hero__glow {
    background: radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 55%);
  }
}

/* ---- Value proposition ---- */

.value-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4) var(--space-3);
}

.value-list__item {
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

.value-list__item .index {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--color-accent);
}

.value-list__item h3 {
  margin-block: var(--space-1);
  font-size: 1.25rem;
}

.value-list__item p {
  color: var(--color-text-muted);
}

/* ---- Services (asymmetric zig-zag rows) ---- */

.service-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-top: 1px solid var(--color-border);
  align-items: start;
}

.service-row:last-child {
  border-bottom: 1px solid var(--color-border);
}

.service-row:nth-child(even) .service-row__label {
  order: 2;
}

.service-row__label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.service-row__label .index {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.service-row__label h3 {
  font-size: var(--fs-h3);
}

.service-row__body p.lead {
  margin-bottom: var(--space-2);
}

.service-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---- Work / showcase (full-bleed alternating tiles) ---- */

.work-tile {
  padding-block: var(--space-section);
}

.work-tile__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-5);
  align-items: center;
}

.work-tile:nth-child(even) .work-tile__visual {
  order: 2;
}

.work-tile__visual {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-tile__visual svg {
  width: 100%;
  height: 100%;
}

/* ---- Shuffling color swatches (E-commerce tile) ----
   All six squares share the same 2x3 grid, which happens to have every
   cell on its own perimeter — so a single ring path visits all of them.
   Each <g> animates along that ring starting from its own slot, so the
   squares continuously and smoothly trade places like a conveyor belt.
   The hover scale/glow lives on the inner <rect> instead of the <g> so
   it never fights with the running position animation. */
.ecom-swatch {
  fill: var(--swatch-color);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 220ms ease, filter 220ms ease;
  cursor: pointer;
}

.ecom-swatch:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 12px 26px var(--swatch-color));
}

.ecom-tile {
  animation-duration: 18s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.ecom-tile--1 { animation-name: ecom-ring-1; }
.ecom-tile--2 { animation-name: ecom-ring-2; }
.ecom-tile--3 { animation-name: ecom-ring-3; }
.ecom-tile--4 { animation-name: ecom-ring-4; }
.ecom-tile--5 { animation-name: ecom-ring-5; }
.ecom-tile--6 { animation-name: ecom-ring-6; }

@keyframes ecom-ring-1 {
  0%, 100% { transform: translate(0, 0); }
  16.66% { transform: translate(105px, 0); }
  33.33% { transform: translate(210px, 0); }
  50% { transform: translate(210px, 110px); }
  66.66% { transform: translate(105px, 110px); }
  83.33% { transform: translate(0, 110px); }
}

@keyframes ecom-ring-2 {
  0%, 100% { transform: translate(0, 0); }
  16.66% { transform: translate(105px, 0); }
  33.33% { transform: translate(105px, 110px); }
  50% { transform: translate(0, 110px); }
  66.66% { transform: translate(-105px, 110px); }
  83.33% { transform: translate(-105px, 0); }
}

@keyframes ecom-ring-3 {
  0%, 100% { transform: translate(0, 0); }
  16.66% { transform: translate(0, 110px); }
  33.33% { transform: translate(-105px, 110px); }
  50% { transform: translate(-210px, 110px); }
  66.66% { transform: translate(-210px, 0); }
  83.33% { transform: translate(-105px, 0); }
}

@keyframes ecom-ring-4 {
  0%, 100% { transform: translate(0, 0); }
  16.66% { transform: translate(0, -110px); }
  33.33% { transform: translate(105px, -110px); }
  50% { transform: translate(210px, -110px); }
  66.66% { transform: translate(210px, 0); }
  83.33% { transform: translate(105px, 0); }
}

@keyframes ecom-ring-5 {
  0%, 100% { transform: translate(0, 0); }
  16.66% { transform: translate(-105px, 0); }
  33.33% { transform: translate(-105px, -110px); }
  50% { transform: translate(0, -110px); }
  66.66% { transform: translate(105px, -110px); }
  83.33% { transform: translate(105px, 0); }
}

@keyframes ecom-ring-6 {
  0%, 100% { transform: translate(0, 0); }
  16.66% { transform: translate(-105px, 0); }
  33.33% { transform: translate(-210px, 0); }
  50% { transform: translate(-210px, -110px); }
  66.66% { transform: translate(-105px, -110px); }
  83.33% { transform: translate(0, -110px); }
}

/* ---- Plate + glow (Restaurant tile) ---- */
.rest-icon__glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: rest-glow-pulse 6s ease-in-out infinite;
}

.rest-icon__plate {
  transform-box: fill-box;
  transform-origin: center;
  animation: rest-plate-breathe 7s ease-in-out infinite;
}

.rest-icon__fork,
.rest-icon__knife {
  transform-box: fill-box;
  transform-origin: center;
  animation: rest-utensil-sway 5s ease-in-out infinite;
}

.rest-icon__knife {
  animation-delay: -2.5s; /* sways opposite the fork instead of in lockstep */
}

@keyframes rest-glow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes rest-plate-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

@keyframes rest-utensil-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ecom-tile,
  .rest-icon__glow,
  .rest-icon__plate,
  .rest-icon__fork,
  .rest-icon__knife {
    animation: none;
  }
}

.node-network-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---- Cursor-tracking 3D cube (Luxury / 3D Product tile) ---- */
/* Pure CSS 3D + JS (js/cube.js) — no model/video asset. The cube tilts
   toward the cursor anywhere on screen, easing back to a resting 3/4
   angle when idle. Edit --cube-size to resize; face styling below. */

.cube-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
}

.cube {
  --cube-size: 130px;
  position: relative;
  width: var(--cube-size);
  height: var(--cube-size);
  transform-style: preserve-3d;
  transform: rotateX(-18deg) rotateY(28deg);
  will-change: transform;
}

.cube__face {
  position: absolute;
  inset: 0;
  width: var(--cube-size);
  height: var(--cube-size);
  background: linear-gradient(135deg, rgba(10, 124, 255, 0.28), rgba(10, 124, 255, 0.04));
  border: 1px solid rgba(10, 124, 255, 0.45);
  box-shadow: inset 0 0 40px rgba(10, 124, 255, 0.18);
}

.cube__face--front {
  transform: translateZ(calc(var(--cube-size) / 2));
}
.cube__face--back {
  transform: rotateY(180deg) translateZ(calc(var(--cube-size) / 2));
}
.cube__face--right {
  transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2));
}
.cube__face--left {
  transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2));
}
.cube__face--top {
  transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2));
  background: linear-gradient(135deg, rgba(10, 124, 255, 0.4), rgba(10, 124, 255, 0.1));
}
.cube__face--bottom {
  transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2));
  background: linear-gradient(135deg, rgba(10, 124, 255, 0.16), rgba(10, 124, 255, 0.02));
}

@media (prefers-reduced-motion: reduce) {
  .cube {
    transition: none;
  }
}

.work-tile__category {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.work-tile__index {
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

.work-tile h3 {
  margin-block: var(--space-2);
}

.work-tile__meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-block: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.section-dark .work-tile__meta {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.work-tile__meta h4 {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.work-tile__meta ul li {
  font-size: var(--fs-small);
  padding-block: 0.15rem;
}

.work-tile__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-3);
}

.work-tile__budget {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/* ---- Process (stepper) ---- */

.process-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
}

.process-track::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
}

.process-track__fill {
  position: absolute;
  top: 22px;
  left: 0;
  height: 1px;
  width: 0%;
  background: var(--color-accent);
  transition: width 900ms var(--ease-spring);
}

.process-step {
  position: relative;
  padding-top: var(--space-4);
}

.process-step__dot {
  position: absolute;
  top: 14px;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-border-strong);
  transition: border-color var(--duration-base) ease, background-color var(--duration-base) ease;
}

.process-step.is-active .process-step__dot {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.process-step .index {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--color-text-muted);
}

.process-step h4 {
  font-size: 1.0625rem;
  margin-block: 0.35rem;
}

.process-step p {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

/* ---- Pricing ---- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  align-items: end;
}

.pricing-card {
  position: relative;
}

.pricing-card.is-featured {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lifted);
  transform: translateY(-8px);
}

.pricing-card__badge {
  position: absolute;
  top: -14px;
  left: var(--space-4);
  background: var(--color-accent);
  color: #fff;
  font-size: var(--fs-micro);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
}

.pricing-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-1);
}

.pricing-card__price {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.pricing-card__price span {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  font-weight: 400;
  white-space: nowrap;
}

.pricing-card__desc {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  margin-bottom: var(--space-3);
}

.pricing-card ul {
  margin-bottom: var(--space-4);
}

.pricing-card ul li {
  display: flex;
  gap: 0.6rem;
  font-size: var(--fs-small);
  padding-block: 0.4rem;
  border-top: 1px solid var(--color-border);
}

.pricing-card ul li:first-child {
  border-top: none;
}

.pricing-note {
  margin-top: var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--fs-small);
}

.pricing-addon {
  margin-top: var(--space-3);
  text-align: center;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

/* ---- About ---- */

.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--space-5);
  align-items: center;
}

.about-portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.about-portrait .particle-img {
  width: 78%;
  opacity: 0.9;
}

.about-founder {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.about-founder strong {
  color: var(--color-text);
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
}

/* ---- Why us ---- */

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.why-card {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
}

.section-dark .why-card {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.why-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.why-card p {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
}

.section-dark .why-card p {
  color: #a1a1a6;
}

/* ---- FAQ ---- */

.faq-list {
  max-width: 760px;
}

/* ---- Final CTA ---- */

.final-cta {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.final-cta__inner {
  max-width: 640px;
}

.final-cta h2 {
  margin-bottom: var(--space-4);
}

.final-cta__actions {
  display: flex;
  justify-content: center;
}

/* ---- Contact strip (inside footer area) ---- */

.contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  margin-top: var(--space-4);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.section-dark .contact-strip {
  color: #a1a1a6;
}

.contact-strip a:hover {
  color: var(--color-accent);
}

/* ---- Start a Project page ---- */

.project-form-page {
  padding-top: calc(var(--nav-height) + var(--space-5));
  padding-bottom: var(--space-section);
}

.project-form-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: var(--space-5);
  align-items: start;
}

.project-form-aside h1 {
  font-size: var(--fs-h2);
  margin-bottom: var(--space-2);
}

.project-form-aside ul {
  margin-top: var(--space-4);
}

.project-form-aside ul li {
  display: flex;
  gap: 0.6rem;
  padding-block: 0.6rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--fs-small);
}

.project-form-aside ul li:first-child {
  border-top: none;
}

/* ---- Legal pages ---- */

.legal-page {
  padding-top: calc(var(--nav-height) + var(--space-5));
  padding-bottom: var(--space-section);
  max-width: 760px;
}

.legal-page h1 {
  font-size: var(--fs-h2);
  margin-bottom: var(--space-2);
}

.legal-page .updated {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  margin-bottom: var(--space-5);
}

.legal-page h2 {
  font-size: 1.375rem;
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

.legal-page p, .legal-page li {
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.legal-page ul {
  padding-left: 1.25rem;
  list-style: disc;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .value-list,
  .why-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .process-track {
    grid-template-columns: repeat(4, 1fr);
    row-gap: var(--space-4);
  }

  .process-track::before,
  .process-track__fill {
    display: none;
  }
}

@media (max-width: 900px) {
  .work-tile__grid,
  .about-grid,
  .project-form-layout {
    grid-template-columns: 1fr;
  }

  .work-tile:nth-child(even) .work-tile__visual {
    order: -1;
  }

  .service-row {
    grid-template-columns: 1fr;
  }

  .service-row:nth-child(even) .service-row__label {
    order: 0;
  }

  .pricing-card.is-featured {
    transform: none;
  }
}

@media (max-width: 640px) {
  .nav__cta {
    display: none;
  }

  .nav__brand-text {
    display: none;
  }

  /* Not enough width for side-by-side columns — stack the mark below
     the text instead, and shrink it. */
  .hero__grid {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: var(--space-8) var(--space-6);
    gap: var(--space-4);
  }

  .hero__stage {
    justify-self: center;
  }

  .hero__mark {
    width: min(60vw, 260px);
  }
}

/* Collapses to the hamburger menu earlier than the content breakpoints
   below — translated nav labels (RU/ES) plus the language switcher run
   out of room in the ~800-1024px tablet range well before the page
   content itself needs to reflow. */
@media (max-width: 1024px) {
  .nav__links,
  .nav__toggle {
    display: none;
  }

  .nav.is-open .nav__links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-3);
    gap: var(--space-2);
  }

  .nav__burger {
    display: flex;
  }
}

@media (max-width: 768px) {
  .value-list,
  .why-grid,
  .pricing-grid,
  .process-track {
    grid-template-columns: 1fr;
  }

  .work-tile__meta {
    grid-template-columns: 1fr;
  }
}
