/* Shared foundation: tokens, theme and the brand switcher. */

:root {
  --ground: #ffffff;
  --ground-2: #f2f2f2;
  --ground-3: #e4e4e4;
  --ink: #0a0a0a;
  --ink-2: #565656;
  --invert-ground: #0a0a0a;
  --invert-ink: #ffffff;
  --margin: clamp(16px, 2.6vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --ground: #000000;
  --ground-2: #111111;
  --ground-3: #1e1e1e;
  --ink: #ffffff;
  --ink-2: #a3a3a3;
  --invert-ground: #ffffff;
  --invert-ink: #0a0a0a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-inter), Inter, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { letter-spacing: -0.035em; line-height: 0.98; font-weight: 600; text-wrap: balance; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* The Nuvate logo in whatever colour the text is. */
.nv-logo {
  display: inline-block;
  aspect-ratio: 301 / 110;
  height: 26px;
  background: currentColor;
  -webkit-mask: url('../assets/logo.png') center / contain no-repeat;
  mask: url('../assets/logo.png') center / contain no-repeat;
}

.nv-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--margin);
}
.nv-bar nav { display: flex; gap: clamp(14px, 2vw, 28px); }
.nv-bar nav a { text-decoration: none; font-size: 15px; font-weight: 500; }
.nv-bar nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nv-bar-end { display: flex; align-items: center; gap: 10px; }
.nv-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.4s var(--ease);
}
.nv-btn:hover { transform: translateY(-2px); }
.nv-btn:active { transform: translateY(0) scale(0.98); }
.nv-btn.ghost { background: var(--ground-3); color: var(--ink); }
.nv-theme {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--ground-2);
  color: var(--ink);
  cursor: pointer;
}
.nv-theme svg { width: 18px; height: 18px; }
@media (max-width: 760px) {
  .nv-bar nav { display: none; }
}

/* Brand switcher: a real app home screen drawn in HTML. */
.nv-switch { display: flex; flex-direction: column; align-items: center; gap: 18px; --brand: #4f5bd5; }
.nv-phone {
  width: min(280px, 72vw);
  aspect-ratio: 9 / 15;
  border-radius: 40px;
  padding: 9px;
  background: #0b0b0b;
  box-shadow: 0 0 0 1px #2c2c2c;
}
.nv-phone-screen {
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: #fff;
  color: #111;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 16px;
  gap: 14px;
  font-size: 13px;
}
.nv-phone-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 16px; }
.nv-phone-top i { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); transition: background 0.5s var(--ease); }
.nv-phone-card { border-radius: 18px; padding: 20px 16px; background: var(--brand); color: #fff; transition: background 0.5s var(--ease); }
.nv-phone-card small { display: block; opacity: 0.8; }
.nv-phone-card b { display: block; font-size: 28px; margin-top: 2px; letter-spacing: -0.02em; }
.nv-phone-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; font-size: 11px; }
.nv-phone-acts span::before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 5px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 16%, #fff);
  transition: background 0.5s var(--ease);
}
.nv-phone-rows { display: flex; flex-direction: column; gap: 12px; margin-top: auto; font-size: 14px; }
.nv-phone-rows div { display: flex; justify-content: space-between; gap: 8px; }
.nv-phone-rows em { font-style: normal; font-weight: 600; white-space: nowrap; }
.nv-brands { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.nv-brands button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ground-2);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.nv-brands button[aria-pressed='true'] { background: var(--ink); color: var(--ground); }
.nv-brands i { width: 11px; height: 11px; border-radius: 50%; }

/* Entrance used by NV.reveal(). Content stays visible if the script fails. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .nv-btn { transition: none; }
}
