/* The install hand-off (install.html) and the 404 page. Builds on styles.css. */

/* The launcher's accent button (ModalAccentBrush, pressed: #4fbcf5): flat, dark label */
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
}
.btn-primary:hover { background: #7dd3ff; }
.btn-primary:active { background: #4fbcf5; }

/* `hidden` must win over the buttons' own display */
.handoff [hidden] { display: none !important; }

/* ---------- Stage ---------- */
.handoff {
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 128px 24px 96px;
}
.handoff-inner { width: 100%; max-width: 560px; text-align: center; }
.handoff-inner:has(.ho-project.is-new:not([hidden])) { max-width: 1040px; } /* room for the pitch */
.handoff:has(.ho-project.is-new:not([hidden])) { place-items: start center; } /* a long page: from the top */
.handoff + .footer { margin-top: 0; }

/* Each state comes in a line at a time when it appears */
.ho-state > * { animation: enter 500ms var(--ease-out) backwards; }
.ho-state > :nth-child(2) { animation-delay: 50ms; }
.ho-state > :nth-child(3) { animation-delay: 100ms; }
.ho-state > :nth-child(4) { animation-delay: 150ms; }
.ho-state > :nth-child(5) { animation-delay: 200ms; }
.ho-state > :nth-child(n + 6) { animation-delay: 250ms; }

.ho-state h1 {
  font-size: clamp(30px, 4.4vw, 42px);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 700;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

/* ---------- Countdown ring ---------- */
.ring {
  position: relative;
  width: 136px; height: 136px;
  margin: 0 auto 36px;
  display: grid; place-items: center;
}
.ring-svg { position: absolute; inset: 0; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 3; }
.ring-bar {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 339.292; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 200ms ease, opacity 200ms ease;
}
.ring-n {
  font-size: 58px; font-weight: 700; line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.ring-check {
  display: none;
  width: 44px; height: 44px; color: var(--accent); stroke-width: 2.4;
}

/* Stopped: the ring dims and holds */
.ring.is-stopped .ring-bar { stroke: var(--faint); opacity: .6; transition: stroke 200ms ease, opacity 200ms ease; }
.ring-n { transition: color 200ms ease; }
.ring.is-stopped .ring-n { color: var(--muted); }

/* Sent: full ring, check mark */
.ring.is-done .ring-bar { stroke-dashoffset: 0 !important; transition: stroke-dashoffset 400ms var(--ease-out); }
.ring.is-done .ring-n { display: none; }
/* The tick draws itself from its short stroke to its long one (a dash the length of the path, sliding into place) */
.ring.is-done .ring-check { display: block; stroke-dasharray: 24; animation: ring-check 400ms var(--ease-out) 100ms backwards; }
@keyframes ring-check { from { stroke-dashoffset: -24; } }

/* ---------- Project line ---------- */
.ho-meta { margin-top: 14px; font-size: 15px; color: var(--muted); }

.ho-status {
  margin: 22px auto 0; max-width: 42ch;
  min-height: 3.2em; /* room for two lines, so the buttons never jump */
  font-size: 16px; line-height: 1.6; color: var(--doc-text, #c4ced8);
  text-wrap: pretty;
}

/* ---------- Actions ---------- */
.ho-actions { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ho-actions .btn { padding: 13px 22px; font-size: 15px; }

.ho-download {
  margin-top: 26px;
  font-size: 14px; color: var(--faint);
}
.ho-download a,
.ho-lead a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .3);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease, color 150ms ease;
}
.ho-download a:hover, .ho-lead a:hover { color: var(--accent-2); text-decoration-color: currentColor; }

.ho-uri { margin-top: 44px; }
.ho-uri code, .ho-tip code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  overflow-wrap: anywhere;
}

/* ---------- Forms (CurseForge ID, paste a link) ---------- */
.ho-lead {
  margin: 16px auto 0; max-width: 46ch;
  font-size: 17px; line-height: 1.65; color: var(--muted);
  text-wrap: pretty;
}
.ho-lead b { color: var(--text); font-weight: 600; }

.ho-form { margin-top: 32px; text-align: left; }
.ho-form label {
  display: block; margin: 0 0 8px 2px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.field { display: flex; gap: 8px; }
.field input {
  flex: 1; min-width: 0;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font: inherit; font-size: 15px;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.field input::placeholder { color: var(--faint); opacity: 1; }
.field input:hover { border-color: rgba(255, 255, 255, .2); }
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }
.field input[aria-invalid="true"] { border-color: #ef6f7b; }
.field .btn { padding: 13px 20px; font-size: 15px; flex: none; }
.field-error { min-height: 1.5em; margin: 8px 0 0 2px; font-size: 14px; color: #f4a0a8; }
.field-error:empty { min-height: 0; margin: 0; }

.ho-tip { margin-top: 18px; font-size: 14px; color: var(--faint); line-height: 1.7; }
.ho-tip code { color: var(--muted); }

/* ---------- A project: new here, or back again ---------- */
/* Back again: the countdown. New here (.is-new): what Modal is, its download, and the pitch below. */
.ho-project:not(.is-new) :is(.ho-new, .ho-pitch, .ho-for-new) { display: none; }
.ho-project.is-new .ho-back { display: none; }
.ho-project.is-new .ho-uri { display: none; }

.ho-top { max-width: 620px; margin-inline: auto; }
.ho-kicker {
  display: inline-block; margin-bottom: 16px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--accent-2);
  background: var(--accent-soft); border: 1px solid rgba(92, 200, 255, .22);
}
.ho-back { margin-top: 36px; }
.ho-back .ring { margin-bottom: 8px; }
.ho-project .ho-lead { max-width: 52ch; }
.ho-lead .js-name { color: var(--text); }

.ho-new { margin-top: 30px; }
.ho-dl { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ho-dl .btn { padding: 15px 26px; }
/* Only this system's download; on other systems (macOS, phones) both, the second one quieter */
html.os-windows .ho-dl [data-os="linux"], html.os-linux .ho-dl [data-os="windows"] { display: none; }
html:not(.os-windows):not(.os-linux) .ho-dl [data-os="linux"] {
  background: rgba(255, 255, 255, .03); border-color: var(--border-strong); color: var(--text);
}
.ho-dl-meta { margin-top: 14px; font-size: 14px; color: var(--faint); }
.ho-dl-meta [data-os] { display: none; }
html.os-windows .ho-dl-meta [data-os="windows"],
html.os-linux .ho-dl-meta [data-os="linux"],
html:not(.os-windows):not(.os-linux) .ho-dl-meta [data-os="other"] { display: inline; }
.ho-dl-meta a, .ho-more a {
  color: var(--muted);
  text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: 3px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
.ho-dl-meta a:hover, .ho-more a:hover { color: var(--text); text-decoration-color: currentColor; }

.ho-new-status { max-width: 46ch; margin: 18px auto 0; font-size: 15.5px; line-height: 1.6; color: var(--doc-text, #c4ced8); text-wrap: pretty; }
.ho-new-status:empty { display: none; }

.ho-have {
  margin-top: 26px; padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px;
  font-size: 15px; color: var(--muted);
}
.ho-have .btn { padding: 11px 18px; font-size: 15px; }

/* ---------- Why Modal ---------- */
.ho-pitch { margin-top: 72px; text-align: left; }

.ho-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  counter-reset: step;
}
.ho-steps li {
  position: relative;
  padding: 20px 20px 20px 64px;
  border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  counter-increment: step;
}
.ho-steps li::before {
  content: counter(step);
  position: absolute; left: 20px; top: 19px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(92, 200, 255, .25);
}
.ho-steps b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ho-steps li > span { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }

.ho-shot {
  margin-top: 40px;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .4);
  background: var(--surface);
}
.ho-shot img { display: block; width: 100%; height: auto; }

.ho-features {
  margin-top: 40px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px;
}
.ho-features b { display: block; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.ho-features p { margin-top: 6px; font-size: 15px; line-height: 1.6; color: var(--muted); }

.ho-more { margin-top: 40px; text-align: center; font-size: 15px; color: var(--faint); }

@media (max-width: 860px) {
  .ho-steps { grid-template-columns: 1fr; }
  .ho-features { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------- 404 ---------- */
.nf-actions { margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.nf-actions .btn { padding: 13px 22px; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .ring-bar { transition: none; }
  .ring.is-done .ring-check { animation: fade 200ms ease; }
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  .handoff { padding: 108px 16px 72px; }
  .ring { width: 116px; height: 116px; margin-bottom: 30px; }
  .ring-n { font-size: 50px; }
  .ho-actions .btn, .nf-actions .btn, .ho-dl .btn, .ho-have .btn { flex: 1 1 100%; }
  .ho-pitch { margin-top: 56px; }
  .field { flex-direction: column; }
}
