/*
 * campaignai.ca home pages (/ and /fr/) — the board approved on Nov 21, 2026 (ADR-445).
 * Loaded after tokens.css and site.css, and scoped to body.home, so no other page changes.
 * Colours come from the tokens only. No JavaScript: the phone menu is a <details>, and all motion is CSS.
 *
 * Headline type: Archivo at normal width, sentence case. This is the public site's own choice (owner, Nov 21);
 * the app keeps the brand's condensed capitals.
 */

.home main {
  padding: 0;
}
.home h1,
.home h2,
.home h3,
.home p,
.home ul,
.home ol {
  margin: 0;
}
.home li + li {
  margin-top: 0;
}
.home .wrap {
  max-width: 1180px;
  padding: 0 20px;
}
@media (min-width: 641px) {
  .home .wrap {
    padding: 0 40px;
  }
}
.home .phone-only {
  display: none;
}

/* ---------- Header ---------- */
.home-header .wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 68px;
}
.home-header .brand img {
  height: 24px;
}
.home-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  order: 0;
  width: auto;
  margin-left: auto;
}
.home-nav > ul {
  gap: 0 28px;
}
.home-nav > ul a {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--color-text-secondary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.home-nav > ul a:hover {
  color: var(--color-text);
  text-decoration: none;
}
/* The small dark "Start free" in the header: ink, not yellow (the one yellow action is the hero's). */
.home .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-text);
  color: var(--color-paper);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
}
.home .pill:hover {
  background: var(--color-text-secondary);
  text-decoration: none;
}
.home .pill:focus-visible,
.home .button:focus-visible,
.home .menu summary:focus-visible {
  border-radius: var(--radius-pill);
}

/* Phone menu: a <details>, so it opens with no script. */
.home .menu {
  position: relative;
}
.home .menu summary {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.home .menu summary::-webkit-details-marker {
  display: none;
}
.home .menu ul {
  display: block;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-box);
  background: var(--color-card);
  box-shadow: var(--shadow-3);
  list-style: none;
}
.home .menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-card);
  font-weight: 500;
  text-decoration: none;
}
.home .menu a:hover {
  background: var(--color-paper);
  text-decoration: none;
}

/* ---------- Hero ---------- */
.home .hero {
  padding: 48px 0 40px;
  text-align: center;
}
.home h1 {
  max-width: 13em;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: 42px;
  font-stretch: 100%;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}
.home .sub {
  max-width: 28em;
  margin: 24px auto 36px;
  color: var(--color-text-secondary);
  font-size: 17px;
  line-height: 1.5;
  text-wrap: balance;
}
/* The one yellow action of its region (hero; the dark band at the bottom is its own region). */
.home .button-primary {
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
}
.home .button-primary:hover {
  background: var(--color-yellow-300);
}
.home .note {
  margin-top: 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* ---------- The three stories ---------- */
.home .film .wrap {
  display: flex;
  flex-direction: column;
}
.home .panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.home .panel {
  position: relative;
  grid-area: 1 / 1;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 20px;
  background: var(--color-border-subtle);
  /* Phone: one story at a time, about 9 s each, with a soft fade. */
  opacity: 0;
  animation: home-show 27s ease-in-out infinite;
  animation-delay: var(--show);
}
.home .panel-1 {
  --drift: 0s;
  --card: 0s;
  --show: 0s;
  opacity: 1;
}
.home .panel-2 {
  --drift: -7s;
  --card: -6s;
  --show: 9s;
}
.home .panel-3 {
  --drift: -14s;
  --card: -12s;
  --show: 18s;
}
.home .panel img,
.home .panel .clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.home .panel img {
  animation: home-drift 22s ease-in-out infinite alternate;
  animation-delay: var(--drift);
}
.home .tag {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-card);
  font-size: 13px;
  font-weight: 600;
}
/* The cream card at the bottom: the post, then the reply and "Saved to Contacts". */
.home .story {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 16px;
  border-radius: 16px;
  background: var(--color-card);
  box-shadow: var(--shadow-3);
  animation: home-post 9s ease-in-out infinite;
  animation-delay: var(--show);
}
.home .story-reply {
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  animation-name: home-reply;
}
.home .who {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}
.home .avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-text);
  color: var(--color-paper);
  font-size: 10px;
  font-weight: 700;
}
.home .words {
  font-size: 14px;
  line-height: 1.45;
}
.home .bubble {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
}
.home .bubble-in {
  border-bottom-left-radius: 4px;
  background: var(--color-paper);
}
.home .bubble-out {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--color-text);
  color: var(--color-paper);
}
/* Green = forward motion: the person is now in Contacts. */
.home .saved {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-pill);
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 12px;
  font-weight: 600;
}
.home .saved .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
}
/* Pause (WCAG 2.2.2): a <details> before the panels in the source, shown under them. Open = everything holds still. */
.home .motion {
  order: 2;
  align-self: center;
  margin-top: 8px;
}
.home .motion summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--color-text-secondary);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  list-style: none;
}
.home .motion summary::-webkit-details-marker {
  display: none;
}
.home .motion .when-paused,
.home .motion[open] .when-playing {
  display: none;
}
.home .motion[open] .when-paused {
  display: inline;
}
.home .motion[open] ~ .panels .panel,
.home .motion[open] ~ .panels .panel img,
.home .motion[open] ~ .panels .story {
  animation-play-state: paused;
}
.home .motion[open] ~ .panels .clip {
  display: none;
}

@keyframes home-show {
  0% {
    opacity: 0;
  }
  3%,
  31% {
    opacity: 1;
  }
  34%,
  100% {
    opacity: 0;
  }
}
@keyframes home-drift {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}
/* A card that is fully hidden is hidden for everyone (visibility: hidden: not read aloud, not scanned); it is visible
   while it fades, because visibility switches at the ends of each step, not in the middle. */
@keyframes home-post {
  0% {
    opacity: 0;
    transform: translateY(8px);
    visibility: hidden;
  }
  5%,
  42% {
    opacity: 1;
    transform: none;
    visibility: visible;
  }
  48%,
  100% {
    opacity: 0;
    transform: translateY(8px);
    visibility: hidden;
  }
}
@keyframes home-reply {
  0%,
  50% {
    opacity: 0;
    transform: translateY(8px);
    visibility: hidden;
  }
  56%,
  92% {
    opacity: 1;
    transform: none;
    visibility: visible;
  }
  98%,
  100% {
    opacity: 0;
    transform: translateY(8px);
    visibility: hidden;
  }
}

/* ---------- Three steps ---------- */
.home .how {
  padding-top: 80px;
}
.home .how h2,
.home .free h2,
.home .band h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-stretch: 100%;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
}
.home .beats {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  max-width: 900px;
  margin: 48px auto 0;
  padding: 0;
  list-style: none;
}
.home .beats li {
  position: relative;
  text-align: center;
}
.home .beats .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border: 1px solid var(--color-text);
  border-radius: 50%;
  background: var(--color-card);
  font-family: var(--font-mono);
  font-size: 15px;
}
.home .beats h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
.home .beats p {
  margin-top: 6px;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Free to try ---------- */
.home .free {
  padding: 80px 0;
}
.home .cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  max-width: 560px;
  margin: 56px auto 0;
  padding: 0;
  list-style: none;
}
.home .card {
  padding: 32px;
  border-radius: 16px;
  background: var(--color-card);
}
.home .card .icon {
  display: block;
  width: 44px;
  height: 44px;
}
.home .icon-disc {
  fill: var(--color-yellow-100);
}
.home .icon-line {
  fill: none;
  stroke: var(--site-on-yellow);
  stroke-linecap: round;
  stroke-width: 2.2;
}
/* Campi's own face (a copy of the app's drawing): its outline is ink in both themes, like the yellow it sits on. */
.home .campi {
  color: var(--site-on-yellow);
}
/* The app's canvas leaves room around the tile, so the tile itself (88 of 112) is drawn at the size of the two discs
   beside it (40px) while the icon still takes the same 44px box. */
.home .card .campi {
  width: 50px;
  height: 50px;
  margin: -3px;
}
.home .card h3 {
  margin: 20px 0 8px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}
.home .card h3 .num {
  font-family: inherit;
}
.home .card p {
  color: var(--color-text-secondary);
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- The dark band (dark in both themes) ---------- */
.home .band {
  padding: 88px 0;
  background: var(--color-caption-ink);
  color: var(--color-caption-text);
  text-align: center;
}
.home .band h2 {
  font-size: 38px;
}
.home .band .button {
  margin-top: 36px;
}

/* ---------- Footer ---------- */
.home .site-footer {
  padding: 64px 0 48px;
  border-top: 0;
  background: var(--color-paper);
  font-size: 15px;
}
.home .site-footer picture img {
  display: block;
  width: auto;
  height: 21px;
}
.home .columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  margin-top: 40px;
}
.home .site-footer h2 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.home .columns ul {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}
.home .columns a {
  color: var(--color-text-secondary);
  text-decoration: none;
}
.home .columns a:hover {
  color: var(--color-text);
  text-decoration: underline;
}
.home .site-contact {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.6;
}
.home .site-contact > * {
  min-height: 0;
}
.home .site-contact > strong {
  font-weight: 400;
}
.home .site-contact > a {
  min-height: 44px;
}
.home .texts-note {
  max-width: 760px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-subtle);
  scroll-margin-top: 24px;
}
.home .texts-note h2 {
  margin-bottom: 6px;
}
.home .texts-note p {
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.55;
}
.home .copy {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}
/* The footer's last line: the copyright, and opposite it the credit to the team that built the platform (owner, Nov 24). */
.home .footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-subtle);
}
.home .made-by {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-text-secondary);
  font-size: 14px;
  text-decoration: none;
}
.home .made-by:hover {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Phone only (up to 640px) ---------- */
@media (max-width: 640px) {
  .home .wide-only {
    display: none;
  }
  .home ul.wide-only {
    display: none;
  }
  .home span.phone-only {
    display: inline;
  }
  .home .footer-base {
    flex-direction: column;
    align-items: flex-start;
  }
  .home details.phone-only {
    display: block;
  }
}

/* ---------- Wider than a phone ---------- */
@media (min-width: 641px) {
  .home-header .wrap {
    gap: 28px;
    height: 80px;
  }
  .home-nav {
    gap: 28px;
  }
  .home .hero {
    padding: 88px 0 56px;
  }
  .home h1 {
    font-size: 58px;
  }
  .home .sub {
    font-size: 20px;
  }
  /* Three panels side by side: each picture drifts, each card shows the post, then the reply. */
  .home .panels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  .home .panel {
    grid-area: auto;
    aspect-ratio: 2 / 3;
    opacity: 1;
    animation: none;
  }
  .home .story {
    animation-duration: 18s;
    animation-delay: var(--card);
  }
  .home .how {
    padding-top: 120px;
  }
  .home .how h2,
  .home .free h2 {
    font-size: 48px;
  }
  .home .beats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
  .home .beats::before {
    content: "";
    position: absolute;
    left: calc(100% / 6);
    right: calc(100% / 6);
    top: 22px;
    height: 1px;
    background: var(--color-border);
  }
  .home .free {
    padding: 112px 0;
  }
  .home .band {
    padding: 112px 0;
  }
  .home .band h2 {
    font-size: 56px;
  }
  .home .columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 961px) {
  .home h1 {
    font-size: 76px;
  }
  .home .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }
  .home .columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Reduced motion: no drift, no fades, the stills and the post cards only ---------- */
@media (prefers-reduced-motion: reduce) {
  .home .panel,
  .home .panel img,
  .home .story {
    animation: none;
  }
  .home .panel {
    grid-area: auto;
    opacity: 1;
  }
  .home .panels {
    gap: 20px;
  }
  .home .story-post {
    opacity: 1;
    transform: none;
    visibility: visible;
  }
  .home .story-reply,
  .home .panel .clip,
  .home .motion {
    display: none;
  }
}

/* ---------- Dark theme ---------- */
@media (prefers-color-scheme: dark) {
  /* The reversed logo file has a margin drawn around the mark (its canvas is 516 x 112 for a 468 x 64 mark, 24 on each
     side). Drawn at the same height it would look about 60 % of the size, so it is drawn larger and pulled back by its
     own margin: the mark lands exactly where the light logo's does. Heights: 24 x 112 / 64 and 21 x 112 / 64. */
  .home-header .brand img {
    height: 42px;
    margin: -9px;
  }
  .home .site-footer picture img {
    height: 36.75px;
    margin: -7.875px;
  }
  /* The band is ink in both themes; on the dark page it gets the raised surface and an edge, so it reads as a band. */
  .home .band {
    border-top: 1px solid var(--color-border-strong);
    border-bottom: 1px solid var(--color-border-strong);
    background: var(--color-raised);
  }
}

@media print {
  .home-nav,
  .home .motion {
    display: none;
  }
}
