/*
 * Shared stylesheet for static legal pages (privacy, terms, data-deletion).
 *
 * These pages are served as static HTML (not part of the Vue SPA) so that
 * Meta / Google / TikTok review crawlers receive full content without
 * needing to execute JavaScript. The styling mirrors the V2_Playground
 * editorial design (Landing.vue + LandingFooter.vue) so visitors landing
 * on /privacy or /terms see the same brand world as the marketing site.
 *
 * Palette + type tokens are kept in sync with frontend/src/views/Landing.vue
 * (`palette` const) and components/landing/LandingFooter.vue. If you change
 * one place, change all three.
 */

:root {
  /* Editorial palette — these tokens intentionally diverge from
     `frontend/src/assets/main.css` (the in-app chrome stylesheet,
     which uses a slightly warmer cream `--bg: #FAF8F2` and a softer
     `--ink: #1F1B16`). The legal pages live next to the marketing
     surface, not the product surface, so they pick up the Landing.vue
     editorial palette instead. Keep these values in sync with the
     `palette` const in `frontend/src/views/Landing.vue` and
     `frontend/src/components/landing/LandingFooter.vue`. */
  --bg:        #FAFAF7;
  --card:      #FFFFFF;
  --ink:       #14121C;
  --ink-soft:  #565369;
  --line:      #E9E6DE;
  --accent:    #C6F24A; /* electric lime */
  --coral:     #FF6B5B; /* sticker pop / wordmark dot */
  --plum:      #4B2E83;

  /* Fonts. Space Grotesk for display + UI, Inter for long-form prose,
     Fraunces for the wonky wordmark. */
  --font-display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Inter', 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --fraunces:     'Fraunces', Georgia, serif;

  --footer-pad: 32px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-feature-settings: 'kern', 'liga';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* Faint grid texture matching Landing.vue's .grid-bg. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* All page chrome sits above the grid. */
.legal-header,
.legal-content,
.legal-footer {
  position: relative;
  z-index: 1;
}

/* ---------- Header / back link ---------- */

.legal-header {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 32px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease;
  font-family: var(--font-display);
  font-weight: 500;
}

.back-link:hover,
.back-link:focus-visible {
  transform: translate(-2px, -2px);
  outline: none;
}

.back-link .arrow {
  font-size: 1rem;
  line-height: 1;
}

.wordmark {
  font-family: var(--fraunces);
  font-weight: 500;
  letter-spacing: -0.025em;
  font-variation-settings:
    'opsz' 144,
    'SOFT' 100,
    'WONK' 1;
  color: var(--ink);
  line-height: 1;
}

.back-link .wordmark {
  font-size: 30px;
}

.wordmark-period {
  color: var(--coral);
}

/* ---------- Main content ---------- */

.legal-content {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 32px 96px;
  width: 100%;
}

.legal-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--ink);
  text-wrap: balance;
}

.legal-date {
  display: inline-block;
  margin: 0 0 48px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
}

.legal-body section {
  margin-bottom: 48px;
}

.legal-body section:last-child {
  margin-bottom: 0;
}

.legal-body h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 14px;
}

.legal-body p {
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.legal-body p:last-child {
  margin-bottom: 0;
}

.legal-body strong {
  color: var(--ink);
  font-weight: 600;
}

.legal-body code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--ink);
}

.legal-body ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 16px;
  color: var(--ink-soft);
  display: grid;
  gap: 10px;
}

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

.legal-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  border: 1.5px solid var(--ink);
}

.legal-body a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 100% 28%;
  background-position: 0 92%;
  padding: 0 1px;
  transition: background-size 0.15s ease;
}

.legal-body a:hover,
.legal-body a:focus-visible {
  background-size: 100% 60%;
  outline: none;
}

/* ---------- Footer (mirror of LandingFooter.vue) ---------- */

.legal-footer {
  /* Transparent so the body grid texture shows through, matching
     LandingFooter.vue and the V2_Playground reference. */
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  padding: 64px 0 40px;
  border-top: 0;
}

.legal-footer .footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--footer-pad);
}

.legal-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 40px;
}

.legal-footer .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.legal-footer .brand .wordmark {
  font-size: 1.75rem;
}

.legal-footer .tagline {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 280px;
  line-height: 1.5;
  font-family: var(--font-body);
}

.legal-footer .col-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-footer .col-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.legal-footer .col-links li::before {
  content: none;
}

.legal-footer .col-links li {
  padding-left: 0;
  margin: 0;
}

.legal-footer .col-link {
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  background-image: none;
  padding: 0;
  transition: color 0.15s ease;
}

.legal-footer .col-link:hover,
.legal-footer .col-link:focus-visible {
  color: var(--ink);
  outline: none;
}

/* Non-interactive placeholder (e.g. "API (Coming soon)"). Quieter
   than a real link, no hover affordance, no pointer cursor. Mirrors
   the `.col-link--disabled` style in components/landing/LandingFooter.vue. */
.legal-footer .col-link--disabled {
  color: #A59E8E;
  cursor: default;
  font-style: italic;
}
.legal-footer .col-link--disabled:hover,
.legal-footer .col-link--disabled:focus-visible {
  color: #A59E8E;
}

.legal-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1.5px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}

.legal-footer .status {
  letter-spacing: 0.04em;
}

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

@media (max-width: 880px) {
  .legal-header { padding: 20px 24px; }
  .legal-content {
    padding: 32px 24px 64px;
  }
  .legal-footer {
    padding: 48px 0 32px;
  }
  .legal-footer .footer-inner { padding: 0 24px; }
  .legal-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .legal-footer .brand {
    grid-column: 1 / -1;
  }
  .legal-body { font-size: 16px; }
  .legal-body h2 { font-size: 22px; }
}

@media (max-width: 520px) {
  .legal-footer .footer-grid {
    grid-template-columns: 1fr;
  }
  .legal-footer .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
