:root {
  color-scheme: light;
  --page: #f3f6f9;
  --surface: #fffefa;
  --ink: #1d2b3a;
  --muted: #536476;
  --blue: #1762a3;
  --blue-deep: #104b7f;
  --blue-pale: #e6f0f8;
  --line: #d5dfe8;
  --focus: #bb5c13;
  --content-width: 1100px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --heading-font: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 88% 9%, rgba(214, 229, 241, 0.52), transparent 28rem),
    var(--page);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.site-header {
  width: min(100% - 64px, var(--content-width));
  min-height: 88px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: var(--blue);
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  font-family: var(--heading-font);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: normal;
}

.page-main {
  width: min(100% - 64px, var(--content-width));
  margin-inline: auto;
  padding-block: clamp(64px, 9vw, 104px) 88px;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer-content {
  width: min(100% - 64px, var(--content-width));
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.welcome {
  max-width: 760px;
}

.welcome h1 {
  max-width: 750px;
  overflow-wrap: anywhere;
  margin: 0;
  font-family: var(--heading-font);
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.25;
  text-wrap: balance;
}

.welcome p {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.demo-section {
  margin-top: clamp(44px, 6vw, 66px);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

/* The catalogue is inserted by app.js; direct children are intentionally
   styled as equal, keyboard-friendly demo tiles. */
.demo-grid > *,
.demo-grid .demo-card,
.demo-grid .demo-tile {
  min-width: 0;
  min-height: 248px;
  padding: 25px 25px 23px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-top: 3px solid #83add0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(33, 59, 82, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.demo-grid .demo-card--visual {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.demo-visual {
  width: 100%;
  aspect-ratio: 840 / 500;
  flex: 0 0 auto;
  overflow: hidden;
  background: #e7f0f2;
}

.demo-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-card-content {
  width: 100%;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 19px 23px 17px;
}

.demo-card--visual .demo-card-content .demo-name {
  margin-top: 0;
}

.demo-card:not(.demo-card--visual) .demo-card-content {
  padding: 0;
}

.demo-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.demo-access-note {
  margin: 14px 0 4px;
  color: var(--blue-deep);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

.demo-grid > *:hover,
.demo-grid .demo-card:hover,
.demo-grid .demo-tile:hover {
  transform: translateY(-2px);
  border-color: #a7bfd3;
  border-top-color: var(--blue);
  box-shadow: 0 8px 20px rgba(33, 59, 82, 0.08);
}

.demo-grid h2,
.demo-grid h3,
.demo-grid .demo-name {
  margin: 20px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.demo-grid :is(svg, .demo-icon, [data-demo-icon]) {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--blue-deep);
  background: var(--blue-pale);
}

.demo-grid svg {
  padding: 11px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-grid a[href],
.demo-grid button,
.demo-grid .demo-action {
  min-height: 44px;
  margin-top: auto;
  padding: 10px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  color: var(--blue-deep);
  background: transparent;
  font: inherit;
  font-size: 0.97rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.demo-grid a[href]:hover,
.demo-grid button:hover,
.demo-grid .demo-action:hover {
  color: #0a3a66;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.demo-grid :is(.demo-status, [data-status]) {
  margin-top: auto;
  padding-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 550;
}

@media (max-width: 820px) {
  .site-header,
  .page-main,
  .site-footer-content {
    width: min(100% - 48px, var(--content-width));
  }

  .demo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .demo-card-content {
    padding: 18px 20px 16px;
  }
}

@media (max-width: 560px) {
  .site-header,
  .page-main,
  .site-footer-content {
    width: min(100% - 36px, var(--content-width));
  }

  .site-header {
    min-height: 76px;
  }

  .page-main {
    padding-block: 57px 64px;
  }

  .welcome h1 {
    font-size: clamp(1.75rem, 7vw, 2rem);
  }

  .welcome p {
    margin-top: 17px;
    font-size: 1.05rem;
  }

  .demo-section {
    margin-top: 38px;
  }

  .demo-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .demo-grid > *,
  .demo-grid .demo-card,
  .demo-grid .demo-tile {
    min-height: 205px;
    padding: 22px;
  }

  .demo-grid .demo-card--visual {
    min-height: 0;
    padding: 0;
  }

  .demo-card--visual .demo-card-content {
    padding: 17px 20px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}