/* =========================================================
   SDNB — Tech Tutorials
   Light theme · blue primary · cyan accent
   ========================================================= */

:root {
  --c-primary: #2563eb;
  --c-primary-dark: #1d4ed8;
  --c-primary-soft: #dbeafe;
  --c-cyan: #06b6d4;
  --c-cyan-soft: #cffafe;
  --c-bg: #ffffff;
  --c-bg-soft: #f8fafc;
  --c-bg-tint: #eff6ff;
  --c-text: #0f172a;
  --c-muted: #64748b;
  --c-border: #e2e8f0;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 16px 40px rgba(37, 99, 235, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 820px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--c-text);
}
.brand:hover { color: var(--c-text); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-cyan));
  color: #fff;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: .02em; }
.brand-text small { font-size: .72rem; color: var(--c-muted); letter-spacing: .06em; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.main-nav a { color: var(--c-muted); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { color: var(--c-primary); }
.header-cta {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--c-primary);
  color: #fff !important;
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
}
.header-cta:hover { background: var(--c-primary-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--c-text); border-radius: 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 0 84px;
  background: linear-gradient(180deg, var(--c-bg-tint) 0%, var(--c-bg) 100%);
  border-bottom: 1px solid var(--c-border);
}
.hero-inner { position: relative; max-width: 720px; }
.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 20px;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--c-primary), var(--c-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { font-size: 1.15rem; color: var(--c-muted); margin: 0 0 30px; max-width: 620px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-glow {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, .18), transparent 65%);
  pointer-events: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--c-primary); border-color: var(--c-border); }
.btn-ghost:hover { border-color: var(--c-primary); }
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-weight: 600;
}
.btn-back:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* ---------- sections ---------- */
.section { padding: 76px 0; }
.section--alt { background: var(--c-bg-soft); border-top: 1px solid var(--c-border); }
.section-head { margin-bottom: 40px; }
.section-kicker {
  display: inline-block;
  color: var(--c-primary);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-title { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0 0 10px; letter-spacing: -.01em; }
.section-sub { color: var(--c-muted); margin: 0; }

/* ---------- post grid ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 26px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--c-bg-soft); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .post-card-media img { transform: scale(1.04); }
.card-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--c-primary), var(--c-cyan));
  color: #fff;
}
.fallback-mark { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: .04em; }
.post-card-body { display: flex; flex-direction: column; gap: 8px; padding: 20px; flex: 1; }
.post-card-cat {
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--c-primary);
  background: var(--c-bg-tint);
  padding: 3px 10px;
  border-radius: 999px;
}
.post-card-title { font-family: var(--font-display); font-size: 1.16rem; line-height: 1.3; margin: 4px 0 2px; }
.post-card-title a { color: var(--c-text); }
.post-card-title a:hover { color: var(--c-primary); }
.post-card-excerpt { color: var(--c-muted); font-size: .92rem; margin: 0; flex: 1; }
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
  font-size: .85rem;
  color: var(--c-muted);
}
.post-card-link { font-weight: 600; color: var(--c-primary); }
.post-card-link:hover { color: var(--c-primary-dark); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.about-card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 26px; }
.about-card .ico { font-size: 1.8rem; }
.about-card h3 { font-family: var(--font-display); margin: 12px 0 8px; }
.about-card p { color: var(--c-muted); margin: 0; font-size: .95rem; }

/* ---------- article ---------- */
.article-main { padding: 40px 0 80px; }
.breadcrumb { font-size: .85rem; color: var(--c-muted); margin-bottom: 22px; }
.breadcrumb a { color: var(--c-muted); }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb .sep { margin: 0 6px; color: var(--c-border); }
.post-header { margin-bottom: 24px; }
.post-category {
  display: inline-block;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--c-primary);
  background: var(--c-bg-tint);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.post-header h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; }
.post-meta { display: flex; align-items: center; gap: 8px; color: var(--c-muted); font-size: .92rem; }
.meta-author { color: var(--c-text); font-weight: 600; }
.meta-sep { color: var(--c-border); }
.post-hero { margin: 0 0 30px; }
.post-hero img { width: 100%; border-radius: var(--radius); border: 1px solid var(--c-border); }

.post-content { font-size: 1.05rem; }
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-display);
  color: var(--c-text);
  line-height: 1.25;
  margin: 1.8em 0 .6em;
  letter-spacing: -.01em;
}
.post-content h2 { font-size: 1.6rem; padding-bottom: .4em; border-bottom: 1px solid var(--c-border); }
.post-content h3 { font-size: 1.3rem; }
.post-content h4 { font-size: 1.12rem; }
.post-content p { margin: 0 0 1.1em; }
.post-content ul,
.post-content ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.post-content li { margin-bottom: .5em; }
.post-content li::marker { color: var(--c-primary); font-weight: 600; }
.post-content strong { color: var(--c-text); }
.post-content a { text-decoration: underline; text-underline-offset: 2px; }
.post-content img { border-radius: 10px; margin: 1.4em auto; }
.post-content figure { margin: 1.4em 0; }

.post-content code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 1px 6px;
  color: #0e7490;
}
.post-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.4em 0;
  line-height: 1.5;
}
.post-content pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: .86rem;
  white-space: pre;
  font-family: var(--font-mono);
}

.table-wrap { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--c-border); border-radius: 12px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table-wrap th, .table-wrap td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.table-wrap thead th { background: var(--c-bg-tint); color: var(--c-text); font-weight: 600; }
.table-wrap tbody tr:last-child td { border-bottom: none; }

/* ---------- FAQ ---------- */
.faq { margin: 1.4em 0 1.8em; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--c-border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  list-style: none;
  color: var(--c-text);
  background: #fff;
  transition: background .15s ease;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+';
  margin-left: auto;
  font-size: 1.3rem;
  color: var(--c-primary);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.faq-item[open] .faq-q { background: var(--c-bg-tint); }
.faq-item[open] .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 4px 18px 18px; color: var(--c-muted); }
.faq-a p { margin: .6em 0 0; }
.faq-a p:first-child { margin-top: 0; }

/* ---------- post footer ---------- */
.post-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--c-border); }

/* ---------- footer ---------- */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 60px 0 0; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 44px; }
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand p { margin: 0; font-size: .95rem; max-width: 320px; }
.footer-col h4 { color: #fff; font-family: var(--font-display); font-size: .95rem; margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #cbd5e1; font-size: .92rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .85rem;
  color: #94a3b8;
}

/* ---------- to top ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--c-primary);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .25s ease;
  z-index: 40;
}
.to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--c-primary-dark); }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
[data-reveal].revealed { opacity: 1; transform: translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .header-cta { display: none; }
  .main-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--c-border);
    padding: 8px 20px 16px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--c-border); }
  .main-nav a:last-child { border-bottom: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
