/* ==========================================================================
   UVSeQure — main.css
   A living summer sky behind frosted glass.
   ========================================================================== */

/* ---------- Fonts (self-hosted, GDPR-safe) ---------- */
@font-face {
  font-family: "Quicksand";
  src: url("/assets/fonts/Quicksand-Variable.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-Variable.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Colour */
  --color-sunrise: #FF8A3D;
  --color-coral:   #F5524B;
  --color-sky:     #3FA3E6;
  --color-sky-deep:#2479B8;
  --color-cloud:   #EAF6FE;
  --color-ink:     #0C3A5A;
  --color-ink-soft:#2A4A63;
  --color-sub:     #557089;
  --color-white:   #FFFFFF;

  --gradient-sun: linear-gradient(90deg, #FF8A3D, #F5524B);

  /* Type */
  --font-display: "Quicksand", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --size-h1: clamp(2.7rem, 6.5vw, 4.4rem);
  --size-h2: clamp(1.85rem, 3.6vw, 2.5rem);
  --size-h3: clamp(1.25rem, 2vw, 1.5rem);
  --size-body: 1.0625rem;
  --size-caption: 0.8125rem;

  /* Rhythm */
  --section-pad: clamp(4.5rem, 10vw, 8rem);
  --container: 1140px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 34px;
  --radius-pill: 999px;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.30);
  --glass-bg-strong: rgba(255, 255, 255, 0.55);
  --glass-border: 1px solid rgba(255, 255, 255, 0.62);
  --glass-blur: 20px;
  --shadow-glass: 0 14px 46px rgba(18, 60, 92, 0.16);
  --shadow-card: 0 10px 30px rgba(18, 60, 92, 0.16);
  --shadow-lift: 0 22px 56px rgba(18, 60, 92, 0.22);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.6;
  color: var(--color-ink-soft);
  background: linear-gradient(180deg, #CDE9FB 0%, #EAF6FE 30%, #F6FBFF 100%);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-display); color: var(--color-ink); line-height: 1.08; margin: 0 0 0.6em; }
h1 { font-size: var(--size-h1); font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: var(--size-h2); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: var(--size-h3); font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--color-sky-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--color-sunrise); outline-offset: 3px; border-radius: 4px; }

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

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--size-caption);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-sunrise);
  margin: 0 0 1rem;
}

.glass {
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-lg);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .site-nav, .store-btn, .lang-switch, .toast { background: rgba(255, 255, 255, 0.82); }
}

/* ---------- Sky canvas (Three.js renders the day cycle behind the page) ---------- */
#sky-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  display: block;
}

/* ---------- Reveal choreography (GSAP owns the animation; CSS only sets states) ---------- */
.reveal { opacity: 0; will-change: opacity, transform; }
.reveal.in-view { opacity: 1; transform: none; }
html.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: min(var(--container), calc(100% - 2 * var(--gutter)));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 6px 24px rgba(18, 60, 92, 0.10);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}
.site-nav.scrolled {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 32px rgba(18, 60, 92, 0.16);
}
.nav-brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.2rem; color: var(--color-ink);
}
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 30px; height: 30px; }
.nav-links { display: flex; gap: 1.5rem; margin-inline: auto; }
.nav-links a {
  position: relative;
  font-weight: 600; font-size: 0.95rem; color: var(--color-ink-soft);
  padding: 0.25rem 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; border-radius: 2px;
  background: var(--gradient-sun);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav-links a:hover { text-decoration: none; color: var(--color-ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 0.7rem; margin-left: auto; }

.lang-switch {
  display: inline-flex;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 3px;
}
.lang-switch a, .lang-switch span {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em;
  padding: 0.28rem 0.7rem; border-radius: var(--radius-pill);
  color: var(--color-sub);
}
.lang-switch a:hover { text-decoration: none; color: var(--color-ink); }
.lang-switch .active {
  background: var(--gradient-sun);
  color: #fff;
  box-shadow: 0 3px 10px rgba(245, 82, 75, 0.35);
}

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 800; font-size: 0.95rem;
  color: #fff;
  background: var(--gradient-sun);
  border: none; cursor: pointer;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 22px rgba(245, 110, 60, 0.38);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(245, 110, 60, 0.45);
  text-decoration: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--section-pad) + 3rem) 0 var(--section-pad);
  overflow: hidden;
  isolation: isolate;
}
/* soft haze so ink text always reads on the live sky */
.hero-haze {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 55% at 28% 42%, rgba(255, 255, 255, 0.62), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 35%);
}
/* WebGL unavailable → fall back to the static sky art */
html.no-webgl .hero {
  background: url("/assets/img/sky-hero-landscape.webp") center bottom / cover no-repeat;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  max-width: 34em;
  color: var(--color-ink-soft);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.8rem; }
.hero-micro {
  margin-top: 1.1rem;
  font-size: 0.9rem; font-weight: 600; color: var(--color-sub);
}

.hero-phone { display: flex; justify-content: center; }
.device-card {
  width: min(340px, 78vw);
  border-radius: var(--radius-xl);
  padding: 10px;
  background: var(--glass-bg);
  border: var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-lift);
}
.device-card img { border-radius: calc(var(--radius-xl) - 10px); }
.hero-phone .device-card { rotate: -3deg; }

/* ---------- Store buttons ---------- */
.store-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1.4rem 0.7rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--glass-bg-strong);
  border: var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-card);
  color: var(--color-ink);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.store-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); text-decoration: none; }
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn .store-lines { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-btn .store-pre { font-size: 0.68rem; font-weight: 600; color: var(--color-sub); letter-spacing: 0.02em; }
.store-btn .store-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }

/* ---------- Official store badges ---------- */
.store-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  transition: transform 0.25s var(--ease-out);
}
.store-badge:hover { transform: translateY(-2px); }
.store-badge:focus-visible { outline: 3px solid var(--color-sunrise); outline-offset: 3px; }
.store-badge img { height: 48px; width: auto; display: block; }
@media (max-width: 420px) { .store-badge img { height: 44px; } }

/* ---------- Generic section ---------- */
.section { padding-block: var(--section-pad); position: relative; }
/* translucent veils so the WebGL sky stays visible behind the content */
#how {
  background: linear-gradient(180deg,
    rgba(244, 250, 255, 0) 0%,
    rgba(244, 250, 255, 0.72) 9%,
    rgba(244, 250, 255, 0.72) 100%);
}
#features {
  background: linear-gradient(180deg,
    rgba(244, 250, 255, 0.72) 0%,
    rgba(244, 250, 255, 0.72) 90%,
    rgba(244, 250, 255, 0) 100%);
}
html.no-webgl #how, html.no-webgl #features { background: rgba(244, 250, 255, 0.95); }
.section-head { max-width: 56ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { font-size: clamp(1rem, 1.5vw, 1.15rem); color: var(--color-sub); }

/* ---------- How it works ---------- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2rem);
}
.how-card {
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border-radius: var(--radius-lg);
  background: var(--glass-bg-strong);
  border: var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.how-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.how-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 170, 90, 0.25), rgba(63, 163, 230, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.7);
  margin-bottom: 1.2rem;
}
.how-icon img, .how-icon svg { width: 28px; height: 28px; }
.how-step {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em;
  color: var(--color-sunrise);
  display: block; margin-bottom: 0.4rem;
}
.how-card p { margin: 0; color: var(--color-sub); font-size: 0.98rem; }

/* ---------- Feature rows ---------- */
.feature-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(2.6rem, 6vw, 4.5rem);
}
.feature-row .device-card { width: min(320px, 72vw); margin-inline: auto; }
.feature-row.row-flip .feature-media { order: 2; }
.feature-copy h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.feature-copy p { color: var(--color-sub); max-width: 36em; font-size: clamp(1rem, 1.4vw, 1.1rem); }
.band-cool {
  background: linear-gradient(180deg, rgba(174, 200, 222, 0.0), rgba(174, 200, 222, 0.35) 18%, rgba(174, 200, 222, 0.35) 82%, rgba(174, 200, 222, 0));
}

/* ---------- Trust band (sky darkens to dusk behind it) ---------- */
.trust {
  background: linear-gradient(170deg, rgba(15, 66, 104, 0.45) 0%, rgba(12, 58, 90, 0.55) 55%, rgba(10, 50, 82, 0.45) 100%);
  color: var(--color-cloud);
}
html.no-webgl .trust {
  background:
    radial-gradient(ellipse 70% 60% at 80% 0%, rgba(63, 163, 230, 0.35), transparent 60%),
    linear-gradient(170deg, #0F4268 0%, #0C3A5A 55%, #0A3252 100%);
}
.trust h2 { color: #fff; }
.trust .section-head p { color: rgba(234, 246, 254, 0.75); }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2rem);
}
.trust-card {
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.trust-card h3 { color: #fff; font-size: 1.25rem; }
.trust-card p { color: rgba(234, 246, 254, 0.78); margin: 0; font-size: 0.98rem; }
.trust-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1.1rem;
}
.trust-icon svg { width: 24px; height: 24px; }

/* ---------- Final CTA — golden hour (the sky itself turns golden here) ---------- */
.cta-final {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 239, 220, 0) 0%, rgba(255, 227, 192, 0.35) 40%, rgba(255, 217, 174, 0.5) 100%);
}
html.no-webgl .cta-final {
  background: linear-gradient(180deg, #F6FBFF 0%, #FFEFDC 35%, #FFD9AE 100%);
}
.cta-final .container { position: relative; }
.cta-final h2 { font-size: clamp(2.1rem, 4.5vw, 3.2rem); }
.cta-final p { color: var(--color-ink-soft); max-width: 38em; margin-inline: auto; font-size: clamp(1rem, 1.5vw, 1.15rem); }
.cta-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; margin-top: 2.2rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: linear-gradient(180deg, #0C3A5A 0%, #07273E 100%);
  color: rgba(234, 246, 254, 0.78);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  margin-bottom: 2.5rem;
}
.footer-brand img { width: 150px; margin-bottom: 1rem; }
.footer-brand p { margin: 0; font-family: var(--font-display); font-weight: 600; color: #fff; font-size: 1.05rem; }
.site-footer h4 {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(234, 246, 254, 0.55);
  margin: 0 0 1rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.site-footer a { color: rgba(234, 246, 254, 0.85); }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: center;
  font-size: 0.85rem;
  color: rgba(234, 246, 254, 0.55);
}
.footer-langs { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; }
/* legal pages carry 6 languages in the nav switch — keep it compact on small screens */
@media (max-width: 480px) {
  .lang-switch a, .lang-switch span { padding: 0.28rem 0.42rem; letter-spacing: 0.02em; }
}

/* ---------- Language toast ---------- */
.toast {
  position: fixed;
  bottom: 1.4rem; left: 50%;
  transform: translateX(-50%) translateY(140%);
  z-index: 60;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lift);
  font-weight: 600; color: var(--color-ink);
  transition: transform 0.5s var(--ease-out);
  max-width: calc(100% - 2rem);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast a { font-weight: 800; color: var(--color-sky-deep); white-space: nowrap; }
.toast button {
  border: none; background: none; cursor: pointer;
  font-size: 1.1rem; line-height: 1; color: var(--color-sub);
  padding: 0.2rem;
}

/* ---------- Legal pages ---------- */
.legal-hero { padding: calc(var(--section-pad) + 2rem) 0 0; }
.legal-hero .eyebrow { margin-bottom: 0.6rem; }
.legal-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.legal-date {
  display: inline-block;
  font-size: 0.8rem; font-weight: 700;
  color: var(--color-sky-deep);
  background: rgba(63, 163, 230, 0.12);
  border: 1px solid rgba(63, 163, 230, 0.25);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
.legal-wrap { padding-block: clamp(7rem, 12vw, 9rem) var(--section-pad); }
.legal-card {
  max-width: 80ch;
  margin-inline: auto;
  padding: clamp(1.6rem, 4.5vw, 3.5rem);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.66);
  border: var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-glass);
}
.legal-prose { font-size: 1.04rem; line-height: 1.68; color: var(--color-ink-soft); }
.legal-prose h1 { font-size: 1.9rem; margin-top: 0; }
.legal-prose h4 {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700;
  color: var(--color-ink);
  margin: 2.2em 0 0.7em;
  scroll-margin-top: 110px;
}
.legal-prose strong { color: var(--color-ink); }
.legal-prose hr { border: none; border-top: 1px solid rgba(12, 58, 90, 0.12); margin: 2.2em 0; }
.legal-prose ul, .legal-prose ol { padding-left: 1.4em; }
.legal-prose li { margin-bottom: 0.45em; }
.legal-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.4em 0;
  display: block;
  overflow-x: auto;
}
.legal-prose th, .legal-prose td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(12, 58, 90, 0.14);
  vertical-align: top;
  min-width: 9em;
}
.legal-prose th {
  background: rgba(63, 163, 230, 0.1);
  font-weight: 800; color: var(--color-ink);
  white-space: nowrap;
}
.legal-prose tr:nth-child(even) td { background: rgba(234, 246, 254, 0.5); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy .hero-sub { margin-inline: auto; }
  .hero-ctas { justify-content: center; }
  .hero-haze {
    background:
      radial-gradient(ellipse 80% 45% at 50% 30%, rgba(255, 255, 255, 0.62), transparent 72%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 35%);
  }
  .how-grid, .trust-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .feature-row { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .feature-row.row-flip .feature-media { order: 0; }
  .feature-copy p { margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .site-nav .btn-primary { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding-top: 7rem; }
}

/* ---------- Motion preferences / fallbacks ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
