/* tutorials-newdesign.css
 *
 * Overlays the purple/Instrument Serif design system on top of the unchanged
 * shared style.css for the tutorial library only. Linked AFTER style.css from
 * tutorials.html and every /tutorials/*.html so the cascade wins.
 *
 * Approach mirrors /try.html: redirect the existing CSS tokens (--bg, --text,
 * --signal, --border, etc.) to the new palette so style.css's existing rules
 * pick up the new colors without rewriting them. Component-level overrides
 * use !important where style.css has high-specificity selectors.
 */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #FAFAFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F5F3FF;
  --bg-elev: #F2EFFE;
  --bg-nav: rgba(250, 250, 255, 0.78);
  --text: #1A1530;
  --text-muted: #5D5475;
  --text-dim: #8B829F;
  --signal: #A855F7;
  --signal-glow: rgba(168, 85, 247, 0.22);
  --accent-violet: #A855F7;
  --accent-soft: rgba(168, 85, 247, 0.10);
  --accent-line: rgba(168, 85, 247, 0.30);
  --hot: #F472B6;
  --border: rgba(168, 85, 247, 0.12);
  --border-strong: rgba(168, 85, 247, 0.30);
  --ff-display: 'Instrument Serif', 'EB Garamond', Georgia, serif;
  --grad-aurora: linear-gradient(135deg, #A855F7 0%, #C026D3 50%, #F472B6 100%);
}

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'DM Sans', sans-serif !important;
  background: var(--bg) !important;
  background-image:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(168, 85, 247, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(244, 114, 182, 0.06), transparent 70%) !important;
  background-attachment: fixed !important;
  color: var(--text);
}
::selection { background: var(--signal); color: #fff; }

/* ── Nav re-skin: glass blur + purple L logo + Instrument Serif wordmark ── */
.nav-bar, .site-header {
  background: var(--bg-nav) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border) !important;
}
/* Full-width nav (logo flush-left, link group centered, CTAs flush-right).
 * Uses CSS grid 1fr/auto/1fr so the auto-width center column is mathematically
 * centered in the viewport, regardless of how wide the logo or CTA blocks are. */
.nav-inner {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  gap: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 18px 40px !important;
  height: auto !important;
}
.nav-inner > .nav-logo   { grid-column: 1; justify-self: start; }
.nav-inner > .nav-links  { grid-column: 2; justify-self: center; }
.nav-inner > .nav-burger { grid-column: 3; justify-self: end; }
@media (max-width: 720px) {
  .nav-inner { padding: 14px 20px !important; }
}
.nav-logo {
  color: var(--text) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-family: var(--ff-display) !important;
  font-style: italic !important;
  font-weight: 400 !important;
  font-size: 1.35rem !important;
  letter-spacing: -0.01em;
  text-decoration: none !important;
}
.nav-logo::before {
  content: 'L';
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--signal); color: #fff;
  border-radius: 6px;
  font-family: var(--ff-display);
  font-size: 18px; font-weight: 400; font-style: italic;
  transform: rotate(-4deg);
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.30);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-logo:hover::before {
  transform: rotate(-2deg) translateY(-1px);
  box-shadow: 0 10px 24px rgba(168, 85, 247, 0.42);
}
.nav-links a { color: var(--text-muted) !important; }
.nav-links a:hover { color: var(--text) !important; }
.nav-links a.nav-link-active,
.nav-links a.current {
  color: var(--signal) !important;
}
/* Canonical .nav-cta is a flex wrapper around Sign in + Start downloading;
   purple styling lives on .btn-primary inside it. */
.nav-cta { display: inline-flex; gap: 10px; align-items: center; }

/* Compact nav search — sits between canonical links and the auth CTAs.
 * Visible on every page; tokens carry through both this sheet and the
 * inline marketing-page styles via fallback chain. */
.nav-search-li { list-style: none; display: inline-flex; }
.nav-search {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border, rgba(168, 85, 247, 0.18));
  border-radius: 100px;
  padding: 4px 10px 4px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  max-width: 220px; min-width: 0;
  margin: 0 4px;
}
.nav-search:focus-within {
  border-color: var(--signal, #A855F7);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}
.nav-search svg {
  width: 14px; height: 14px; flex-shrink: 0;
  color: var(--text-muted, #5D5475);
}
.nav-search input {
  border: none; outline: none; background: transparent;
  font-family: 'Geist', -apple-system, sans-serif;
  font-size: 13px;
  color: var(--text, #1A1530);
  padding: 4px 0; width: 130px; min-width: 0;
}
.nav-search input::placeholder {
  color: var(--text-dim, #8B829F);
}
@media (max-width: 980px) {
  .nav-search, .nav-search-li { display: none !important; }
}

/* ── Breadcrumb / category filters (tutorial-specific chrome) ──────────── */
.tutorial-breadcrumb,
.tutorials-breadcrumb {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border) !important;
}
.tutorial-breadcrumb a,
.tutorials-breadcrumb a { color: var(--text-muted) !important; }
.tutorial-breadcrumb a:hover,
.tutorials-breadcrumb a:hover { color: var(--signal) !important; }
.tutorial-breadcrumb a.active,
.tutorials-breadcrumb a.active,
.tutorial-breadcrumb .pill.active,
.tutorials-breadcrumb .pill.active {
  background: var(--accent-soft) !important;
  color: var(--signal) !important;
  border-color: var(--border-strong) !important;
}

/* ── Hero / page-title typography ─────────────────────────────────────── */
.tutorials-hero {
  background:
    radial-gradient(circle at 30% 50%, rgba(168, 85, 247, 0.10) 0%, transparent 50%),
    radial-gradient(circle at 70% 50%, rgba(244, 114, 182, 0.06) 0%, transparent 50%) !important;
  border-bottom: 1px solid var(--border) !important;
}
.tutorials-hero h1,
.tutorial-hero h1,
article.tutorial > header h1,
main h1.tutorial-title {
  font-family: var(--ff-display) !important;
  font-weight: 400 !important;
  letter-spacing: -0.022em !important;
  color: var(--text) !important;
}
.tutorials-eyebrow,
.tutorial-eyebrow {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text-muted) !important;
}

/* ── Tutorial cards on the index page ─────────────────────────────────── */
.tutorial-card,
.tutorials-grid > a,
.tutorials-grid > article {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.tutorial-card:hover,
.tutorials-grid > a:hover,
.tutorials-grid > article:hover {
  border-color: var(--accent-line) !important;
  background: var(--bg-card-hover) !important;
  box-shadow: 0 12px 28px rgba(168, 85, 247, 0.10);
  transform: translateY(-2px);
}
.tutorial-cta {
  color: var(--signal) !important;
}

/* ── Tutorial body content (the article reading surface) ──────────────── */
article.tutorial h2,
article.tutorial h3,
main article h2,
main article h3,
.tutorial-content h2,
.tutorial-content h3 {
  color: var(--text);
}
article.tutorial a,
main article a,
.tutorial-content a {
  color: var(--signal);
}
article.tutorial code:not(pre code),
main article code:not(pre code),
.tutorial-content code:not(pre code) {
  background: var(--accent-soft);
  color: var(--signal);
  border: 1px solid var(--border);
}
article.tutorial blockquote,
main article blockquote,
.tutorial-content blockquote {
  border-left: 3px solid var(--signal);
  background: var(--bg-card);
  color: var(--text-muted);
}

/* Footer styling lives in style.css now — every page renders the canonical
   4-column footer. Don't override here; doing so makes tutorial pages look
   different (e.g. a grey bg) from the rest of the site. */

/* Reduced motion: keep aurora gradient static rather than fixed-attached. */
@media (prefers-reduced-motion: reduce) {
  body { background-attachment: scroll !important; }
}
