/* Getting an app live, drawn as the same line as the Academy: the site's three
   status words are its stops and it ends at "in the air". Picking a tool makes the
   route the reader's own, in that tool's color, and each tool's own page
   (/deploy/<tool>) is that route with the tool already picked. The color and the steps are CSS,
   so they work with no script and every press counts, even mid-change. */
@import url('/static/academy-guide.css');

.ga.dp {
  --ga-ring-top: 0px;
  --dp-on: var(--color-ink); /* the number on a filled ring */
  --dp-wash: 24%;            /* how strongly the steps panel takes the tool's color */
}
.dp .ga-open { padding-block-start: 16px; }
.dp-note { margin: 18px 0 0; color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

/* ---- The reader's tool colors the whole route ---- */
.dp:has(input[value='base44']:checked) { --brand-star: var(--tool-base44); }
.dp:has(input[value='lovable']:checked) { --brand-star: var(--tool-lovable); }
.dp:has(input[value='chatgpt']:checked) { --brand-star: var(--tool-chatgpt); }
.dp:has(input[value='claude']:checked) { --brand-star: var(--tool-claude); }
.dp:has(input[value='v0']:checked) { --brand-star: var(--text-default); --dp-on: var(--surface-page); --dp-wash: 8%; }
/* A tool's own page (/deploy/<tool>) is the same route with the tool already picked. */
.dp[data-tool='base44'] { --brand-star: var(--tool-base44); }
.dp[data-tool='lovable'] { --brand-star: var(--tool-lovable); }
.dp[data-tool='chatgpt'] { --brand-star: var(--tool-chatgpt); }
.dp[data-tool='claude'] { --brand-star: var(--tool-claude); }
.dp[data-tool='v0'] { --brand-star: var(--text-default); --dp-on: var(--surface-page); --dp-wash: 8%; }
/* The WordPress page (/wordpress) is the same route in WordPress blue. */
.dp[data-tool='wordpress'] { --brand-star: var(--tool-wordpress); --dp-on: var(--color-white); }

/* The whole line turns, and a pulse of the new color runs on down it to the end. */
.dp .ga-rail::before { transition: background-color 0.45s ease-out; }
.dp .ga-star::before { transition: background-color 0.3s ease-out; }
.dp-run {
  position: absolute;
  top: 0;
  inset-inline-start: calc(50% - 1.5px);
  width: 3px;
  height: 96px;
  border-radius: 2px;
  background: linear-gradient(to bottom, transparent, var(--brand-star));
  filter: drop-shadow(0 0 6px var(--brand-star));
  animation: dp-run 0.75s cubic-bezier(0.45, 0, 0.7, 1) forwards;
}
@keyframes dp-run {
  from { transform: translateY(var(--dp-from, 0px)); }
  to { transform: translateY(var(--dp-to, 0px)); }
}

/* ---- The stops ---- */
.dp .ga-name { z-index: 4; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.15; } /* a stop stays readable when the lit line runs through it */
.dp .ga-name::before { content: none; }
.dp-ring {
  position: absolute;
  inset-inline-start: calc(-1 * var(--ga-rail));
  top: 4px;
  z-index: 2;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-default);
  background: var(--surface-page);
  border: 2px solid var(--brand-star);
  transition: background-color 0.3s ease-out, border-color 0.3s ease-out, color 0.3s ease-out;
}
.dp .ga-name.is-reached .dp-ring { background: var(--brand-star); color: var(--dp-on); }
/* Each stop down the line takes the new color a little after the one above it. */
.dp .ga-part + .ga-part .dp-ring { transition-delay: 0.2s; }
.dp-arrive .dp-ring { transition-delay: 0.5s; }

/* What rides the line: the star until a tool is picked, then that tool's mark. */
.dp .ga-rail { width: 64px; inset-inline-start: calc(var(--ga-line-at) + 1px - 32px); }
.ga-star.has-tool > svg { visibility: hidden; }
.dp-rider { display: none; }
.has-tool > .dp-rider {
  display: grid;
  place-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  color: var(--text-default);
  background: var(--surface-raised);
  border: 2px solid var(--brand-star);
  box-shadow: 0 0 14px color-mix(in srgb, var(--brand-star) 60%, transparent);
  transition: border-color 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.3s ease-out;
}
.dp-rider .dp-mark { animation: dp-board 0.46s cubic-bezier(0.3, 1.7, 0.5, 1); }
@keyframes dp-board { from { transform: scale(0.2) rotate(-35deg); opacity: 0; } }

/* ---- Picking the tool ---- */
.dp-title { margin: 24px 0 12px; font-family: var(--font-body); font-size: 1.0625rem; font-weight: 700; }
.dp-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dp-tool {
  --dp-c: var(--control);
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.dp-tool[data-tool='base44'] { --dp-c: var(--tool-base44); }
.dp-tool[data-tool='lovable'] { --dp-c: var(--tool-lovable); }
.dp-tool[data-tool='chatgpt'] { --dp-c: var(--tool-chatgpt); }
.dp-tool[data-tool='claude'] { --dp-c: var(--tool-claude); }
.dp-tool[data-tool='v0'] { --dp-c: var(--text-default); }
.dp-tool input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.dp-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; }
.dp-mark > * { display: block; width: 22px; height: 22px; object-fit: contain; }
@media (hover: hover) {
  .dp-tool:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--dp-c) 55%, transparent);
    box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--dp-c) 60%, transparent);
  }
}
.dp-tool:has(input:focus-visible) { outline: 3px solid var(--control); outline-offset: 3px; }
@supports not selector(:has(*)) {
  .dp-tool input:focus-visible + .dp-mark { outline: 3px solid var(--control); outline-offset: 3px; }
}
.dp-tool:has(input:checked) {
  border-color: var(--dp-c);
  box-shadow: inset 0 0 0 1px var(--dp-c), 0 10px 24px -12px color-mix(in srgb, var(--dp-c) 70%, transparent);
  animation: dp-lit 0.8s ease-out;
}
/* It arrives with its full glow, which then settles. */
@keyframes dp-lit {
  from { box-shadow: inset 0 0 0 1px var(--dp-c), 0 0 30px 3px color-mix(in srgb, var(--dp-c) 75%, transparent); }
}

/* The one filled panel on the page: the part where the reader does something. */
.dp-panel {
  margin-block-start: 18px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 170% at 100% 0%, color-mix(in srgb, var(--brand-star) var(--dp-wash), transparent), transparent 62%),
    var(--surface-raised);
  border: 1px solid color-mix(in srgb, var(--brand-star) 40%, transparent);
}
.dp-panel-name { margin: 0 0 10px !important; font-family: var(--font-display); font-size: 1.3rem !important; line-height: 1.3 !important; }
.dp-panel .answer-steps { margin-block-end: 0; }
.dp-panel-more { margin: 14px 0 0 !important; font-size: 1rem !important; }
/* With no :has() every tool's steps simply stay open. */
@supports selector(:has(*)) {
  .dp-panel, .dp-panel-name { display: none; }
  .dp:has(input[value='base44']:checked) .dp-panel[data-tool='base44'],
  .dp:has(input[value='lovable']:checked) .dp-panel[data-tool='lovable'],
  .dp:has(input[value='v0']:checked) .dp-panel[data-tool='v0'],
  .dp:has(input[value='chatgpt']:checked) .dp-panel[data-tool='chatgpt'],
  .dp:has(input[value='claude']:checked) .dp-panel[data-tool='claude'],
  .dp:has(input[value='other']:checked) .dp-panel[data-tool='other'] {
    display: block;
    animation: ga-open 0.28s ease-out;
  }
  .dp[data-tool] .dp-panel { display: block; }
}

/* ---- Where the line arrives ---- */
.dp-arrive { position: relative; padding-inline-start: var(--ga-rail); }
.dp-arrive .ga-part { padding-block-end: 0; }
.dp-arrive .ga-name { position: relative; top: auto; } /* the line ends here, so its last stop stays put */
.dp-arrive .ga-name.is-reached .dp-ring {
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand-star) 22%, transparent), 0 0 30px color-mix(in srgb, var(--brand-star) 70%, transparent);
  animation: dp-land 0.9s ease-out;
}
@keyframes dp-land {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-star) 70%, transparent), 0 0 0 color-mix(in srgb, var(--brand-star) 70%, transparent); }
}
/* What rode the line lands in the last ring. */
.dp:has(.dp-arrive .ga-name.is-reached) .ga-star > svg,
.dp:has(.dp-arrive .ga-name.is-reached) .dp-rider { opacity: 0; }
.dp-included { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dp-included li { position: relative; padding-inline-start: 20px; max-width: none; }
.dp-included li::before {
  content: '';
  position: absolute;
  inset-inline-start: 2px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-star);
}

/* A route with a name of its own above it (/wordpress: how a move goes). */
.dp-route-name { margin: 0 0 28px; padding-inline-start: var(--ga-rail); font-family: var(--font-body); font-size: 1.0625rem; font-weight: 700; color: var(--text-muted); }

/* ---- Past the end of the line: quiet, for whoever still has a question ---- */
.dp-after { margin-block-start: 88px; padding-inline-start: var(--ga-rail); }
.dp-name { margin: 0; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.3; }

@media (max-width: 760px) {
  .dp-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dp-panel { padding: 16px 18px; }
  .dp-after { margin-block-start: 64px; padding-inline-start: 0; }
  .dp-after .ga-part { gap: 8px; }
  .dp-tool { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .dp .ga-rail::before, .dp .ga-star::before, .dp-ring, .has-tool > .dp-rider, .dp-tool { transition: none; }
  .dp .ga-part + .ga-part .dp-ring, .dp-arrive .dp-ring { transition-delay: 0s; }
  .dp-run { display: none; }
  .dp-rider .dp-mark, .dp-tool:has(input:checked), .dp-arrive .ga-name.is-reached .dp-ring, .dp-panel { animation: none !important; }
  .dp-tool:hover { transform: none; }
}
