/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Copyright (C) 2026 the tapey-1 contributors */

/* The welcome: a card made of the unit's own body, in the skin it wears, with the
   screen's black glass for the lines to copy. welcome.js builds it. */

.wl {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(12, 13, 15, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms, visibility 0s linear 160ms;
}
.wl.open { opacity: 1; visibility: visible; transition: opacity 160ms; }

.wl-card {
  position: relative;
  width: min(760px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 26px 30px 22px;
  border-radius: 18px;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--body-shine), rgba(255, 255, 255, 0) 5%),
    linear-gradient(180deg, var(--body-top), var(--body-bottom));
  box-shadow: var(--body-edge), 0 2px 3px rgba(0, 0, 0, 0.35), 0 30px 70px rgba(0, 0, 0, 0.5);
  -webkit-user-select: text;
  user-select: text;
  transform: translateY(8px) scale(0.985);
  transition: transform 200ms ease-out;
}
.wl.open .wl-card { transform: none; }

.wl-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.wl-close:hover { background: var(--tile-lo); color: var(--ink); }
.wl-close:focus-visible { outline: 2px solid var(--knob-blue); }
.wl-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* The name, as the edge of the unit prints it, and the four knob colours. */
.wl-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.wl-dots { display: flex; gap: 6px; padding-bottom: 7px; }
.wl-dots i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.25);
}
.wl-dots i:nth-child(1) { background: var(--knob-blue); }
.wl-dots i:nth-child(2) { background: var(--knob-green); }
.wl-dots i:nth-child(3) { background: var(--knob-white); }
.wl-dots i:nth-child(4) { background: var(--knob-orange); }
.wl-name {
  margin: 0;
  font-size: 40px;
  line-height: 0.95;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.wl-tag { margin: 6px 0 0; font-size: 15px; color: var(--ink-soft); }

.wl-label {
  margin: 0 0 8px;
  font: 500 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* How to play: three tiles, as the panel's own cells. */
.wl-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.wl-way {
  padding: 12px 13px 13px;
  border-radius: 10px;
  background: linear-gradient(165deg, var(--tile-hi), var(--tile-lo));
  box-shadow: var(--tile-edge), 0 0 0 1px var(--seam-color);
}
.wl-way h3 { margin: 0 0 6px; font-size: 14px; font-weight: 650; color: var(--ink); }
.wl-way p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.wl-caps { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 8px; }
.wl-cap {
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  font: 500 11px var(--mono);
  color: var(--ink);
  background: var(--cap-face);
  box-shadow: var(--cap-lift);
}
.wl-cap.wide { padding: 0 9px; }

/* Playing with an agent: folded away, for whoever wants it. */
.wl-extra { margin-top: 16px; }
.wl-extra > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 4px 0;
}
.wl-extra > summary:hover { color: var(--ink); }
.wl-extra[open] > summary { margin-bottom: 10px; }
.wl-alpha { margin: 14px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }

/* Plug in your agent: the screen's black glass. */
.wl-agent {
  padding: 16px 16px 14px;
  border-radius: 12px;
  background: #0c0d0f;
  color: #e7e9ec;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--seam-color), 0 1px 0 var(--body-shine);
}
.wl-agent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wl-agent h3 { margin: 0; font-size: 15px; font-weight: 650; color: #f2f3f5; }
.wl-status { display: inline-flex; align-items: center; gap: 7px; font: 500 11.5px var(--mono); color: #9aa0a8; white-space: nowrap; }
.wl-status i { width: 8px; height: 8px; border-radius: 50%; background: #4a4f57; }
.wl-status.on { color: var(--knob-green); }
.wl-status.on i { background: var(--knob-green); box-shadow: 0 0 8px var(--knob-green); }
.wl-status.bad { color: #ff7a66; }
.wl-status.bad i { background: #ff7a66; }
.wl-agent p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: #a7adb5; }
.wl-agent p:last-child { margin-bottom: 0; }
.wl-agent a { color: var(--knob-blue); }
.wl-agent code { font: 12px var(--mono); color: #e7e9ec; }

.wl-copy {
  display: flex;
  align-items: stretch;
  margin-bottom: 8px;
  border: 1px solid #2c3036;
  border-radius: 8px;
  background: #141518;
  overflow: hidden;
}
.wl-copy pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 9px 12px;
  overflow-x: auto;
  font: 12px/1.5 var(--mono);
  color: #e7e9ec;
  white-space: pre;
}
.wl-copy pre .pr { color: var(--knob-orange); -webkit-user-select: none; user-select: none; }
.wl-copy button {
  flex: none;
  min-width: 66px;
  border: 0;
  border-left: 1px solid #2c3036;
  background: #1d1f23;
  color: #cfd3d8;
  font: 500 12px var(--sans);
  cursor: pointer;
}
.wl-copy button:hover { background: #26292e; color: #fff; }
.wl-copy button:focus-visible { outline: 2px solid var(--knob-blue); outline-offset: -2px; }
.wl-copy button.done { color: var(--knob-green); }
.wl-more { margin: 2px 0 8px; font-size: 12px; color: #9aa0a8; }
.wl-more summary { cursor: pointer; }
.wl-more summary:focus-visible { outline: 2px solid var(--knob-blue); }
.wl-more[open] summary { margin-bottom: 8px; }

.wl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.wl-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.wl-check input { accent-color: var(--knob-orange); }
.wl-go {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: var(--knob-orange);
  color: #1b0d05;
  font: 600 14px var(--sans);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.wl-go:hover { background: #ff7838; }
.wl-go:focus-visible { outline: 2px solid var(--knob-blue); outline-offset: 2px; }

/* In the settings: the agent server and the way back to the welcome. */
.wl-set .row { align-items: center; }
.wl-port {
  width: 86px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #3b3f46;
  border-radius: 6px;
  background: #1a1c1f;
  color: var(--text);
  font: 13px var(--mono);
}
.wl-port:focus-visible { outline: 2px solid var(--knob-blue); outline-offset: 1px; }
.wl-port:disabled { opacity: 0.55; }
.wl-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--knob-blue);
  font: 500 13px var(--sans);
  cursor: pointer;
}
.wl-link:hover { text-decoration: underline; }
.wl-link:focus-visible { outline: 2px solid var(--knob-blue); outline-offset: 2px; }

@media (max-width: 640px) {
  .wl-card { padding: 22px 18px 18px; }
  .wl-ways { grid-template-columns: 1fr; }
  .wl-name { font-size: 32px; }
  .wl-foot { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .wl, .wl-card { transition: none; }
}
