/* =========================================================
   THE STACK SOLUTIONS — stylesheet
   Design tokens live in :root. Change colors/spacing there
   and they cascade through the whole site.
   ========================================================= */

:root {
  /* -- surfaces (light theme, matching the subdomain) -- */
  --ink: #FFFFFF;
  --surface: #F4F5F8;
  --surface-2: #EAECF1;
  --line: #E1E4EA;
  --line-soft: #EBEDF1;

  /* -- text -- */
  --text: #171B22;
  --text-muted: #5B6472;
  --text-dim: #8A93A1;

  /* -- accents (code-editor inspired) -- */
  --blue: #2F6FED;
  --blue-soft: rgba(47, 111, 237, 0.09);
  --mint: #0B8F6F;
  --mint-soft: rgba(11, 143, 111, 0.09);
  --violet: #7C5CFC;
  --violet-soft: rgba(124, 92, 252, 0.09);

  /* -- forced-dark tokens for the hero's code-editor widget only —
     a code window reads as authentic when it stays dark like a real
     editor, even though the rest of the site is light -- */
  --code-bg: #10141C;
  --code-surface: #171C27;
  --code-line: #262C3A;
  --code-text-dim: #7C8598;
  --code-accent: #35D0A2;

  /* -- type -- */
  --font-display: 'Segoe UI Semibold', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* -- layout -- */
  --max-width: 1180px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
}

/* =========================== RESET =========================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* subtle dot-grid backdrop, like an editor canvas */
body {
  background-image: radial-gradient(circle, rgba(23,27,34,0.06) 1px, transparent 1px);
  background-size: 26px 26px;
}

::selection { background: var(--blue); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* =========================== TYPE =========================== */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }

.eyebrow, .section-eyebrow, .contact-label, .brand-mark, .window-title, .preview-logo-text {
  font-family: var(--font-mono);
}

.eyebrow, .section-eyebrow {
  color: var(--mint);
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  margin-bottom: 10px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 44px;
}

/* =========================== BUTTONS =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--blue);
  color: #ffffff;
}
.btn-primary:hover { background: #6ba0ff; }

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
}
.btn-ghost:hover { border-color: var(--blue); }

.btn-sm { padding: 9px 18px; font-size: 0.88rem; }
.btn-full { width: 100%; }

/* =========================== HEADER =========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
  margin-right: auto;
}
.brand-mark {
  color: var(--mint);
  font-size: 1.15rem;
  font-weight: 500;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.main-nav {
  display: flex;
  gap: 28px;
}
.main-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.main-nav a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 0 auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================== HERO =========================== */
.hero { padding: 88px 0 64px; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 22px;
}
.hero-title-accent { color: var(--blue); }

.hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-trust-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* -- hero code / preview window signature element -- */
.hero-visual {
  position: relative;
  height: 380px;
}

.code-window, .preview-window {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(23,27,34,0.18);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* the code editor stays dark deliberately — it reads as an actual
   code editor, which wouldn't look right in the site's light theme */
.code-window {
  background: var(--code-bg);
  border-color: var(--code-line);
}
.code-window .window-bar {
  background: var(--code-surface);
  border-bottom-color: var(--code-line);
}
.code-window .window-title { color: var(--code-text-dim); }
.code-window .window-code { color: var(--code-accent); }

.preview-window {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}
.preview-window.visible {
  opacity: 1;
  transform: scale(1);
}
.code-window.hidden {
  opacity: 0;
  transform: scale(0.98);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-r { background: #FF5F57; }
.dot-y { background: #FEBC2E; }
.dot-g { background: #28C840; }
.window-title {
  margin-left: 8px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.window-code {
  margin: 0;
  padding: 22px 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--mint);
  white-space: pre-wrap;
  min-height: 220px;
}
.caret {
  color: var(--blue);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.preview-body { padding: 20px; }
.preview-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.preview-logo {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  margin-right: auto;
}
.preview-link {
  width: 36px; height: 8px;
  border-radius: 4px;
  background: var(--line);
}
.preview-hero { margin-bottom: 22px; }
.preview-line {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: var(--line);
  margin-bottom: 10px;
}
.preview-line-lg { width: 78%; height: 18px; background: var(--text-dim); }
.preview-line-md { width: 55%; }
.preview-btn {
  display: inline-block;
  width: 100px;
  height: 30px;
  border-radius: 999px;
  background: var(--blue);
  margin-top: 6px;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.preview-grid span {
  height: 60px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* =========================== TRUST MARQUEE =========================== */
.trust-bar {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  padding: 22px 0;
  background: var(--surface);
}
.trust-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: marquee 26s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.trust-chip {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text-dim);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* =========================== SECTIONS =========================== */
.section { padding: 84px 0; }
.section-alt { background: var(--surface); }

/* =========================== SERVICES =========================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.section-alt .service-card { background: var(--ink); }
.service-card:hover {
  border-color: var(--blue);
  transform: translateY(-3px);
}
.service-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.service-card h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.service-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* =========================== PROJECTS =========================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.section-alt .project-card { background: var(--surface); }
.project-card:hover { transform: translateY(-4px); border-color: var(--blue); }

.project-thumb {
  height: 170px;
  position: relative;
  overflow: hidden;
}
.project-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 14px);
}
.project-thumb-blue { background: linear-gradient(135deg, #14203A, #1C3A6B); }
.project-thumb-violet { background: linear-gradient(135deg, #201436, #4A2E7A); }
.project-thumb-mint { background: linear-gradient(135deg, #0F2A24, #14523F); }
.project-thumb-mark {
  position: absolute;
  bottom: 14px;
  left: 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
}

.project-body { padding: 22px; }
.project-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--violet);
  margin-bottom: 8px;
  display: block;
}
.project-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.project-body p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 18px; }
.project-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.project-link:hover { text-decoration: underline; }

/* =========================== PRODUCTS =========================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-tag {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mint);
  background: var(--mint-soft);
  padding: 3px 9px;
  border-radius: 999px;
}
.product-category {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.product-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.product-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; flex-grow: 1; }
.product-price {
  display: none;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}
.product-price span {
  display: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 6px;
}

/* =========================== CONTACT =========================== */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.contact-list { margin-top: 28px; }
.contact-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.contact-list a {
  font-size: 1.15rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.contact-list a:hover { color: var(--blue); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.contact-form input,
.contact-form textarea {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--blue);
  outline: none;
}
.form-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
}

/* =========================== FOOTER =========================== */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-top: 64px;
  background: var(--surface);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}
.footer-brand .brand-mark { font-size: 1.1rem; }
.footer-brand .brand-name {
  font-family: var(--font-display);
  margin-left: 8px;
  font-size: 1rem;
}
.footer-tagline {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 14px;
  max-width: 260px;
}
.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 10px;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--line-soft);
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* =========================== RESPONSIVE =========================== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { height: 320px; order: -1; }
  .contact-inner { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav { 
    position: absolute;
    top: 72px;
    left: 0; right: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line-soft);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}

/* =========================================================
   SCROLL REVEAL
   Elements with .reveal start hidden/offset; js/script.js
   adds .reveal-visible via IntersectionObserver as they
   enter the viewport. Cards get the same treatment inline
   from their render functions.
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}
/* stagger children of a grid slightly for a nicer cascade */
.services-grid .reveal-visible:nth-child(2n) { transition-delay: 0.06s; }
.services-grid .reveal-visible:nth-child(3n) { transition-delay: 0.12s; }
.projects-grid .reveal-visible:nth-child(2n) { transition-delay: 0.08s; }
.team-grid .reveal-visible:nth-child(2n) { transition-delay: 0.06s; }
.team-grid .reveal-visible:nth-child(3n) { transition-delay: 0.12s; }
.products-grid .reveal-visible:nth-child(2n) { transition-delay: 0.05s; }
.products-grid .reveal-visible:nth-child(3n) { transition-delay: 0.1s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   PARALLAX
   Hero visual and the dot-grid backdrop drift at a slightly
   different rate than the page scroll — js/script.js sets
   --parallax-y on #parallaxLayer as the user scrolls.
   ========================================================= */
.parallax-layer {
  transform: translateY(calc(var(--parallax-y, 0px)));
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .parallax-layer { transform: none !important; }
}

/* =========================================================
   CUSTOM CURSOR
   A full-viewport canvas draws a smooth trailing "tail" behind
   the pointer (js/script.js does the drawing). Disabled
   automatically on touch devices and prefers-reduced-motion.
   ========================================================= */
.cursor-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
body.cursor-ready .cursor-canvas { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .cursor-canvas { display: none; }
}

/* buttons get a magnetic transform from JS on mousemove (inline
   style, so it naturally overrides the CSS hover lift above) */

/* =========================================================
   TEAM
   ========================================================= */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.team-card {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.team-card:hover { border-color: var(--blue); transform: translateY(-3px); }

.team-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--text-dim);
  overflow: hidden;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }

.team-card h3 { font-size: 1.02rem; margin-bottom: 4px; }
.team-role {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mint);
}
