/*
  Adam™ Programming Language

  Copyright © 2026-present tinyBigGAMES™ LLC
  All Rights Reserved.

  https://adamlang.org

  SPDX-License-Identifier: MPL-2.0

  This Source Code Form is subject to the terms of the
  Mozilla Public License, v. 2.0. If a copy of the MPL
  was not distributed with this file, You can obtain one
  at https://mozilla.org/MPL/2.0/.

  ---

  Design system: the landing page's building blocks: the circuit board surface, the hero, the
  sections and bands, and the media section (video / audio frames, the click zoom, the image
  lightbox, the mouse / touch hints; behaviour in ds.js). Values come from tokens.css only.
*/

/* ================================================================ the board */

/* A circuit board under the content: a fine trace grid, a cyan glow from the top left and a gold
   one from the bottom right (the logo's light) */
.ds-board {
  position: relative;
  isolation: isolate;
}

.ds-board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 70% at 12% 0%, var(--ds-cyan-soft), transparent 70%),
    radial-gradient(50% 60% at 95% 100%, var(--ds-gold-soft), transparent 70%),
    repeating-linear-gradient(0deg, var(--ds-line) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, var(--ds-line) 0 1px, transparent 1px 48px);
  -webkit-mask-image: radial-gradient(90% 90% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(90% 90% at 50% 40%, #000 30%, transparent 100%);
  pointer-events: none;
}

/* ================================================================ hero */

.ds-hero {
  padding: var(--ds-sp-8) 0 var(--ds-sp-7);
  text-align: center;
}

.ds-hero .ds-lead {
  margin-inline: auto;
}

.ds-hero .ds-row {
  justify-content: center;
  margin-top: var(--ds-sp-5);
}

.ds-hero-title {
  margin: 0 auto var(--ds-sp-5);
  font-size: var(--ds-fs-hero);
}

.ds-hero-ring {
  margin: 0 auto var(--ds-sp-5);
}

.ds-hero-mark {
  width: min(420px, 78vw);
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 0 40px var(--ds-cyan-glow));
}

/* ================================================================ sections */

.ds-section {
  padding: var(--ds-sp-8) 0;
}

.ds-section--tight {
  padding: var(--ds-sp-6) 0;
}

.ds-band {
  border-block: 1px solid var(--ds-line);
  background: var(--ds-bg-2);
}

.ds-section-head {
  max-width: 52rem;
  margin-bottom: var(--ds-sp-6);
}

.ds-section-head--center {
  margin-inline: auto;
  text-align: center;
}

.ds-section-head--center .ds-lead {
  margin-inline: auto;
}

/* ================================================================ media frames */

.ds-media-frame {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--ds-cyan-glow);
  border-radius: var(--ds-radius-lg);
  background: #000;
  box-shadow: var(--ds-glow), var(--ds-shadow);
}

.ds-media-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.ds-media-frame--video {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.ds-media-frame--portrait {
  width: min(100%, 340px);
  aspect-ratio: 9 / 16;
}

.ds-media-frame--image {
  width: 100%;
  border-color: var(--ds-gold-glow);
  box-shadow: var(--ds-glow-gold), var(--ds-shadow);
}

.ds-media-frame--image .ds-zoom {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ds-media-frame--audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ds-sp-4);
  width: 100%;
  max-width: 640px;
  padding: var(--ds-sp-6) var(--ds-sp-5);
  background: radial-gradient(80% 120% at 50% 0%, var(--ds-cyan-soft), transparent 70%), var(--ds-surface);
}

.ds-media-frame--audio audio {
  width: 100%;
}

/* The click zoom (ds.js): the frame flies to a fixed, fitted box above a backdrop; the place it
   left keeps its size (.ds-media-hold), so the page never moves */
.ds-media-frame.is-zoomed {
  position: fixed;
  z-index: var(--ds-z-zoomed);
  max-width: none;
  margin: 0;
  transform-origin: 0 0;
}

.ds-media-hold {
  margin: 0 auto;
}

/* Fine pointer: the picture says it zooms */
@media (hover: hover) and (pointer: fine) {
  .ds-media-frame--video:not(.is-zoomed),
  .ds-media-frame--portrait:not(.is-zoomed),
  .ds-zoom {
    cursor: zoom-in;
  }

  .ds-media-frame.is-zoomed {
    cursor: zoom-out;
  }
}

.ds-zoom-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--ds-z-backdrop);
  /* A deep scrim, never a backdrop-filter: a blur over a playing video is redone every frame
     (software compositing starved the page: zoom_check, D3) */
  background: var(--ds-scrim-deep);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ds-slow) var(--ds-ease);
}

.ds-zoom-backdrop.is-in {
  opacity: 1;
  pointer-events: auto;
}

.ds-zoom-close {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: var(--ds-z-close);
  display: none;
}

.ds-zoom-close.is-in {
  display: inline-grid;
}

/* ================================================================ image zoom and lightbox */

.ds-zoom {
  display: block;
  overflow: hidden;
  border: 1px solid var(--ds-gold-glow);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-glow-gold);
}

.ds-zoom img {
  width: 100%;
}

.ds-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 0;
  background: transparent;
}

.ds-lightbox::backdrop {
  background: var(--ds-scrim);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.ds-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.ds-lightbox img {
  width: auto;
  max-width: calc(100vw - 64px);
  max-height: calc(100vh - 64px);
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow);
  transform-origin: 0 0;
}

/* Narrow: the image at its real size, panned by scrolling */
@media (max-width: 760px) {
  .ds-lightbox[open] {
    display: block;
  }

  .ds-lightbox img {
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
}

/* ================================================================ hints */

.ds-media-hint {
  margin-top: var(--ds-sp-3);
  color: var(--ds-muted);
  font-size: var(--ds-fs-sm);
  text-align: center;
}

.ds-hint-touch {
  display: none;
}

@media not all and (hover: hover) and (pointer: fine) {
  .ds-hint-mouse {
    display: none;
  }

  .ds-hint-touch {
    display: inline;
  }
}

/* ================================================================ landing blocks */

/* The hero's one-line promise under the logo */
.ds-hero-promise {
  margin: 0 auto var(--ds-sp-4);
  font-family: var(--ds-display);
  font-size: var(--ds-fs-2xl);
  line-height: var(--ds-lh-tight);
}

/* The at-a-glance strip (gen_site's glance marker): counts read from the compiler's tables */
.ds-glance {
  border-block: 1px solid var(--ds-line);
  background: var(--ds-surface);
}

.ds-glance-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--ds-sp-4);
  margin-block: 0;
  padding-block: var(--ds-sp-5);
  list-style: none;
}

.ds-glance-list a {
  display: flex;
  flex-direction: column;
  gap: var(--ds-sp-1);
  color: var(--ds-muted);
  text-decoration: none;
}

.ds-glance-list b {
  font-family: var(--ds-display);
  font-size: var(--ds-fs-3xl);
  line-height: var(--ds-lh-tight);
  color: var(--ds-gold);
}

.ds-glance-list a:hover b,
.ds-glance-list a:focus-visible b {
  color: var(--ds-cyan);
}

/* A code sample beside its notes (the Code tabs, Get started) */
.ds-split {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--ds-sp-6);
  align-items: start;
}

.ds-split-code {
  display: flex;
  flex-direction: column;
  gap: var(--ds-sp-3);
  min-width: 0;
}

.ds-split-notes h3 {
  margin-top: 0;
}

/* A list of what a sample shows, each item behind a cyan tick */
.ds-checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-checks li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: var(--ds-sp-2);
}

.ds-checks li::before {
  content: "";
  position: absolute;
  left: 0.2em;
  top: 0.45em;
  width: 0.7em;
  height: 0.35em;
  border-left: 2px solid var(--ds-cyan);
  border-bottom: 2px solid var(--ds-cyan);
  transform: rotate(-45deg);
}

/* The live infographic (gen_site's claims marker): one card per group of claims.md, each claim a
   link to the docs page that shows it */
.ds-claims {
  align-items: stretch;
}

.ds-claim-card h3 {
  margin-top: 0;
  color: var(--ds-text-strong);
}

.ds-claim-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-claim-list li + li {
  margin-top: var(--ds-sp-3);
}

.ds-claim-list a {
  display: block;
  color: var(--ds-text);
  text-decoration: none;
  font-size: var(--ds-fs-sm);
  line-height: var(--ds-lh);
}

.ds-claim-list b {
  color: var(--ds-cyan);
}

.ds-claim-list a:hover b,
.ds-claim-list a:focus-visible b {
  color: var(--ds-gold);
  text-decoration: underline;
}

/* The closing band: the ouroboros, the promise, the way in */
.ds-closing {
  text-align: center;
}

.ds-closing .ds-row {
  justify-content: center;
  margin-top: var(--ds-sp-5);
}

@media (max-width: 760px) {
  .ds-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .ds-hero-promise {
    font-size: var(--ds-fs-xl);
  }
}
