:root {
  --bg: #191a1f;
  --card: #22232a;
  --accent: #8a67f3;
  --text: #f2f2f2;
  --muted: #a0a3ad;
}

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

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 40px 24px;
}

h1 {
  margin-bottom: 20px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.nav {
  background: #15161a;
  border-bottom: 1px solid #2b2d36;
}

.nav-inner {
  align-items: center;
  max-width: 1200px;
  margin: auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
}

.nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  transition: color .2s ease;
}

.nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    #8a67f3,
    #6f4fe0
  );
  opacity: 0;
  transition: opacity .25s ease;
  z-index: -1;
}

.nav a:hover {
  color: white;
}

.nav a:hover::before {
  opacity: 1;
}

.card {
  background: var(--card);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 16px;
  transition: 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  border: 1px solid var(--accent);
}

.button {
  background: var(--accent);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

/* Tutorial Steps */

.step {
  margin: 40px 0;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
}

.step-number {
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 8px;
}

.video {
  margin-top: 15px;
  aspect-ratio: 16/9;
}

.video iframe {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: none;
}

.product-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  border: 1px solid transparent;
  position: relative;
  height: 100%;
}

.product-image {
  overflow: hidden;
  height: 160px;
  background: #15161a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  max-height: 100%;
  object-fit: contain;
  transition: transform .25s ease;
}

.product-content {
  padding-top: 15px;
}

/* refined hover */
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(138,103,243,.6);
  box-shadow:
    0 10px 25px rgba(0,0,0,.35),
    0 0 0 1px rgba(138,103,243,.25);
}

.product-card:hover img {
  transform: scale(1.05);
}

/* Search box */
#search {
  padding: 8px 12px;
  border-radius: 6px;
  background: #1f1f23;
  color: white;
  outline: none;
  transition: border-color 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

/* Focus state */
#search:focus {
  border-color: #8a67f3;
  box-shadow: 0 0 8px rgba(138,103,243,0.6);
}

/* STEP NAV LINKS */
.sidebar a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  transition: all .4s ease;
}

.sidebar a:hover {
  padding-left: 10px;
  background: rgba(138,103,243,.15);
  color: white;
  transform: translateX(4px);
}

.sidebar a.active {
  background: linear-gradient(135deg,#8a67f3,#6f4fe0);
  color: white;
}

/* PLUGIN IMAGES */

.plugin-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  border: 1px solid transparent;
  position: relative;
  height: 100%;
}

.plugin-card:hover {
  transform: translateY(-3px);
  border-color: rgba(138,103,243,.6);
  box-shadow:
    0 8px 20px rgba(0,0,0,.3),
    0 0 0 1px rgba(138,103,243,.25);
}

.plugin-card:hover img {
  transform: scale(1.05);
}

.plugin-card img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin-bottom: 12px;
  display: block;
  transition: transform .25s ease;
}

/* VIDEO EMBEDS */

.video {
  max-width: 800px;
  margin: 20px auto;
  aspect-ratio: 16 / 9;
}

.video iframe {
  width: 100%;
  height: 100%;
}

/* Base button */
.button.external {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: #8a67f3;          /* fallback base color */
  color: white;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  overflow: hidden;              /* contains pseudo-element */
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 0;
}

/* Content wrapper to keep text above pseudo-element */
.button.external .button-content {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Gradient hover using pseudo-element */
.button.external::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #8a67f3, #6f4fe0);
  border-radius: 8px;
  opacity: 0;                    /* hidden by default */
  transition: opacity 0.25s ease;
  z-index: 0;                    /* behind text/icon */
}

/* Hover effects */
.button.external:hover::before {
  opacity: 1;                     /* fade in gradient */
}

.button.external:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* External icon */
.external-icon svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

/* Icon moves slightly on hover */
.button.external:hover .external-icon svg {
  transform: translate(2px, -1px);
}

/* TUTORIAL IMAGES */
.tutorial-image {
  text-align: center;           /* center images */
  margin: 20px 0;               /* vertical spacing */
}

.tutorial-image img {
  max-width: 100%;              /* responsive */
  max-height: 500px;            /* optional height limit */
  border-radius: 8px;           /* rounded corners */
  box-shadow: 0 4px 15px rgba(0,0,0,0.35); /* subtle shadow */
  object-fit: contain;
}