/* ============================================================
   algoritmitech — stylesheet
   Display: Space Grotesk · Body: Inter · Mono: JetBrains Mono
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --accent: #7c6cf0;
  --accent-2: #2dd4bf;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --nav-h: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Dark (default) */
[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-2: #0f131c;
  --surface: #141926;
  --surface-2: #1b2130;
  --text: #eaecf2;
  --text-dim: #8a90a2;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --net: rgba(124, 108, 240, 0.5);
}

/* Light */
[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-2: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --text: #14161f;
  --text-dim: #5a6072;
  --border: rgba(12, 16, 28, 0.10);
  --border-strong: rgba(12, 16, 28, 0.18);
  --shadow: 0 24px 50px -22px rgba(40, 44, 70, 0.28);
  --accent: #5b47e0;
  --accent-2: #0fb5a6;
  --net: rgba(91, 71, 224, 0.35);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--font-mono); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Custom cursor ---------- */
.cursor-ring, .cursor-dot {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid var(--accent);
  transition: width 0.2s var(--ease), height 0.2s var(--ease),
              opacity 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent-2);
}
body.cursor-ready .cursor-ring,
body.cursor-ready .cursor-dot { opacity: 1; }

body.cursor-ready.cursor-hover .cursor-ring {
  width: 58px; height: 58px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent-2);
}
body.cursor-ready.cursor-card .cursor-ring {
  width: 76px; height: 76px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
/* Hide native cursor only on fine pointers */
@media (pointer: fine) {
  body.cursor-ready, body.cursor-ready a, body.cursor-ready button,
  body.cursor-ready [data-cursor] { cursor: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
}
.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn--full { width: 100%; }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav__inner {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  font-family: var(--font-mono); font-weight: 500;
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad); color: #fff; font-size: 1rem;
}
.brand__logo { height: 34px; width: auto; border-radius: 8px; }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em; }

.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-size: 0.93rem; font-weight: 500; color: var(--text-dim);
  position: relative; padding: 4px 0;
  transition: color 0.2s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--grad); border-radius: 2px;
  transition: width 0.25s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.nav__actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  transition: transform 0.4s var(--ease), background 0.3s, border-color 0.3s;
}
.theme-toggle:hover { transform: rotate(18deg); border-color: var(--border-strong); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { transition: opacity 0.3s, transform 0.4s var(--ease); }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav__burger { display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  align-items: center; justify-content: center; cursor: pointer; }
.nav__burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: calc(var(--nav-h) + 14px); right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 13px 18px; border-radius: 12px; font-size: 0.9rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: toastIn 0.4s var(--ease) both;
  max-width: 340px;
}
.toast--success { border-left: 3px solid var(--accent-2); }
.toast--error { border-left: 3px solid #f0606c; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  padding: var(--nav-h) 0 60px;
  overflow: hidden;
  background: radial-gradient(120% 80% at 80% 0%, var(--bg-2), var(--bg) 60%);
}
.hero__net { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.7; }

.hero__slides {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
}
.slide {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 50px; align-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.slide.is-active { opacity: 1; visibility: visible; position: relative; }

.slide__content > * { opacity: 0; transform: translateY(24px); }
.slide.is-active .slide__content > * { animation: riseIn 0.7s var(--ease) forwards; }
.slide.is-active .slide__content > *:nth-child(1) { animation-delay: 0.05s; }
.slide.is-active .slide__content > *:nth-child(2) { animation-delay: 0.16s; }
.slide.is-active .slide__content > *:nth-child(3) { animation-delay: 0.27s; }
.slide.is-active .slide__content > *:nth-child(4) { animation-delay: 0.38s; }
.slide.is-active .slide__content > *:nth-child(5) { animation-delay: 0.49s; }
@keyframes riseIn { to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 22px;
}
.eyebrow__num {
  color: var(--accent-2); padding: 3px 9px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.slide__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.3rem, 5.5vw, 4rem); line-height: 1.04; letter-spacing: -0.03em;
  margin-bottom: 18px;
}
.slide__subtitle { font-size: clamp(1.05rem, 2vw, 1.35rem); font-weight: 500; color: var(--text); margin-bottom: 14px; }
.slide__details { font-size: 1.02rem; color: var(--text-dim); max-width: 30em; margin-bottom: 30px; }

.slide__media {
  position: relative; aspect-ratio: 4 / 3.4; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  opacity: 0; transform: scale(1.04);
}
.slide.is-active .slide__media { animation: mediaIn 0.9s var(--ease) 0.1s forwards; }
@keyframes mediaIn { to { opacity: 1; transform: none; } }
.slide__media img { width: 100%; height: 100%; object-fit: cover; }
.slide__media--placeholder { width: 100%; height: 100%;
  background: var(--grad); position: relative; }
.slide__media--placeholder::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 40%),
                    radial-gradient(circle at 75% 70%, rgba(0,0,0,0.25), transparent 45%);
}
.slide__scrim { position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,0.35)); }

.hero__controls {
  position: absolute; z-index: 3; bottom: 38px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px;
}
.hero__arrow {
  width: 44px; height: 44px; border-radius: 50%; font-size: 1.5rem;
  display: grid; place-items: center; line-height: 1;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.hero__arrow:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.hero__dots { display: flex; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--border-strong); transition: width 0.3s var(--ease), background 0.3s; }
.dot.is-active { width: 28px; border-radius: 6px; background: var(--grad); }

.hero__scroll {
  position: absolute; bottom: 34px; right: 32px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--text-dim);
}
.hero__scroll span { width: 1px; height: 40px; background: linear-gradient(var(--accent), transparent); animation: scrollPulse 1.8s ease-in-out infinite; }
@keyframes scrollPulse { 0%,100% { opacity: 0.3; transform: scaleY(0.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* ---------- Sections shared ---------- */
.section { padding: 110px 0; position: relative; }
.section__eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2);
  margin-bottom: 14px;
}
.section__eyebrow::before { content: "// "; color: var(--text-dim); }
.section__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -0.03em;
  margin-bottom: 48px;
}
.empty-note { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.9rem; }

/* ---------- About ---------- */
.about { background: var(--bg-2); }
.about__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: center; }
.about__text .section__title { margin-bottom: 22px; }
.about__body { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 36px; }
.stats { display: flex; gap: 38px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem;
  line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { font-size: 0.85rem; color: var(--text-dim); margin-top: 6px; }

.about__visual img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.about__code { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.about__code-bar { display: flex; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.about__code-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.about__code-bar span:first-child { background: #f0606c; }
.about__code pre { padding: 22px; font-size: 0.88rem; line-height: 1.8; overflow-x: auto; color: var(--text); }
.c-accent { color: var(--accent-2); }

/* ---------- Services ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
  position: relative; overflow: hidden;
}
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card:hover::before { transform: scaleX(1); }
.card__icon { font-size: 1.9rem; margin-bottom: 16px; }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin-bottom: 10px; }
.card__body { color: var(--text-dim); font-size: 0.96rem; }

/* ---------- Products ---------- */
.products { background: var(--bg-2); }
.products__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.product:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.product__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.product__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.product:hover .product__media img { transform: scale(1.06); }
.product__media--placeholder { width: 100%; height: 100%; background: var(--grad); display: grid; place-items: center; }
.product__media--placeholder span { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; color: rgba(255,255,255,0.85); }
.product__tag { position: absolute; top: 14px; left: 14px; font-family: var(--font-mono); font-size: 0.72rem;
  padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(6px); border: 1px solid var(--border); }
.product__body { padding: 22px 22px 26px; }
.product__name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; margin-bottom: 9px; }
.product__desc { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 16px; }
.product__link { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-2); font-weight: 500; }
.product__link:hover { text-decoration: underline; }

/* ---------- Social ---------- */
.social__inner { text-align: center; }
.social__inner .section__eyebrow::before { content: "// "; }
.social__links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 8px; }
.social-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.2s var(--ease), border-color 0.3s, background 0.3s;
}
.social-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.social-card__icon { display: grid; place-items: center; color: var(--accent); }
.social-card__name { font-weight: 500; font-size: 0.95rem; }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 60px; }
.contact__lead { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 32px; }
.contact__info { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.contact__info li { display: flex; flex-direction: column; gap: 3px; }
.contact__k { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.contact__info a:hover { color: var(--accent-2); }
.contact__phone-row { display: flex; align-items: center; gap: 10px; }
.whatsapp-link {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: #25D366; color: #fff;
  transition: transform 0.2s var(--ease), box-shadow 0.3s;
  flex-shrink: 0;
}
.whatsapp-link:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45); color: #fff; }

.contact__form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 7px; color: var(--text-dim); }
.field {
  width: 100%; padding: 13px 15px; font-family: var(--font-body); font-size: 0.96rem;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea.field { resize: vertical; min-height: 120px; }
.form-row .errorlist { list-style: none; color: #f0606c; font-size: 0.82rem; margin-top: 6px; }

/* ---------- Footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 56px 0 30px; }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.footer__text { color: var(--text-dim); font-size: 0.9rem; max-width: 32em; }
.footer__socials { display: flex; gap: 10px; }
.social-chip { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  transition: transform 0.2s, color 0.2s, border-color 0.2s; }
.social-chip:hover { transform: translateY(-3px); color: var(--accent); border-color: var(--accent); }
.footer__bottom { max-width: var(--maxw); margin: 36px auto 0; padding: 22px 24px 0; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 0.84rem; color: var(--text-dim); }
.footer__mono { font-family: var(--font-mono); }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .slide { grid-template-columns: 1fr; gap: 30px; text-align: left; }
  .slide__media { order: -1; aspect-ratio: 16 / 9; }
  .about__grid, .contact__grid { grid-template-columns: 1fr; gap: 40px; }
  .cards, .products__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav__links {
    position: fixed; top: var(--nav-h); right: 0; width: min(78vw, 300px);
    height: calc(100vh - var(--nav-h)); flex-direction: column; gap: 6px;
    background: var(--surface); border-left: 1px solid var(--border);
    padding: 24px; transform: translateX(110%); transition: transform 0.35s var(--ease);
  }
  .nav__links.open { transform: none; }
  .nav__links a { padding: 12px 8px; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .nav__burger { display: flex; }
  .section { padding: 80px 0; }
  .cards, .products__grid { grid-template-columns: 1fr; }
  .hero__scroll { display: none; }
  .stats { gap: 26px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .slide__content > * { opacity: 1 !important; transform: none !important; }
  .slide__media { opacity: 1 !important; transform: none !important; }
}

/* ---------- Focus visibility ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
