/* ======================================================
   learn.css — COMPLETE (through article polish)
   - React-like Learn pages + stable grid
   - Cover-first media
   - Article polish (layout + prose + TOC)
   ====================================================== */

:root{
  --bg1:#0b1f47; --bg2:#0a2b4f; --bg3:#0a1020;
  --card: rgba(255,255,255,.08);
  --card2: rgba(255,255,255,.06);
  --border: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --muted2: rgba(255,255,255,.60);
  --shadow: 0 25px 70px rgba(0,0,0,.35);
  --radius: 22px;
  --blue1:#0ea5e9; --blue2:#2563eb;
  --focus: rgba(56,189,248,.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color: var(--text);
  background:
    radial-gradient(700px 320px at 18% 12%, rgba(59,130,246,0.20), transparent),
    radial-gradient(520px 280px at 85% 18%, rgba(14,165,233,0.16), transparent),
    linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
}

a{ color: inherit; text-decoration:none; }
.prose a:hover{ text-decoration: underline; }

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 16px 56px;
}
/* ======================================================
   Header
   ====================================================== */

.learn-header{
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.learn-header-inner{
  max-width: 72rem;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.learn-brand{
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.learn-logo{
  height: clamp(96px, 7vw, 144px);
  width: auto;
  object-fit: contain;
  display: block;
  transition: all 0.3s ease;
  filter: drop-shadow(0 10px 25px rgba(0,0,0,.35));
}

.learn-nav{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.learn-nav a{
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  transition: 0.2s ease;
}

.learn-nav a:hover{
  background: rgba(255,255,255,0.08);
  color: white;
}

.learn-cta{
  color: white !important;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.2);
}

.learn-cta:hover{
  background: linear-gradient(90deg, #3b82f6, #38bdf8) !important;
}

@media (max-width: 900px){
  .learn-header-inner{
    flex-direction: column;
    align-items: flex-start;
  }

  .learn-nav{
    flex-wrap: wrap;
  }
}

@media (max-width: 640px){
  .learn-nav a{
    padding: 9px 12px;
    font-size: 0.9rem;
  }

  .learn-logo{
    height: clamp(84px, 18vw, 120px);
  }
}

/* ======================================================
   Shell
   ====================================================== */

.shell{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  border-radius: calc(var(--radius) + 10px);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ======================================================
   Typography helpers
   ====================================================== */

.kicker{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dot{ width:8px; height:8px; border-radius:999px; background: var(--blue1); }

.learn-title{
  margin: 12px 0 0;
  font-size: clamp(30px, 4.5vw, 54px);
  line-height: 1.05;
  letter-spacing: -.03em;
}

.meta{
  font-size: 12.5px;
  font-weight: 650;
  color: rgba(255,255,255,.68);
}

/* ======================================================
   Buttons
   ====================================================== */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-weight: 800;
  font-size: 14px;
}
.btn:hover{ background: rgba(255,255,255,.10); }

.btn-primary{
  border: none;
  background: linear-gradient(90deg, var(--blue1), var(--blue2));
  box-shadow: 0 18px 40px rgba(37,99,235,.30);
}
.btn-primary:hover{ filter: brightness(1.05); }

/* ======================================================
   Breadcrumbs
   ====================================================== */

.crumbs{
  display:flex; flex-wrap:wrap; gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.crumbs a{ color: var(--muted); }
.crumbs a:hover{ color: var(--text); }
.sep{ opacity: .6; }

/* ======================================================
   Media — cover-first (world class)
   ====================================================== */

.media{
  --img: none;
  --fit: cover;
  --pos: 50% 30%;
  --pad: 0px;

  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 55px rgba(0,0,0,.28);
}

.media::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: linear-gradient(to top, rgba(0,0,0,.18), transparent 55%);
}

.media__img{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: var(--fit);
  object-position: var(--pos);
  padding: var(--pad);
  box-sizing: border-box;
  transform: translateZ(0);
}

.media--card{ aspect-ratio: 4 / 3; border-radius: 16px; }
.media--featurepanel{ border-radius: 0; border: 0; box-shadow: none; height: 320px; }
.media--hero{ height: clamp(220px, 38vw, 520px); border-radius: 18px; --pos: 50% 25%; }

/* ======================================================
   Learn hero
   ====================================================== */

.learn-hero{ padding: 4px 2px 6px; }

/* ======================================================
   React-like Insights layout
   ====================================================== */

.insights{ margin-top: 26px; }

.insights-featured{
  display: grid;
  grid-template-columns: 6fr 6fr;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.08);
  border-radius: calc(var(--radius) + 10px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.insights-featured-body{
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.insights-featured-title{
  margin: 0;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.insights-featured-desc{
  margin: 0;
  color: rgba(255,255,255,.80);
  line-height: 1.65;
  max-width: 60ch;
}

/* 4-up grid desktop */
.insights-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.insights-card{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 55px rgba(0,0,0,.22);
}

.insights-card-body{ padding: 12px 14px 14px; }

.insights-card-title{
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.insights-card-desc{
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,.76);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hover polish */
@media (prefers-reduced-motion: no-preference){
  .insights-card:hover .media__img,
  .insights-featured:hover .media__img{
    transform: scale(1.02);
    transition: transform .55s ease;
  }
}

/* Focus */
.insights-featured,
.insights-card{ text-decoration: none !important; }

.insights-featured:focus-visible,
.insights-card:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

/* ======================================================
   Article polish (layout + prose + TOC)
   ====================================================== */

.article-hero{
  max-width: 1100px;
  margin: 0 auto 18px;
  padding: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  border-radius: calc(var(--radius) + 10px);
  box-shadow: var(--shadow);
}

.meta-row{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255,255,255,.68);
  font-size: 13px;
  font-weight: 650;
}

.article-layout{
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
}

.article-aside{ position: sticky; top: 14px; }

.toc-card,
.aside-card{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.20);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 12px;
}

.aside-title{
  font-weight: 900;
  letter-spacing: -.01em;
  font-size: 13px;
  color: rgba(255,255,255,.88);
  margin-bottom: 10px;
}

.toc{
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,.70);
}
.toc ul{ margin: 0; padding-left: 16px; }
.toc li{ margin: 6px 0; }
.toc a{
  display: inline-block;
  padding: 6px 8px;
  border-radius: 10px;
  color: rgba(255,255,255,.82);
}
.toc a:hover{
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.95);
}

.prose{
  max-width: 72ch;
  margin: 0 auto;
  padding: 0;
  font-size: 17px;
  line-height: 1.85;
  color: rgba(255,255,255,.88);
}

.prose p{ margin: 14px 0; }
.prose p:first-child{ margin-top: 0; }

.prose h2{
  margin: 34px 0 12px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.prose h3{
  margin: 22px 0 10px;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.prose ul, .prose ol{ margin: 12px 0 16px 22px; padding: 0; }
.prose li{ margin: 6px 0; }

.prose hr{
  border: 0;
  height: 1px;
  background: rgba(255,255,255,.10);
  margin: 28px 0;
}

.prose blockquote{
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 3px solid rgba(14,165,233,.55);
  border-radius: 16px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.80);
}

.prose code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .92em;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.10);
}

.prose pre{
  margin: 18px 0;
  padding: 14px;
  border-radius: 18px;
  overflow:auto;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.10);
}
.prose pre code{ padding:0; border:none; background: transparent; }

.prose a{
  color: rgba(125,211,252,.95);
  text-decoration: underline;
  text-decoration-color: rgba(125,211,252,.35);
  text-underline-offset: 3px;
}
.prose a:hover{
  color: rgba(186,230,253,.98);
  text-decoration-color: rgba(186,230,253,.55);
}

/* ======================================================
   Responsive
   ====================================================== */

@media (max-width: 1024px){
  .insights-grid{ grid-template-columns: repeat(2, 1fr); }
  .article-layout{ grid-template-columns: 1fr; }
  .article-aside{ position: static; order: 2; }
}

@media (max-width: 900px){
  .learn-header-inner{ flex-direction: column; align-items: flex-start; }
  .learn-nav{ flex-wrap: wrap; }
  .insights-featured{ grid-template-columns: 1fr; }
  .media--featurepanel{ height: clamp(200px, 50vw, 280px); }
  .insights-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px){
  .learn-header-inner{ flex-direction: column; align-items: flex-start; }
  .learn-brand-tagline{ display: none; }
  .learn-nav a{ padding: 9px 12px; font-size: 0.9rem; }

  .container{ padding-top: 18px; }
  .shell{ padding: 14px; }
  .article-hero{ padding: 16px; }
  .insights-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 520px){
  .insights-grid{ grid-template-columns: 1fr; }
}
