/* KD Vendingmachine (komadev.dk/vendingmachine/). Uses the tokens from assets/css/app.css. */

.vm-page {
  padding-bottom: 2rem;
}

.vm-ic {
  width: 1.35rem;
  height: 1.35rem;
}

.vm-grad {
  background: linear-gradient(110deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vm-page code {
  font-family: var(--mono);
  font-size: 0.86em;
}

/* ---------- Hero ---------- */

.vm-hero {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
  margin-top: 2.5rem;
}

.vm-hero__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.vm-hero__title {
  margin-top: 1.3rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.5vw, 3.3rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  overflow-wrap: break-word;
}

.vm-hero__kd {
  color: var(--ink);
}

.vm-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.vm-hero__note {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--faint);
}

.vm-hero__chips {
  margin-top: 1.6rem;
}

.vm-hero__visual {
  margin: 0;
  min-width: 0;
}

.vm-frame {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(169, 155, 255, 0.06), 0 0 80px -20px rgba(255, 59, 71, 0.25);
}

.vm-frame__bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.vm-frame__dots {
  display: inline-flex;
  gap: 0.35rem;
}

.vm-frame__dots i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--line-2);
}

.vm-frame__title {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vm-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.vm-hero__caption {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--faint);
  text-align: center;
}

.vm-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.vm-facts li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.2rem 1.4rem;
  border-color: var(--line);
  border-style: solid;
  border-width: 0 0 1px 0;
}

.vm-facts li:nth-child(odd) {
  border-right-width: 1px;
}

.vm-facts li:nth-last-child(-n + 2) {
  border-bottom-width: 0;
}

.vm-facts strong {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.03em;
}

.vm-facts span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Machines ---------- */

.vm-machines {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vm-machine {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(1.3rem, 3vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  overflow: hidden;
  transition: border-color 0.4s var(--ease), translate 0.6s var(--ease);
}

.vm-machine:hover {
  border-color: var(--line-2);
  translate: 0 -4px;
}

.vm-machine__glow {
  position: absolute;
  inset: -50% -30% auto auto;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tone) 22%, transparent), transparent 65%);
  pointer-events: none;
  z-index: -1;
}

.vm-machine__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vm-machine__swatch {
  flex: none;
  width: 0.9rem;
  height: 2rem;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--tone), color-mix(in srgb, var(--tone) 45%, #000));
  box-shadow: 0 0 18px -2px var(--tone);
}

.vm-machine__name {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vm-machine__text {
  color: var(--muted);
  line-height: 1.6;
}

.vm-machine__props {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.vm-machine__props code {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.76rem;
  color: color-mix(in srgb, var(--tone) 70%, var(--ink));
}

/* ---------- Features ---------- */

.vm-features {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vm-feature {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: clamp(1.2rem, 3vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.vm-feature__icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(169, 155, 255, 0.08);
  color: var(--accent);
}

.vm-feature:nth-child(2n) .vm-feature__icon {
  background: rgba(111, 227, 255, 0.07);
  color: var(--accent-2);
}

.vm-feature__title {
  font-weight: 500;
  font-size: 1.08rem;
}

.vm-feature__text {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- Requirements ---------- */

.vm-req {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.vm-req > div {
  display: grid;
  gap: 0.35rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--line);
}

.vm-req > div:last-child {
  border-bottom: 0;
}

.vm-req dt {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.vm-req dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.vm-req a,
.vm-table a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(169, 155, 255, 0.5);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.vm-req a:hover,
.vm-table a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ---------- Installation ---------- */

.vm-steps {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.vm-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.vm-step__num {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(169, 155, 255, 0.45);
  border-radius: 50%;
  background: rgba(169, 155, 255, 0.1);
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--accent);
}

.vm-step__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding-top: 0.35rem;
}

.vm-step__title {
  font-weight: 500;
  font-size: 1.08rem;
}

.vm-step__text {
  color: var(--muted);
  line-height: 1.6;
}

.vm-step__btn {
  align-self: flex-start;
  margin-top: 0.3rem;
}

.vm-step .vm-code {
  margin-top: 0.3rem;
}

/* ---------- Blocks, tables and code ---------- */

.vm-block {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
  padding: clamp(1.2rem, 3vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

#varer {
  margin-top: 1.6rem;
}

.vm-block__title {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vm-block__text {
  color: var(--muted);
  line-height: 1.6;
}

.vm-cfg {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.vm-api {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.vm-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.vm-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.vm-table th,
.vm-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.vm-table thead th {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.025);
}

.vm-table tbody th {
  font-weight: 500;
  white-space: nowrap;
}

.vm-table tbody th small {
  display: block;
  font-weight: 400;
  color: var(--faint);
}

.vm-table td {
  color: var(--muted);
}

.vm-table tbody tr:last-child th,
.vm-table tbody tr:last-child td {
  border-bottom: 0;
}

.vm-code {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #08080b;
  overflow: hidden;
}

.vm-code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.vm-code__lang {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.vm-code__copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.vm-code__copy svg {
  width: 0.95rem;
  height: 0.95rem;
}

.vm-code__copy:hover,
.vm-code__copy:focus-visible {
  border-color: var(--line-2);
  color: var(--ink);
}

.vm-code__copy.is-done {
  border-color: rgba(61, 220, 120, 0.4);
  background: rgba(61, 220, 120, 0.08);
  color: var(--done);
}

.vm-code pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: #e6e6f0;
  tab-size: 4;
}

.vm-code pre code {
  font-size: inherit;
}

.vm-c {
  color: #7d7d8c;
  font-style: italic;
}

.vm-tip {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 210, 63, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(255, 210, 63, 0.06);
  color: var(--muted);
  line-height: 1.55;
}

.vm-tip svg {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.1rem;
  color: var(--wip);
}

/* Collapsible config blocks. */
.vm-more {
  gap: 0;
}

.vm-more summary,
.vm-qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.vm-more summary::-webkit-details-marker,
.vm-qa summary::-webkit-details-marker {
  display: none;
}

.vm-more[open] summary {
  margin-bottom: 0.9rem;
}

.vm-more > :not(summary) + :not(summary) {
  margin-top: 0.9rem;
}

.vm-more summary i,
.vm-qa summary i {
  position: relative;
  flex: none;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.vm-more summary i::before,
.vm-more summary i::after,
.vm-qa summary i::before,
.vm-qa summary i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.7rem;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.vm-more summary i::after,
.vm-qa summary i::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: transform 0.4s var(--ease);
}

.vm-more[open] summary i,
.vm-qa[open] summary i {
  border-color: rgba(169, 155, 255, 0.6);
  background: rgba(169, 155, 255, 0.12);
  color: var(--accent);
}

.vm-more[open] summary i::after,
.vm-qa[open] summary i::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* ---------- Security ---------- */

.vm-sec {
  display: grid;
  gap: 1rem;
}

.vm-sec__list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vm-sec__list li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  line-height: 1.55;
}

.vm-sec__list svg {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
  color: var(--done);
}

/* ---------- FAQ ---------- */

.vm-faq {
  display: grid;
  gap: 1rem;
}

.vm-faq__list {
  display: grid;
  gap: 0.6rem;
}

.vm-qa {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.vm-qa[open] {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.04);
}

.vm-qa summary {
  padding: 1.1rem 1.25rem;
  font-weight: 500;
  font-size: 1.02rem;
}

.vm-qa__a {
  padding: 0 1.25rem 1.2rem;
  color: var(--muted);
  line-height: 1.65;
}

.vm-end__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Larger screens ---------- */

@media (min-width: 640px) {
  .vm-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .vm-facts li {
    border-width: 0 1px 0 0;
  }

  .vm-facts li:last-child {
    border-right-width: 0;
  }

  .vm-machines,
  .vm-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vm-req > div {
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: baseline;
  }
}

@media (min-width: 1000px) {
  .vm-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }

  .vm-machines,
  .vm-features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .vm-api {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vm-sec,
  .vm-faq {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 3rem;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vm-machine,
  .vm-machine:hover {
    transition: none;
    translate: none;
  }
}

/* ---------- GitHub star reminders ---------- */

.btn .vm-star,
.vm-starbox__icon svg {
  color: var(--wip);
}

.vm-hero__star {
  margin-top: 0.35rem;
  max-width: 34rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.vm-starbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.3rem;
  margin-top: 1rem;
  padding: clamp(1.2rem, 3vw, 1.6rem);
  border: 1px solid rgba(255, 210, 63, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(255, 210, 63, 0.08), rgba(169, 155, 255, 0.05));
}

.vm-starbox__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 210, 63, 0.4);
  border-radius: 50%;
  background: rgba(255, 210, 63, 0.1);
}

.vm-starbox__icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
}

.vm-starbox__copy {
  flex: 1 1 16rem;
  min-width: 0;
}

.vm-starbox__title {
  font-weight: 500;
  font-size: 1.08rem;
}

.vm-starbox__text {
  margin-top: 0.2rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- Machine screenshots ---------- */

.vm-machine {
  --pad: clamp(1.3rem, 3vw, 1.7rem);
  padding: var(--pad);
}

.vm-machine__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0.3rem;
  border-bottom: 1px solid var(--line);
  background: #07080b;
  overflow: hidden;
}

.vm-machine__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.vm-machine:hover .vm-machine__media img {
  transform: scale(1.04);
}

.vm-machine__zoom {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(6, 6, 8, 0.7);
  backdrop-filter: blur(6px);
  color: var(--ink);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}

.vm-machine__zoom svg {
  width: 1rem;
  height: 1rem;
}

.vm-machine__media:hover .vm-machine__zoom,
.vm-machine__media:focus-visible .vm-machine__zoom {
  opacity: 1;
  transform: none;
}

/* eCola is shown in the big preview at the top, so its card points there. */
.vm-machine__media--above {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tone) 28%, transparent), transparent 70%),
    #0b0709;
  color: var(--ink);
  font-size: 0.92rem;
  text-decoration: none;
}

.vm-machine__media--above svg {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--tone) 55%, transparent);
  border-radius: 50%;
  color: var(--tone);
  transition: transform 0.4s var(--ease);
}

.vm-machine__media--above:hover svg {
  transform: translateY(-4px);
}

@media (hover: none) {
  .vm-machine__zoom {
    opacity: 1;
    transform: none;
  }
}
