/* NAM Solutions: company page. Restrained and monochrome; each app's own colour shows only on its card.
   Every colour is a token here, redefined for dark mode, which follows the system. */

/* ---------- Colour tokens ---------- */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f6f7f9;
  --ink: #111418;
  --mute: #555c66;
  --line: #dfe3e8;
  --on-brand: #ffffff;

  /* Messages (messages/website/src/styles.css: accent, tint) */
  --msg-accent: #1a55eb;
  --msg-soft: #e0edff;
  --msg-on-soft: #1a55eb;

  /* NutriLife (AppTokens: brand, brandSoft, onBrandSoft) */
  --nl-accent: #0f7a4f;
  --nl-soft: #ddf1e6;
  --nl-on-soft: #0a5537;

  /* Invoicing, purple theme (AppTokens: p, pl, pd) */
  --inv-accent: #7a12d4;
  --inv-soft: #f3ecfc;
  --inv-on-soft: #5b0fa0;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0c0e11;
    --surface: #15181d;
    --ink: #f2f4f7;
    --mute: #a2a9b4;
    --line: #272c33;
    --on-brand: #ffffff;

    --msg-accent: #86c8ff;
    --msg-soft: #11284a;
    --msg-on-soft: #86c8ff;

    --nl-accent: #3cc789;
    --nl-soft: #173a2b;
    --nl-on-soft: #8be3ba;

    --inv-accent: #7a12d4;
    --inv-soft: #2b1942;
    --inv-on-soft: #d9bcfa;
  }
}

/* ---------- Other tokens ---------- */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --max: 1120px;
  --radius: 20px;
  --ease: cubic-bezier(.2, 0, 0, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

.skip {
  position: absolute;
  left: var(--gutter);
  top: 8px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Header ---------- */
.top { padding-block: 20px; }
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark {
  font-size: 1.125rem;
  letter-spacing: -.01em;
  text-decoration: none;
  font-weight: 400;
}
.wordmark b { font-weight: 800; letter-spacing: .02em; }

.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lang button {
  min-width: 44px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mute);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lang button:focus-visible { outline-offset: 2px; border-radius: 999px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 9vw, 112px) clamp(40px, 7vw, 80px); }
.hero__title {
  max-width: 16ch;
  font-size: clamp(2.5rem, 9vw, 6rem);
  line-height: 1.02;
  letter-spacing: -.028em;
  font-weight: 800;
  text-wrap: balance;
}
.hero__lead {
  margin-top: clamp(20px, 3vw, 32px);
  font-size: clamp(1.125rem, 2.4vw, 1.5rem);
  color: var(--mute);
}

/* ---------- Apps ---------- */
.apps, .contact { padding-block: clamp(32px, 6vw, 72px); }
.section-title {
  margin-bottom: 24px;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
}

.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 880px) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

.card {
  --a: var(--ink);
  --s: var(--surface);
  --o: var(--ink);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .25s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--a);
}
.card:hover { border-color: var(--a); }
.card--messages { --a: var(--msg-accent); --s: var(--msg-soft); --o: var(--msg-on-soft); }
.card--nutrilife { --a: var(--nl-accent); --s: var(--nl-soft); --o: var(--nl-on-soft); }
.card--invoicing { --a: var(--inv-accent); --s: var(--inv-soft); --o: var(--inv-on-soft); }

.card__head { display: flex; align-items: center; gap: 16px; }
.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--s);
  overflow: hidden;
}
.icon img { width: 100%; height: 100%; object-fit: cover; }
.card--messages .icon img { width: 80%; height: 80%; object-fit: contain; }
.icon--initial {
  background: var(--a);
  color: var(--on-brand);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}
.card__name { font-size: 1.5rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 750; }
.card__line { color: var(--mute); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 4px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: var(--s);
  color: var(--o);
  font-size: .875rem;
  font-weight: 600;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--a);
}
.status--soon::before { background: transparent; box-shadow: inset 0 0 0 2px var(--a); }

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  min-height: 44px;
  margin-top: auto;
  margin-left: -6px;
  padding: 8px 6px 0;
  font-weight: 650;
  text-decoration: none;
}
.card__link > span:first-child {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
  transition: text-decoration-color .2s var(--ease);
}
.card__link:hover > span:first-child { text-decoration-color: var(--ink); }
.arrow { transition: transform .25s var(--ease); }
.card__link:hover .arrow { transform: translateX(4px); }

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--line); margin-top: clamp(24px, 5vw, 56px); }
.contact__lead { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 650; letter-spacing: -.02em; }
.contact__mail {
  display: inline-block;
  margin-top: 12px;
  font-size: clamp(1.125rem, 3.4vw, 1.75rem);
  overflow-wrap: anywhere;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- Footer ---------- */
.foot { padding-block: 32px 48px; border-top: 1px solid var(--line); color: var(--mute); font-size: .875rem; }

/* ---------- Entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fade { animation: rise .7s var(--ease) backwards; }
  .hero__lead { animation-delay: .08s; }
  .card:nth-child(1) { animation-delay: .12s; }
  .card:nth-child(2) { animation-delay: .2s; }
  .card:nth-child(3) { animation-delay: .28s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}
