/*
 * Page Bias Bars: the standalone site at /pagebiasbars/ and its policy at
 * /pagebiasbars/privacy/. Deliberately self-contained: it does not use the
 * portfolio shell, so everything the page needs is defined here.
 */

:root {
  --pbb_ink: #2a1d14;
  --pbb_muted: #6b5847;
  --pbb_line: #e2d6cc;
  --pbb_accent: #7a4a26;
  --pbb_panel: #fdf8f4;
  --pbb_page: #f4efe9;
}

body.pbb_site-body {
  margin: 0;
  background-color: var(--pbb_page);
  color: var(--pbb_ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* --- top bar -------------------------------------------------------------- */

.pbb_topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  background-color: #fff;
  border-bottom: 1px solid var(--pbb_line);
}

.pbb_brand {
  font-weight: bold;
  font-size: 1rem;
  color: var(--pbb_ink);
  text-decoration: none;
}

.pbb_nav {
  display: flex;
  gap: 1.25rem;
}

.pbb_nav a {
  color: var(--pbb_muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.pbb_nav a:hover {
  color: var(--pbb_accent);
  text-decoration: underline;
}

/* --- layout --------------------------------------------------------------- */

.pbb_site {
  max-width: 58rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem 1.5rem;
}

.pbb_hero {
  text-align: center;
}

.pbb_hero h1 {
  margin: 1.5rem auto 0 auto;
  max-width: 34rem;
  font-size: 1.75rem;
  line-height: 1.25;
  color: var(--pbb_ink);
}

/* --- hero: 3D screenshot carousel ---------------------------------------- */

.pbb_scene {
  /* How much foreshortening the ring gets. Lower = flatter. */
  perspective: 1400px;
  perspective-origin: 50% 50%;
  /* Tall enough for the front card plus its 3D overhang; the slides are centred
     on the ring, which is itself centred in this box. */
  height: 31rem;
  display: flex;
  align-items: center;
  justify-content: center;
  /* The ring is 0x0 by design, so the cards spill out of it: do not clip them. */
  overflow: visible;
}

.pbb_ring {
  position: relative;
  transform-style: preserve-3d;
  /* No size of its own: the slides position themselves around the centre. */
  width: 0;
  height: 0;
}

/* Rotation only once the script has filled in every slide. */
.pbb_ring.pbb_ring-live {
  animation: pbb_spin 36s linear infinite;
}

/* Slides sit on a ring facing outwards. --i is the index, --n the count.
   `transform` is re-declared on the class so the universal `* { transform: none }`
   in defaults.css cannot flatten the ring. The ring is a 0x0 point, so the card is
   pulled back by half its own size to sit centred on that point. */
.pbb_slide {
  position: absolute;
  left: 0;
  top: 0;
  width: 13.5rem;
  margin: 0;
  padding: 0.4rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.3);
  transform:
    translate(calc(-50% - 0.4rem), calc(-50% - 0.4rem))
    rotateY(calc(var(--i) * (360deg / var(--n))))
    translateZ(12rem);
  backface-visibility: hidden;
}

.pbb_slide img {
  display: block;
  width: 100%;
  height: 22rem;
  object-fit: contain;
  background-color: #fff;
  border-radius: 0.3rem;
}

@keyframes pbb_spin {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

/* Stop the movement while a card is being read, and respect reduced motion. */
.pbb_scene:hover .pbb_ring-live {
  animation-play-state: paused;
}

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

.pbb_tagline {
  margin: 1.25rem auto 0 auto;
  max-width: 34rem;
  font-size: 0.95rem;
  color: var(--pbb_muted);
}

.pbb_cta {
  margin-top: 1.5rem;
}

.pbb_btn,
.pbb_site .pbb_btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 0.5rem;
  background-color: var(--pbb_accent);
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
}

.pbb_btn:hover,
.pbb_site .pbb_btn:hover {
  background-color: #5e3620;
  color: #fff;
}

/* --- description ---------------------------------------------------------- */

.pbb_about {
  margin-top: 3rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.pbb_about h2 {
  margin: 0 0 0.6rem 0;
  font-size: 1.15rem;
  color: var(--pbb_ink);
}

.pbb_about p {
  margin: 0 0 0.85rem 0;
}

.pbb_features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.pbb_feature {
  border: 1px solid var(--pbb_line);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  background-color: var(--pbb_panel);
}

.pbb_feature .name {
  font-weight: bold;
  margin-bottom: 0.35rem;
}

.pbb_feature p {
  margin: 0;
}

.pbb_about code {
  background-color: #efe7e0;
  border-radius: 3px;
  padding: 0 0.25rem;
  font-size: 0.85em;
}

.pbb_privacy {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pbb_line);
}

.pbb_site a {
  color: var(--pbb_accent);
}

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

.pbb_footer {
  border-top: 1px solid var(--pbb_line);
  background-color: #fff;
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--pbb_muted);
}

.pbb_footer p {
  margin: 0;
}

/* --- privacy policy (/pagebiasbars/privacy/) ------------------------------ */

.policy_standalone {
  max-width: 52rem;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

.policy_standalone .policy_page-title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: bold;
  margin: 0;
}

.policy_head {
  text-align: center;
  font-size: 0.85rem;
  color: var(--pbb_muted);
  margin-top: 1rem;
}

.policy_body {
  margin-top: 2rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.policy_updated {
  font-size: 0.8rem;
  color: var(--pbb_muted);
  margin-bottom: 1.5rem;
}

.policy_section {
  margin-bottom: 1.75rem;
}

.policy_section h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: bold;
  color: #111;
}

.policy_body p {
  margin-bottom: 0.75rem;
}

.policy_body ul {
  margin: 0 0 0.75rem 1.25rem;
  list-style: disc;
}

.policy_body li {
  margin-bottom: 0.35rem;
}

.policy_body code {
  background-color: #efe7e0;
  border-radius: 3px;
  padding: 0 0.25rem;
  font-size: 0.85em;
}

.policy_body a {
  color: var(--pbb_accent);
}

.policy_perms {
  margin: 0;
}

.policy_perms dt {
  font-weight: bold;
  color: #111;
  margin-top: 0.5rem;
}

.policy_perms dd {
  margin: 0 0 0.5rem 1rem;
}

.policy_back {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pbb_line);
}

@media (max-width: 40rem) {
  .pbb_scene {
    height: 24rem;
  }

  .pbb_slide {
    width: 11rem;
    transform:
      translate(calc(-50% - 0.4rem), calc(-50% - 0.4rem))
      rotateY(calc(var(--i) * (360deg / var(--n))))
      translateZ(9rem);
  }

  .pbb_slide img {
    height: 17rem;
  }

  .pbb_hero h1 {
    font-size: 1.35rem;
  }
}
