/*
 * Hawker's public blue-glass foundation.
 *
 * This file is deliberately presentation-only. It contains no state, URL,
 * provider or marketplace behaviour. Each token maps to a visual role rather
 * than a business assertion: blue means interface emphasis, while green is
 * reserved for a confirmed positive protocol state that the application has
 * explicitly labelled.
 */

:root {
  --hawker-page-max: 96rem;
  --hawker-gutter: clamp(1.25rem, 4vw, 4.25rem);
  --hawker-section-space: clamp(5.75rem, 11vw, 10rem);
  --hawker-radius-xs: 0.42rem;
  --hawker-radius-sm: 0.72rem;
  --hawker-radius-md: 1rem;
  --hawker-radius-pill: 999px;
  --hawker-motion-fast: 160ms;
  --hawker-motion-base: 240ms;
  --hawker-motion-curve: cubic-bezier(.22, 1, .36, 1);
}

body.landing-page--night {
  --hawker-surface-page: #070a10;
  --hawker-surface-base: #09111f;
  --hawker-surface-raised: rgba(16, 31, 56, 0.78);
  --hawker-surface-deep: rgba(6, 13, 26, 0.9);
  --hawker-text-strong: #f2f6ff;
  --hawker-text: #b7c5dc;
  --hawker-text-muted: #8294b2;
  --hawker-accent: #9fc2ff;
  --hawker-accent-strong: #c9dcff;
  --hawker-positive: #b8ff5f;
  --hawker-border-subtle: rgba(163, 198, 255, 0.16);
  --hawker-border-strong: rgba(184, 214, 255, 0.38);
  --hawker-shadow-inset: inset 0 1px 0 rgba(232, 241, 255, 0.08);
  --hawker-shadow-glass: 0 1.15rem 3rem rgba(0, 4, 15, 0.22);
  --hawker-focus: #d9e8ff;
}

/* Reusable surface primitives. New landing modules should compose these
 * classes instead of reintroducing a one-off dark card treatment. */
.hawker-glass-surface,
.hawker-glass-card,
.hawker-state-panel {
  border: 1px solid var(--hawker-border-subtle);
  border-radius: var(--hawker-radius-md);
  box-shadow: var(--hawker-shadow-inset), var(--hawker-shadow-glass);
}

.hawker-glass-surface {
  background: linear-gradient(145deg, var(--hawker-surface-raised), var(--hawker-surface-deep));
}

.hawker-glass-card {
  background: linear-gradient(145deg, rgba(22, 41, 73, 0.78), rgba(7, 14, 27, 0.94));
}

.hawker-state-panel {
  background: rgba(10, 20, 37, 0.82);
  color: var(--hawker-text);
}

.hawker-source-label {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  width: max-content;
  max-width: 100%;
  padding: 0.28rem 0.42rem;
  border: 1px solid var(--hawker-border-subtle);
  border-radius: var(--hawker-radius-xs);
  color: var(--hawker-text-muted);
  font: 750 0.47rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* One focus treatment across the human-facing landing page. This makes small
 * icon actions and horizontal rails as legible to keyboard users as larger
 * links, without making a visual state look like a market approval. */
body.landing-page--night :is(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--hawker-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 0.26rem rgba(113, 163, 255, 0.22);
}

/* Shared glass treatment for the home modules that are rendered after load.
 * Unique gradients remain local to each component; this only normalises their
 * edge, radius and readable type treatment. */
body.landing-page--night :is(
  .activity-console,
  .latest-product-card,
  .agent-storefront-card,
  .plugin-marketplace-card,
  .activity-metrics > .activity-metric-card,
  .activity-event
) {
  border-color: var(--hawker-border-subtle);
  box-shadow: var(--hawker-shadow-inset), var(--hawker-shadow-glass);
}

body.landing-page--night :is(.latest-product-card, .agent-storefront-card, .plugin-marketplace-card) {
  border-radius: var(--hawker-radius-sm);
}

body.landing-page--night :is(.latest-product-card, .agent-storefront-card, .plugin-marketplace-card, .activity-event) :is(h3, strong) {
  color: var(--hawker-text-strong);
}

/* Data-source and loading states are part of the component contract. A glass
 * card does not imply a live transaction: simulated and local-reference data
 * visibly retain their source state. */
body.landing-page--night [aria-busy="true"] > .catalog-loading {
  display: grid;
  min-height: 8.5rem;
  margin: 0;
  padding: 1rem;
  border: 1px dashed rgba(163, 198, 255, 0.28);
  border-radius: var(--hawker-radius-sm);
  background: linear-gradient(135deg, rgba(16, 30, 54, 0.56), rgba(7, 14, 27, 0.66));
  color: var(--hawker-text-muted);
  font-size: 0.62rem;
  letter-spacing: 0.055em;
  line-height: 1.5;
  place-items: center;
  text-align: center;
}

body.landing-page--night [data-storefront-source="local-reference"] .agent-storefront-card__footer::after {
  margin-left: auto;
  color: #91a7c8;
  content: "reference";
  font: 750 0.42rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

body.landing-page--night [data-activity-mode="simulation"] .activity-status,
body.landing-page--night .activity-event--simulated .activity-event-source {
  color: #aebbd0;
}

body.landing-page--night [data-activity-mode="recorded"] .activity-status {
  border-color: rgba(184, 255, 95, 0.38);
  color: #d9f6a6;
}

/* The shell uses the same spacing model at every breakpoint. It prevents a
 * separate component from silently choosing an incompatible page width. */
body.landing-page--night :is(.hero, .manifesto, .catalog-section, .trust-section, .ecosystem, .plugin-marketplace, .agent-storefronts-section) {
  max-width: var(--hawker-page-max);
}

@media (max-width: 840px) {
  body.landing-page--night .site-nav {
    gap: clamp(0.55rem, 1.7vw, 1rem);
    font-size: 0.58rem;
  }

  body.landing-page--night .site-header {
    padding-right: var(--hawker-gutter);
    padding-left: var(--hawker-gutter);
  }

  body.landing-page--night .activity-console-title {
    min-width: 0;
  }

  body.landing-page--night .activity-console-subtitle {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  body.landing-page--night .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.landing-page--night .site-nav {
    display: none;
  }

  body.landing-page--night .agent-link {
    min-height: 2.35rem;
    padding: 0.45rem 0;
  }

  body.landing-page--night .latest-product-provenance p,
  body.landing-page--night .agent-storefront-card__footer {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  body.landing-page--night .activity-console-title {
    gap: 0.28rem;
  }

  body.landing-page--night .activity-console-subtitle {
    max-width: 11rem;
  }

  body.landing-page--night [aria-busy="true"] > .catalog-loading {
    min-height: 7.25rem;
  }
}

@media (hover: hover) and (pointer: fine) {
  body.landing-page--night :is(.latest-product-card, .agent-storefront-card, .plugin-marketplace-card, .activity-event) {
    transition-duration: var(--hawker-motion-base);
    transition-timing-function: var(--hawker-motion-curve);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.landing-page--night :is(.latest-product-card, .agent-storefront-card, .plugin-marketplace-card, .activity-event) {
    transition: none;
  }
}

.hawker-no-script {
  width: min(calc(100% - var(--hawker-gutter) - var(--hawker-gutter)), var(--hawker-page-max));
  margin: 0 auto var(--hawker-section-space);
  padding: 1rem 1.1rem;
  border: 1px solid var(--hawker-border-strong);
  border-radius: var(--hawker-radius-sm);
  background: var(--hawker-surface-base);
  color: var(--hawker-text);
  font-size: 0.75rem;
  line-height: 1.55;
}
