/* VTC default public landing page.
 *
 * Standalone — no build step, no framework. Echoes the admin UX
 * design language (indigo brand, Inter-style stack, 4px grid) but
 * leans more marketing-y in the hero. CSP forbids inline JS; styles
 * stay external too.
 */

:root {
  color-scheme: light dark;

  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Code", Menlo,
    Consolas, monospace;

  /* Indigo brand — matches the admin UX. */
  --brand-50: #efeffe;
  --brand-100: #e0e1fd;
  --brand-300: #a0a0f3;
  --brand-400: #7c7ce8;
  --brand-500: #5b5bd6;
  --brand-600: #4a4ac4;

  --accent-pink: #db5dd7;
  --accent-violet: #8b5cf6;

  /* Semantic surface tokens — light-dark() flips on `color-scheme`. */
  --bg: light-dark(#fafaff, #08080d);
  --bg-elev: light-dark(#ffffff, #14141c);
  --bg-subtle: light-dark(#f4f4fa, #1c1c26);
  --border: light-dark(#e4e4ec, #26262f);
  --border-strong: light-dark(#d4d4dc, #34343f);
  --text: light-dark(#0f0f17, #f5f5fa);
  --text-muted: light-dark(#54545f, #a0a0aa);
  --text-faint: light-dark(#7a7a82, #6f6f78);
  --brand: light-dark(var(--brand-500), var(--brand-400));
  --brand-hover: light-dark(var(--brand-600), var(--brand-300));
  --success: light-dark(#16a34a, #4ade80);
  --warning: light-dark(#d97706, #fbbf24);
  --danger: light-dark(#dc2626, #f87171);

  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-card: light-dark(
    0 1px 2px rgb(0 0 0 / 0.04),
    0 1px 2px rgb(0 0 0 / 0.4)
  );
  --shadow-hover: light-dark(
    0 10px 32px -8px rgb(91 91 214 / 0.18),
    0 10px 32px -8px rgb(0 0 0 / 0.6)
  );
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Soft brand-tinted backdrop. Two large radial blobs sit behind
 * everything, very low opacity so they read as a gradient wash rather
 * than discrete shapes. */
.bg-accent {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 0% 0%,
      color-mix(in srgb, var(--brand-500) 18%, transparent) 0,
      transparent 45%
    ),
    radial-gradient(
      circle at 100% 0%,
      color-mix(in srgb, var(--accent-pink) 14%, transparent) 0,
      transparent 40%
    ),
    radial-gradient(
      circle at 50% 100%,
      color-mix(in srgb, var(--accent-violet) 10%, transparent) 0,
      transparent 50%
    );
}

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
  text-align: left;
  padding-block: clamp(2rem, 6vw, 4rem) 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.status-dot.ok {
  background: var(--success);
}

.status-dot.warn {
  background: var(--warning);
}

.status-dot.err {
  background: var(--danger);
}

.hero h1 {
  margin: 1.25rem 0 0;
  font-size: clamp(2.25rem, 4.5vw + 0.5rem, 3.5rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.028em;
  background: linear-gradient(
    135deg,
    var(--brand-500) 0%,
    var(--accent-violet) 50%,
    var(--accent-pink) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Fallback colour for browsers that don't gradient-clip text. */
  color: var(--brand-500);
}

/* Optional operator-supplied logo. Sits above the headline in the
 * hero. `hidden` by default; site.js sets `src` + clears the
 * `hidden` attribute when the public profile includes `logoUrl`. */
.community-logo {
  display: block;
  margin: 1.5rem 0 0;
  width: auto;
  height: auto;
  max-height: 96px;
  max-width: min(220px, 100%);
  /* Subtle elevation so PNGs with transparent backgrounds read on
   * either theme without a hard border. */
  border-radius: var(--radius-md);
  object-fit: contain;
  /* Soft drop shadow on light theme — invisible on dark, which is
   * fine since dark backgrounds rarely need the lift. */
  filter: drop-shadow(0 2px 8px rgb(0 0 0 / 0.06));
}

.community-logo[hidden] {
  display: none;
}

.lead {
  margin: 1rem 0 0;
  font-size: clamp(1.05rem, 1vw + 0.85rem, 1.25rem);
  line-height: 1.55;
  max-width: 44rem;
  color: var(--text-muted);
}

/* ── Status card ─────────────────────────────────────────── */

h2 {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.status-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  box-shadow: var(--shadow-card);
}

.status-card dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 1rem;
  align-items: baseline;
  padding-block: 0.5rem;
  border-bottom: 1px dashed var(--border);
}

/* DID rows stack the value below the label so the monospace string
 * gets the full card width — no awkward mid-DID linebreaks. */
.status-row.stacked {
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding-block: 0.75rem;
}

.status-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.status-row dt {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-row dd {
  margin: 0;
}

.did-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.did-value {
  flex: 1 1 0;
  min-width: 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
  /* DIDs are long opaque tokens with no good break points — mid-
   * string wrapping looks like data corruption. Keep them on a
   * single line and let the box scroll horizontally on narrow
   * viewports instead. */
  overflow-x: auto;
  white-space: nowrap;
  /* Subtle scrollbar styling so the scroll affordance is visible
   * without being noisy. */
  scrollbar-width: thin;
}

.copy-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-elev);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 180ms cubic-bezier(0.16, 1, 0.3, 1),
    color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.copy-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand) 8%, var(--bg-elev));
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 50%, var(--border-strong));
}

.copy-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.copy-btn .icon-clipboard,
.copy-btn .icon-check {
  display: inline-block;
}

.copy-btn .icon-check {
  display: none;
}

.copy-btn.copied {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 50%, var(--border-strong));
  background: color-mix(in srgb, var(--success) 10%, var(--bg-elev));
}

.copy-btn.copied .icon-clipboard {
  display: none;
}

.copy-btn.copied .icon-check {
  display: inline-block;
}

.copy-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ── Resource grid ───────────────────────────────────────── */

.resource-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .resource-grid ul {
    grid-template-columns: repeat(3, 1fr);
  }
}

.resource {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1rem;
  color: var(--text);
  text-decoration: none;
  height: 100%;
  position: relative;
  transition:
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
}

.resource:hover,
.resource:focus-visible {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--border-strong));
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  outline: none;
}

.resource:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.resource-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand);
}

.resource-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 auto;
}

.resource-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--text);
}

.resource-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.resource-arrow {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  color: var(--text-faint);
  transition:
    color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.resource:hover .resource-arrow {
  color: var(--brand);
  transform: translate(2px, -2px);
}

.resource-internal:hover .resource-arrow {
  transform: translateX(3px);
}

/* ── Code + footer ───────────────────────────────────────── */

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.1em 0.4em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  word-break: break-all;
}

footer {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

footer p {
  margin: 0;
  max-width: 50rem;
}

footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  color: var(--brand-hover);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer-meta {
  color: var(--text-faint);
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  .resource,
  .resource-arrow {
    transition: none;
  }

  .resource:hover {
    transform: none;
  }
}
