/* ===========================================================================
   Pool Route Monitor — shared stylesheet for the standalone legal documents
   (privacy-policy.html, terms-of-service.html).

   Mirrors the marketing site's design system: ocean-blue palette, Inter for
   body copy, Edu VIC WA NT Hand for display headings, soft cards and waves.
   =========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Edu VIC WA NT Hand';
  src: url('/fonts/EduVICWANTHand-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --white: #ffffff;
  --sky: #38bdf8;
  --ocean: #0c87d8;
  --primary: #2563eb;
  --deep: #1d4ed8;
  --navy: #0b2545;

  --surface: #f2f9ff;
  --ink: #1e293b;
  --ink-soft: #475569;
  --ink-mute: #64748b;
  --hairline: #e2e8f0;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: rgba(37, 99, 235, 0.18);
  color: var(--navy);
}

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 0.5rem;
}

/* --------------------------------------------------------------- site bar */

.legal-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid rgba(11, 37, 69, 0.07);
}

.legal-nav-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--navy);
}

.legal-brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: block;
}

.legal-brand span {
  font-family: 'Edu VIC WA NT Hand', cursive;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
  transition: background 0.25s ease, color 0.25s ease;
}

.legal-back:hover {
  background: var(--surface);
  color: var(--deep);
}

/* -------------------------------------------------------------- page head */

.legal-hero {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface) 55%, #e3f2fe 100%);
  padding: 56px 24px 0;
  overflow: hidden;
}

.legal-hero::before {
  content: '';
  position: absolute;
  top: -160px;
  left: -120px;
  width: 26rem;
  height: 26rem;
  background: rgba(56, 189, 248, 0.28);
  filter: blur(80px);
  border-radius: 50%;
  pointer-events: none;
}

.legal-hero::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -140px;
  width: 22rem;
  height: 22rem;
  background: rgba(37, 99, 235, 0.18);
  filter: blur(80px);
  border-radius: 50%;
  pointer-events: none;
}

.legal-hero-inner {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding-bottom: 44px;
}

.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--primary);
  margin-bottom: 14px;
}

.legal-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: rgba(37, 99, 235, 0.5);
}

/* The document's own <h1> lives inside .header — style it as the display title */
.header h1,
.legal-hero h1 {
  font-family: 'Edu VIC WA NT Hand', cursive;
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.22;
  letter-spacing: 0.005em;
  color: var(--navy);
  margin-bottom: 14px;
}

.header .meta,
.legal-hero .meta {
  font-size: 0.875rem;
  color: var(--ink-mute);
  line-height: 1.7;
}

/* Wave that flows out of the hero into the document body */
.legal-wave {
  display: block;
  width: 100%;
  height: 70px;
  margin-bottom: -1px;
}

/* --------------------------------------------------------------- document */

.page-wrapper {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 24px 96px;
}

/* The hero above already renders the title block, so the in-document one
   is hidden to avoid printing it twice. */
.page-wrapper > .header {
  display: none;
}

h2 {
  font-family: 'Edu VIC WA NT Hand', cursive;
  font-weight: 500;
  font-size: 1.85rem;
  line-height: 1.3;
  color: var(--navy);
  margin-top: 56px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 30px;
  margin-bottom: 10px;
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 20px;
  margin-bottom: 8px;
}

p {
  margin-bottom: 15px;
  color: var(--ink-soft);
}

strong {
  color: var(--navy);
  font-weight: 600;
}

ul,
ol {
  margin: 10px 0 16px 22px;
}

li {
  margin-bottom: 8px;
  color: var(--ink-soft);
}

li::marker {
  color: var(--ocean);
}

a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, 0.3);
  transition: color 0.25s ease, border-color 0.25s ease;
}

a:hover {
  color: var(--deep);
  border-bottom-color: var(--deep);
}

/* ------------------------------------------------------------ components */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.platform-card {
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface) 100%);
  box-shadow: 0 1px 2px rgba(11, 37, 69, 0.04), 0 14px 32px -22px rgba(11, 37, 69, 0.28);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.platform-card:hover {
  transform: translateY(-4px);
  border-color: #bfe3fd;
  box-shadow: 0 2px 4px rgba(11, 37, 69, 0.05), 0 26px 50px -26px rgba(12, 135, 216, 0.42);
}

.platform-card .platform-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
}

.platform-card.ios .platform-title {
  color: var(--navy);
}
.platform-card.android .platform-title {
  color: var(--ocean);
}
.platform-card.web .platform-title {
  color: var(--primary);
}

.platform-card ul {
  margin-left: 18px;
}

.platform-card li {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.platform-card li strong {
  display: block;
  color: var(--navy);
}

.platform-card li span {
  color: var(--ink-mute);
  font-size: 0.82rem;
}

/* Callout */
.notice {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
  border-left: 4px solid var(--ocean);
  border-radius: 0 14px 14px 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.notice strong {
  color: var(--navy);
}

/* Table */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  font-size: 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
}

th {
  background: linear-gradient(135deg, var(--ocean) 0%, var(--primary) 55%, var(--deep) 100%);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) td {
  background: #f8fbff;
}

/* Contact card */
.contact-box {
  background: linear-gradient(180deg, #ffffff 0%, var(--surface) 100%);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 28px;
  margin-top: 20px;
  box-shadow: 0 1px 2px rgba(11, 37, 69, 0.04), 0 18px 40px -26px rgba(11, 37, 69, 0.3);
}

.contact-box p {
  margin-bottom: 8px;
}

/* ---------------------------------------------------------------- footer */

.legal-footer {
  position: relative;
  background: linear-gradient(160deg, #0b2545 0%, #10346b 55%, #1b3fa8 100%);
  color: #cbd5e1;
  overflow: hidden;
}

.legal-footer .legal-wave {
  transform: rotate(180deg);
  margin-bottom: 0;
}

.legal-footer-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 24px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.legal-footer a {
  color: #cbd5e1;
  border-bottom: none;
}

.legal-footer a:hover {
  color: #fff;
}

/* The document's own trailing .footer block */
.page-wrapper > .footer {
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
  font-size: 0.8rem;
  color: var(--ink-mute);
  text-align: center;
}

@media (max-width: 640px) {
  h2 {
    font-size: 1.5rem;
    margin-top: 44px;
  }
  .legal-hero {
    padding-top: 40px;
  }
  .legal-brand span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .platform-card:hover {
    transform: none;
  }
}

@media print {
  .legal-nav,
  .legal-hero::before,
  .legal-hero::after,
  .legal-wave,
  .legal-footer {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .page-wrapper > .header {
    display: block;
  }
}
