/* Verda legal pages — mirrors Verda/Theme/Theme.swift and AmbientBackground.swift.
   Token names match the Swift so the two stay diffable. */

:root {
  color-scheme: light dark;

  --acc: #16a34a;
  --acc-soft: rgba(22, 163, 74, 0.16);
  --g1: #7ed957;
  --tx: #152219;
  --tx2: rgba(21, 42, 30, 0.62);
  --tx3: rgba(21, 42, 30, 0.42);
  --glass: rgba(255, 255, 255, 0.52);
  --glass2: rgba(255, 255, 255, 0.74);
  --gbrd: rgba(255, 255, 255, 0.75);
  --shine: rgba(255, 255, 255, 0.9);
  --inset: rgba(18, 54, 34, 0.07);
  --over: #d97c06;
  --over-soft: rgba(222, 140, 16, 0.16);
  --card-shadow: rgba(22, 62, 38, 0.12);

  --bg-a: #eff7ec;
  --bg-b: #e7f2e6;
  --blob-1: #bdefc9;
  --blob-2: #e2f5a6;
  --blob-3: #ace4d3;
  --blob-4: #ffe4bf;
  --blob-4-opacity: 0.8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --tx: #eaf5ec;
    --tx2: rgba(222, 244, 230, 0.62);
    --tx3: rgba(222, 244, 230, 0.4);
    --glass: rgba(26, 40, 31, 0.55);
    --glass2: rgba(22, 34, 26, 0.82);
    --gbrd: rgba(255, 255, 255, 0.13);
    --shine: rgba(255, 255, 255, 0.12);
    --inset: rgba(255, 255, 255, 0.08);
    --over: #f2a93b;
    --over-soft: rgba(242, 169, 59, 0.2);
    --card-shadow: rgba(0, 0, 0, 0.42);

    /* the accent lightens in dark rather than inverting */
    --acc: #62c687;
    --acc-soft: rgba(98, 198, 135, 0.24);
    --g1: #9be070;

    --bg-a: #0a110d;
    --bg-b: #0c1510;
    --blob-1: #17452e;
    --blob-2: #26401a;
    --blob-3: #0f3b33;
    --blob-4: transparent;
    --blob-4-opacity: 0;
  }
}

:root[data-theme='dark'] {
  --tx: #eaf5ec;
  --tx2: rgba(222, 244, 230, 0.62);
  --tx3: rgba(222, 244, 230, 0.4);
  --glass: rgba(26, 40, 31, 0.55);
  --glass2: rgba(22, 34, 26, 0.82);
  --gbrd: rgba(255, 255, 255, 0.13);
  --shine: rgba(255, 255, 255, 0.12);
  --inset: rgba(255, 255, 255, 0.08);
  --over: #f2a93b;
  --over-soft: rgba(242, 169, 59, 0.2);
  --card-shadow: rgba(0, 0, 0, 0.42);
  --acc: #62c687;
  --acc-soft: rgba(98, 198, 135, 0.24);
  --g1: #9be070;
  --bg-a: #0a110d;
  --bg-b: #0c1510;
  --blob-1: #17452e;
  --blob-2: #26401a;
  --blob-3: #0f3b33;
  --blob-4: transparent;
  --blob-4-opacity: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', sans-serif;
  color: var(--tx);
  background: linear-gradient(180deg, var(--bg-a), var(--bg-b));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* AmbientBackground.swift — a drifting blob field behind every screen */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: drift 11s ease-in-out infinite alternate;
}

.blob-1 {
  width: 340px; height: 340px;
  top: -60px; left: -80px;
  background: radial-gradient(circle closest-side, var(--blob-1), transparent);
}
.blob-2 {
  width: 320px; height: 320px;
  top: 300px; right: -110px;
  background: radial-gradient(circle closest-side, var(--blob-2), transparent);
  animation-delay: -3s;
}
.blob-3 {
  width: 380px; height: 380px;
  bottom: -90px; left: -60px;
  background: radial-gradient(circle closest-side, var(--blob-3), transparent);
  animation-delay: -6s;
}
.blob-4 {
  width: 200px; height: 200px;
  bottom: 40px; right: -40px;
  opacity: var(--blob-4-opacity);
  background: radial-gradient(circle closest-side, var(--blob-4), transparent);
  animation-delay: -8s;
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(22px, -18px); }
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 16px 96px;
}

/* GlassCard — Glass.swift fallback path: glass fill + material + 1px border + top shine */
.card {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--gbrd);
  border-radius: 30px;
  box-shadow: 0 7px 20px var(--card-shadow);
  padding: 32px 28px;
}

/* the signature inner top-edge highlight, fading out by the vertical midpoint */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, var(--shine), transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

header.masthead {
  margin-bottom: 20px;
  padding: 0 8px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--tx2);
  margin: 0 0 4px;
}

h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0;
  line-height: 1.15;
}

.updated {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 34px 0 10px;
}

h2:first-of-type {
  margin-top: 0;
}

h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin: 22px 0 6px;
  color: var(--acc);
}

/* Body copy uses the primary text token, not tx2. In the app tx2 is for small
   secondary labels; at 62% it lands under 4.5:1 on the card, which is fine for a
   caption and not fine for a page of legal text that has to be readable. */
p, li {
  font-size: 15px;
  line-height: 1.65;
  font-weight: 450;
  color: var(--tx);
  margin: 0 0 12px;
}

li {
  margin-bottom: 7px;
}

strong {
  font-weight: 700;
  color: var(--tx);
}

ul {
  padding-left: 20px;
  margin: 0 0 14px;
}

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

a {
  color: var(--acc);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

hr {
  border: 0;
  height: 1px;
  background: var(--inset);
  margin: 30px 0;
}

/* callout — reuses the amber "over goal" semantic from CalorieCard.swift */
.callout {
  border-radius: 20px;
  background: var(--over-soft);
  padding: 16px 18px;
  margin: 20px 0;
}

.callout p {
  color: var(--tx);
  margin: 0;
  font-size: 14px;
}

.callout .callout-title {
  display: block;
  font-weight: 800;
  color: var(--over);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 14px;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 16px;
}

th {
  text-align: left;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--tx3);
  padding: 0 12px 8px 0;
  white-space: nowrap;
}

td {
  padding: 10px 12px 10px 0;
  border-top: 1px solid var(--inset);
  color: var(--tx);
  line-height: 1.5;
  vertical-align: top;
}

td:first-child {
  color: var(--tx);
  font-weight: 600;
}

footer {
  margin-top: 26px;
  padding: 0 8px;
  text-align: center;
}

footer p {
  font-size: 12.5px;
  color: var(--tx3);
  margin: 0;
}

@media (max-width: 520px) {
  .wrap { padding: 28px 12px 72px; }
  .card { padding: 24px 20px; border-radius: 26px; }
  h1 { font-size: 26px; }
}
