
/* THEME TOKENS */
:root{
  --brand: #f4184c;
  --brand2: rgba(244, 24, 76, 0.12);
  --bg: #ffffff;
  --card: rgba(255,255,255,0.88);
  --border: rgba(20,20,20,0.10);
  --text: #1b1b1b;
  --muted: rgba(27,27,27,0.70);
  --radius: 16px;
  --scrollTrack: #226cbb;
  --scrollThumb: #56a7fe;
}

/* BASE / RESETS */
*{ box-sizing:border-box; }
[id]{ scroll-margin-top: 120px; }
html, body{ height: 100%; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size:17px;
  line-height:1.6;
}
a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration: underline; text-underline-offset:4px; }

/* Keep brand links branded */
.linkBrand{
  color: var(--brand);
  font-weight: 900;
  text-decoration: none;
}

/* LAYOUT WRAPPER */
.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  overflow-x: clip;
}

/* BACKGROUND EFFECTS */
body::before{
  content:"";
  position: fixed; 
  inset: 0; 
  z-index:-2;
  
  opacity: 1;
  transform: translateZ(0);
  will-change: background-position;
  background-repeat: repeat, repeat;
  
  background:
    radial-gradient(circle, rgba(244,24,76,0.15) 2px, transparent 3.5px),
    radial-gradient(circle, rgba(86,167,254,0.12) 2px, transparent 3.5px);
  background-size: 42px 42px, 42px 42px;
  background-position: 0 0, 21px 21px;
  animation: dotsFloat 22s linear infinite;
}
@keyframes dotsFloat{
  from{ background-position: 0 0, 21px 21px; }
  to{ background-position: -168px -84px, -147px -63px; }
}
/* TOP BAR / HEADER */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.72);
  border-bottom: 1px solid var(--border);
}
.topbarInner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 auto;
}
/* Makes header to align with .wrap exactly */
@media (min-width: 0px){
  .topbarInner{
    padding-left: 16px;
    padding-right: 16px;
  }
}
.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  white-space: nowrap;
}
.badge{
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  color: var(--muted);
  font-weight: 900;
}
/* NAV (DESKTOP + SHARED) */
/* split to primary + secondary + hamburger */
.nav{
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.navPrimary,
.navSecondary{
  display: flex;
  align-items: center;
  gap: 10px;
}
/* External link diagonal arrow (desktop) */
.navlinkExternal::after{
  content: "↗";
  font-size: 12px;
  font-weight: 900;
  margin-left: 6px;
  opacity: 0.65;
  transform: translateY(-1px);
}
/* NAV LINK */
.navlink{
  display:inline-flex;
  align-items:center;
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 15px;
  color: rgba(27,27,27,0.88);
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.navlink:hover{
  text-decoration: none;
  background: rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.topbar .navlink[aria-current="page"]{
  background: var(--brand2);
  color: var(--brand);
  border-color: rgba(244,24,76,0.25);
}
/* HAMBURGER + MOBILE MENU */
/* Hamburger button */
.menuBtn{
  display: none;            /* desktop: hidden */
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(20,20,20,0.12);
  background: rgba(255,255,255,0.90);
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
  cursor: pointer;
}
.menuBtn:hover{ transform: translateY(-1px); }
/* Simple hamburger icon */
.menuIcon{
  width: 18px;
  height: 2px;
  background: rgba(27,27,27,0.80);
  border-radius: 999px;
  position: relative;
  display: block;
}
.menuIcon::before,
.menuIcon::after{
  content:"";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: rgba(27,27,27,0.80);
  border-radius: 999px;
}
.menuIcon::before{ top: -6px; }
.menuIcon::after { top:  6px; }

/* Dropdown panel (mobile) */
.menuPanel{
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(20,20,20,0.12);
  box-shadow: 0 14px 28px rgba(0,0,0,.10);
  backdrop-filter: blur(10px);
  z-index: 20;
}
.menuPanel .navlink{
  width: 100%;
  justify-content: flex-start;
  border-color: rgba(20,20,20,0.10);
  background: rgba(0,0,0,0.04);
  margin-top: 8px;
}
.menuPanel .navlink:first-child{ margin-top: 0; }
.menuPanel.is-open{ display: block; }

/* RESPONSIVE TOPBAR */
@media (max-width: 900px){
  html, body{ height: auto; }
  .topbarInner{ align-items: flex-start; flex-direction: column; align-items: center; }
  .topbar nav{ justify-content: flex-start; }
}
/* --- Top bar Mobile rules: only 3 buttons + hamburger --- */
@media (max-width: 600px){
  .badge{ display: none; }

  /* 2-column layout: pills + hamburger */
  .nav{
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
  }

  .navSecondary{ display: none; } /* external links moved into hamburger */
  .menuBtn{ display: inline-flex; }

  /* Pills row: never wrap, always equal width */
  .navPrimary{
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0; /* important for grid */
  }

  .navPrimary .navlink{
    flex: 1 1 0;
    justify-content: center;
    white-space: nowrap;
    border-color: rgba(20,20,20,0.12);
    background: rgba(255,255,255,0.90);
    /* optional: keeps the pills visually consistent on tiny screens */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

   /* Keep active pill styling on top */
  .topbar .navlink[aria-current="page"]{
    background: var(--brand2);
    color: var(--brand);
    border-color: rgba(244,24,76,0.25);
    box-shadow: none;
  }

  /* Dropdown position */
  .menuPanel{
    right: 0;
    left: auto;
    top: calc(100% + 10px);
  }
}

/* Tablet-ish widths: hide badge + center nav */
@media (min-width: 601px) and (max-width: 1024px){
  .badge{ display: none; }
  .nav{ flex: 1; justify-content: center; }
}

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,.06);
  transition: box-shadow .15s ease, transform .15s ease;
  will-change: transform;
  transform: translateZ(0);
}

.card:hover{
  box-shadow: 0 14px 28px rgba(0,0,0,.07);
  transform: translateY(-2px);
}

/* HERO */
.hero{ padding: 18px 0 8px; }

.heroH1{
  position: relative;
  display: flex;
  width: fit-content; /* ← prevents way too long line under title */
  flex-direction: column;
  align-items: center;
  margin: 6px auto 18px;
  text-align: center;
  line-height: 1.15;
}

.heroH1Main{
  display: block;
  font-size: 34px;
  font-weight: 780;
  letter-spacing: -0.3px;
}

.heroH1::after{
  content:"";
  display:block;
  width: 100%;
  height: 5px;
  margin-top: 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ff2d6f 0%, var(--brand) 35%, #9fdf28 70%, #ff2d6f 100%);
  background-size: 200% 100%;
  animation: titleShimmer 3s linear infinite;
  box-shadow: 0 4px 12px rgba(244,24,76,0.35);
}

.heroH1Sub{
  display: block;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(27,27,27,0.68);
}

@keyframes titleShimmer{
  0%{ background-position: 0% 50%; }
  100%{ background-position: 200% 50%; }
}

.subtitle{
  max-width: 620px;
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.4;
  text-align: center;
}

/* TYPOGRAPHY HELPERS */
.lead{
  font-weight: 600;
  line-height: 1.35;
  color: rgba(27,27,27,0.75);
}

.sectionTitle{
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.2px;
}

h2{ line-height: 28px; padding-bottom: 10px; }
.muted{ color: rgba(27,27,27,0.62); font-weight: 800; font-size: 14px; }
.txtSmall{
  font-size:0.9em;
  opacity:0.8;
}
.spoiler{
  margin:8px 0;
}

.spoiler summary{
  cursor:pointer;
  font-weight:700;
}

/* TAGS / FILTERS */
.tagRow{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:10px; }
.tag{
  font-size: 13px; font-weight:900;
  padding: 6px 10px; border-radius:999px;
  border:1px solid rgba(20,20,20,0.10);
  background: rgba(255,255,255,0.78);
  color: rgba(27,27,27,0.78);
}
.miniRow{ display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-start; margin-top:12px; }
.miniRow.center{ justify-content:center; }

/* BUTTONS / LINKS */
.btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
  text-decoration:none;
  font-size: 16px;
}
.btn:hover{ text-decoration:none; transform: translateY(-1px); }

.btnPrimary{
  background: var(--brand);
  color: #fff;
  border-color: rgba(244,24,76,0.35);
}

.btnPrimary:hover{
  box-shadow: 0 14px 30px rgba(244,24,76,.20);
  transform: translateY(-1px);
}

button, .navlink, a{
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

button:active, .navlink:active{
  transform: translateY(1px) scale(0.99);
}

.linkBrand{
  color: var(--brand);
  font-weight: 900;
}
.linkBrand:hover{
  text-decoration: none;
  background: var(--brand2);
  border-radius: 10px;
  padding: 2px 6px;
  margin: -2px -6px;
}

.tutorialGrid{
  display:grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 14px;
  margin-top: 14px;
  align-items:start;
}
@media(max-width:900px){ .tutorialGrid{ grid-template-columns:1fr; } }

.subcard{
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
}
.subcard strong{
  display:block;
  font-weight: 1000;
  letter-spacing: -0.1px;
}
.step{
  display:flex; gap:12px; align-items:flex-start;
  margin-top:12px; padding:12px;
  border-radius: 14px;
  border: 1px solid rgba(20,20,20,0.10);
  background: rgba(255,255,255,0.72);
}
.stepNum{
  width:34px;
  height:34px;
  flex: 0 0 34px;     /* prevents shrinking in flex rows */
  flex-shrink: 0;     /* extra safety */
  border-radius:12px;
  display:grid;
  place-items:center;
  font-weight:700;
  color:#fff;
  background: var(--brand);
  box-shadow: 0 10px 18px rgba(244,24,76,0.18);
}
.stepTitle{
  font-size: 20px;
  letter-spacing: 0;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.25;
  text-transform: capitalize;
}
.step p{ margin:0; color: rgba(27,27,27,0.82); }

/* CALLOUT SYSTEM */
.callout{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #eef6ff;
  border: 1px solid rgba(0, 123, 255, 0.25);
}
.callout.success{ background: rgba(46, 184, 92, 0.12); border-color: rgba(46, 184, 92, 0.35); }
.callout.warn{ background: rgba(220, 53, 69, 0.12); border-color: rgba(220, 53, 69, 0.35); }
.callout.warn strong{ color:#b02a37; }

.callout a{
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.callout a:hover{
  color: var(--brand);
}

pre{
  margin: 12px 0 0;
  padding: 12px 20px;
  border-radius: 14px;
  border: 1px solid rgba(20,20,20,0.10);
  background: #f3f5f7;
  overflow:hidden;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;       
  overflow-wrap: anywhere;      
  word-break: break-word;       
}
code{
  background:#f3f5f7;
  color:#444;
  border-radius:6px;
  display:inline;
  overflow-wrap:anywhere;
  padding: 2px 6px;
  border: 1px solid rgba(20,20,20,0.10);
}
/* when code wraps, the extra line-height gives breathing room */
code:where(:not(:empty)){
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;

}
.video, .imageCard{
  width:100%;
  border: 1px solid rgba(20,20,20,0.10);
  border-radius: 16px;
  overflow:hidden;
  background: rgba(255,255,255,0.86);
  margin-top: 12px;
}
.video{ aspect-ratio: 16/9; }
.video iframe{ width:100%; height:100%; border:0; display:block; }

.imageCard img{ width:100%; height:auto; display:block; }
.imageCardCrossfade{ position:relative; aspect-ratio:16/9; }
.imageCardCrossfade .frame{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit: cover; display:block;
}
.imageCardCrossfade .is-top{
  opacity:0;
  transition: opacity .55s ease;
  pointer-events: none; /* let clicks go through to the base image */
}

.stepBody{
  margin-top: 6px;
}

.stepBody p{
  margin: 0;
}

.stepBody pre{
  margin: 8px 0;
}

/* TOC (STICKY) */
/* Make the TOC card itself sticky */
.tocCard{
  position: sticky;
  top: 100px;
  align-self:start;
  height: fit-content;
}
@media(max-width:900px){ .tocCard{ position: static; } }

.toc a{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid rgba(20,20,20,0.10);
  background: rgba(0,0,0,0.06);
  font-weight:900;
  margin-top:8px;
}
.toc a:hover{ background: rgba(255,255,255,0.92); text-decoration:none; }
.toc a.is-active{ background: var(--brand2); border-color: rgba(244,24,76,0.25); }
.toc a.is-active span{ color: var(--brand); }
.toc small{ font-weight:900; color: rgba(27,27,27,0.55); }

.tocProgress{
  height: 8px; border-radius:999px;
  background: rgba(0,0,0,0.08);
  border:1px solid rgba(20,20,20,0.10);
  overflow:hidden;
  margin-top:10px;
}
.tocProgressFill{
  height:100%;
  width:0%;
  background: var(--brand);
  border-radius:999px;
  transition: width .12s linear;
}

/* FOOTER */
footer{
  margin-top: 26px;
  padding: 18px 0 34px;
  color: rgba(27,27,27,0.72);
  font-size: 14px;
}

.hangout{
  text-align: center;
  margin: 18px 0 14px;
  font-size: 15px;
  color: rgba(27,27,27,0.78);
}

.footerInner{
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items:center;
}

.socialText{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  justify-content:center;
  align-items:center;
  font-weight: 900;
}

.socialText a{
  padding: 2px 6px;
  border-radius: 10px;
  text-decoration: none;
}

.socialText a:hover{
  background: rgba(0,0,0,0.06);
  text-decoration: none;
}

.sepDot{
  width: 6px;
  height: 6px;
  background: var(--brand);
  border-radius: 50%;
  display: inline-block;
  margin: 0 10px;
}

.footerRight{
  display:flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.sep{
  color: rgba(20,20,20,0.35);
  font-weight: 800;
  margin: 0 2px;
}

/* RESPONSIVE FOOTER */
@media (max-width: 1050px){
  .footerInner{ grid-template-columns: 1fr; text-align:center; }
  .footerRight{ justify-content: center !important; }
  .socialText{ justify-content: center !important; }
}

/* SCROLLBAR */
html{
  scrollbar-color: var(--scrollThumb) var(--scrollTrack);
  scrollbar-width: auto;
}
::-webkit-scrollbar{ width: 24px; height: 24px; }
::-webkit-scrollbar-track{ background: var(--scrollTrack); }
::-webkit-scrollbar-thumb{
  background: var(--scrollThumb);
  border-radius: 999px;
  border: 6px solid var(--scrollTrack);
}
::-webkit-scrollbar-thumb:hover{ filter: brightness(0.95); }
::-webkit-scrollbar-corner{ background: var(--scrollTrack); }

/* REVEAL ANIMATION */
.preReveal{
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s ease, transform .45s ease;
}
.reveal{
  opacity: 1;
  transform: translateY(0);
}

/* lightbox */
.lightbox{
  position: fixed; inset:0; z-index:9999;
  display:none; align-items:center; justify-content:center; padding:20px;
}
.lightbox.is-open{ display:flex; }
.lightboxOverlay{ position:absolute; inset:0; background: rgba(0,0,0,0.85); }
.lightboxPanel{
  position:relative; z-index:1;
  width: min(1100px, 96vw);
  height: min(78vh, 720px);
  display:grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}
.lightboxTop{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  color: rgba(255,255,255,0.9); font-weight:900; user-select:none;
}
.lightboxClose{
  border:1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.10);
  color:#fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  font-weight:900;
}
.lightboxStage{
  position:relative;
  border-radius: 18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  display:grid; place-items:center;
}
.lightboxImg{
  max-width:100%;
  max-height:100%;
  object-fit: contain;
  pointer-events:none;
}
.lightboxNav{
  position:absolute; top:50%;
  width:46px; height:46px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color:#fff;
  cursor:pointer;
  display:grid; place-items:center;
  font-size:22px; font-weight:900;
  transform: translateY(-50%);
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
  opacity:.92;
}
.lightboxPrev{ left: 12px; }
.lightboxNext{ right: 12px; }
.lightboxBottom{ display:flex; justify-content:center; gap:8px; }
.lightboxDot{
  width:10px; height:10px; border-radius:999px;
  border:1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.18);
}
.lightboxDot.is-active{ background:#fff; border-color: rgba(255,255,255,0.8); }


img[data-lb="1"]{ cursor: zoom-in; }








