/* ============================================================
   UPSIDE — THE FOUR PATHWAY CARDS, SLIM (home page)
   ============================================================
   Buy · Sell · Rent · Manage as one row of short charcoal cards
   with a red border. Signed in, they sit on the bottom edge of the
   search photo; signed out, they sit in the dark band under the
   header (which needs the dark behind its white logo).

   Motion: the cards rise in one after another when the page opens.
   On hover or keyboard focus a card lifts on a small spring, red
   fills it from the icon outward, the icon turns white with a tilt
   and the arrow pops out. Only transform, opacity and colour move;
   with reduced motion the cards simply appear and change colour.
   ============================================================ */
.gateway {
  --pw-card: #232326;
  --pw-card-hover: #2d2d31;
  padding: clamp(36px, 5vw, 56px) 0 clamp(28px, 3.4vw, 40px);
}
/* home page, signed out: the band is the first thing under the header */
body[data-page="home"]:not(.has-hs) .gateway { padding-top: clamp(104px, 12vw, 118px); }
.gateway .gateway__head { margin-bottom: 18px; }
.gateway .gateway__title { font-size: clamp(1.15rem, 1.7vw, 1.45rem); }
.gateway .gateway__note { display: none; }

/* one card: icon, name, a two-to-four word line, arrow */
.gateway .path {
  display: grid;
  grid-template-columns: 38px 1fr;
  column-gap: 14px; row-gap: 4px;
  align-items: center;
  min-height: 0;
  padding: 16px 40px 16px 16px;
  border: 1px solid var(--accent);
  background: var(--pw-card);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  transform: none;
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.3s ease, background 0.3s ease;
  animation: pw-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.gateway .path:nth-child(2) { animation-delay: 0.07s; }
.gateway .path:nth-child(3) { animation-delay: 0.14s; }
.gateway .path:nth-child(4) { animation-delay: 0.21s; }
.gateway .path[data-reveal] { opacity: 1; }
@keyframes pw-rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

.gateway .path__top { display: contents; }
.gateway .path__num, .gateway .path__cta, .gateway .path__desc { display: none; }
.gateway .path__ico { grid-row: 1 / 3; width: 38px; height: 38px; transition: background 0.3s ease, color 0.3s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.gateway .path__ico svg { width: 17px; height: 17px; }
.gateway .path__label { margin-top: 0; font-size: 1.02rem; color: #fff; }
.gateway .path__short { display: block; font-size: 0.8rem; line-height: 1.35; color: rgba(255, 255, 255, 0.66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s ease; }

/* the arrow, top right */
.gateway .path::before {
  content: ""; position: absolute; right: 16px; top: 16px; width: 14px; height: 14px;
  background: currentColor; opacity: 0.45;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}
/* the red that fills the card, grown from behind the icon */
.gateway .path::after {
  content: ""; position: absolute; z-index: -1; inset: auto; left: 34px; top: 50%;
  width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: radial-gradient(circle, #c4121a, #8f0c12);
  opacity: 1; transform: scale(0);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.gateway .path:hover,
.gateway .path:focus-visible {
  transform: translateY(-6px);
  background: var(--pw-card-hover);
  border-color: var(--accent);
  box-shadow: 0 22px 44px rgba(237, 28, 36, 0.28);
}
.gateway .path:hover::after, .gateway .path:focus-visible::after { transform: scale(16); }
.gateway .path:hover .path__ico, .gateway .path:focus-visible .path__ico { background: #fff; color: var(--accent); transform: rotate(-8deg) scale(1.06); }
.gateway .path:hover .path__short, .gateway .path:focus-visible .path__short { color: rgba(255, 255, 255, 0.9); }
.gateway .path:hover::before, .gateway .path:focus-visible::before { transform: translate(4px, -4px) scale(1.15); opacity: 1; }
.gateway .path:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.gateway .path:active { transform: translateY(-2px) scale(0.985); }

/* ---------- signed in: on the bottom edge of the search photo ---------- */
body.has-hs[data-page="home"] .gateway {
  position: relative; z-index: 3;
  margin-top: -46px; padding: 0 0 10px;
  background: transparent; color: var(--ink);
}
body.has-hs[data-page="home"] .gateway .gateway__head { display: none; }
body.has-hs[data-page="home"] .gateway .path { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28); }
body.has-hs[data-page="home"] .gateway .path:hover { box-shadow: 0 22px 44px rgba(237, 28, 36, 0.3); }
body.has-hs .hs { padding-bottom: 96px; }

/* ---------- the trust line under the search ---------- */
.hs__trust { margin: 2px 0 0; font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 0, 0, 0.35); }
.hs__trust i { font-style: normal; }
.hs__trust .s { display: none; }
.hs__trust > span + span::before { content: "·"; margin: 0 10px; opacity: 0.6; }

/* ---------- tablets and phones: two by two ---------- */
@media (max-width: 1120px) {
  .gateway .gateway__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .gateway .path { grid-template-columns: 32px 1fr; min-height: 60px; padding: 12px 30px 12px 12px; column-gap: 10px; }
  .gateway .path::before { right: 10px; top: 12px; width: 12px; height: 12px; }
  .gateway .path::after { left: 28px; }
  .gateway .path__ico { grid-row: auto; width: 32px; height: 32px; }
  .gateway .path__label { font-size: 0.9rem; }
  /* two across is too narrow for the short line: icon and name only */
  .gateway .path__short { display: none; }
  body.has-hs[data-page="home"] .gateway { margin-top: -34px; }
  body.has-hs .hs { padding-bottom: 72px; }
  .hs__trust { font-size: 0.76rem; }
  .hs__trust .l { display: none; }
  .hs__trust .s { display: inline; }
}

/* touch: no hover, so a press gives the feedback */
@media (hover: none) {
  .gateway .path:hover { transform: none; box-shadow: none; background: var(--pw-card); }
  .gateway .path:hover::after { transform: scale(0); }
  .gateway .path:hover .path__ico { background: var(--accent); color: var(--ink); transform: none; }
  .gateway .path:active { transform: scale(0.97); background: var(--pw-card-hover); }
}

@media (prefers-reduced-motion: reduce) {
  .gateway .path { animation: none; transition: background 0.2s ease, box-shadow 0.2s ease; }
  .gateway .path:hover, .gateway .path:focus-visible, .gateway .path:active { transform: none; }
  .gateway .path::after { transition: none; }
  .gateway .path__ico { transition: background 0.2s ease, color 0.2s ease; }
  .gateway .path:hover .path__ico, .gateway .path:focus-visible .path__ico { transform: none; }
}

/* the search photo sits under the header: keep "Sign in" readable on it */
body.has-hs .hdr-signin { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
body.has-hs .hdr-signin:hover { color: var(--ink); text-shadow: none; }
