/* Appily Fiftythree — Route Beacon track & support */

.af-track {
  --aft-ink: var(--ts-ink, #15202B);
  --aft-paper: #fff;
  --aft-mist: var(--ts-paper, #F3F5F8);
  --aft-copper: var(--ts-wine, #B85C38);
  --aft-teal: var(--ts-grove, #2A6F7A);
  --aft-line: var(--ts-line, #CDD4DE);
  --aft-muted: var(--ts-muted, #5E6B7A);
  --aft-ease: var(--ease-out, cubic-bezier(.22, 1, .36, 1));
}

@keyframes aft-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: .4; }
}
@keyframes aft-ring {
  0% { transform: translate(-50%, -50%) scale(.55); opacity: .7; }
  100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
}
@keyframes aft-beam {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes aft-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes aft-bars {
  0%, 100% { transform: scaleY(.45); }
  50% { transform: scaleY(1); }
}
@keyframes aft-gauge {
  from { stroke-dashoffset: 251; }
}

/* ── Hero + radar ── */
.aft-hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 72px;
  color: #F4F7FA;
  background:
    radial-gradient(ellipse 55% 80% at 85% 30%, rgba(184, 92, 56, .22), transparent 55%),
    linear-gradient(145deg, #15202B 0%, #1B2430 50%, #1A4A52 100%);
}
.aft-hero-radar {
  position: absolute;
  right: max(4%, calc((100% - var(--container)) / 2 - 20px));
  top: 50%;
  width: min(340px, 42vw);
  height: min(340px, 42vw);
  transform: translateY(-50%);
  pointer-events: none;
  opacity: .9;
}
.aft-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(232, 196, 180, .35);
  border-radius: 50%;
  animation: aft-ring 4.5s ease-out infinite;
}
.aft-ring-a { width: 42%; height: 42%; animation-delay: 0s; }
.aft-ring-b { width: 68%; height: 68%; animation-delay: 1.2s; }
.aft-ring-c { width: 96%; height: 96%; animation-delay: 2.4s; }
.aft-beam {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48%;
  height: 48%;
  background: conic-gradient(from 0deg, transparent 0 72%, rgba(184, 92, 56, .35) 78%, transparent 86%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: aft-beam 8s linear infinite;
  mask: radial-gradient(circle, transparent 28%, #000 30%);
}
.aft-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: var(--aft-copper);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
}
.aft-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px;
  align-items: end;
  animation: aft-rise .7s var(--aft-ease) both;
}
.aft-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #E8C4B4;
}
.aft-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7DCFB6;
  animation: aft-pulse 1.8s ease-out infinite;
}
.aft-hero-copy h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
  max-width: 10ch;
}
.aft-hero-copy h1 em {
  font-style: italic;
  font-weight: 500;
  color: #F0D2C4;
}
.aft-lede {
  margin: 0;
  max-width: 40ch;
  color: rgba(244, 247, 250, .72);
  font-size: 15px;
  line-height: 1.65;
}
.aft-hero-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 280px;
  justify-self: end;
}
.aft-hero-chips li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
}
.aft-hero-chips strong {
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #E8C4B4;
}
.aft-hero-chips span {
  color: rgba(244, 247, 250, .65);
  text-align: right;
}

/* ── Console split ── */
.aft-console {
  padding: 0 0 72px;
  margin-top: -36px;
  position: relative;
  z-index: 2;
}
.aft-console-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: stretch;
}
.aft-panel {
  background: var(--aft-paper);
  border: 1px solid var(--aft-line);
  box-shadow: var(--shadow);
  animation: aft-rise .55s var(--aft-ease) both;
}
.aft-panel-form { padding: 32px 30px 28px; }
.aft-panel-result {
  min-height: 520px;
  background:
    linear-gradient(165deg, rgba(42, 111, 122, .06), transparent 40%),
    var(--aft-mist);
  padding: 28px;
}
.aft-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.aft-panel-tag {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--aft-copper);
}
.aft-panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}
.aft-panel-badge {
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  background: var(--aft-ink);
  color: #fff;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}
.aft-panel-note {
  margin: 0 0 22px;
  color: var(--aft-muted);
  font-size: 14px;
  line-height: 1.55;
}
.aft-form { display: grid; gap: 16px; }
.aft-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--aft-ink);
}
.aft-field input {
  width: 100%;
  border: 1px solid var(--aft-line);
  background: var(--aft-mist);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--aft-ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.aft-field input:focus {
  border-color: var(--aft-copper);
  box-shadow: 0 0 0 4px rgba(184, 92, 56, .14);
  background: #fff;
}
.aft-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 16px 18px;
  border: 0;
  background: var(--aft-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, transform .25s;
}
.aft-submit:hover {
  background: var(--aft-copper);
  transform: translateY(-2px);
}
.aft-form-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--aft-line);
}
.aft-form-links a {
  font-size: 12px;
  font-weight: 600;
  color: var(--aft-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.aft-form-links a:hover { color: var(--aft-copper); }

/* Result states */
.aft-result {
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: aft-rise .5s var(--aft-ease) both;
}
.aft-result-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 26px;
}
.aft-result-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--aft-copper);
}
.aft-result-hit h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 600;
  word-break: break-word;
}
.aft-result-status {
  margin: 0;
  display: inline-flex;
  padding: 5px 10px;
  background: rgba(42, 111, 122, .12);
  color: var(--aft-teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.aft-gauge {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  --aft-progress: 0;
}
.aft-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.aft-gauge-track {
  fill: none;
  stroke: var(--aft-line);
  stroke-width: 8;
}
.aft-gauge-value {
  fill: none;
  stroke: var(--aft-copper);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251;
  stroke-dashoffset: calc(251 - (251 * var(--aft-progress) / 100));
  animation: aft-gauge 1s var(--aft-ease) both;
}
.aft-gauge-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0;
}
.aft-gauge-label strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1;
}
.aft-gauge-label span {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--aft-muted);
}

/* Vertical route timeline */
.aft-route {
  list-style: none;
  margin: 0 0 24px;
  padding: 0 0 0 8px;
  position: relative;
  display: grid;
  gap: 0;
  flex: 1;
}
.aft-route::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--aft-line);
}
.aft-route::after {
  content: '';
  position: absolute;
  left: 23px;
  top: 12px;
  width: 2px;
  height: calc((var(--aft-step, 0) - 0.5) / 4 * 100%);
  max-height: calc(100% - 24px);
  background: linear-gradient(180deg, var(--aft-copper), var(--aft-teal));
  transition: height .6s var(--aft-ease);
}
.aft-route-stop {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
}
.aft-route-node {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid var(--aft-line);
  background: #fff;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  color: var(--aft-muted);
  z-index: 1;
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
  transition: background .25s, border-color .25s, color .25s;
}
.aft-route-stop.is-done .aft-route-node,
.aft-route-stop.is-live .aft-route-node {
  background: var(--aft-ink);
  border-color: var(--aft-ink);
  color: #fff;
}
.aft-route-stop.is-live .aft-route-node {
  background: var(--aft-copper);
  border-color: var(--aft-copper);
  box-shadow: 0 0 0 6px rgba(184, 92, 56, .16);
}
.aft-route-copy strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}
.aft-route-copy span {
  font-size: 12px;
  color: var(--aft-muted);
}
.aft-route-stop.is-todo .aft-route-copy { opacity: .55; }

.aft-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.aft-meta div {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--aft-line);
  display: grid;
  gap: 4px;
}
.aft-meta em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--aft-muted);
}
.aft-meta b {
  font-size: 14px;
  font-weight: 700;
}

.aft-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  background: var(--aft-copper);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: background .2s, transform .25s;
}
.aft-cta:hover {
  background: var(--aft-ink);
  transform: translateY(-2px);
}
.aft-cta-soft {
  background: transparent;
  color: var(--aft-ink);
  border: 1px solid var(--aft-ink);
}
.aft-cta-soft:hover {
  background: var(--aft-ink);
  color: #fff;
}

/* Miss / idle */
.aft-result-miss,
.aft-result-idle {
  justify-content: center;
  align-items: flex-start;
  padding: 20px 8px;
}
.aft-miss-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: rgba(184, 92, 56, .12);
  color: var(--aft-copper);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
}
.aft-result-miss h2,
.aft-result-idle h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}
.aft-result-miss p,
.aft-result-idle p {
  margin: 0 0 22px;
  color: var(--aft-muted);
  max-width: 40ch;
  line-height: 1.6;
}
.aft-idle-viz {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 36px;
  margin-bottom: 18px;
}
.aft-idle-viz span {
  width: 8px;
  height: 100%;
  background: var(--aft-copper);
  transform-origin: bottom;
  animation: aft-bars 1.2s ease-in-out infinite;
}
.aft-idle-viz span:nth-child(2) {
  background: var(--aft-teal);
  animation-delay: .15s;
}
.aft-idle-viz span:nth-child(3) {
  animation-delay: .3s;
}
.aft-idle-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.aft-idle-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--aft-line);
  font-size: 13px;
  font-weight: 600;
}
.aft-idle-steps span {
  font-family: var(--font-display);
  color: var(--aft-copper);
  font-weight: 700;
}

/* Bottom strip */
.aft-strip {
  border-top: 1px solid var(--aft-line);
  background: var(--aft-ink);
  color: #F4F7FA;
  padding: 22px 0;
}
.aft-strip-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.aft-strip-inner p {
  margin: 0;
  font-size: 14px;
  color: rgba(244, 247, 250, .75);
  max-width: 46ch;
}
.aft-strip-inner strong { color: #fff; }
.aft-strip-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.aft-strip-nav a {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: background .2s, border-color .2s;
}
.aft-strip-nav a:hover {
  background: var(--aft-copper);
  border-color: var(--aft-copper);
}

@media (max-width: 980px) {
  .aft-hero-grid,
  .aft-console-grid { grid-template-columns: 1fr; }
  .aft-hero-chips { justify-self: start; max-width: none; grid-template-columns: repeat(3, 1fr); }
  .aft-hero-radar {
    opacity: .35;
    right: -40px;
    width: 260px;
    height: 260px;
  }
  .aft-panel-result { min-height: 0; }
}

@media (max-width: 640px) {
  .aft-hero { padding: 40px 0 56px; }
  .aft-hero-chips { grid-template-columns: 1fr; }
  .aft-panel-form,
  .aft-panel-result { padding: 22px 18px; }
  .aft-result-top { flex-direction: column; }
  .aft-meta { grid-template-columns: 1fr; }
  .aft-idle-steps { grid-template-columns: 1fr; }
  .aft-strip-inner { align-items: flex-start; }
}
