/* PrimeAxis Services — layout: sticky header, split hero, section bands, card grids */
/* Palette: deep slate ground, electric indigo accent, hue-biased neutrals */

:root {
  /* color — light */
  --bg:        #f6f7fb;
  --surface:   #ffffff;
  --surface-2: #eef0f7;
  --fg:        #171826;
  --muted:     #565a72;
  --line:      #e0e3ef;
  --accent:    #4f46e5;
  --accent-2:  #7c6cf5;
  --accent-ink:#ffffff;
  --good:      #16a34a;
  --code-bg:   #0e1022;
  --code-fg:   #d6dcf5;

  /* type */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* layout */
  --wrap: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23,24,38,.06), 0 12px 32px -12px rgba(23,24,38,.18);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0b0d1a;
    --surface:   #141729;
    --surface-2: #1b1f36;
    --fg:        #eef0fb;
    --muted:     #9aa0c0;
    --line:      #262b48;
    --accent:    #7c6cf5;
    --accent-2:  #a897ff;
    --accent-ink:#0b0d1a;
    --good:      #4ade80;
    --code-bg:   #080a16;
    --code-fg:   #d6dcf5;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 40px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:        #0b0d1a;
  --surface:   #141729;
  --surface-2: #1b1f36;
  --fg:        #eef0fb;
  --muted:     #9aa0c0;
  --line:      #262b48;
  --accent:    #7c6cf5;
  --accent-2:  #a897ff;
  --accent-ink:#0b0d1a;
  --good:      #4ade80;
  --code-bg:   #080a16;
  --code-fg:   #d6dcf5;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 40px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -.015em; }
h3 { font-size: 1.18rem; }
p  { margin: 0; }

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .76rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: .9rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 600; font-size: .95rem;
  padding: .72rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px var(--accent); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  background: var(--bg); z-index: 51;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--fg); }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; line-height: 1; display: flex; flex-direction: column; }
.brand-sub { font-size: .62rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.nav { display: flex; gap: 1.7rem; }
.nav a { font-size: .94rem; font-weight: 500; color: var(--muted); position: relative; }
.nav a:hover,
.nav a.active { color: var(--fg); }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: var(--accent); transition: width .2s ease; }
.nav a:hover::after,
.nav a.active::after { width: 100%; }
.nav a.active { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: .6rem; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
/* Toggle icon reflects the chosen mode: auto (no data-theme) / light / dark */
.theme-toggle svg { display: none; }
.theme-toggle .icon-auto { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-auto { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: inline; }
:root[data-theme="dark"]  .theme-toggle .icon-auto { display: none; }
:root[data-theme="dark"]  .theme-toggle .icon-moon { display: inline; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; align-items: center; justify-content: center; }
.menu-toggle span { width: 18px; height: 2px; background: var(--fg); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-copy .lede { font-size: 1.14rem; color: var(--muted); margin-top: 1.1rem; max-width: 34ch; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.7rem; }
.hero-stats { list-style: none; margin: 2.4rem 0 0; padding: 0; display: flex; gap: 1.6rem; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--font-display); font-size: 1.05rem; }
.hero-stats span { font-size: .82rem; color: var(--muted); }

.hero-visual { perspective: 1200px; }
.code-card {
  position: relative;
  background: var(--code-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.07);
  overflow: hidden; transform: rotateY(-6deg) rotateX(3deg);
  transform-style: preserve-3d; will-change: transform;
  transition: transform .4s ease;
}
.code-card:hover { transform: rotateY(0) rotateX(0); }

/* Pointer-follow glare sheen */
.glare {
  position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.22), rgba(255,255,255,0) 45%);
  mix-blend-mode: screen; z-index: 2;
}

/* 3D tilt primitives (JS sets inline transform; these are the resting/transition base) */
.tilt { transform-style: preserve-3d; will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .code-card, .tilt { transform: none !important; }
  .glare { display: none; }
}
.code-bar { display: flex; align-items: center; gap: .4rem; padding: .7rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.code-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a3f5c; }
.code-bar span:nth-child(1) { background: #ff5f57; } .code-bar span:nth-child(2) { background: #febc2e; } .code-bar span:nth-child(3) { background: #28c840; }
.code-bar em { margin-left: auto; font-style: normal; font-size: .76rem; color: #8b91b5; font-family: var(--font-display); }
.code-card pre { margin: 0; padding: 1.2rem 1.3rem; overflow-x: auto; }
.code-card code { font-family: ui-monospace, "Cascadia Code", "Consolas", monospace; font-size: .86rem; line-height: 1.8; color: var(--code-fg); white-space: pre; }
.c-k { color: #7c6cf5; } .c-g { color: #4ade80; } .c-d { color: #8b91b5; }

/* ---------- Trust strip ---------- */
.strip { border-block: 1px solid var(--line); background: var(--surface); }
.strip-inner { display: flex; flex-wrap: wrap; gap: 1rem 2.4rem; padding-block: 1rem; justify-content: center; }
.strip-inner span { font-family: var(--font-display); font-size: .82rem; font-weight: 500; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 46ch; margin-bottom: 2.6rem; }
.section-lede { color: var(--muted); margin-top: .9rem; font-size: 1.05rem; }

/* ---------- Cards / services ---------- */
.grid { display: grid; gap: 1.1rem; }
.services { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.section-alt .card { background: var(--surface-2); }
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.card-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem;
}
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .96rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 3.6rem); align-items: start; }
.about-copy p { color: var(--muted); margin-top: 1rem; }
.facts { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.facts li { display: flex; flex-direction: column; padding: .9rem 1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.section-alt .facts li { background: var(--surface); }
.facts strong { font-family: var(--font-display); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.facts span { margin-top: .25rem; font-weight: 500; }
.about-values { display: flex; flex-direction: column; gap: 1rem; }
.value { padding: 1.3rem 1.4rem; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.section-alt .value { background: var(--surface); }
.value h4 { font-size: 1.05rem; margin-bottom: .35rem; }
.value p { color: var(--muted); font-size: .94rem; }

/* ---------- Process ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; counter-reset: s; }
.steps li { position: relative; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.section-alt .steps li { background: var(--surface-2); }
.step-n { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--accent); display: inline-block; margin-bottom: .8rem; }
.steps h3 { margin-bottom: .4rem; }
.steps p { color: var(--muted); font-size: .92rem; }

/* ---------- Objects ---------- */
.objects { margin: 0; padding: 0; list-style: none; counter-reset: o; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.6rem; }
.objects li { counter-increment: o; position: relative; padding: 1rem 1rem 1rem 3.1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .96rem; }
.objects li::before {
  content: counter(o, decimal-leading-zero);
  position: absolute; left: 0; top: 1rem;
  font-family: var(--font-display); font-weight: 700; font-size: .9rem; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  width: 2.2rem; height: 2.2rem; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.6rem); align-items: start; }
.contact-copy p { color: var(--muted); margin-top: 1rem; }
.contact-list { list-style: none; margin: 1.8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.contact-list li { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); flex-wrap: wrap; }
.c-label { font-family: var(--font-display); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); min-width: 72px; }
.c-value { font-weight: 500; }
.copy { margin-left: auto; font-size: .78rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--accent); cursor: pointer; font-family: var(--font-display); }
.copy:hover { border-color: var(--accent); }
.copy.done { color: var(--good); border-color: var(--good); }

.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-size: .82rem; font-weight: 600; font-family: var(--font-display); }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: .96rem; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .85rem; width: 100%; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.form-note { font-size: .86rem; color: var(--good); font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-top: 3rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 2rem; }
.footer-brand { max-width: 36ch; }
.footer-brand p { color: var(--muted); font-size: .9rem; margin-top: .8rem; }
.footer-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: flex-start; }
.footer-nav a { color: var(--muted); font-size: .92rem; }
.footer-nav a:hover { color: var(--accent); }
.footer-base { border-top: 1px solid var(--line); padding-block: 1.3rem; font-size: .84rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 480px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .objects { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav { display: none; }
  .header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 0;
  }
  .nav.open a { padding: .85rem max(20px, env(safe-area-inset-left, 0px)); }
  .nav.open a::after { display: none; }
}
@media (max-width: 480px) {
  .services { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.2rem; }
}
