/* ==========================================================================
   APPZ.WTF - Clay styling for legal pages (privacy / terms)
   Styles the existing .terms-* markup in the clay aesthetic. Also defines the
   legacy spacing/color variables that a few inline styles still reference, so
   nothing falls back to unstyled defaults.
   ========================================================================== */

:root {
  /* Legacy spacing tokens still referenced by inline styles on these pages */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 8rem;

  /* Legacy color aliases remapped to clay (used by leftover inline styles) */
  --border-color: rgba(45, 52, 54, 0.15);
  --text-muted: #636e72;
  --accent-primary: #0e7c74; /* AA-safe teal text */
  --accent-secondary: #c73333; /* AA-safe coral-ink text */
  --font-mono: 'Nunito', sans-serif;
  --font-display: 'Fredoka', sans-serif;
}

/* ---- Page header (clay) ----------------------------------------------- */
.legal-header {
  padding: 1.5rem 1rem;
}

.legal-header-inner {
  max-width: 56rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.legal-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.legal-logo-badge {
  width: 2.75rem;
  height: 2.75rem;
  background: #ff6b6b;
  border: 3px solid #2d3436;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d3436;
}

.legal-logo-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #2d3436;
}

.legal-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ---- Container -------------------------------------------------------- */
.terms-container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
}

/* ---- Back link (clay chip) -------------------------------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: #2d3436;
  text-decoration: none;
  background: #ffe66d;
  border: 3px solid #2d3436;
  border-radius: 16px;
  box-shadow: 4px 4px 0 #2d3436;
  padding: 0.5rem 1rem;
  margin-bottom: 2rem;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.back-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #2d3436;
}

.back-link:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #2d3436;
}

/* ---- Header block ----------------------------------------------------- */
.terms-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 4px solid #2d3436;
}

.terms-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: #add8e6;
  border: 3px solid #2d3436;
  border-radius: 9999px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: #2d3436;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.terms-title {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #2d3436;
  margin-bottom: 0.75rem;
}

.terms-updated {
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  color: #636e72;
}

/* ---- Intro + highlight ------------------------------------------------ */
.terms-intro {
  font-size: 1.05rem;
  color: #2d3436;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.privacy-highlight {
  background: #98ff98;
  border: 3px solid #2d3436;
  border-radius: 24px;
  box-shadow: 6px 6px 0 #2d3436, inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: #2d3436;
}

/* ---- Sections --------------------------------------------------------- */
.terms-section {
  margin-bottom: 2.5rem;
}

.terms-section h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2d3436;
  margin-bottom: 1rem;
}

.terms-section p {
  font-size: 1rem;
  color: #2d3436;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.terms-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.terms-section li {
  font-size: 1rem;
  color: #2d3436;
  line-height: 1.8;
  padding-left: 1.4rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.terms-section li::before {
  content: '+';
  position: absolute;
  left: 0;
  color: #0e7c74; /* AA-safe teal */
  font-weight: 700;
}

.terms-section strong {
  color: #2d3436;
  font-weight: 700;
}

/* ---- Contact card (clay) ---------------------------------------------- */
.terms-contact {
  background: #fff8f0;
  border: 4px solid #2d3436;
  border-radius: 24px;
  box-shadow: 8px 8px 0 #2d3436, inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-top: 2.5rem;
}

.terms-contact h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2d3436;
  margin-bottom: 1rem;
}

.terms-contact p {
  font-size: 1rem;
  color: #2d3436;
  line-height: 1.8;
}

.terms-contact a {
  color: #0e7c74; /* AA-safe teal */
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms-contact a:hover {
  color: #c73333;
}

/* ---- See-also link ---------------------------------------------------- */
.see-also {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(45, 52, 54, 0.15);
}

.see-also a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0e7c74;
  text-decoration: none;
  transition: gap 0.2s ease;
}

.see-also a:hover {
  gap: 0.85rem;
}

/* ---- Page footer ------------------------------------------------------ */
.terms-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 4px solid #2d3436;
  text-align: center;
}

.terms-footer p {
  font-size: 0.9rem;
  color: #636e72;
}

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

  .back-link:hover,
  .back-link:active {
    transform: none;
  }
}

::selection {
  background: #ffe66d;
  color: #2d3436;
}
