/*
 * Components: buttons, chips, cards, nav, forms, hero.
 * Every value comes from tokens.css. No literal colours below this line.
 */

/* --- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 44px;                 /* touch target floor */
  padding: 0.7rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

/* The only place a large yellow area is permitted, and it always carries
   near-black text. DESIGN.md rule 1. */
.btn--primary {
  background-color: var(--color-signal);
  color: var(--color-void);
}

.btn--primary:hover {
  color: var(--color-void);
  transform: translateY(-1px);
}

.btn--ghost {
  background-color: transparent;
  border-color: var(--color-line-strong);
  color: var(--color-ink);
}

.btn--ghost:hover {
  border-color: var(--color-signal);
  color: var(--color-signal);
}

.btn:active {
  transform: translateY(1px);       /* tactile push, never a glow */
}

/* --- Spec chips ------------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: 0;
  margin: 0 0 var(--space-3);
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  color: var(--color-ink-soft);
  font-size: var(--step--1);
  text-decoration: none;
  white-space: nowrap;
}

.chip:hover,
.chip--active {
  background-color: var(--color-signal);
  border-color: var(--color-signal);
  color: var(--color-void);
}

/* --- Cards ------------------------------------------------------------ */

.card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  overflow: hidden;
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-spring),
              border-color var(--dur-base) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--color-line-strong);
  box-shadow: var(--shadow-card);
}

/* The photography is the product. No inner mat around it. */
.card__media {
  aspect-ratio: 4 / 3;
  background-color: var(--color-surface-alt);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body {
  padding: var(--space-3);
}

.card__title {
  margin: 0 0 var(--space-1);
  font-size: var(--step-1);
}

.card__text {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: var(--step--1);
}

/* --- Site header ------------------------------------------------------ */

.site-header {
  position: relative;
  z-index: 10;
  padding-block: var(--space-2);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
  font-weight: 700;
}

.brand img {
  height: 40px;
  width: auto;
}

.site-nav ul {
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-ink-soft);
  font-size: var(--step--1);
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
  color: var(--color-signal);
}

/* The desktop nav hides on mobile, but nothing is hidden behind a tap: the
   bottom bar below carries the primary destinations. */
@media (max-width: 899px) {
  .site-nav {
    display: none;
  }
}

/* --- Sticky bottom bar (the hamburger replacement) -------------------- */

.bottom-bar {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: var(--color-surface);
  border-block-start: 1px solid var(--color-line);
  padding-block-end: env(safe-area-inset-bottom, 0px);
}

.bottom-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--bottom-bar-height);
  padding: var(--space-1) 0;
  color: var(--color-ink-soft);
  font-size: 0.72rem;
  text-decoration: none;
}

.bottom-bar__item[aria-current="page"] {
  color: var(--color-signal);
}

.bottom-bar__item svg {
  width: 22px;
  height: 22px;
}

@media (min-width: 900px) {
  .bottom-bar {
    display: none;
  }
}

/* --- Hero ------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100dvh;              /* never 100vh: iOS Safari URL-bar jump */
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero__canvas,
.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__poster {
  object-fit: cover;
  z-index: 0;
}

.hero__canvas {
  z-index: 1;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.hero__canvas.is-ready {
  opacity: 1;
}

/*
 * The scrim does real work here, not decoration.
 *
 * A hologram sheet throws the entire spectrum at full brightness, so a symmetric
 * vignette leaves the headline sitting on gold and unreadable — which is exactly
 * what the first build did. Three layers, in order:
 *
 *   1. a vignette that pulls the frame edges down to the canvas colour
 *   2. a floor-to-ceiling gradient so the lower copy and CTA always have ground
 *   3. a directional wash on the inline start, where the copy column lives
 *
 * Layer 3 is the one that makes the text legible, and it has to follow writing
 * direction rather than a fixed side.
 */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(13, 13, 13, 0.5) 0%, rgba(13, 13, 13, 0.15) 35%, rgba(13, 13, 13, 0.92) 100%),
    radial-gradient(120% 90% at 50% 45%, transparent 18%, var(--color-void) 100%);
}

/* The copy column's own ground. Strong where the text is, gone by mid-frame,
   so the crystal keeps the light it needs. */
.hero__scrim::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(13, 13, 13, 0.88) 0%, rgba(13, 13, 13, 0.45) 28%, transparent 58%);
}

[dir='ltr'] .hero__scrim::after {
  background: linear-gradient(to right, rgba(13, 13, 13, 0.88) 0%, rgba(13, 13, 13, 0.45) 28%, transparent 58%);
}

/*
 * Narrow viewports get a vertical wash instead of a directional one.
 *
 * The directional version assumes the copy is a column with the crystal beside
 * it. Below 900px there is no column — the text runs the full width, so a
 * side gradient leaves half of every line sitting on bare hologram. Measured on
 * a 375px frame: the headline survived and the lede did not.
 */
@media (max-width: 899px) {
  .hero__scrim::after,
  [dir='ltr'] .hero__scrim::after {
    background: linear-gradient(
      to bottom,
      transparent 0%,
      rgba(13, 13, 13, 0.55) 30%,
      rgba(13, 13, 13, 0.86) 55%,
      rgba(13, 13, 13, 0.94) 100%
    );
  }
}

/* Once the crystal is live it draws its own backdrop, so the poster underneath
   is redundant paint. Fade rather than remove, so the swap is never a flash. */
.hero:has(.hero__canvas.is-ready) .hero__poster {
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

/* Asymmetric, not centred. DESIGN.md rule 16. In RTL the inline start is the
   right edge, which is where a Persian reader begins. */
.hero__content {
  position: relative;
  z-index: 3;
  max-width: 46ch;
  padding-block: var(--space-6);
  margin-inline-end: auto;
}

/*
 * Hero copy sits on photography, not on a flat surface, so it does not use the
 * page's normal ink values.
 *
 * --color-ink-soft is 62% opacity, which is right over --color-void and far too
 * light over a lit hologram sheet: measured at 375px the lede was legible only
 * where the sheet happened to be dark. Full ink plus a soft shadow keeps it
 * readable across the whole frame without brightening the scrim further and
 * flattening the crystal.
 */
.hero__title {
  font-size: var(--step-4);
  margin-block-end: var(--space-2);
  text-shadow: 0 2px 24px rgba(13, 13, 13, 0.85);
}

.hero__lede {
  color: var(--color-ink);
  font-size: var(--step-1);
  margin-block-end: var(--space-3);
  max-width: none;
  text-shadow: 0 1px 16px rgba(13, 13, 13, 0.9);
}

/* --- Forms ------------------------------------------------------------ */

.field {
  display: block;
  margin-block-end: var(--space-3);
}

.field__label {
  display: block;
  margin-block-end: 0.35rem;
  font-size: var(--step--1);
  color: var(--color-ink-soft);
}

.field__control {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
}

.field__control:focus-visible {
  border-color: var(--color-signal);
}

.field__hint {
  display: block;
  margin-block-start: 0.35rem;
  font-size: var(--step--1);
  color: var(--color-ink-faint);
}

/* The honeypot. Hidden from people and from assistive technology, but a real
   fillable field as far as a bot is concerned. */
.field--trap {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice {
  padding: var(--space-2);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  margin-block-end: var(--space-3);
}

.notice--ok {
  border-color: var(--color-ok);
}

.notice--error {
  border-color: var(--color-danger);
}

/* --- Footer ----------------------------------------------------------- */

.site-footer {
  border-block-start: 1px solid var(--color-line);
  padding-block: var(--space-5);
  color: var(--color-ink-soft);
  font-size: var(--step--1);
}

.site-footer a {
  text-decoration: none;
}

.channel-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  margin: 0;
  list-style: none;
}
