/* BotBuilder Apps
   Type scale (rem, 16px base): 0.75 / 0.875 / 1 / 1.125 / 1.25 / 1.5 / 2 / 2.75
   Spacing follows an 8px grid. The only script is the decorative backdrop (backdrop.js). */

:root {
  color-scheme: dark;

  --color-bg: #0b0b0c;
  --color-surface: #141416;
  --color-text: #ededed;
  --color-text-secondary: #a1a1a6;
  --color-text-muted: #6e6e73;
  --color-border: #232326;
  --color-border-strong: #333338;
  --color-link: #8ab4ff;
  --color-brand: #1a9fef;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;

  --radius: 0.5rem;
  --radius-lg: 0.875rem;
  --container: 78rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; background: var(--color-bg); }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--color-link); }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--color-link); outline-offset: 3px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 20;
  padding: 0.5rem 1rem; border-radius: var(--radius);
  background: var(--color-text); color: var(--color-bg); font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* Backdrop: a wall of robot code behind the top of the page, drawn by backdrop.js.
   Moving the mouse leaves a brand-blue trail through it. */

.backdrop {
  --backdrop-accent: var(--color-brand);
  position: absolute; inset: -3.5rem 0 0; z-index: -1; overflow: hidden; pointer-events: none;
  color: var(--color-text-secondary);
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  /* Fade out under the header, at the sides and toward the bottom. */
  -webkit-mask-image:
    linear-gradient(to bottom, rgb(0 0 0 / 15%), #000 3.5rem, #000 65%, transparent),
    linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image:
    linear-gradient(to bottom, rgb(0 0 0 / 15%), #000 3.5rem, #000 65%, transparent),
    linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* Oversized so the slow drift never shows an edge. */
.backdrop-drift { position: absolute; inset: -48px -80px; animation: drift 48s ease-in-out infinite; will-change: transform; }
.backdrop canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Sits over the cards; backdrop.js only draws on their borders. */
/* The opacity caps how bright a border can get where the trail overlaps itself. */
.card-edges { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; opacity: 0.45; }
@keyframes drift {
  0%, 100% { transform: translate3d(-66px, 0, 0); }
  25% { transform: translate3d(0, -40px, 0); }
  50% { transform: translate3d(66px, 0, 0); }
  75% { transform: translate3d(0, 40px, 0); }
}

.eyebrow { margin-bottom: 1rem; color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; }

/* Buttons */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  min-height: 2.25rem; padding: 0 0.875rem;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: var(--text-sm); font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-lg { min-height: 3rem; padding: 0 1.25rem; font-size: var(--text-base); }
.btn-primary { background: var(--color-text); color: var(--color-bg); }
.btn-ghost { border-color: var(--color-border-strong); color: var(--color-text); }

/* Header */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 11, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 3.5rem; }
.logo { display: flex; align-items: center; gap: 0.625rem; color: var(--color-text); font-size: var(--text-base); font-weight: 800; text-decoration: none; letter-spacing: -0.01em; }
.logo img { width: auto; height: 1.75rem; }
.site-header nav { display: flex; align-items: center; gap: 1.75rem; }
.site-header nav a {
  display: inline-flex; align-items: center; gap: 0.25rem;
  color: var(--color-text-secondary); font-size: var(--text-sm); font-weight: 600; text-decoration: none;
  transition: color 150ms ease;
}

/* Apps: the intro sits in the grid's first cell, so the whole directory reads at a glance. */

.apps { position: relative; isolation: isolate; padding: 2.5rem 0 5rem; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.intro { display: flex; flex-direction: column; padding: 1.5rem 1.5rem 1.5rem 0; }
.wordmark { width: 17rem; height: auto; margin-bottom: 1.5rem; }
/* A soft scrim keeps the intro readable over the code wall. */
.intro { position: relative; isolation: isolate; }
.intro::before {
  content: ""; position: absolute; inset: -4rem -3rem -4rem -6rem; z-index: -1;
  background: radial-gradient(closest-side, var(--color-bg) 0%, color-mix(in srgb, var(--color-bg) 70%, transparent) 60%, transparent);
}
h1 { font-size: var(--text-4xl); line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
.lead { margin-top: 1.25rem; max-width: 26rem; color: var(--color-text-secondary); font-size: var(--text-lg); line-height: 1.6; }
.intro-count {
  margin-top: auto; padding-top: 2rem;
  color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}

.card {
  --app-color: var(--color-link);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: border-color 200ms ease;
}

.card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #000; border-bottom: 1px solid var(--color-border); }
.card-shot {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  filter: brightness(0.92);
  transition: filter 200ms ease;
}
.card-placeholder {
  display: grid; place-items: center; height: 100%;
  background: color-mix(in srgb, var(--app-color) 9%, var(--color-surface));
}
.card-placeholder-icon {
  display: grid; place-items: center; width: 5rem; height: 5rem;
  border-radius: 1.25rem; color: var(--app-color);
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
}
.card-placeholder-icon img { border-radius: 0.75rem; }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.125rem 1.25rem 1.25rem; }
.card-head { display: flex; align-items: center; gap: 0.625rem; }
.card-icon {
  flex: none; display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: var(--radius); color: var(--app-color);
  background: color-mix(in srgb, var(--app-color) 14%, transparent);
}
.card-icon svg { width: 1.125rem; height: 1.125rem; }
.card-icon img { width: 1.25rem; height: 1.25rem; }
.card h2 { flex: 1; min-width: 0; font-size: var(--text-lg); font-weight: 800; letter-spacing: -0.015em; }
.card-tagline { margin-top: 0.625rem; color: var(--color-text-secondary); font-size: var(--text-sm); line-height: 1.55; }

.card-more { margin-top: 0.75rem; }
.card-more summary {
  display: inline-flex; align-items: center; gap: 0.25rem; cursor: pointer; list-style: none;
  color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600;
  transition: color 150ms ease;
}
.card-more summary::-webkit-details-marker { display: none; }
.card-more summary svg { transition: transform 200ms var(--ease-out); }
.card-more[open] summary { color: var(--color-text); }
.card-more[open] summary svg { transform: rotate(180deg); }
.card-more > p { margin-top: 0.75rem; color: var(--color-text-secondary); font-size: var(--text-sm); line-height: 1.65; }

.features { display: grid; gap: 0.375rem; margin: 0.875rem 0 0; padding: 0; list-style: none; }
.features li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: var(--text-sm); }
.features svg { flex: none; margin-top: 0.1875rem; color: var(--app-color); }

.card-meta { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; margin: 1rem 0 0; padding-top: 0.875rem; border-top: 1px solid var(--color-border); }
.card-meta dt { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 600; }
.card-meta dd { margin: 0.125rem 0 0; font-size: var(--text-sm); font-weight: 600; }

.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 1.25rem; }
.card-note { margin-top: auto; padding-top: 1.25rem; color: var(--color-text-muted); font-size: var(--text-sm); }

/* A screenshot that plays the app's demo */
.card-media-demo { position: relative; }
.card-play {
  position: absolute; left: 50%; top: 50%; width: 3.5rem; height: 3.5rem; margin: -1.75rem 0 0 -1.75rem;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(11, 11, 12, 0.7); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform 200ms var(--ease-out), background-color 150ms ease;
}
.card-play svg { margin-left: 2px; } /* a play triangle looks centred when nudged right */

/* Demo video dialog */
.demo {
  width: min(72rem, calc(100vw - 2rem)); max-width: none; max-height: calc(100vh - 2rem);
  padding: 0; overflow: hidden;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg);
  background: var(--color-surface); color: var(--color-text);
  transition: opacity 200ms ease, transform 250ms var(--ease-out);
}
@starting-style { .demo[open] { opacity: 0; transform: scale(0.97); } }
.demo::backdrop { background: rgba(0, 0, 0, 0.75); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.demo-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem; border-bottom: 1px solid var(--color-border);
}
.demo-head p { font-size: var(--text-sm); font-weight: 700; }
.demo-head span { color: var(--color-text-muted); font-weight: 600; }
.demo-close {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--color-text-secondary); cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.demo-close:active { transform: scale(0.97); }
.demo video { display: block; width: 100%; height: auto; max-height: calc(100vh - 6rem); aspect-ratio: 16 / 9; background: #000; }

/* Status badges (only shown when an app isn't live yet) */

.badge {
  flex: none; padding: 0.125rem 0.5rem; border-radius: 0.375rem;
  font-size: var(--text-xs); font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.badge-beta { color: #f5c451; background: rgba(245, 196, 81, 0.12); }
.badge-coming-soon { color: var(--color-text-secondary); background: rgba(255, 255, 255, 0.06); }

/* About */

.about { padding: 5rem 0 6rem; border-top: 1px solid var(--color-border); }
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4rem; align-items: start; }
.about h2 { margin-bottom: 1.25rem; font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.03em; }
.about p { max-width: 38rem; color: var(--color-text-secondary); font-size: var(--text-lg); line-height: 1.7; }
.about p + p { margin-top: 1rem; }
.facts { margin: 0; border-top: 1px solid var(--color-border); }
.facts div { padding: 1rem 0; border-bottom: 1px solid var(--color-border); }
.facts dt { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; }
.facts dd { margin: 0.25rem 0 0; font-size: var(--text-lg); font-weight: 700; line-height: 1.45; }

/* Footer */

.site-footer { padding: 2rem 0; border-top: 1px solid var(--color-border); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; color: var(--color-text-muted); font-size: var(--text-sm); }
.footer-inner ul { display: flex; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.footer-inner a { color: var(--color-text-secondary); font-weight: 600; text-decoration: none; transition: color 150ms ease; }

/* 404 */

.not-found { position: relative; isolation: isolate; padding: 8rem 0; }

/* Hover only where there is a real pointer, so taps on phones don't stick. */

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #fff; }
  .btn-ghost:hover { border-color: #4a4a50; }
  .site-header nav a:hover, .footer-inner a:hover, .card-more summary:hover { color: var(--color-text); }
  .card:hover { border-color: var(--color-border-strong); }
  .card:hover .card-shot { filter: none; }
  .card:hover .card-play { transform: scale(1.06); background: rgba(11, 11, 12, 0.85); }
  .demo-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--color-text); }
}

/* Motion: one quiet staggered fade on load. */

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
}
@keyframes fade {
  from { opacity: 0; }
}
.grid > * { animation: enter 400ms var(--ease-out) both; }
.grid > :nth-child(2) { animation-delay: 50ms; }
.grid > :nth-child(3) { animation-delay: 100ms; }
.grid > :nth-child(4) { animation-delay: 150ms; }
.grid > :nth-child(5) { animation-delay: 200ms; }
.grid > :nth-child(n + 6) { animation-delay: 250ms; }

/* Responsive */

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 640px) {
  .site-header nav { gap: 1.25rem; }
  .site-header nav a:first-child { display: none; }
  .apps { padding-top: 1.5rem; }
  .grid { grid-template-columns: 1fr; }
  .intro { padding: 1rem 0 1.5rem; }
  h1 { font-size: var(--text-3xl); }
  .wordmark { width: 13rem; margin-bottom: 1.25rem; }
  .lead { font-size: var(--text-base); }
  .intro-count { padding-top: 1rem; }
  .about { padding: 4rem 0; }
  .about h2 { font-size: var(--text-2xl); }
  .about p { font-size: var(--text-base); }
}

@media (max-width: 480px) {
  .container { padding-inline: 1rem; }
  .actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .backdrop-drift { animation: none; }
  .grid > * { animation-name: fade; }
}
