/* APX Digital Solution — site styles (everything except the 3D hero, see hero.css) */

:root {
  color-scheme: light;
  --canvas: #FAFAFA;
  --surface: #FFFFFF;
  --ink: #14151A;
  --muted: #6B7080;
  --stroke: #E7E8ED;
  --night: #0B0D12;
  --night-raised: #1B1E27;
  --night-fg: #F4F5F8;
  --night-muted: #A3A8B8;
  --night-stroke: rgba(255, 255, 255, .12);
  --accent: #4F63D9;
  --accent-soft: #7788EA;
  --silver: #D1D5DF;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --gutter: clamp(20px, 5.2vw, 80px);
  --max: 1320px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* button colours, switched per tone below */
  --btn-bg: var(--ink);
  --btn-fg: var(--canvas);
}

[data-tone="dark"] { --btn-bg: #FAFAFA; --btn-fg: var(--ink); }
[data-tone="light"] { --btn-bg: var(--ink); --btn-fg: var(--canvas); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.anim { scroll-behavior: smooth; }
body, h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }

h1, h2 { font-weight: 560; letter-spacing: -.045em; line-height: 1.02; }
h2 { font-size: clamp(2.1rem, 4.6vw, 4.25rem); text-wrap: balance; max-width: 18ch; }
h3 { font-weight: 550; letter-spacing: -.03em; line-height: 1.15; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.label { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 22px; }
.lead { font-size: clamp(1.05rem, 1.35vw, 1.3rem); color: var(--muted); max-width: 46ch; line-height: 1.55; }

.services, .products, .expertise, .about, .contact { padding-block: clamp(88px, 11vw, 168px); }
main section { scroll-margin-top: var(--header-h); }

.skip {
  position: fixed; top: -80px; left: 12px; z-index: 100;
  background: var(--ink); color: var(--canvas);
  padding: 12px 18px; border-radius: 8px; font-weight: 550; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 8px;
  font-size: 15px; font-weight: 550; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bg);
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--ghost {
  background: transparent; color: inherit;
  border-color: rgba(128, 128, 140, .45);
  border-color: color-mix(in srgb, currentColor 30%, transparent);
}
.btn--small { min-height: 44px; padding: 0 18px; font-size: 14.5px; }
.btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.tl {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
  text-decoration-color: rgba(128, 128, 140, .55);
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: color .2s, text-decoration-color .2s;
}
.tl:hover { color: var(--accent); text-decoration-color: currentColor; }
[data-tone="dark"] .tl:hover { color: var(--accent-soft); }
.tl--strong {
  display: inline-flex; align-items: center; gap: .35em; min-height: 44px;
  font-weight: 550; margin-top: 14px;
}

/* ---------- header ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--header-h);
  --fg: var(--night-fg); --hl: var(--accent-soft);
  --hair: var(--night-stroke); --menu-bg: var(--night);
  color: var(--fg);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, color .3s, border-color .3s;
}
.top[data-tone="light"] {
  --fg: var(--ink); --hl: var(--accent);
  --hair: var(--stroke); --menu-bg: var(--canvas);
  background: rgba(250, 250, 250, .86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: var(--stroke);
}
/* over dark sections the bar stays clear at the very top, then gets a night backing so content can pass under it */
.top[data-tone="dark"].scrolled {
  background: rgba(11, 13, 18, .82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.top-in { height: 100%; display: flex; align-items: center; gap: 8px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-size: 16px; text-decoration: none; letter-spacing: -.01em; white-space: nowrap;
}
.brand b { font-weight: 600; }
.brand-mark { flex: none; border-radius: 7px; }
.top-links { margin-left: auto; display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); }
.top-links a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 15px; font-weight: 500; text-decoration: none; transition: color .2s;
}
.top-links a:not(.btn):hover { color: var(--hl); }
.menu-btn {
  display: none; align-items: center; min-height: 44px; padding: 0 6px;
  background: none; border: 0; cursor: pointer; font-size: 15px; font-weight: 500;
}
.menu-btn:hover { color: var(--hl); }
.menu {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--menu-bg); color: var(--fg);
  padding: 4px var(--gutter) 12px; border-bottom: 1px solid var(--hair);
}
.menu[hidden] { display: none; }
.menu a {
  display: flex; align-items: center; min-height: 52px;
  font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; text-decoration: none;
}
.menu a + a { border-top: 1px solid var(--hair); }
.menu a:hover { color: var(--hl); }

@media (max-width: 859px) {
  .top-links a:not(.btn) { display: none; }
  .menu-btn { display: inline-flex; }
}
@media (min-width: 860px) {
  .menu { display: none !important; }
}
@media (max-width: 479px) {
  .brand-word { display: none; }
}
@media (max-width: 399px) {
  .btn--small { padding: 0 12px; font-size: 14px; }
  .menu-btn { padding: 0 2px; }
}

/* ---------- section heads ---------- */
.sec-head { display: grid; gap: 28px; align-items: end; }
@media (min-width: 900px) {
  .sec-head { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); }
  .sec-head .lead { justify-self: end; padding-bottom: .35em; }
}

/* ---------- services ---------- */
.services { background: var(--canvas); }
.service-list { margin-top: clamp(56px, 7vw, 104px); border-bottom: 1px solid var(--stroke); }
.service {
  --svc-h3: clamp(1.35rem, 2.3vw, 2.1rem);
  display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(16px, 3vw, 48px); align-items: baseline;
  padding-block: clamp(28px, 3.4vw, 48px);
  border-top: 1px solid var(--stroke);
}
.service h3 { font-size: var(--svc-h3); }
.service p { font-size: 16px; color: var(--muted); max-width: 52ch; }
.swatch {
  align-self: start; width: 22px; height: 22px; border-radius: 6px;
  margin-top: calc((var(--svc-h3) * 1.15 - 22px) / 2);
}
.swatch--silver { background: var(--silver); box-shadow: inset 0 0 0 1px rgba(20, 21, 26, .12); }
.swatch--cobalt { background: var(--accent); }
@media (max-width: 819px) {
  .service { grid-template-columns: 22px minmax(0, 1fr); row-gap: 14px; column-gap: 18px; }
  .service p { grid-column: 2; }
}

/* ---------- products ---------- */
.products { background: var(--surface); border-block: 1px solid var(--stroke); }
.products-grid { display: grid; gap: clamp(48px, 7vw, 72px); }
.products-intro .lead { margin-top: 28px; }
.product-list { list-style: none; }
.product { padding-block: clamp(28px, 3.2vw, 44px); border-top: 1px solid var(--stroke); }
.product:last-child { border-bottom: 1px solid var(--stroke); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; line-height: 1.4; }
.cat { color: var(--muted); }
.status { display: inline-flex; align-items: center; color: var(--ink); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; }
.dot--live { background: var(--accent); }
.dot--house { background: var(--silver); box-shadow: inset 0 0 0 1px rgba(20, 21, 26, .12); }
.product h3 { font-size: clamp(1.8rem, 3.4vw, 3rem); margin-top: 14px; }
.desc { font-size: 16px; color: var(--muted); max-width: 56ch; margin-top: 16px; }
.note {
  font-size: 14px; color: var(--ink); margin-top: 20px;
  padding-left: 14px; border-left: 1px solid var(--muted);
}
@media (min-width: 1000px) {
  .products-grid { grid-template-columns: minmax(0, .38fr) minmax(0, .62fr); gap: clamp(48px, 7vw, 112px); align-items: start; }
  .products-intro { position: sticky; top: calc(var(--header-h) + 40px); }
}

/* ---------- expertise ---------- */
.expertise { background: var(--canvas); }
.domains { list-style: none; margin-top: clamp(56px, 7vw, 104px); display: grid; grid-template-columns: minmax(0, 1fr); }
.domain { border-top: 1px solid var(--stroke); padding-block: 28px; }
.domain h3 { font-size: 1.15rem; }
.domain p { font-size: 15.5px; color: var(--muted); margin-top: 8px; max-width: 52ch; }
@media (min-width: 820px) {
  .domains { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 6vw, 96px); }
}

/* ---------- about ---------- */
.about { background: var(--canvas); border-top: 1px solid var(--stroke); }
.about-grid { display: grid; gap: 36px; }
.about-copy p { font-size: clamp(1.1rem, 1.5vw, 1.4rem); color: var(--muted); line-height: 1.55; }
.about-copy p + p { margin-top: 1.2em; }
.about-copy strong { color: var(--ink); font-weight: 500; }
.points { display: grid; gap: 0; margin-top: clamp(64px, 8vw, 120px); }
.point { border-top: 1px solid var(--stroke); padding-top: 28px; padding-bottom: 28px; }
.point h3 { font-size: 1.25rem; }
.point p { font-size: 15.5px; color: var(--muted); margin-top: 10px; max-width: 44ch; }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(48px, 7vw, 120px); align-items: start; }
}
@media (min-width: 760px) {
  .points { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 64px); }
  .point { padding-bottom: 0; }
}

/* ---------- contact ---------- */
.contact { background: var(--night); color: var(--night-fg); color-scheme: dark; }
.contact h2 { font-size: clamp(3rem, 8.6vw, 8.5rem); line-height: .98; max-width: 11ch; }
.contact .lead { color: var(--night-muted); margin-top: 28px; }
.contact-grid { display: grid; gap: 48px; margin-top: 64px; }
.contact-note { color: var(--night-muted); font-size: 16px; max-width: 44ch; }
.next-steps { list-style: none; counter-reset: step; margin-top: 32px; display: grid; gap: 18px; }
.next-steps li {
  position: relative; padding-left: 40px; min-height: 24px;
  font-size: 15px; line-height: 1.5; color: var(--night-fg);
}
.next-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--night-stroke); color: var(--night-muted);
  display: flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1;
}
.field { margin-bottom: 26px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; }
.field label { display: block; font-size: 14px; color: var(--night-muted); margin-bottom: 4px; }
.contact input:not([type="hidden"]), .contact textarea {
  display: block; width: 100%; min-height: 48px; padding: 12px 0;
  background: transparent; color: var(--night-fg);
  border: 0; border-bottom: 1px solid var(--night-stroke); border-radius: 0;
  font-size: 16px; line-height: 1.5; transition: border-color .2s;
}
.contact textarea { resize: vertical; min-height: 120px; }
.contact input:focus, .contact textarea:focus { border-bottom-color: var(--accent-soft); }
.contact ::placeholder { color: rgba(163, 168, 184, .78); opacity: 1; }
.contact input:-webkit-autofill,
.contact textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--night-fg);
  -webkit-box-shadow: 0 0 0 1000px var(--night) inset;
  box-shadow: 0 0 0 1000px var(--night) inset;
  caret-color: var(--night-fg);
}
.form-ok {
  display: none; margin-bottom: 28px; padding: 4px 0 4px 14px;
  border-left: 1px solid var(--accent-soft); color: var(--night-fg); font-size: 15px;
}
.form-ok.show { display: block; }
.contact-form .btn { margin-top: 10px; }
@media (min-width: 860px) {
  .contact-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(48px, 7vw, 112px); align-items: start; }
}
@media (min-width: 521px) {
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- footer ---------- */
.foot { background: var(--night); color: var(--night-muted); border-top: 1px solid var(--night-stroke); font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; padding-block: 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- reveal motion (once) ---------- */
html.anim .rv { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
html.anim .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html, html.anim { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
