/* ==========================================================================
   Net Master — Design System
   Tokens extracted from the app icon, logo and in-app screenshots:
   court blue, tennis-ball lime, ranking gold, mint canvas, white cards.
   ========================================================================== */

:root {
  /* --- Brand colours ---------------------------------------------------- */
  --nm-blue-50: #eaf3fe;
  --nm-blue-100: #d3e6fd;
  --nm-blue-200: #a9cdfa;
  --nm-blue: #0b72e8;          /* primary — app icon tile, links, active tab */
  --nm-blue-600: #0a62c9;
  --nm-blue-700: #0850a5;
  --nm-cyan: #2ba9e0;          /* court surface in the logo */

  --nm-lime: #c4d62e;          /* tennis ball */
  --nm-lime-soft: #f1f7cf;

  --nm-gold: #e8b931;          /* ranking points badge */
  --nm-gold-soft: #fbf0d2;

  /* --- Surfaces --------------------------------------------------------- */
  --nm-mint-50: #f5fbf8;
  --nm-mint-100: #e8f6ee;      /* app screen gradient top */
  --nm-mint-200: #d6efdf;      /* diagonal wedge in the app screens */
  --nm-surface: #ffffff;
  --nm-line: #e7ecf3;

  /* --- Typography ------------------------------------------------------- */
  --nm-ink: #0f172a;
  --nm-slate: #334155;
  --nm-muted: #667085;

  /* --- Radii ------------------------------------------------------------ */
  --radius-card: 24px;
  --radius-button: 16px;
  --radius-input: 14px;
  --radius-pill: 999px;

  /* --- Soft shadows (no heavy material elevation) ----------------------- */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px -18px rgba(15, 23, 42, 0.18);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 40px -28px rgba(15, 23, 42, 0.22);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.04), 0 28px 56px -28px rgba(11, 114, 232, 0.28);
  --shadow-device: 0 40px 80px -40px rgba(15, 23, 42, 0.45), 0 8px 24px -12px rgba(15, 23, 42, 0.18);

  /* --- Motion ----------------------------------------------------------- */
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;          /* clears the sticky navbar on anchor jumps */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--nm-ink);
  background-color: var(--nm-mint-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

::selection {
  background: var(--nm-blue-100);
  color: var(--nm-blue-700);
}

/* Visible, on-brand focus ring for keyboard users. */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--nm-blue);
  outline-offset: 3px;
  border-radius: 8px;
}

/* <main> is a skip-link target only; no ring needed around the whole page. */
main:focus,
main:focus-visible {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 100;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-button) var(--radius-button);
  background: var(--nm-blue);
  color: #fff;
  font-weight: 600;
  transition: transform 0.2s var(--ease-out-soft);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Backgrounds — the mint canvas + diagonal wedge motif from the app
   ========================================================================== */

.nm-canvas {
  background:
    radial-gradient(1100px 620px at 82% -12%, rgba(11, 114, 232, 0.10), transparent 62%),
    radial-gradient(900px 560px at 8% 4%, rgba(196, 214, 46, 0.16), transparent 60%),
    linear-gradient(180deg, var(--nm-mint-100) 0%, var(--nm-mint-50) 42%, #ffffff 100%);
}

.nm-wedge::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  width: min(46%, 620px);
  aspect-ratio: 1 / 1.35;
  background: var(--nm-mint-200);
  opacity: 0.7;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

/* Same motif on the dark download panel. */
.nm-wedge--dark::after {
  background: #ffffff;
  opacity: 0.05;
}

.nm-grid {
  /* Faint tennis-court line grid. */
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 0%, transparent 78%);
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 0%, transparent 78%);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nm-nav {
  transition: background-color 0.3s var(--ease-out-soft), box-shadow 0.3s var(--ease-out-soft),
    border-color 0.3s var(--ease-out-soft);
  background-color: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
}

.nm-nav[data-scrolled="true"] {
  background-color: rgba(255, 255, 255, 0.88);
  border-bottom-color: var(--nm-line);
  box-shadow: var(--shadow-xs);
}

.nm-nav-link {
  position: relative;
  color: var(--nm-slate);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 8px 4px;
  transition: color 0.2s var(--ease-out-soft);
}

.nm-nav-link:hover {
  color: var(--nm-ink);
}

.nm-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--nm-blue);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s var(--ease-out-soft);
}

.nm-nav-link:hover::after,
.nm-nav-link[aria-current="page"]::after,
.nm-nav-link.is-active::after {
  transform: scaleX(1);
}

.nm-nav-link[aria-current="page"],
.nm-nav-link.is-active {
  color: var(--nm-blue);
}

/* The "Home" link stands down while an in-page section owns the highlight,
   so only one nav item ever reads as active. */
.nm-nav-link.is-inactive {
  color: var(--nm-slate);
}

.nm-nav-link.is-inactive::after {
  transform: scaleX(0);
}

.nm-nav-link.is-inactive:hover {
  color: var(--nm-ink);
}

.nm-nav-link.is-inactive:hover::after {
  transform: scaleX(1);
}

/* Mobile drawer */
.nm-mobile-menu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.32s var(--ease-out-soft), opacity 0.2s ease;
}

.nm-mobile-menu[data-open="true"] {
  grid-template-rows: 1fr;
  opacity: 1;
}

.nm-mobile-menu > div {
  overflow: hidden;
}

.nm-burger span {
  display: block;
  height: 2px;
  width: 20px;
  border-radius: 2px;
  background: var(--nm-ink);
  transition: transform 0.28s var(--ease-out-soft), opacity 0.2s ease;
}

.nm-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nm-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nm-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-button);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 15px 24px;
  white-space: nowrap;
  transition: transform 0.22s var(--ease-out-soft), box-shadow 0.22s var(--ease-out-soft),
    background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--nm-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 24px -14px rgba(11, 114, 232, 0.7);
}

.btn-primary:hover {
  background: var(--nm-blue-600);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06), 0 20px 34px -16px rgba(11, 114, 232, 0.65);
}

.btn-secondary {
  background: #fff;
  color: var(--nm-ink);
  border: 1px solid var(--nm-line);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  border-color: var(--nm-blue-200);
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--nm-slate);
}

.btn-ghost:hover {
  color: var(--nm-ink);
  background: rgba(15, 23, 42, 0.04);
}

/* App store badges */
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: var(--radius-button);
  background: var(--nm-ink);
  color: #fff;
  transition: transform 0.22s var(--ease-out-soft), box-shadow 0.22s var(--ease-out-soft),
    background-color 0.22s ease;
}

.btn-store:hover {
  transform: translateY(-2px);
  background: #1c2740;
  box-shadow: 0 24px 40px -22px rgba(15, 23, 42, 0.6);
}

.btn-store--light {
  background: #fff;
  color: var(--nm-ink);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.btn-store--light:hover {
  background: #fff;
  box-shadow: 0 24px 40px -22px rgba(15, 23, 42, 0.35);
}

/* Glass variant so the second badge stays legible on the dark panel. */
.btn-store--glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn-store--glass:hover {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 40px -22px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Cards & surfaces
   ========================================================================== */

.card {
  background: var(--nm-surface);
  border: 1px solid var(--nm-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease-out-soft), box-shadow 0.3s var(--ease-out-soft),
    border-color 0.3s var(--ease-out-soft);
}

.card-hover:hover {
  transform: translateY(-6px);
  border-color: var(--nm-blue-100);
  box-shadow: var(--shadow-hover);
}

.card-hover:hover .feature-icon {
  transform: scale(1.06) rotate(-3deg);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  transition: transform 0.35s var(--ease-out-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--nm-line);
  box-shadow: var(--shadow-xs);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nm-slate);
}

/* Wordmark styling copied from the app's hero lockup. */
.wordmark {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tagline {
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.text-gradient {
  background: linear-gradient(100deg, var(--nm-blue) 0%, var(--nm-cyan) 55%, var(--nm-lime) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Phone mockups
   ========================================================================== */

.device {
  position: relative;
  border-radius: 46px;
  padding: 10px;
  background: linear-gradient(160deg, #2c3446 0%, #0f172a 45%, #1c2333 100%);
  box-shadow: var(--shadow-device);
  transition: transform 0.5s var(--ease-out-soft), box-shadow 0.5s var(--ease-out-soft);
}

.device::before {
  /* Dynamic-island style pill */
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 22px;
  border-radius: var(--radius-pill);
  background: #0b101c;
  z-index: 2;
}

.device-screen {
  position: relative;
  overflow: hidden;
  border-radius: 37px;
  background: var(--nm-mint-100);
  aspect-ratio: 472 / 1024;
}

.device-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.device-tilt:hover {
  transform: translateY(-10px) rotate(0deg) scale(1.01);
}

.float-slow {
  animation: nm-float 7s ease-in-out infinite;
}

.float-slower {
  animation: nm-float 9s ease-in-out infinite;
  animation-delay: -2.5s;
}

@keyframes nm-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

/* Floating stat chips around the hero device */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-button);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--nm-line);
  box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out-soft), transform 0.7s var(--ease-out-soft);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Legal pages (privacy & terms)
   ========================================================================== */

.legal-toc a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--nm-muted);
  border-left: 2px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.legal-toc a:hover {
  color: var(--nm-ink);
  background: var(--nm-mint-100);
}

.legal-toc a.is-active {
  color: var(--nm-blue);
  border-left-color: var(--nm-blue);
  background: var(--nm-blue-50);
  font-weight: 600;
}

.legal-body h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--nm-ink);
  margin-bottom: 12px;
  scroll-margin-top: 110px;
}

.legal-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--nm-ink);
  margin: 22px 0 8px;
}

.legal-body p,
.legal-body li {
  color: var(--nm-slate);
  line-height: 1.75;
}

.legal-body p + p {
  margin-top: 14px;
}

.legal-body ul {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.legal-body li {
  position: relative;
  padding-left: 24px;
}

.legal-body li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nm-lime);
  box-shadow: 0 0 0 3px var(--nm-lime-soft);
}

.legal-body section + section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--nm-line);
}

.legal-body a {
  color: var(--nm-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer-link {
  color: var(--nm-muted);
  font-size: 0.9375rem;
  transition: color 0.2s ease, transform 0.2s var(--ease-out-soft);
  display: inline-block;
}

.footer-link:hover {
  color: var(--nm-ink);
  transform: translateX(2px);
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
