/* SpiffyLink hub — applies Design pack tokens */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sl-font-ui);
  font-size: 17px;
  line-height: 1.5;
  background: var(--sl-bg);
  color: var(--sl-ink);
}

a {
  color: var(--sl-volt);
}

a:hover {
  color: var(--sl-spark-soft);
}

.wrap {
  max-width: var(--sl-max);
  margin: 0 auto;
  padding: calc(var(--sl-space) * 6) calc(var(--sl-space) * 3)
    calc(var(--sl-space) * 8);
}

.hero {
  text-align: center;
  margin-bottom: calc(var(--sl-space) * 5);
}

.hero__logo {
  height: 88px;
  width: auto;
  display: block;
  margin: 0 auto calc(var(--sl-space) * 2);
}

.hero__title {
  font-family: var(--sl-font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0 0 calc(var(--sl-space) * 1.5);
}

.hero__tag {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--sl-ink-dim);
  font-size: 1.125rem;
}

.hero__strip {
  display: block;
  height: 28px;
  width: min(100%, 420px);
  margin: calc(var(--sl-space) * 3) auto 0;
}

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: calc(var(--sl-space) * 3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--sl-panel);
  border: 1px solid var(--sl-line);
  border-radius: var(--sl-radius);
  padding: calc(var(--sl-space) * 3);
  box-shadow: var(--sl-shadow);
  display: flex;
  flex-direction: column;
  gap: calc(var(--sl-space) * 2);
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.card:hover,
.card:focus-within {
  background: var(--sl-panel-hover);
  border-color: var(--sl-line-bright);
  transform: translateY(-2px);
}

.card__emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.card__title {
  font-family: var(--sl-font-display);
  font-weight: 600;
  font-size: 1.375rem;
  margin: 0;
}

.card__pitch {
  margin: 0;
  color: var(--sl-ink-dim);
  flex: 1;
  max-width: 70ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  background: var(--sl-spark);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--sl-radius-pill);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--sl-spark-deep);
  color: #fff;
  outline: 2px solid var(--sl-sun);
  outline-offset: 2px;
}

.site-footer {
  margin-top: calc(var(--sl-space) * 8);
  padding-top: calc(var(--sl-space) * 3);
  border-top: 1px solid var(--sl-line);
  color: var(--sl-ink-mute);
  font-size: 0.8125rem;
  text-align: center;
}

.site-footer a {
  color: var(--sl-ink-mute);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: var(--sl-ink-dim);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* /devprojects inventory */
.hero--compact { margin-bottom: calc(var(--sl-space) * 3); }
.hero--compact .hero__logo { height: 56px; }
.section__title {
  font-family: var(--sl-font-display);
  color: var(--sl-ink);
  font-size: 1.4rem;
  margin: calc(var(--sl-space) * 4) 0 calc(var(--sl-space) * 2);
}
.badge {
  align-self: flex-start;
  font-family: var(--sl-font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 10px;
  border-radius: var(--sl-radius-pill);
  border: 1px solid var(--sl-line-bright);
}
.badge--live { color: var(--sl-ok); border-color: var(--sl-ok); }
.badge--dev { color: var(--sl-warn); border-color: var(--sl-warn); }
.btn--quiet { background: transparent; color: var(--sl-ink); border: 1px solid var(--sl-line-bright); }
.btn--quiet:hover, .btn--quiet:focus-visible { background: var(--sl-panel-hover); }

/* /bplog product page */
.hero__note {
  margin: calc(var(--sl-space) * 1.5) auto 0;
  max-width: 36rem;
  color: var(--sl-ink-mute);
  font-size: 0.95rem;
}
/* Rows: text first in the DOM (mobile reads heading, text, phone);
   desktop alternates the phone left/right with grid order. */
.feature {
  display: grid;
  grid-template-columns: 280px minmax(0, 44ch);
  justify-content: center;
  column-gap: calc(var(--sl-space) * 7);
  align-items: center;
  margin: calc(var(--sl-space) * 8) auto 0;
  max-width: 880px;
}
.feature + .feature,
.feature + .note,
.settings-block + .feature { margin-top: calc(var(--sl-space) * 12); }
.feature > .feature__shot { order: -1; }
.feature--flip { grid-template-columns: minmax(0, 44ch) 280px; }
.feature--flip > .feature__shot { order: 0; }
.feature--solo { display: block; text-align: center; }
.feature--solo .feature__text p { margin: 0 auto; }
.feature__shot {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  aspect-ratio: 540 / 1202;
  justify-self: center;
  background: var(--sl-panel);
  border: 1px solid var(--sl-line);
  border-radius: var(--sl-radius);
  color: var(--sl-ink-mute);
  font-size: 0.85rem;
}
.feature__title {
  font-family: var(--sl-font-display);
  font-weight: 600;
  font-size: 1.6rem;
  margin: 0 0 calc(var(--sl-space) * 1.5);
}
.feature__text p,
.note p {
  margin: 0;
  color: var(--sl-ink-dim);
  max-width: 62ch;
}
.feature__text p { max-width: 44ch; }
.feature--solo .feature__text p { max-width: 62ch; }
/* /bplog Settings section: real break + compact 2-up cards */
.settings-block {
  max-width: 880px;
  margin: calc(var(--sl-space) * 16) auto 0; /* 128px above hairline */
  padding-top: calc(var(--sl-space) * 4); /* room under the line */
  border-top: 1px solid var(--sl-line);
}
.settings-block__head {
  text-align: center;
  margin: 0 0 calc(var(--sl-space) * 6);
}
.settings-block__title {
  font-family: var(--sl-font-display);
  font-weight: 600;
  font-size: 2rem;
  margin: 0 0 calc(var(--sl-space) * 1.5);
  color: var(--sl-ink);
}
.settings-block__intro {
  margin: 0 auto;
  max-width: 36rem;
  font-family: var(--sl-font-ui);
  font-size: 1.05rem;
  color: var(--sl-ink-dim);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: calc(var(--sl-space) * 6);
  row-gap: calc(var(--sl-space) * 8);
  justify-items: center;
}
.settings-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 22rem;
  width: 100%;
}
/* 5 cards: last alone, centred on its row */
.settings-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.settings-card__title {
  font-family: var(--sl-font-display);
  font-weight: 600;
  font-size: 1.35rem;
  margin: calc(var(--sl-space) * 2) 0 calc(var(--sl-space) * 1);
  order: 0;
}
.settings-card p {
  margin: 0;
  color: var(--sl-ink-dim);
  max-width: 44ch;
  font-size: 0.98rem;
  order: 0;
}
.settings-card__shot {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 540 / 1202;
  order: -1; /* phone on top on desktop */
  background: var(--sl-panel);
  border: 1px solid var(--sl-line);
  border-radius: var(--sl-radius);
}
@media (max-width: 680px) {
  .settings-block {
    margin-top: calc(var(--sl-space) * 10); /* 80px above hairline */
    padding-top: calc(var(--sl-space) * 3);
  }
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: calc(var(--sl-space) * 6); /* 48px */
  }
  .settings-card:last-child:nth-child(odd) {
    grid-column: auto;
  }
  .settings-card__shot {
    order: 1; /* heading, text, then phone */
    max-width: 200px;
    margin-top: calc(var(--sl-space) * 2);
  }
}
.note {
  max-width: 880px;
  margin: calc(var(--sl-space) * 12) auto 0;
  padding: calc(var(--sl-space) * 3);
  background: var(--sl-bg-lift);
  border: 1px solid var(--sl-line);
  border-radius: var(--sl-radius);
}
@media (max-width: 680px) {
  .feature,
  .feature--flip { grid-template-columns: minmax(0, 1fr); row-gap: calc(var(--sl-space) * 3); }
  .feature > .feature__shot,
  .feature--flip > .feature__shot { order: 0; max-width: 240px; }
  .feature + .feature,
  .feature + .note { margin-top: calc(var(--sl-space) * 8); }
}
/* /bplog slideshow zones (progressive enhancement).
   Only .js-zones .zone--ready collapses slides; without JS the stacked
   layout above is what renders. */
.js-zones .zone--ready {
  max-width: 880px;
  margin: calc(var(--sl-space) * 8) auto 0;
  outline: none;
}
.js-zones .zone--ready:focus-visible {
  outline: 2px solid var(--sl-sun);
  outline-offset: 8px;
  border-radius: var(--sl-radius);
}
.js-zones .zone--settings.zone--ready { margin-top: 0; }
/* Stack every slide in one grid cell: the track takes the tallest slide's
   height, so changing slides never shifts the page. */
.js-zones .zone--ready .zone__track {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  row-gap: 0;
  column-gap: 0;
  touch-action: pan-y;
}
.js-zones .zone--ready .zone__slide {
  grid-area: 1 / 1;
  margin: 0 auto;
  align-self: start;
  opacity: 0;
  visibility: hidden;
  transform: translateX(24px);
  transition: opacity 350ms ease-out, transform 350ms ease-out, visibility 0s linear 350ms;
}
.js-zones .zone--ready .zone__slide.is-before { transform: translateX(-24px); }
.js-zones .zone--ready .zone__slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 350ms ease-out, transform 350ms ease-out, visibility 0s;
}
/* Features: phone left, text right on every slide (no alternation in a slideshow) */
.js-zones .zone--ready .feature { align-self: center; }
@media (min-width: 681px) {
  .js-zones .zone--ready .feature--flip { grid-template-columns: 280px minmax(0, 44ch); }
  .js-zones .zone--ready .feature--flip > .feature__shot { order: -1; }
  /* Settings cards become side-by-side rows: phone, then heading + text */
  .js-zones .zone--ready .settings-card {
    display: grid;
    grid-template-columns: 240px 44ch;
    grid-template-areas: "shot ." "shot title" "shot text" "shot .";
    grid-template-rows: 1fr auto auto 1fr;
    column-gap: calc(var(--sl-space) * 7);
    align-items: start;
    justify-content: center;
    width: 100%;
    max-width: 880px;
    justify-self: stretch;
    text-align: left;
    align-self: center;
  }
  .js-zones .zone--ready .settings-card__shot { grid-area: shot; }
  .js-zones .zone--ready .settings-card__title { grid-area: title; margin-top: 0; }
  .js-zones .zone--ready .settings-card p { grid-area: text; }
}
.js-zones .zone--ready .settings-card:last-child:nth-child(odd) { grid-column: 1; }

/* Controls: prev, pips, next */
.zone__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--sl-space) * 2);
  margin-top: calc(var(--sl-space) * 4);
}
.zone__pips {
  display: flex;
  align-items: center;
  gap: 4px;
}
.zone__pip,
.zone__arrow {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--sl-ink);
  cursor: pointer;
  font: inherit;
}
.zone__pip {
  position: relative;
  width: 28px;
  height: 28px; /* hit target ≥ 24px */
  border-radius: var(--sl-radius-pill);
}
.zone__pip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: var(--sl-radius-pill);
  background: var(--sl-ink-mute); /* 3.72:1 on --sl-bg */
  transition: background 0.2s ease-out, transform 0.2s ease-out;
}
.zone__pip:hover::before { background: var(--sl-ink-dim); }
.zone__pip[aria-current="true"]::before {
  background: var(--sl-spark);
  transform: scale(1.3);
}
.zone__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--sl-line-bright);
  border-radius: var(--sl-radius-pill);
  font-size: 1.6rem;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.zone__arrow span { margin-top: -3px; }
.zone__arrow:hover { background: var(--sl-panel-hover); border-color: var(--sl-ink-mute); }
.zone__pip:focus-visible,
.zone__arrow:focus-visible {
  outline: 2px solid var(--sl-sun);
  outline-offset: 2px;
}

/* Scroll reveal: fade + small slide-up as sections enter view */
.js-zones .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}
.js-zones .reveal.is-in { opacity: 1; transform: none; }

/* Mobile zones: the slideshow area is the phone (same size on every slide),
   the controls sit right under it at a fixed y, and the active slide's own
   heading + text flows below the controls. Inactive slides leave the flow,
   so the zone only grows below the controls. */
@media (max-width: 680px) {
  .js-zones .zone--ready {
    --zone-phone-w: 240px;
    --zone-gap: calc(var(--sl-space) * 3); /* 24px */
    --zone-ctrl-h: 44px;
    position: relative;
    margin-top: calc(var(--sl-space) * 6);
  }
  .js-zones .zone--settings.zone--ready { --zone-phone-w: 200px; margin-top: 0; }
  .js-zones .zone--ready .zone__track { display: block; position: relative; }
  .js-zones .zone--ready .zone__slide,
  .js-zones .zone--ready .zone__slide.is-before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transform: none; /* text crossfades without the shift */
  }
  .js-zones .zone--ready .zone__slide.is-active { position: relative; }
  .js-zones .zone--ready .feature,
  .js-zones .zone--ready .feature--flip { row-gap: 0; }
  .js-zones .zone--ready .feature > .feature__shot,
  .js-zones .zone--ready .feature--flip > .feature__shot,
  .js-zones .zone--ready .settings-card__shot {
    order: -1; /* phone first, then the controls, then the text */
    width: var(--zone-phone-w);
    max-width: var(--zone-phone-w);
    margin: 0 auto;
    transform: translateX(24px);
    transition: transform 350ms ease-out;
  }
  .js-zones .zone--ready .zone__slide.is-before .feature__shot,
  .js-zones .zone--ready .zone__slide.is-before .settings-card__shot { transform: translateX(-24px); }
  .js-zones .zone--ready .zone__slide.is-active .feature__shot,
  .js-zones .zone--ready .zone__slide.is-active .settings-card__shot { transform: none; }
  /* room for the controls between phone and text */
  .js-zones .zone--ready .feature__text,
  .js-zones .zone--ready .settings-card__title {
    margin-top: calc(var(--zone-gap) * 2 + var(--zone-ctrl-h));
  }
  .js-zones .zone--ready .settings-card { max-width: 22rem; margin: 0 auto; }
  .js-zones .zone--ready .zone__controls {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--zone-phone-w) * 1202 / 540 + var(--zone-gap));
    height: var(--zone-ctrl-h);
    margin: 0;
    gap: var(--sl-space);
    z-index: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js-zones .zone--ready .zone__slide,
  .js-zones .zone--ready .zone__slide.is-active,
  .js-zones .reveal,
  .js-zones .zone--ready .feature__shot,
  .js-zones .zone--ready .settings-card__shot,
  .zone__pip::before,
  .zone__arrow {
    transition: none !important;
  }
  .js-zones .zone--ready .feature__shot,
  .js-zones .zone--ready .settings-card__shot { transform: none !important; }
  .js-zones .zone--ready .zone__slide,
  .js-zones .zone--ready .zone__slide.is-before { transform: none; }
  .js-zones .reveal { opacity: 1; transform: none; }
  .zone__pip[aria-current="true"]::before { transform: none; }
}
