/* Appily Ninetyseven — Windsock Bay (track-support)
   Runway windsocks · tower lookup · clearance banner
   Not telemetry console / vertical signal rail / horizontal stepper /
   ticket sidebar / Abacus Trace / Tide Clock / Pegboard Dispatch */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.a97-wind {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--wd-ink);
  background:
    radial-gradient(ellipse 90% 60% at 10% -10%, rgba(0, 180, 216, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 5%, rgba(255, 90, 31, 0.16), transparent 50%),
    linear-gradient(180deg, var(--wd-sky) 0%, var(--wd-foam) 42%, #EAF6FF 100%);
  -webkit-font-smoothing: antialiased;
}

.wd-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--wd-ink);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.wd-skip:focus { left: 8px; top: 8px; }

/* —— Hop nav —— */
.wd-hop {
  position: relative;
  top: 0;
  z-index: 40;
  background: var(--wd-ink);
  color: #fff;
  border-bottom: 3px solid var(--wd-blaze);
}
.wd-hop-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px var(--space-page);
}
.wd-hop-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  line-height: 1;
  flex-shrink: 0;
}
.wd-hop-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--wd-blaze);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.35);
}
.wd-hop-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-left: auto;
}
.wd-hop-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}
.wd-hop-links a:hover,
.wd-hop-links a[aria-current="page"] {
  color: var(--wd-lemon);
  border-bottom-color: var(--wd-aqua);
}
.wd-hop-toggle {
  display: none;
  margin-left: auto;
  min-height: 42px;
  min-width: 5.5rem;
  background: var(--wd-aqua-deep);
  color: #fff;
  border: 3px solid var(--wd-ink);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.wd-hop-toggle:hover,
.wd-hop-toggle:focus-visible {
  background: var(--wd-aqua);
  color: var(--wd-ink);
  outline: 3px solid var(--wd-lemon);
  outline-offset: 2px;
}
.wd-hop-sheet a:focus-visible {
  outline: 3px solid var(--wd-lemon);
  outline-offset: 2px;
}
.wd-hop-sheet {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px var(--space-page) 16px;
  background: var(--wd-ink-soft);
}
.wd-hop-sheet a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.wd-hop-sheet a[aria-current="page"],
.wd-hop-sheet a:hover {
  background: rgba(0, 180, 216, 0.25);
  color: var(--wd-lemon);
}
.wd-hop.is-open .wd-hop-sheet { display: flex; }

@media (max-width: 760px) {
  .wd-hop-links { display: none; }
  .wd-hop-toggle { display: inline-flex; }
}

/* —— Mast —— */
.wd-mast {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) var(--space-page) 8px;
}
.wd-mast-kicker {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wd-aqua-deep);
}
.wd-mast h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--wd-ink);
}
.wd-mast p {
  margin: 10px 0 0;
  max-width: 38rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--wd-mute);
}

/* —— Runway stage —— */
.wd-stage {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px var(--space-page) 48px;
  display: grid;
  gap: 28px;
}

/* Tower lookup */
.wd-tower {
  position: relative;
  background: var(--wd-plate);
  border: 3px solid var(--wd-ink);
  border-radius: var(--radius) var(--radius) 6px 6px;
  box-shadow: var(--shadow-tower);
  padding: 22px 22px 20px;
  max-width: 520px;
}
.wd-tower::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: -14px;
  height: 14px;
  background: var(--wd-ink);
  clip-path: polygon(8% 100%, 0 0, 100% 0, 92% 100%);
}
.wd-tower-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.wd-tower-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
}
.wd-tower-head p {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--wd-mute);
  line-height: 1.4;
}

/* Anemometer cue */
.wd-anemo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--wd-ink);
  background: var(--wd-sky);
  position: relative;
  display: grid;
  place-items: center;
}
.wd-anemo-needle {
  width: 3px;
  height: 18px;
  background: var(--wd-blaze);
  border-radius: 2px;
  transform-origin: 50% 90%;
  transform: rotate(-28deg);
  transition: transform var(--motion-needle);
  box-shadow: 0 0 0 1px rgba(255, 90, 31, 0.2);
}
.wd-tower.is-focused .wd-anemo-needle {
  transform: rotate(42deg);
}
.wd-tower.is-focused .wd-anemo {
  border-color: var(--wd-aqua);
  box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.25);
}

.wd-form {
  display: grid;
  gap: 14px;
}
.wd-field {
  display: grid;
  gap: 6px;
}
.wd-field span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wd-mute);
}
.wd-field input {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 3px solid var(--wd-line);
  background: transparent;
  padding: 10px 2px 8px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--wd-ink);
  outline: none;
  transition: border-color 200ms ease;
  background-image: linear-gradient(var(--wd-aqua), var(--wd-aqua));
  background-size: 0% 3px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 280ms var(--ease-out), border-color 200ms ease;
}
.wd-field input:focus {
  border-bottom-color: transparent;
  background-size: 100% 3px;
}
.wd-field input::placeholder { color: #556274; }

.wd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.wd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: 8.5rem;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 3px solid var(--wd-ink);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.wd-btn:focus-visible {
  outline: 3px solid var(--wd-aqua);
  outline-offset: 3px;
}

.wd-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--wd-ink);
}

.wd-btn--blaze {
  background: var(--wd-blaze-deep);
  color: #fff;
  box-shadow: 4px 4px 0 var(--wd-ink);
}

.wd-btn--blaze:hover,
.wd-btn--blaze:focus-visible {
  background: var(--wd-blaze);
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--wd-ink);
}

.wd-btn--aqua {
  background: var(--wd-aqua-deep);
  color: #fff;
  box-shadow: 4px 4px 0 var(--wd-ink);
}

.wd-btn--aqua:hover,
.wd-btn--aqua:focus-visible {
  background: var(--wd-aqua);
  color: var(--wd-ink);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--wd-ink);
}

.wd-btn--ghost {
  background: transparent;
  color: var(--wd-ink);
}

.wd-btn--ghost:hover,
.wd-btn--ghost:focus-visible {
  background: var(--wd-sky);
  color: var(--wd-ink);
}

@media (max-width: 560px) {
  .wd-actions {
    flex-direction: column;
  }
  .wd-actions .wd-btn {
    width: 100%;
  }
}

/* —— Runway + windsocks —— */
.wd-runway {
  position: relative;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 28px,
      rgba(20, 32, 51, 0.08) 28px 32px
    ),
    linear-gradient(180deg, #B8D9EE 0%, #9EC8E0 100%);
  border: 3px solid var(--wd-ink);
  border-radius: var(--radius);
  padding: 28px 18px 36px;
  overflow: hidden;
  min-height: 280px;
}
.wd-runway::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    #fff 0 18px,
    transparent 18px 32px
  );
  opacity: 0.85;
  transform: translateY(-50%);
  pointer-events: none;
}
.wd-runway-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.wd-runway-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--wd-ink);
}
.wd-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--wd-ink);
  background: var(--wd-plate);
  color: var(--wd-mute);
}
.wd-chip--live {
  background: var(--wd-live);
  color: #fff;
  border-color: var(--wd-ink);
}
.wd-chip--progress {
  background: var(--wd-blaze);
  color: #fff;
}
.wd-chip--pending {
  background: var(--wd-lemon);
  color: var(--wd-ink);
}
.wd-chip--miss {
  background: var(--wd-miss);
  color: #fff;
}
.wd-chip--idle {
  background: rgba(255, 255, 255, 0.7);
}

.wd-socks {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: end;
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 180px;
}

.wd-sock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.wd-sock-pole {
  width: 6px;
  height: 72px;
  background: var(--wd-ink);
  border-radius: 3px;
  position: relative;
}
.wd-sock-pole::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 22px;
  height: 6px;
  background: var(--wd-ink);
  border-radius: 3px;
  transform: translateX(-50%);
}
.wd-sock-cloth {
  width: 54px;
  height: 78px;
  margin-bottom: -4px;
  clip-path: polygon(0 8%, 100% 0, 88% 100%, 12% 92%);
  border: 2px solid var(--wd-ink);
  transform-origin: 20% 12%;
  transform: scaleY(0.28) rotate(-8deg);
  opacity: 0.45;
  transition:
    transform var(--motion-inflate),
    opacity 320ms ease,
    filter 320ms ease;
  filter: saturate(0.55);
}
.wd-sock:nth-child(1) .wd-sock-cloth { background: var(--wd-lemon); }
.wd-sock:nth-child(2) .wd-sock-cloth { background: var(--wd-aqua); }
.wd-sock:nth-child(3) .wd-sock-cloth { background: var(--wd-blaze); }
.wd-sock:nth-child(4) .wd-sock-cloth { background: var(--wd-live); }

.wd-sock.is-done .wd-sock-cloth,
.wd-sock.is-current .wd-sock-cloth {
  transform: scaleY(1) rotate(0deg);
  opacity: 1;
  filter: saturate(1.05);
}
.wd-sock.is-current .wd-sock-cloth {
  animation: wd-billow 1.1s var(--ease-billow) infinite alternate;
}
.wd-sock.is-done .wd-sock-cloth {
  animation: wd-billow-soft 2.4s ease-in-out infinite alternate;
}

/* Stagger inflate when found */
body.is-found .wd-sock.is-done .wd-sock-cloth,
body.is-found .wd-sock.is-current .wd-sock-cloth {
  transition-delay: calc(var(--wd-i, 0) * 90ms);
}

@keyframes wd-billow {
  from { transform: scaleY(1) rotate(-4deg) skewX(-2deg); }
  to { transform: scaleY(1.04) rotate(6deg) skewX(3deg); }
}
@keyframes wd-billow-soft {
  from { transform: scaleY(1) rotate(-2deg); }
  to { transform: scaleY(1.02) rotate(3deg); }
}

.wd-sock strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--wd-ink);
}
.wd-sock small {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--wd-mute);
  line-height: 1.25;
  max-width: 7.5rem;
}
.wd-sock.is-current strong { color: var(--wd-blaze-deep); }
.wd-sock.is-done strong { color: var(--wd-live-deep); }

@media (max-width: 640px) {
  .wd-socks {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 12px;
    min-height: 0;
  }
  .wd-runway { min-height: 0; padding-bottom: 24px; }
  .wd-runway::before { display: none; }
}

/* —— Clearance banner (results) —— */
.wd-clearance {
  position: relative;
  border: 3px solid var(--wd-ink);
  border-radius: var(--radius);
  background: var(--wd-plate);
  padding: 22px 22px 20px;
  opacity: 0;
  transform: translateY(18px);
  animation: wd-banner-in var(--motion-banner) forwards;
}
body.is-found .wd-clearance {
  background: linear-gradient(135deg, #E8FFF6 0%, var(--wd-plate) 48%, #EAF9FF 100%);
  box-shadow: 0 0 0 4px rgba(18, 184, 134, 0.28);
}
body.is-miss .wd-clearance {
  background: linear-gradient(135deg, #FFE8E6 0%, var(--wd-plate) 55%);
  box-shadow: 0 0 0 4px rgba(224, 49, 49, 0.22);
  animation: wd-banner-in var(--motion-banner) forwards, wd-shake 420ms 380ms ease;
}
body.is-idle .wd-clearance {
  background: linear-gradient(135deg, var(--wd-foam), var(--wd-plate));
}

@keyframes wd-banner-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes wd-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.wd-clearance-tag {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wd-aqua-deep);
}
body.is-found .wd-clearance-tag { color: var(--wd-live-deep); }
body.is-miss .wd-clearance-tag { color: var(--wd-miss); }

.wd-clearance h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}
.wd-clearance > p {
  margin: 8px 0 0;
  color: var(--wd-mute);
  line-height: 1.45;
  max-width: 36rem;
}

.wd-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.wd-facts li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--wd-ink);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.wd-fact-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wd-mute);
}
.wd-fact-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--wd-ink);
}
.wd-order-id {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--wd-blaze-deep);
  word-break: break-all;
}

.wd-clearance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 560px) {
  .wd-facts { grid-template-columns: 1fr; }
  .wd-tower-head { flex-direction: column; }
}

/* Quick links */
.wd-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-page) 20px;
}
.wd-links a {
  color: var(--wd-ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--wd-aqua);
  padding-bottom: 2px;
  transition: color 160ms ease, border-color 160ms ease;
}
.wd-links a:hover {
  color: var(--wd-blaze-deep);
  border-bottom-color: var(--wd-blaze);
}

.wd-foot-mini {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px var(--space-page) 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 0.85rem;
  color: var(--wd-mute);
}
.wd-foot-mini a {
  color: var(--wd-mute);
  text-decoration: none;
  font-weight: 600;
}
.wd-foot-mini a:hover { color: var(--wd-blaze); }

@media (prefers-reduced-motion: reduce) {
  .wd-sock-cloth,
  .wd-anemo-needle,
  .wd-field input,
  .wd-clearance {
    transition: none !important;
    animation: none !important;
  }
  body.is-found .wd-sock.is-done .wd-sock-cloth,
  body.is-found .wd-sock.is-current .wd-sock-cloth {
    transition-delay: 0ms !important;
  }
  .wd-clearance { opacity: 1; transform: none; }
}
