/* MagpieFeed homepage, v4 showcase sections: How it works (sticky rail), the owners bento
   with its network marquee, and the examples tabs. Loaded AFTER landing.css, so the rules
   here win at equal specificity. Colours are tokens only (static/css/tokens.css), so the
   dark scheme follows. Motion: CSS + static/js/landing-showcase.js, 160-220ms, one easing,
   and all of it sits behind prefers-reduced-motion: no-preference or a JS-set class, so
   without script or with reduced motion the page is complete and static. */

.home {
  --sx-ease: cubic-bezier(.22, 1, .36, 1);
  --hi: transparent;            /* inset top highlight on a card */
  --sx-tint: color-mix(in srgb, var(--ink) 5%, transparent);
}
@media screen and (prefers-color-scheme: dark) {
  .home { --hi: rgba(255, 255, 255, .06); }
}

/* ------------------------------------------------------------ section heads */
.home h2.show-h { font-weight: 750; font-size: clamp(2rem, 1.2rem + 3.2vw, 3.5rem); line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
.home .steps-sec .sec-head, .home .owners-sec .sec-head { margin-bottom: clamp(24px, 3.5vw, 44px); }

/* ------------------------------------------------------------ the framed window (steps stage, examples) */
.win {
  border: 1px solid var(--line); border-radius: 20px; background: var(--paper); overflow: hidden;
  box-shadow: inset 0 1px 0 var(--hi), var(--lift);
}
.win-bar {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-sunk) 55%, var(--paper));
}
.win-bar > i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--field-line); }
.win-bar > span:not(.rail-pips) { margin-left: 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.rail-pips { display: inline-flex; gap: 4px; margin-left: auto; }
.rail-pips b { width: 18px; height: 4px; border-radius: 2px; background: var(--line); transition: background-color .2s var(--sx-ease); }
.rail-pips b.on { background: var(--blue); }

/* ------------------------------------------------------------ how it works */
.rail-list { display: grid; gap: 28px; margin: 0; padding: 0; list-style: none; }
.rail-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 14px; }
.rail-n {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--fill-ink); color: var(--on-fill-ink); font-size: .875rem; font-weight: 700;
  transition: background-color .2s var(--sx-ease), color .2s var(--sx-ease);
}
.home .rail-item h3 { font-size: 1.25rem; font-weight: 750; letter-spacing: -.015em; color: var(--ink); }
.rs-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-width: 0; padding: 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.rs-inline { grid-column: 1 / -1; min-height: 148px; }
.rail-stage, .rail-track { display: none; }
@media (min-width: 48rem) {
  .rail-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .rail-item { grid-template-columns: 32px minmax(0, 1fr); }
}

/* wide screen + script: sticky left rail, stage on the right, switched by scroll */
@media (min-width: 62.5rem) {
  .rail.rail-js {
    --rail-step: 24vh; position: relative; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: clamp(32px, 5vw, 72px); min-height: calc(var(--rail-step) * 3 + 360px);
  }
  .rail-js .rail-list { position: sticky; top: 112px; align-self: start; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .rail-js .rail-item {
    padding: 18px 20px; border: 1px solid transparent; border-radius: 20px; cursor: pointer; column-gap: 16px;
    transition: background-color .2s var(--sx-ease), border-color .2s var(--sx-ease), box-shadow .2s var(--sx-ease);
  }
  .rail-js .rs-inline { display: none; }
  .home .rail-js .rail-item h3 { font-size: 1.75rem; letter-spacing: -.03em; line-height: 1.15; color: var(--muted); transition: color .2s var(--sx-ease); }
  .rail-js .rail-n { width: 36px; height: 36px; background: var(--bg-sunk); color: var(--muted); }
  .rail-js .rail-item:hover h3 { color: var(--ink); }
  .rail-js .rail-item.is-on { background: var(--paper); border-color: var(--line); box-shadow: inset 0 1px 0 var(--hi), var(--shadow); }
  .home .rail-js .rail-item.is-on h3 { color: var(--ink); }
  .rail-js .rail-item.is-on .rail-n { background: var(--fill-ink); color: var(--on-fill-ink); }
  .rail-js .rail-stage { display: block; position: sticky; top: 100px; align-self: start; }
  .rail-slides { display: grid; place-items: center; min-height: 340px; padding: 28px; background:
    radial-gradient(70% 90% at 50% 0%, var(--blue-soft), transparent 75%); }
  .rail-slide {
    grid-area: 1 / 1; width: min(100%, 25rem); padding: 26px; gap: 18px; opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .22s var(--sx-ease), transform .22s var(--sx-ease), visibility 0s linear .22s;
  }
  .rail-slide.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .rail-slide .fi-url { padding: 8px 8px 8px 18px; font-size: .9375rem; }
  .rail-slide .fi-go { width: 38px; height: 38px; }
  .rail-slide .fi-post { padding: 12px; gap: 14px; }
  .rail-slide .fi-thumb { width: 68px; height: 68px; font-size: 1.6rem; }
  .rail-slide .fi-lines { gap: 9px; }
  .rail-slide .fi-lines span { height: 8px; }
  .rail-slide .fi-yes, .rail-slide .fi-no, .rail-slide .fi-send { width: 44px; height: 44px; font-size: 1.3rem; }
  .rail-slide .fi-btns { gap: 14px; }
  .rail-slide .fi-cal { gap: 8px; }
  .rail-js .rail-track { display: grid; grid-template-rows: repeat(3, 1fr); position: absolute; top: 0; left: 0; right: 0; height: calc(var(--rail-step) * 3); pointer-events: none; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .rail-slide, .rail-item, .rail-n, .rail-pips b { transition: none !important; }
  .rail-slide { transform: none !important; }
}

.home .steps-more { margin-top: clamp(24px, 3.5vw, 44px); border-radius: 18px; background: var(--paper); }

/* ------------------------------------------------------------ owners: marquee + bento */
.mq { position: relative; overflow: hidden; margin: 0 0 clamp(18px, 2.5vw, 28px); }
.mq-track { display: flex; width: max-content; }
.mq-set { display: flex; flex: none; gap: 10px; margin: 0; padding: 0 10px 0 0; list-style: none; }
.mq-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: .875rem; font-weight: 650;
}
.mq-chip svg { flex: none; color: var(--ink); }
.mq-chip.is-soon { border-style: dashed; background: transparent; box-shadow: none; color: var(--text); }
.mq-chip.is-soon svg { color: var(--muted); }
.mq-soon { font-style: normal; padding: 1px 7px; border-radius: 999px; background: var(--bg-sunk); color: var(--muted); font-size: .6875rem; font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .mq { -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
  .mq-track { animation: sx-marquee 55s linear infinite; will-change: transform; }
  .mq:hover .mq-track, .mq:focus-within .mq-track { animation-play-state: paused; }
  @keyframes sx-marquee { to { transform: translateX(-50%); } }
}
@media (prefers-reduced-motion: reduce) {
  .mq-track { width: auto; flex-wrap: wrap; justify-content: center; }
  .mq-set { flex-wrap: wrap; justify-content: center; padding-right: 0; }
  .mq-set[aria-hidden="true"] { display: none; }
}

.home .schedule { border-radius: 18px; background: var(--paper); }

/* ------------------------------------------------------------ examples: pill tabs + framed window */
.home #examples .ex-head { gap: 14px; }
.home #examples .seg {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; border: 0; background: none; overflow: visible; max-width: 100%;
}
.home #examples .seg [role="tab"] {
  position: relative; min-height: max(44px, var(--tap-min)); padding: 0 22px; border: 1px solid transparent; border-radius: 999px;
  background: var(--sx-tint); color: var(--muted); font-size: .9375rem; font-weight: 600; box-shadow: none;
  transition: background-color .2s var(--sx-ease), color .2s var(--sx-ease), border-color .2s var(--sx-ease), box-shadow .2s var(--sx-ease);
}
.home #examples .seg [role="tab"]:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.home #examples .seg [role="tab"][aria-selected="true"] {
  background: var(--paper); color: var(--ink); border-color: var(--line); box-shadow: inset 0 1px 0 var(--hi), var(--shadow);
}
.home #examples .seg [role="tab"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.home #examples .seg [role="tab"]::after {
  content: ""; position: absolute; left: 20px; right: 20px; bottom: 6px; height: 2px; border-radius: 2px;
  background: var(--blue); transform: scaleX(0); transform-origin: left center;
}
.home #examples .seg [role="tab"][aria-selected="true"]::after { transform: scaleX(1); }
@media (prefers-reduced-motion: no-preference) {
  .home #examples .seg.is-timed:not(.is-stopped) [role="tab"][aria-selected="true"]::after { animation: sx-progress var(--ex-dur, 6s) linear both; }
  .home #examples .seg.is-timed.is-paused [role="tab"][aria-selected="true"]::after { animation-play-state: paused; }
  @keyframes sx-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

.ex-frame {
  max-width: 66rem; margin-inline: auto; min-width: 0; border: 1px solid var(--line); border-radius: 24px; overflow: hidden;
  background: var(--paper); box-shadow: inset 0 1px 0 var(--hi), var(--lift);
}
.ex-frame-body { padding: clamp(14px, 2.4vw, 28px); background: var(--bg-warm); min-width: 0; }
.home .ex-frame .ex-site { max-width: none; margin: 0 0 10px; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.home .ex-frame .landing-ex-cap { margin: 0 0 16px; }
.home .ex-frame .post { border-radius: 18px; box-shadow: inset 0 1px 0 var(--hi); transition: transform .2s var(--sx-ease), box-shadow .2s var(--sx-ease); }
@media (hover: hover) { .home .ex-frame .post:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 var(--hi), var(--lift); } }
.home .ex-frame .post-body summary { min-height: max(36px, var(--tap-min)); }
@media (max-width: 40rem) {
  .home .ex-frame .ex-try { width: 100%; }
  .home .ex-frame .ex-site { padding-bottom: 12px; }
}

