/* Brawnd legal pages
   Editorial, readable and intentionally restrained. Each legal document has a
   distinct abstract visual that communicates its subject without competing
   with the legal copy. */

.legal-page {
  min-height: 100vh;
  background: var(--bg);
}

.legal-hero {
  position: relative;
  overflow: hidden;
  padding: 172px 0 104px;
  border-bottom: 1px solid var(--line);
}

.legal-hero::before {
  content: '';
  position: absolute;
  width: min(720px, 54vw);
  aspect-ratio: 1;
  right: -18vw;
  top: -28vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78,14,35,.18), rgba(78,14,35,.05) 44%, transparent 72%);
  filter: blur(18px);
  pointer-events: none;
}

.legal-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .4fr);
  gap: clamp(64px, 9vw, 150px);
  align-items: end;
}

.legal-kicker,
.legal-sidebar-label,
.legal-updated,
.legal-visual-caption {
  font-family: var(--body);
  text-transform: uppercase;
  letter-spacing: .16em;
}

.legal-kicker {
  margin-bottom: 25px;
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
}

.legal-hero h1 {
  max-width: 900px;
  font-family: var(--headline);
  font-size: clamp(58px, 7.2vw, 104px);
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.legal-intro {
  max-width: 760px;
  margin-top: 34px;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.72;
  color: var(--soft);
}

.legal-updated {
  margin-top: 31px;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Page-specific legal visuals ---------- */

.legal-visual {
  --legal-tilt-x: 0deg;
  --legal-tilt-y: 0deg;
  --legal-shift-x: 0px;
  --legal-shift-y: 0px;
  position: relative;
  width: min(300px, 25vw);
  aspect-ratio: 1;
  justify-self: end;
  opacity: 0;
  transform: perspective(900px) rotateX(var(--legal-tilt-x)) rotateY(var(--legal-tilt-y)) translate3d(var(--legal-shift-x), var(--legal-shift-y), 0) translateY(10px);
  transform-style: preserve-3d;
  transition: transform .26s cubic-bezier(.16,.84,.24,1), opacity .55s ease;
  will-change: transform;
}

.legal-visual.is-ready {
  opacity: 1;
  transform: perspective(900px) rotateX(var(--legal-tilt-x)) rotateY(var(--legal-tilt-y)) translate3d(var(--legal-shift-x), var(--legal-shift-y), 0);
}

.legal-visual-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.026), rgba(78,14,35,.035)),
    var(--bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 24px 70px rgba(0,0,0,.08);
  transform: translateZ(0);
}

.legal-visual-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 15%, rgba(255,255,255,.035) 49%, transparent 78%);
  transform: translateX(-115%);
  animation: legalSheen 9s 2s ease-in-out infinite;
}

.legal-visual-caption {
  position: absolute;
  left: 18px;
  bottom: -28px;
  font-size: 8px;
  font-weight: 650;
  color: var(--muted);
}

/* Privacy: controlled boundary + protected centre. */
.legal-visual--privacy .privacy-ring,
.legal-visual--privacy .privacy-shield,
.legal-visual--privacy .privacy-node,
.legal-visual--privacy .privacy-scan {
  position: absolute;
  display: block;
}

.privacy-ring {
  border: 1px solid rgba(78,14,35,.28);
  border-radius: 50%;
}

.privacy-ring--outer {
  inset: 14%;
  border-style: dashed;
  animation: privacyOrbit 18s linear infinite;
}

.privacy-ring--inner {
  inset: 28%;
  border-color: rgba(78,14,35,.38);
  animation: privacyOrbitReverse 13s linear infinite;
}

.privacy-shield {
  left: 50%;
  top: 50%;
  width: 76px;
  height: 88px;
  background: linear-gradient(160deg, var(--wine2), var(--wine) 58%, #2d0713);
  clip-path: polygon(50% 0, 88% 14%, 82% 68%, 50% 100%, 18% 68%, 12% 14%);
  transform: translate(-50%,-50%);
  box-shadow: 0 18px 50px rgba(78,14,35,.2);
  animation: privacyBreath 4.8s ease-in-out infinite;
}

.privacy-shield i {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 13px;
  height: 20px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 8px 8px 4px 4px;
  transform: translate(-50%,-50%);
}

.privacy-shield i::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -10px;
  width: 9px;
  height: 10px;
  border: 1px solid rgba(255,255,255,.72);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform: translateX(-50%);
}

.privacy-scan {
  left: 19%;
  right: 19%;
  top: 24%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(118,33,63,.8), transparent);
  box-shadow: 0 0 14px rgba(118,33,63,.3);
  animation: privacyScan 4.6s ease-in-out infinite;
}

.privacy-node {
  width: 6px;
  height: 6px;
  border: 1px solid var(--wine2);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 16px rgba(78,14,35,.2);
}

.privacy-node--one { left: 21%; top: 48%; animation: privacyNode 3.4s .2s ease-in-out infinite; }
.privacy-node--two { right: 22%; top: 31%; animation: privacyNode 3.4s 1.25s ease-in-out infinite; }
.privacy-node--three { right: 25%; bottom: 24%; animation: privacyNode 3.4s 2.15s ease-in-out infinite; }

/* Cookies: browser state moving into a controlled preference store. */
.legal-visual--cookies .cookie-orbit,
.legal-visual--cookies .cookie-chip,
.legal-visual--cookies .cookie-store {
  position: absolute;
  display: block;
}

.cookie-orbit {
  left: 50%;
  top: 50%;
  border: 1px solid rgba(78,14,35,.24);
  border-radius: 50%;
  transform: translate(-50%,-50%);
}

.cookie-orbit--one {
  width: 72%;
  height: 72%;
  border-style: dashed;
  animation: privacyOrbit 22s linear infinite;
}

.cookie-orbit--two {
  width: 48%;
  height: 48%;
  border-color: rgba(78,14,35,.34);
  animation: privacyOrbitReverse 15s linear infinite;
}

.cookie-store {
  left: 50%;
  top: 50%;
  width: 112px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
  transform: translate(-50%,-50%);
  box-shadow: 0 18px 42px rgba(0,0,0,.08);
}

.cookie-store i {
  position: relative;
  display: block;
  height: 15px;
  margin: 7px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.cookie-store i::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wine2);
  transform: translateY(-50%);
  animation: cookieToggle 5.4s ease-in-out infinite;
}

.cookie-store i:nth-child(1)::after { left: 8px; animation-delay: 0s; }
.cookie-store i:nth-child(2)::after { left: 37px; animation-delay: -1.7s; }
.cookie-store i:nth-child(3)::after { left: 64px; animation-delay: -3.2s; }

.cookie-chip {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--wine2);
  box-shadow: 0 0 20px rgba(78,14,35,.24);
}

.cookie-chip--one { left: 19%; top: 27%; animation: cookieChipOne 6.4s ease-in-out infinite; }
.cookie-chip--two { right: 18%; top: 38%; animation: cookieChipTwo 7s -1.4s ease-in-out infinite; }
.cookie-chip--three { left: 29%; bottom: 18%; animation: cookieChipThree 6.8s -2.1s ease-in-out infinite; }

/* Terms: two documents align, connect and settle into agreement. */
.legal-visual--terms .terms-sheet,
.legal-visual--terms .terms-link,
.legal-visual--terms .terms-seal {
  position: absolute;
  display: block;
}

.terms-sheet {
  width: 118px;
  height: 154px;
  padding: 24px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(255,255,255,.035), rgba(255,255,255,.008));
  box-shadow: 0 18px 46px rgba(0,0,0,.08);
}

.terms-sheet i {
  display: block;
  height: 1px;
  margin: 14px 0;
  background: var(--line-strong);
  transform-origin: left;
  animation: termsLine 5.8s ease-in-out infinite;
}

.terms-sheet i:nth-child(2) { width: 74%; animation-delay: -.9s; }
.terms-sheet i:nth-child(3) { width: 52%; animation-delay: -1.8s; }

.terms-sheet--back {
  left: 25%;
  top: 26%;
  transform: rotate(-8deg);
  opacity: .55;
  animation: termsBack 6.4s ease-in-out infinite;
}

.terms-sheet--front {
  right: 23%;
  top: 20%;
  transform: rotate(5deg);
  animation: termsFront 6.4s ease-in-out infinite;
}

.terms-link {
  left: 41%;
  right: 39%;
  top: 68%;
  height: 1px;
  background: var(--wine2);
  transform-origin: left;
  animation: termsLink 4.8s ease-in-out infinite;
}

.terms-seal {
  right: 25%;
  bottom: 20%;
  width: 34px;
  height: 34px;
  border: 1px solid var(--wine2);
  border-radius: 50%;
  background: rgba(78,14,35,.1);
  box-shadow: inset 0 0 0 7px rgba(78,14,35,.08), 0 0 30px rgba(78,14,35,.12);
  animation: termsSeal 4.8s ease-in-out infinite;
}

/* Accessibility: clear routes, reachable nodes and a moving focus state. */
.legal-visual--accessibility .access-line,
.legal-visual--accessibility .access-node,
.legal-visual--accessibility .access-focus,
.legal-visual--accessibility .access-core {
  position: absolute;
  display: block;
}

.access-line {
  background: var(--line-strong);
}

.access-line--horizontal {
  left: 20%;
  right: 20%;
  top: 50%;
  height: 1px;
}

.access-line--vertical {
  top: 20%;
  bottom: 20%;
  left: 50%;
  width: 1px;
}

.access-node {
  width: 10px;
  height: 10px;
  border: 1px solid var(--wine2);
  border-radius: 50%;
  background: var(--bg);
  transform: translate(-50%,-50%);
  animation: accessNode 4.4s ease-in-out infinite;
}

.access-node--one { left: 20%; top: 50%; animation-delay: 0s; }
.access-node--two { left: 50%; top: 20%; animation-delay: -1.1s; }
.access-node--three { left: 80%; top: 50%; animation-delay: -2.2s; }
.access-node--four { left: 50%; top: 80%; animation-delay: -3.3s; }

.access-core {
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--wine);
  transform: translate(-50%,-50%);
  box-shadow: 0 0 40px rgba(78,14,35,.22);
}

.access-focus {
  left: 20%;
  top: 50%;
  width: 28px;
  height: 28px;
  border: 1px solid var(--wine2);
  border-radius: 8px;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 0 5px rgba(78,14,35,.06);
  animation: accessFocus 8s cubic-bezier(.45,0,.2,1) infinite;
}

/* ---------- Legal copy ---------- */

.legal-body {
  padding: 92px 0 150px;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(180px, .3fr) minmax(0, 1fr);
  gap: clamp(64px, 9vw, 150px);
  align-items: start;
}

.legal-sidebar {
  position: sticky;
  top: 126px;
}

.legal-sidebar-label {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 650;
  color: var(--muted);
}

.legal-nav {
  display: grid;
  border-bottom: 1px solid var(--line);
}

.legal-nav a {
  position: relative;
  padding: 15px 18px 15px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  transition: color .25s ease, padding-left .25s ease;
}

.legal-nav a:first-child { border-top: 0; }
.legal-nav a:hover { color: var(--text); padding-left: 7px; }

.legal-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 650;
}

.legal-nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wine2);
  transform: translateY(-50%);
}

.legal-home-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  font-size: 11px;
  font-weight: 650;
  color: var(--soft);
}

.legal-home-link span {
  color: var(--wine2);
  transition: transform .25s ease;
}

.legal-home-link:hover span { transform: translateX(5px); }

.legal-content {
  width: min(100%, 840px);
}

.legal-section {
  padding: 42px 0 46px;
  border-top: 1px solid var(--line);
}

.legal-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.legal-section h2 {
  margin-bottom: 20px;
  font-family: var(--display);
  font-size: clamp(25px, 2.2vw, 34px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.legal-section p,
.legal-section li {
  font-family: var(--body);
  font-size: clamp(15px, 1.06vw, 17px);
  line-height: 1.82;
  color: var(--soft);
}

.legal-section p + p { margin-top: 17px; }

.legal-section ul,
.legal-section ol {
  display: grid;
  gap: 11px;
  margin: 20px 0 0;
  padding-left: 21px;
}

.legal-section li::marker { color: var(--wine2); }
.legal-section strong { color: var(--text); font-weight: 650; }
.legal-section a { color: var(--text); text-decoration: underline; text-decoration-color: var(--wine2); text-underline-offset: 4px; }

.legal-endnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 58px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.legal-endnote span {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}

.legal-endnote p {
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Motion ---------- */

@keyframes legalSheen {
  0%, 62% { transform: translateX(-115%); opacity: 0; }
  70% { opacity: .6; }
  86%, 100% { transform: translateX(115%); opacity: 0; }
}

@keyframes privacyOrbit { to { transform: rotate(360deg); } }
@keyframes privacyOrbitReverse { to { transform: rotate(-360deg); } }
@keyframes privacyBreath {
  0%,100% { transform: translate(-50%,-50%) scale(1); filter: brightness(.96); }
  50% { transform: translate(-50%,-50%) scale(1.045); filter: brightness(1.06); }
}
@keyframes privacyScan {
  0%,100% { top: 24%; opacity: 0; }
  18% { opacity: .8; }
  72% { opacity: .8; }
  88% { top: 76%; opacity: 0; }
}
@keyframes privacyNode {
  0%,100% { transform: scale(.8); opacity: .35; }
  50% { transform: scale(1.35); opacity: 1; }
}

@keyframes cookieToggle {
  0%,100% { transform: translateY(-50%) scale(.8); opacity: .45; }
  48%,58% { transform: translateY(-50%) scale(1.25); opacity: 1; }
}
@keyframes cookieChipOne {
  0%,100% { transform: translate3d(0,0,0) rotate(0); }
  50% { transform: translate3d(30px,32px,0) rotate(90deg); }
}
@keyframes cookieChipTwo {
  0%,100% { transform: translate3d(0,0,0) rotate(0); }
  50% { transform: translate3d(-28px,28px,0) rotate(-90deg); }
}
@keyframes cookieChipThree {
  0%,100% { transform: translate3d(0,0,0) rotate(0); }
  50% { transform: translate3d(24px,-28px,0) rotate(90deg); }
}

@keyframes termsBack {
  0%,100% { transform: translate3d(-5px,2px,0) rotate(-8deg); }
  50% { transform: translate3d(8px,-3px,0) rotate(-3deg); }
}
@keyframes termsFront {
  0%,100% { transform: translate3d(5px,0,0) rotate(5deg); }
  50% { transform: translate3d(-6px,3px,0) rotate(1deg); }
}
@keyframes termsLine {
  0%,100% { transform: scaleX(.48); opacity: .4; }
  50% { transform: scaleX(1); opacity: .9; }
}
@keyframes termsLink {
  0%,25%,100% { transform: scaleX(0); opacity: 0; }
  45%,78% { transform: scaleX(1); opacity: 1; }
}
@keyframes termsSeal {
  0%,100% { transform: scale(.92); opacity: .55; }
  55%,70% { transform: scale(1.08); opacity: 1; }
}

@keyframes accessNode {
  0%,100% { box-shadow: 0 0 0 0 rgba(78,14,35,0); }
  50% { box-shadow: 0 0 0 7px rgba(78,14,35,.08); }
}
@keyframes accessFocus {
  0%,12% { left: 20%; top: 50%; }
  25%,37% { left: 50%; top: 20%; }
  50%,62% { left: 80%; top: 50%; }
  75%,87% { left: 50%; top: 80%; }
  100% { left: 20%; top: 50%; }
}

@media (max-width: 980px) {
  .legal-hero { padding: 150px 0 86px; }

  .legal-hero-grid {
    grid-template-columns: 1fr minmax(180px, .3fr);
    gap: 54px;
  }

  .legal-visual { width: min(236px, 24vw); }
  .legal-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 54px; }
  .legal-body { padding: 76px 0 124px; }
}

@media (max-width: 760px) {
  .legal-hero { padding: 132px 0 76px; }

  .legal-hero-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .legal-hero h1 {
    font-size: clamp(48px, 14vw, 70px);
    line-height: .95;
  }

  .legal-intro { margin-top: 26px; font-size: 16px; }
  .legal-updated { margin-top: 24px; }

  .legal-visual {
    width: 150px;
    justify-self: start;
  }

  .legal-visual-stage { border-radius: 22px; }
  .legal-visual-caption { left: 8px; bottom: -24px; font-size: 7px; }
  .privacy-shield { width: 44px; height: 52px; }
  .cookie-store { width: 72px; padding: 7px; border-radius: 12px; }
  .cookie-store i { height: 10px; margin: 4px 0; }
  .cookie-store i:nth-child(1)::after { left: 5px; }
  .cookie-store i:nth-child(2)::after { left: 24px; }
  .cookie-store i:nth-child(3)::after { left: 43px; }
  .terms-sheet { width: 64px; height: 84px; padding: 12px 8px; border-radius: 9px; }
  .terms-sheet i { margin: 8px 0; }
  .terms-seal { width: 20px; height: 20px; }
  .access-core { width: 28px; height: 28px; }
  .access-focus { width: 20px; height: 20px; border-radius: 6px; }

  .legal-body { padding: 54px 0 96px; }
  .legal-layout { grid-template-columns: 1fr; gap: 48px; }

  .legal-sidebar {
    position: static;
    display: none;
  }

  .legal-section { padding: 33px 0 37px; }
  .legal-section h2 { margin-bottom: 16px; }
  .legal-section p,
  .legal-section li { font-size: 15px; line-height: 1.76; }

  .legal-endnote {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-top: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-visual,
  .legal-visual.is-ready {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .legal-visual-stage::after,
  .legal-visual span,
  .legal-visual i,
  .legal-visual i::after {
    animation: none !important;
  }
}
