:root {
  --paper: #f4f6f2;
  --surface: #ffffff;
  --ink: #17191c;
  --muted: #5f666d;
  --line: #d9ded8;
  --blue: #1769e0;
  --blue-dark: #0d4fab;
  --coral: #e35d45;
  --lime: #c7d447;
  --shadow: 0 12px 36px rgba(20, 26, 32, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: 0;
}

a {
  color: var(--blue-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--coral);
}

.navbar {
  min-height: 68px;
  padding: 0.65rem 0;
  background: var(--surface) !important;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(20, 26, 32, 0.05);
}

.navbar .container-fluid {
  width: min(100% - 2rem, 1180px);
  margin-inline: auto;
  padding: 0;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink) !important;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-bottom: 4px solid var(--lime);
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1;
}

.navbar-nav {
  gap: 0.15rem;
  margin-left: auto;
}

.navbar .nav-link {
  position: relative;
  padding: 0.55rem 0.72rem !important;
  color: #3f464c !important;
  border-radius: 4px;
  font-size: 0.92rem;
  font-weight: 620;
  text-decoration: none;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  color: var(--ink) !important;
  background: #eef2ec;
}

.navbar .nav-link.active,
.navbar .dropdown.active > .nav-link {
  color: var(--blue-dark) !important;
  background: #eef4ff;
}

.dropdown-menu {
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.dropdown-item {
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.dropdown-item.active,
.dropdown-item:active {
  color: #fff;
  background: var(--blue-dark);
}

body > .container {
  width: min(100% - 2rem, 980px);
  min-height: calc(100vh - 152px);
  padding: 3.5rem 0 5rem;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 760;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.6rem;
  font-size: 2.55rem;
  line-height: 1.1;
}

h1 small {
  display: block;
  max-width: 720px;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 520;
  line-height: 1.5;
}

h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 0.35rem;
  font-size: 1.65rem;
  line-height: 1.25;
}

h3 {
  margin-top: 2rem;
  font-size: 1.2rem;
}

p,
li {
  max-width: 78ch;
}

.profile-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 2.25rem;
  align-items: start;
  margin-top: 1rem !important;
}

.profile-photo,
.profile-copy {
  width: auto;
  padding: 0;
}

.profile-photo img {
  width: 100%;
  max-width: 190px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.profile-copy p:first-child {
  margin-top: 0;
  color: var(--coral);
  font-weight: 750;
}

.page-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  margin-bottom: 0;
}

img.img-fluid {
  border-radius: 4px;
}

pre,
.CodeMirror {
  border: 1px solid #cfd6d0 !important;
  border-left: 4px solid var(--blue) !important;
  border-radius: 4px;
  background: #fbfcfa !important;
  box-shadow: none;
}

pre {
  max-width: 100%;
  padding: 1rem;
  overflow-x: auto;
  color: #1d252b;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre;
}

.alert {
  border: 1px solid #eadb9f;
  border-radius: 4px;
}

.btn {
  border-radius: 4px;
  font-weight: 650;
}

.btn-primary {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}

.demo {
  margin: 1.5rem 0 2.5rem;
  padding: 1rem;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.phaser-parent canvas {
  width: 100% !important;
  max-width: 800px;
  height: auto !important;
}

.research-frame {
  display: block;
  width: 100%;
  min-height: 900px;
  border: 1px solid var(--line) !important;
  border-left: 4px solid var(--blue) !important;
  border-radius: 4px;
  background: #fff;
}

iframe[src*="youtube.com"] {
  width: min(100%, 720px);
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
}

.site-footer {
  padding: 1.5rem 1rem;
  color: #c7cbc7;
  background: var(--ink);
  border-top: 4px solid var(--lime);
}

.site-footer__inner {
  display: flex;
  width: min(100%, 980px);
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.88rem;
}

.site-footer a {
  color: #fff;
}

.error-page {
  display: grid;
  min-height: 80vh !important;
  align-content: center;
  justify-items: start;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--coral);
  font-weight: 800;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
  }

  .navbar-nav {
    gap: 0.2rem;
  }

  .dropdown-menu {
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 700px) {
	.mast-ui-design-page .container > .row {
		display: grid;
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.mast-ui-design-page .container > .row > .col {
		width: 100%;
	}

  body > .container {
    padding-top: 2.25rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .profile-layout {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .profile-photo img {
    max-width: 150px;
  }

  .mast-ui-design-page .container > .row {
    grid-template-columns: 1fr;
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo {
    margin-inline: -0.5rem;
    padding: 0.65rem;
  }
}
