/* Yard Stake Rail — survey stakes + colored flags on chalk baseline
   Cautionfield Market / Ovasta Seeds (replaces Boom Tag Rail) */
.ys-rail {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--cf-asphalt);
  color: #F4F7F8;
  border-bottom: 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}
.ys-deck {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  width: min(100% - 24px, var(--cf-max));
  margin: 0 auto;
  min-height: 76px;
  padding: 12px 0 0;
}
.ys-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  padding-bottom: 14px;
  transition: transform 220ms ease;
}
.ys-brand:hover { transform: translateY(-2px); }
.ys-hardhat {
  width: 42px;
  height: 28px;
  background: var(--cf-cone);
  border: 2px solid var(--cf-signal);
  border-radius: 18px 18px 4px 4px;
  position: relative;
  box-shadow: 2px 2px 0 #000;
  flex: 0 0 auto;
}
.ys-hardhat-brim {
  position: absolute;
  left: -6px;
  right: -6px;
  bottom: -4px;
  height: 8px;
  background: var(--cf-cone-deep);
  border-radius: 2px;
}
.ys-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.ys-brand-copy small {
  font-family: var(--cf-font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cf-tape);
}
.ys-brand-copy strong {
  font-family: var(--cf-font-display);
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: var(--cf-signal);
}

.ys-field {
  position: relative;
  min-width: 0;
  padding: 0 4px 0;
}
.ys-chalk {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--cf-signal) 0 10px,
    transparent 10px 18px
  );
  opacity: 0.85;
  pointer-events: none;
}
.ys-stakes {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  min-height: 64px;
  padding: 0 2px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ys-stakes::-webkit-scrollbar { display: none; }

.ys-stake {
  --ys-pole-h: calc(18px + (var(--ys-h, 3) * 6px));
  position: relative;
  flex: 1 1 0;
  min-width: 68px;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--cf-ink);
  animation: ysPlant 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--ys-i, 0) * 50ms);
  transition: transform 220ms ease;
}
.ys-stake:hover,
.ys-stake:focus-visible {
  transform: translateY(-4px);
  outline: none;
  z-index: 2;
}
.ys-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  max-width: 100%;
  padding: 4px 8px 4px 10px;
  border: 2px solid #000;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  box-shadow: 2px 2px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: filter 200ms ease, transform 200ms ease;
}
.ys-stake:hover .ys-flag,
.ys-stake:focus-visible .ys-flag {
  filter: brightness(1.06);
  transform: rotate(-2deg);
}
.ys-stake--cone .ys-flag { background: var(--cf-cone); color: var(--cf-on-cone); }
.ys-stake--tape .ys-flag { background: var(--cf-tape); color: var(--cf-asphalt); }
.ys-stake--signal .ys-flag { background: var(--cf-signal); color: var(--cf-signal-ink); }
.ys-stake.is-active .ys-flag {
  outline: 3px solid #fff;
  outline-offset: 1px;
}
.ys-stake.is-active {
  transform: translateY(-2px);
}
.ys-stake.is-active .ys-pole {
  height: calc(var(--ys-pole-h) + 8px);
  background: var(--cf-signal);
}
.ys-flag-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.ys-flag-count {
  font-style: normal;
  background: var(--cf-asphalt);
  color: var(--cf-signal);
  border-radius: 999px;
  min-width: 1.35em;
  padding: 0 5px;
  font-size: 0.68rem;
  text-align: center;
  animation: ysCountPop 360ms ease;
}
.ys-pole {
  width: 5px;
  height: var(--ys-pole-h);
  margin-top: -2px;
  background: linear-gradient(180deg, #c8d0d6 0%, #8a949c 100%);
  border: 1px solid #000;
  border-radius: 1px;
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.15);
  transition: height 220ms ease, background 220ms ease;
}
.ys-peg {
  width: 14px;
  height: 8px;
  margin-top: -2px;
  background: var(--cf-cone-deep);
  border: 1px solid #000;
  clip-path: polygon(15% 0, 85% 0, 100% 100%, 0 100%);
  z-index: 1;
}

.ys-tools {
  display: flex;
  gap: 6px;
  padding-bottom: 12px;
}
.ys-tool {
  border: 2px solid var(--cf-signal);
  background: transparent;
  color: var(--cf-signal);
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.ys-tool:hover,
.ys-tool[aria-expanded="true"] {
  background: var(--cf-signal);
  color: var(--cf-asphalt);
}
.ys-tool--pull { display: none; }

.ys-search,
.ys-more {
  width: min(100% - 24px, var(--cf-max));
  margin: 0 auto;
  padding: 12px 0 14px;
  border-top: 1px dashed rgba(255, 230, 0, 0.28);
}
.ys-search {
  display: flex;
  gap: 8px;
}
.ys-search[hidden],
.ys-more[hidden],
.ys-scrim[hidden] {
  display: none !important;
}
.ys-search input {
  flex: 1;
  min-height: 44px;
  border: 2px solid var(--cf-signal);
  background: #1C2228;
  color: #fff;
  padding: 0 12px;
}
.ys-search button {
  border: 2px solid #000;
  background: var(--cf-tape);
  color: var(--cf-asphalt);
  font-weight: 800;
  padding: 0 16px;
  cursor: pointer;
}
.ys-more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ys-more a {
  text-decoration: none;
  color: var(--cf-asphalt);
  background: var(--cf-field);
  border: 2px solid #000;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 2px 2px 0 var(--cf-cone);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
}
/* Beat body.cf-store a { color: inherit } so Site tabs stay dark on light fills */
body.cf-store .ys-more a {
  color: var(--cf-asphalt);
}
.ys-more a:hover { background: var(--cf-signal); color: var(--cf-asphalt); }
body.cf-store .ys-more a:hover { color: var(--cf-asphalt); }
.ys-more a[aria-current="page"] {
  background: var(--cf-cone);
  color: var(--cf-on-cone);
}
body.cf-store .ys-more a[aria-current="page"] {
  color: var(--cf-on-cone);
}
.ys-scrim {
  position: fixed;
  inset: 0;
  background: rgba(18, 21, 26, 0.55);
  z-index: -1;
}

/* Caution stripe sill under the rail */
.ys-rail::after {
  content: "";
  display: block;
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--cf-signal) 0 8px,
    var(--cf-asphalt) 8px 16px
  );
}

@keyframes ysPlant {
  from {
    opacity: 0;
    transform: translateY(-22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes ysCountPop {
  0% { transform: scale(0.4); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@media (max-width: 900px) {
  .ys-deck {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 10px 0;
    min-height: 64px;
  }
  .ys-brand { padding-bottom: 0; }
  .ys-tools { padding-bottom: 0; }
  .ys-field {
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--cf-asphalt);
    border-bottom: 4px solid var(--cf-cone);
    padding: 18px 12px 22px;
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: transform 320ms ease, opacity 320ms ease;
    z-index: 90;
  }
  .ys-rail.is-pulled .ys-field {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .ys-stakes {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 10px;
    min-height: 0;
    padding-bottom: 0;
  }
  .ys-stake {
    flex: 0 0 auto;
    min-width: 88px;
    max-width: none;
  }
  .ys-tool--pull { display: inline-flex; }
  .ys-tool--more { display: none; }
  .ys-search,
  .ys-more {
    padding-inline: 12px;
  }
  .ys-rail.is-pulled .ys-more {
    display: flex;
    position: relative;
    z-index: 91;
    background: var(--cf-asphalt);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ys-stake,
  .ys-flag,
  .ys-brand {
    animation: none !important;
    transition: none !important;
  }
}
