:root {
  --speedle-purple: #814ce4;
  --speedle-purple-dark: #5c2fc0;
  --speedle-navy: #25134e;
  --speedle-ink: #172033;
  --speedle-muted: #5d667a;
  --speedle-cyan: #01e7cb;
  --speedle-line: #e5e8f1;
  --speedle-soft: #f6f7fb;
  --speedle-radius: 18px;
  --speedle-shadow: 0 18px 50px rgba(40, 27, 83, .11);
}

html { scroll-behavior: smooth; }

body.page-kube {
  margin: 0;
  color: var(--speedle-ink);
  background: #fff !important;
  font-family: Inter, "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

body.page-kube a { color: var(--speedle-purple-dark); }
body.page-kube img { max-width: 100%; }

body.page-kube > header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 76px;
  color: #fff;
  background: rgba(31, 17, 66, .95);
  border-bottom: 1px solid rgba(255,255,255,.1);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

#top {
  width: min(1600px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  padding: 0;
  display: flex !important;
  align-items: center;
  gap: 24px;
  background: transparent;
}

#top-brand { margin: 0 auto 0 0; }
#top-brand a { display: flex; align-items: center; }
#top-brand img { width: 210px !important; height: auto !important; margin: 0 !important; }

#top nav { margin: 0; }
#top nav ul { margin: 0; padding: 0; display: flex; align-items: center; gap: 20px; list-style: none; }
#top nav li { margin: 0; padding: 0; }
#top nav a,
#top-nav-lang .pointerCursor {
  color: rgba(255,255,255,.82) !important;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}
#top nav a:hover,
#top nav li.active a { color: var(--speedle-cyan) !important; }
#top-nav-extra li:nth-child(3) a {
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  color: #fff !important;
}
#top-nav-lang { padding-left: 2px; }
#top-nav-lang .langNameArrow { width: 11px; filter: brightness(0) invert(1); opacity: .7; }
.langsel.hide-sm { top: 68px !important; right: max(20px, calc((100vw - 1160px) / 2)); padding: 8px 14px; background: #fff; border: 1px solid var(--speedle-line); border-radius: 10px; box-shadow: var(--speedle-shadow); }

#nav-toggle-box {
  height: 68px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--speedle-navy);
}
#nav-toggle-brand img { width: 142px !important; height: auto !important; margin: 0 !important; }
#nav-toggle { color: #fff !important; }

body.page-kube > main,
body.page-kube > .container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

body.page-kube > main { padding: 70px 0 100px; }
body.page-kube > .container { padding: 58px 0 100px; }

#main { max-width: none; margin: 0; }
#main > .features { position: relative; padding: 0 0 74px; }
#main > .features + .features { padding-top: 72px; border-top: 1px solid var(--speedle-line); }

#main h1 {
  max-width: 850px;
  margin: 0 0 18px;
  color: var(--speedle-ink);
  font-size: clamp(2.6rem, 5vw, 4.35rem);
  font-weight: 780;
  line-height: 1.05;
  letter-spacing: -.045em;
}

#main h2 {
  margin: 58px 0 18px;
  color: var(--speedle-ink);
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}

#main h3 { margin: 34px 0 12px; color: var(--speedle-ink); font-size: 1.22rem; line-height: 1.38; }
#main h4 { color: var(--speedle-ink); }
#main p, #main li { color: #3f485b; }
#main .subtitle { max-width: 760px; margin: 0 0 34px !important; color: var(--speedle-muted); font-size: 1.18rem; }
#main .top-right-icon { width: 120px; height: 120px; object-fit: contain; opacity: .96; }

#kube-component.content { max-width: 820px; }
#kube-component.content > p:first-child { font-size: 1.06rem; }
#kube-component.content a { text-decoration-color: rgba(92,47,192,.3); text-underline-offset: 3px; }

#main blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  color: #3a3260;
  background: #f2effc;
  border: 0;
  border-left: 4px solid var(--speedle-purple);
  border-radius: 0 12px 12px 0;
}

#main code {
  padding: .15em .42em;
  color: #5c2fc0;
  background: #f0edf8;
  border: 0;
  border-radius: 5px;
  font-size: .88em;
}

#main .highlight {
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid #2a2040;
  border-radius: 13px;
  box-shadow: 0 14px 34px rgba(20, 12, 40, .1);
}
#main .highlight pre,
#main pre {
  margin: 0;
  padding: 22px 24px;
  overflow: auto;
  color: #eeeaf8;
  background: #171022 !important;
  border: 0;
  font-size: .9rem;
  line-height: 1.72;
}
/* Plain fences render as a bare pre without the .highlight wrapper; give them the same rounded frame. */
#main pre:not(.highlight pre) {
  margin: 24px 0;
  border: 1px solid #2a2040;
  border-radius: 13px;
  box-shadow: 0 14px 34px rgba(20, 12, 40, .1);
}
#main .highlight code, #main pre code { padding: 0; color: inherit; background: transparent; }

#main table { width: 100%; margin: 26px 0; overflow: hidden; border: 1px solid var(--speedle-line); border-collapse: separate; border-spacing: 0; border-radius: 12px; }
#main th { color: var(--speedle-ink); background: var(--speedle-soft); font-weight: 750; }
#main th, #main td { padding: 13px 15px; border: 0; border-bottom: 1px solid var(--speedle-line); text-align: left; }
#main tr:last-child td { border-bottom: 0; }

#main .button.primary,
#main a.button.primary {
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #171822 !important;
  background: var(--speedle-cyan);
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  font-weight: 750 !important;
}
#main .button.primary:hover { transform: translateY(-2px); background: #18efd5; }

.content-container { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 44px; align-items: start; }
.content-container > main { min-width: 0; }
.content-container #main h1 { font-size: clamp(2.45rem, 4.5vw, 3.65rem); }

/* Documentation pages use the full viewport: compact navigation on the far
   left and a wide reading column on the right. */
body.page-kube > .container {
  width: min(1800px, calc(100% - 32px));
}

.content-container > main {
  width: 100%;
  max-width: none;
  padding: 1rem 32px 3rem 0;
}

#kube-component.content { max-width: 1120px; }

#contents {
  margin: 30px 0;
  padding: 18px 22px;
  background: var(--speedle-soft);
  border: 1px solid var(--speedle-line);
  border-radius: 12px;
}
#contents:before { content: "On this page"; display: block; margin-bottom: 8px; color: var(--speedle-ink); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
#contents ol { margin: 0; padding-left: 20px; }

/* The documentation index lists every page in full; it never scrolls on its own
   (theme.min.css forces overflow-y: scroll). */
.sidebar {
  overflow: visible;
  padding: 22px;
  background: var(--speedle-soft);
  border: 1px solid var(--speedle-line);
  border-radius: 14px;
}
.sidebar ul { margin: 0; padding: 0; list-style: none; }
.sidebar li { margin: 3px 0; }
.sidebar a { display: block; padding: 7px 10px; color: var(--speedle-muted) !important; border-radius: 7px; font-size: .9rem; line-height: 1.35; }
.sidebar a:hover, .sidebar li.active > a { color: var(--speedle-purple-dark) !important; background: #ebe6fa; }
.sidebar-footer { margin-top: 14px; }

#main .post-item,
#main article,
#main .card {
  border-color: var(--speedle-line);
  border-radius: var(--speedle-radius);
}

body.page-kube > footer.row {
  width: 100%;
  min-height: 170px;
  margin: 0;
  padding: 48px max(20px, calc((100vw - 1160px) / 2));
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  align-items: center;
  gap: 28px;
  color: rgba(255,255,255,.66);
  background: #171022;
  border: 0;
  font-size: .88rem;
}
body.page-kube > footer a { color: var(--speedle-cyan); }
body.page-kube > footer .col { width: auto; margin: 0; padding: 0; }
body.page-kube > footer nav { display: flex; justify-content: flex-end; gap: 10px; }
body.page-kube > footer nav a { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.17); border-radius: 10px; }
body.page-kube > footer nav img { width: 23px; height: 23px; margin: 0; }

@media (max-width: 1020px) {
  #top { gap: 15px; }
  #top nav ul { gap: 12px; }
  #top nav a, #top-nav-lang .pointerCursor { font-size: 13px; }
  .content-container { gap: 28px; grid-template-columns: 220px minmax(0, 1fr); }
  .content-container > main { padding-right: 16px; }
}

@media (max-width: 767px) {
  body.page-kube > header { min-height: 68px; }
  body.page-kube > main,
  body.page-kube > .container { width: min(100% - 28px, 1160px); padding-top: 46px; }
  #top { display: none !important; }
  #top:target { width: 100%; height: auto; padding: 24px; display: flex !important; align-items: flex-start; flex-direction: column; background: var(--speedle-navy); }
  #top:target nav ul { align-items: flex-start; flex-direction: column; }
  #top:target #top-brand { display: none; }
  .content-container { display: block; }
  .sidebar { margin-top: 52px; }
  #main h1 { font-size: 2.5rem; }
  #main .top-right-icon { position: static; margin: 0 0 24px; width: 92px; height: 92px; }
  body.page-kube > footer.row { grid-template-columns: 1fr; text-align: left; }
  body.page-kube > footer .center { text-align: left; }
  body.page-kube > footer nav { justify-content: flex-start; }
  #main table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Landing-page treatment: style only; the original content and order are unchanged. */
body.page-kube.preview-home > main {
  position: relative;
  width: 100%;
  max-width: none;
  padding-top: 0;
  overflow: hidden;
}

body.page-kube.preview-home #main {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

body.page-kube.preview-home #main > .features:first-child {
  isolation: isolate;
  padding-top: 92px;
}

body.page-kube.preview-home #main > .features:first-child::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 510px;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #25134e 0%, #6636c8 62%, #814ce4 100%);
}

body.page-kube.preview-home #main > .features:first-child > h1 {
  max-width: 720px;
  color: #fff;
  font-size: clamp(3rem, 6vw, 5rem);
}

body.page-kube.preview-home #main > .features:first-child > .row:first-of-type {
  min-height: 310px;
  align-items: center;
}

body.page-kube.preview-home #main > .features:first-child > .row:first-of-type .hero {
  filter: drop-shadow(0 28px 28px rgba(20,10,50,.25));
}

@media (max-width: 767px) {
  body.page-kube.preview-home #main {
    width: min(100% - 28px, 1160px);
  }
  body.page-kube.preview-home #main > .features:first-child {
    padding-top: 56px;
  }
  body.page-kube.preview-home #main > .features:first-child::before {
    height: 550px;
  }
  body.page-kube.preview-home #main > .features:first-child > h1 {
    color: #fff;
    font-size: 2.55rem;
  }
}


/* Keep the original Plus navigation markup for content fidelity, but hide it
   in the refreshed visual treatment, matching the approved first preview. */
#top-nav-main li:has(> a[href="https://github.com/teramoby/speedle-plus"]) {
  display: none;
}
