/* ==========================================================================
   Meshly Ltd — meshly.info
   Dark, single-screen brand page. Palette and type from the Meshly Branding
   Identity Deck. Contrast ratios are noted against the surface each token
   is used on; all pairings verified against WCAG AA.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  --void: #0a1322;   /* page base */
  --navy: #16233f;   /* brand navy, raised surfaces */
  --teal: #22d3c5;   /*  9.9:1 on void */
  --coral: #ff6b4a;
  --cloud: #f5f6f9;  /* 18.6:1 on void */
  --chalk: #c8cfdc;  /* 11.9:1 on void — body copy */
  --mist: #8a94a6;   /*  6.0:1 on void — captions, footer */

  --line: rgba(245, 246, 249, 0.1);
  --line-strong: rgba(245, 246, 249, 0.18);

  --font-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 2.5rem);

  /* Pointer spotlight position, updated by JS. Centred by default so the
     page looks intentional with JS disabled. */
  --mx: 50%;
  --my: 38%;
}

/* --- Reset ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--void);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--cloud);
  /* Width-driven, then capped by viewport height so the page still fits on a
     short laptop screen without pushing the footer below the fold. */
  font-size: min(clamp(2.75rem, 1.4rem + 6vw, 5rem), 9.5vh);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--teal);
  text-underline-offset: 0.25em;
}

/* --- Accessibility -------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 100;
  transform: translate(-50%, -130%);
  background: var(--teal);
  color: #06101d;
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 12px 12px;
  text-decoration: none;
  transition: transform 0.18s ease;
}

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

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

/* ==========================================================================
   Animated background
   Layered: aurora blobs → dot grid → pointer spotlight → grain.
   The whole stack is decorative and hidden from assistive tech.
   ========================================================================== */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Aurora — three brand-coloured blobs drifting behind everything. */
.bg__aurora {
  position: absolute;
  inset: -30%;
  filter: blur(90px);
}

.bg__aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: 0.5;
  will-change: transform;
}

.bg__aurora i:nth-child(1) {
  width: 52vw;
  height: 52vw;
  top: 6%;
  left: 8%;
  background: #1c6be0;
  animation: drift-a 26s ease-in-out infinite alternate;
}

.bg__aurora i:nth-child(2) {
  width: 44vw;
  height: 44vw;
  top: 22%;
  right: 4%;
  background: var(--teal);
  opacity: 0.34;
  animation: drift-b 32s ease-in-out infinite alternate;
}

.bg__aurora i:nth-child(3) {
  width: 34vw;
  height: 34vw;
  bottom: 2%;
  left: 34%;
  background: var(--coral);
  opacity: 0.2;
  animation: drift-c 38s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(14vw, 8vh, 0) scale(1.22); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-16vw, 12vh, 0) scale(0.88); }
}

@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.95); }
  to   { transform: translate3d(10vw, -14vh, 0) scale(1.25); }
}

/* Dot grid, faded out towards the edges. */
.bg__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(245, 246, 249, 0.16) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 40%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 78% 62% at 50% 40%, #000 20%, transparent 78%);
  opacity: 0.5;
}

/* Spotlight that follows the pointer. */
.bg__spot {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    460px circle at var(--mx) var(--my),
    rgba(34, 211, 197, 0.14),
    transparent 62%
  );
  transition: background 0.28s ease-out;
}

/* Fine grain, so the large gradients don't band on wide screens. */
.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Keeps the base dark enough under the text for the contrast figures to hold. */
.bg__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 42%, rgba(10, 19, 34, 0.82), transparent 70%),
    linear-gradient(180deg, rgba(10, 19, 34, 0.5) 0%, transparent 30%, rgba(10, 19, 34, 0.85) 100%);
}

/* Floating brand squircles. */
.bg__shapes {
  position: absolute;
  inset: 0;
}

.bg__shapes svg {
  position: absolute;
  opacity: 0.07;
  will-change: transform;
}

.bg__shapes svg:nth-child(1) {
  width: 190px;
  top: 14%;
  left: 6%;
  animation: float-a 22s ease-in-out infinite alternate;
}

.bg__shapes svg:nth-child(2) {
  width: 120px;
  bottom: 16%;
  right: 9%;
  animation: float-b 27s ease-in-out infinite alternate;
}

@keyframes float-a {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(-38px) rotate(9deg); }
}

@keyframes float-b {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(32px) rotate(-11deg); }
}

/* ==========================================================================
   Entrance animation
   CSS-only and fill-mode: both, so it plays without JavaScript and leaves
   everything visible if animations are disabled entirely.
   ========================================================================== */

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.rise {
  animation: rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.16s; }
.rise-3 { animation-delay: 0.27s; }
.rise-4 { animation-delay: 0.38s; }
.rise-5 { animation-delay: 0.5s; }
.rise-6 { animation-delay: 0.62s; }

/* --- Header --------------------------------------------------------------- */

.site-header {
  padding: clamp(1.25rem, 2.5vh, 2.25rem) var(--gutter);
}

.site-header__inner {
  max-width: 1120px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand img {
  height: 26px;
  width: auto;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-header nav a {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--chalk);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.site-header nav a:hover {
  color: var(--teal);
}

/* --- Stage ---------------------------------------------------------------- */

.stage {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: clamp(1.5rem, 4vh, 4rem) var(--gutter) clamp(2rem, 5vh, 5rem);
}

.stage__inner {
  max-width: 62rem;
  width: 100%;
}

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1rem 0.5rem 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(245, 246, 249, 0.04);
  backdrop-filter: blur(8px);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--chalk);
}

.pill__dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.pill__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--teal);
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  0%   { transform: scale(1); opacity: 0.7; }
  70%  { transform: scale(3.2); opacity: 0; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* Headline */
h1 {
  margin-top: clamp(1rem, 2.5vh, 2.25rem);
}

/* Stays inside the teal family: interpolating teal → coral directly runs
   through a desaturated grey and reads as washed-out mid-sweep. */
.grad {
  background: linear-gradient(
    100deg,
    #22d3c5 0%,
    #9ff3e9 30%,
    #ffffff 50%,
    #9ff3e9 70%,
    #22d3c5 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sweep 9s ease-in-out infinite alternate;
}

@keyframes sweep {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

.lede {
  margin: clamp(1rem, 2.5vh, 2rem) auto 0;
  max-width: 38rem;
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.6;
  color: var(--chalk);
}

/* Call to action */
.actions {
  margin-top: clamp(1.5rem, 3.5vh, 2.75rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 1rem 1.875rem;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn--primary {
  background: var(--teal);
  color: #06101d;
  box-shadow: 0 10px 34px -12px rgba(34, 211, 197, 0.75);
}

.btn--primary:hover {
  transform: translateY(-2px);
  background: #58e2d6;
  box-shadow: 0 16px 42px -12px rgba(34, 211, 197, 0.9);
}

/* Shine sweep on hover */
.btn--primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  transform: skewX(-18deg);
}

.btn--primary:hover::after {
  animation: shine 0.85s ease;
}

@keyframes shine {
  to { left: 130%; }
}

.btn--quiet {
  border-color: var(--line-strong);
  color: var(--cloud);
}

.btn--quiet:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  color: var(--teal);
}

.btn__arrow {
  transition: transform 0.18s ease;
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

/* Tagline */
.tagline {
  margin-top: clamp(1.5rem, 5vh, 4rem);
  font-family: var(--font-display);
  font-size: clamp(0.8125rem, 0.75rem + 0.2vw, 0.9375rem);
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: lowercase;
  color: var(--mist);
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  padding: clamp(1.25rem, 2.5vh, 2.5rem) var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--mist);
}

.site-footer__inner {
  max-width: 1120px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer a {
  color: var(--mist);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.site-footer__links {
  display: flex;
  gap: 1.5rem;
}

/* ==========================================================================
   Privacy page
   ========================================================================== */

.legal {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--gutter) clamp(3rem, 7vw, 5rem);
  text-align: left;
}

.legal__eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1rem;
}

.legal h1 {
  font-size: clamp(2rem, 1.5rem + 2.4vw, 3.25rem);
  text-align: left;
}

.legal__updated {
  margin-top: 1rem;
  color: var(--mist);
  font-size: 0.9375rem;
}

.legal h2 {
  font-family: var(--font-display);
  font-size: clamp(1.1875rem, 1.1rem + 0.5vw, 1.4375rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--cloud);
  margin: 3rem 0 0.875rem;
}

.legal p {
  font-size: 1rem;
}

.legal p + p {
  margin-top: 1.125rem;
}

.legal ul {
  margin: 1.125rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.625rem;
}

.legal ul li {
  position: relative;
  padding-left: 1.625rem;
  font-size: 1rem;
}

.legal ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 9px;
  height: 9px;
  border-radius: 2.6px; /* 29.2% of size — the mark's squircle ratio */
  background: var(--teal);
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 620px) {
  .site-header nav {
    gap: 1.125rem;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .bg__shapes svg:nth-child(1) { width: 120px; }
  .bg__shapes svg:nth-child(2) { width: 84px; }

  .tagline {
    letter-spacing: 0.24em;
  }
}

/* --- Motion preference ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Freeze the drifting layers in place rather than letting them snap. */
  .bg__aurora i,
  .bg__shapes svg {
    animation: none !important;
    transform: none !important;
  }

  .bg__spot {
    transition: none;
    background: radial-gradient(
      460px circle at 50% 38%,
      rgba(34, 211, 197, 0.12),
      transparent 62%
    );
  }

  .grad {
    animation: none;
    background-position: 30% 50%;
  }

  .btn:hover,
  .btn--primary:hover {
    transform: none;
  }
}

/* --- Print ---------------------------------------------------------------- */

@media print {
  .bg { display: none; }

  body {
    background: #fff;
    color: #000;
  }
}
