@charset "UTF-8";

/*
 * Shared finishing layer for the Medux tutorial library.
 * The original page layouts stay intact; this file normalizes the visual
 * details that had drifted between the hand-authored page variants.
 */

:root {
  --medux-canvas: #f8fafc;
  --medux-surface: #ffffff;
  --medux-ink: #0f172a;
  --medux-copy: #475569;
  --medux-muted: #64748b;
  --medux-line: #e2e8f0;
  --medux-brand: #635bff;
  --medux-brand-strong: #4f46e5;
  --medux-purple: #7c3cff;
  --medux-cyan: #38bdf8;
  --medux-ring: rgba(99, 91, 255, .28);
  --medux-card-shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 12px 34px rgba(79, 70, 229, .075);
  --medux-raised-shadow: 0 22px 60px rgba(79, 70, 229, .14);
  --medux-radius: 24px;
  --medux-sans: Inter, "SF Pro Text", "SF Pro Display", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --medux-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;

  /* Backwards-compatible aliases used by the existing page variants. */
  --ink: var(--medux-ink);
  --foreground: var(--medux-ink);
  --muted: var(--medux-muted);
  --muted-foreground: var(--medux-copy);
  --line: var(--medux-line);
  --border: var(--medux-line);
  --brand: var(--medux-brand);
  --primary: var(--medux-brand);
  --brand-2: var(--medux-brand-strong);
  --primary-2: var(--medux-purple);
  --brand-3: var(--medux-cyan);
  --cyan: var(--medux-cyan);
  --ring: var(--medux-ring);
  --shadow: var(--medux-raised-shadow);
  --shadow-sm: var(--medux-card-shadow);
  --shadow-md: var(--medux-raised-shadow);
  --soft-shadow: var(--medux-card-shadow);
}

html {
  color-scheme: light;
  scroll-padding-top: 88px;
}

body.tutorial-page,
body.tutorial-index {
  color: var(--medux-ink);
  background-color: var(--medux-canvas);
  font-kerning: normal;
  font-synthesis-weight: none;
  font-family: var(--medux-sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.tutorial-page::before,
body.tutorial-index::before {
  position: fixed;
  inset: 0;
  z-index: -20;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(99, 91, 255, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 91, 255, .026) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 44rem);
}

::selection {
  color: #1e1b4b;
  background: rgba(167, 139, 250, .34);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 15px;
  border: 1px solid rgba(99, 91, 255, .28);
  border-radius: 12px;
  color: #fff;
  background: #312e81;
  box-shadow: 0 12px 30px rgba(49, 46, 129, .28);
  font-size: 14px;
  font-weight: 750;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, summary, video, [tabindex]):focus-visible {
  outline: 3px solid var(--medux-ring);
  outline-offset: 3px;
}

:where(h1, h2, h3, [id]):target {
  scroll-margin-top: 92px;
}

.tutorial-page :where(.site-nav, .nav),
.tutorial-index .site-header {
  border-bottom-color: rgba(226, 232, 240, .86);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 9px 30px rgba(15, 23, 42, .035);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
}

.tutorial-page :where(.nav-inner, .navin),
.tutorial-index .header-row {
  min-height: 72px;
}

.tutorial-page :where(.logo, .brand),
.tutorial-index .brand {
  font-weight: 800;
  letter-spacing: -.04em;
}

.tutorial-page :where(.logo-img, .logo-mark, .mark),
.tutorial-index .brand-icon {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(99, 91, 255, .22);
}

.tutorial-page :where(.nav-cta, .home, .cta),
.tutorial-index .header-action {
  border-color: rgba(99, 91, 255, .2);
  color: var(--medux-brand-strong);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 7px 22px rgba(79, 70, 229, .08);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .tutorial-page :where(.nav-cta, .home, .cta):hover,
  .tutorial-index .header-action:hover {
    border-color: rgba(99, 91, 255, .34);
    color: #4338ca;
    background: #faf9ff;
    box-shadow: 0 12px 28px rgba(79, 70, 229, .12);
    transform: translateY(-1px);
  }
}

:where(.tutorial-page, .tutorial-index) h1,
:where(.tutorial-page, .tutorial-index) h2,
:where(.tutorial-page, .tutorial-index) h3 {
  color: var(--medux-ink);
  text-wrap: balance;
  font-family: var(--medux-sans);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

:where(.tutorial-page, .tutorial-index) h1 {
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.04;
}

:where(.tutorial-page, .tutorial-index) h2 {
  font-weight: 780;
  letter-spacing: -.045em;
  line-height: 1.12;
}

:where(.tutorial-page, .tutorial-index) h3 {
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1.22;
}

:where(.tutorial-page, .tutorial-index) :where(p, li, figcaption) {
  text-wrap: pretty;
}

:where(.tutorial-page, .tutorial-index) :where(code, kbd, pre) {
  font-family: var(--medux-mono);
  font-variant-ligatures: none;
}

.tutorial-page :where(.lead, .muted),
.tutorial-index :where(.hero-intro p, .section-head p) {
  color: var(--medux-copy);
}

.tutorial-page .hero,
.tutorial-index .hero-intro {
  isolation: isolate;
}

.tutorial-page .hero h1,
.tutorial-index .hero-intro h1 {
  max-width: 17ch;
  background: linear-gradient(118deg, #0f172a 8%, #312e81 58%, #635bff 108%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tutorial-page :where(.hero-card, .card, .toc, .block, .prep, .mini, .flow, .check),
.tutorial-index :where(.module-card, .reading-card, .tutorial-card, .faq-card) {
  border-color: rgba(226, 232, 240, .92);
  background-color: rgba(255, 255, 255, .93);
  box-shadow: var(--medux-card-shadow);
}

.tutorial-page :where(.block, .hero-card, .toc),
.tutorial-index :where(.module-card, .reading-card, .tutorial-card, .faq-card) {
  border-radius: var(--medux-radius);
}

.tutorial-index :where(.module-card, .reading-card, .tutorial-card) {
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .tutorial-index :where(.module-card, .reading-card, .tutorial-card):hover {
    border-color: rgba(99, 91, 255, .24);
    box-shadow: var(--medux-raised-shadow);
    transform: translateY(-3px);
  }

  .tutorial-index .tutorial-card:hover .thumb img {
    transform: scale(1.018);
  }
}

.tutorial-index .thumb {
  overflow: hidden;
  background: linear-gradient(145deg, #f5f3ff, #eff6ff);
}

.tutorial-index .thumb.generated-cover {
  background: linear-gradient(135deg, var(--cover-a), var(--cover-b));
}

.tutorial-index .thumb img {
  transition: transform 320ms cubic-bezier(.2, .8, .2, 1);
}

:where(.tutorial-page, .tutorial-index) img,
:where(.tutorial-page, .tutorial-index) video {
  max-width: 100%;
}

.tutorial-page :where(figure, .hero-card, .result-card, .result-demo-card, .media-showcase-card, .compare-panel, .result-video-card) {
  border-color: rgba(226, 232, 240, .94);
  box-shadow: var(--medux-card-shadow);
}

.tutorial-page :where(figure, .hero-card, .result-card, .result-demo-card, .media-showcase-card, .compare-panel, .result-video-card) img,
.tutorial-page :where(figure, .hero-card, .result-card, .result-demo-card, .media-showcase-card, .compare-panel, .result-video-card) video {
  background: linear-gradient(145deg, #f8fafc, #f3f1ff);
}

.tutorial-page :where(figcaption, .caption, .cap) {
  color: var(--medux-muted);
  background: rgba(255, 255, 255, .96);
}

.tutorial-page :where(.chip, .meta-pill) {
  border-color: rgba(99, 91, 255, .16);
  color: #4c4a70;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 5px 16px rgba(79, 70, 229, .045);
}

.tutorial-page :where(.step, .block, section) :where(p, li) a:not([class]),
.tutorial-page .related a,
.tutorial-page .related-tutorial-links a {
  color: var(--medux-brand-strong);
  text-decoration: underline;
  text-decoration-color: rgba(79, 70, 229, .34);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

.tutorial-page :where(.step, .block, section) :where(p, li) a:not([class]):hover,
.tutorial-page .related a:hover,
.tutorial-page .related-tutorial-links a:hover {
  color: #3730a3;
  text-decoration-color: currentColor;
}

.tutorial-page .num {
  border: 1px solid rgba(255, 255, 255, .6);
  background: linear-gradient(145deg, #7c3cff 0%, #635bff 50%, #38bdf8 120%);
  box-shadow: 0 12px 28px rgba(99, 91, 255, .25);
}

.tutorial-page pre {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  scrollbar-color: rgba(148, 163, 184, .58) transparent;
  scrollbar-width: thin;
}

.tutorial-page pre code {
  overflow-wrap: normal;
  word-break: normal;
}

.tutorial-page pre::-webkit-scrollbar {
  height: 8px;
}

.tutorial-page pre::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: rgba(148, 163, 184, .5);
  background-clip: padding-box;
}

.tutorial-page :not(pre) > code {
  border: 1px solid rgba(99, 91, 255, .12);
  color: #5539d6;
  background: #f5f3ff;
}

.tutorial-page :where(.callout, .note) {
  border-color: rgba(99, 91, 255, .18);
  border-left-color: var(--medux-brand);
  background: linear-gradient(135deg, #f7f5ff, #fff 72%);
}

.tutorial-page :where(.publish, .publish-note, .final) {
  border: 1px solid rgba(255, 255, 255, .14);
  background:
    radial-gradient(circle at 92% 0, rgba(56, 189, 248, .28), transparent 36%),
    radial-gradient(circle at 6% 0, rgba(124, 60, 255, .32), transparent 40%),
    linear-gradient(135deg, #101424 0%, #24265d 52%, #4f5eff 112%);
  box-shadow: 0 26px 70px rgba(42, 56, 150, .21);
}

/* Keep checklist tiles legible inside the dark publishing panels. */
.tutorial-page :is(.publish, .publish-note, .final) :is(.checklist, .checks) > * {
  border: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .94);
  background: rgba(15, 23, 42, .24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.tutorial-page :is(.publish, .publish-note, .final) :is(.checklist, .checks) > * :where(strong, b) {
  color: #ffffff;
}

.tutorial-page .result-link {
  display: inline-flex;
  width: fit-content;
  margin: 4px 0 2px;
  padding: 8px 12px;
  border: 1px solid rgba(99, 91, 255, .17);
  border-radius: 999px;
  color: #4f46e5;
  background: #f7f5ff;
  font-size: 13px;
  font-weight: 700;
}

.tutorial-page .search-intents > :where(.wrap, .container) > .block {
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(247, 245, 255, .88));
}

.tutorial-index .card-link,
.tutorial-index .header-action {
  font-weight: 720;
}

.tutorial-index .tag,
.tutorial-index .badge {
  border-color: rgba(99, 91, 255, .15);
  background: rgba(255, 255, 255, .84);
}

.tutorial-index .footer,
.tutorial-page .footer {
  color: var(--medux-copy);
}

@media (max-width: 920px) {
  .tutorial-page :where(.nav-inner, .navin),
  .tutorial-index .header-row {
    min-height: 66px;
  }

  .tutorial-page .hero h1,
  .tutorial-index .hero-intro h1 {
    max-width: 19ch;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 76px;
  }

  .tutorial-page :where(.site-nav, .nav),
  .tutorial-index .site-header {
    position: sticky;
  }

  .tutorial-page :where(.nav-inner, .navin),
  .tutorial-index .header-row {
    min-height: 60px;
  }

  .tutorial-page :where(.logo-img, .logo-mark, .mark),
  .tutorial-index .brand-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }

  .tutorial-page :where(.block, .hero-card, .toc),
  .tutorial-index :where(.module-card, .reading-card, .tutorial-card, .faq-card) {
    border-radius: 20px;
  }

  .tutorial-page .step {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
  }

  .tutorial-page .num {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.api-reference-links {
  padding: 28px 0;
}

.search-intent {
  padding: 28px 0 0;
}

.search-intent-panel {
  padding: 28px 32px;
  border: 1px solid var(--medux-line);
  border-radius: var(--medux-radius);
  background: rgba(255, 255, 255, .93);
  box-shadow: var(--medux-card-shadow);
}

.search-intent-kicker {
  margin: 0 0 8px;
  color: var(--medux-brand-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.search-intent-panel h2 {
  max-width: 28ch;
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 38px);
}

.search-intent-panel > p:not(.search-intent-kicker, .search-topics) {
  max-width: 76ch;
  color: var(--medux-copy);
  font-size: 17px;
  line-height: 1.72;
}

.search-intent-panel details {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--medux-line);
}

.search-intent-panel summary {
  cursor: pointer;
  color: var(--medux-ink);
  font-weight: 740;
}

.search-intent-panel details p {
  margin: 10px 0 0;
  color: var(--medux-copy);
}

.search-topics {
  margin: 18px 0 0;
  color: var(--medux-muted);
  font-size: 13px;
}

.api-reference-panel {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 28px;
  padding: 30px 32px;
  border: 1px solid rgba(99, 91, 255, .16);
  border-radius: var(--medux-radius);
  background: linear-gradient(135deg, rgba(248, 247, 255, .98), rgba(255, 255, 255, .98));
  box-shadow: var(--medux-card-shadow);
}

.api-reference-kicker {
  margin: 0 0 8px;
  color: var(--medux-brand-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.api-reference-panel h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 2.6vw, 34px);
}

.api-reference-intro {
  margin: 0;
  color: var(--medux-copy);
}

.api-reference-panel ul {
  display: grid;
  align-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.api-reference-panel li {
  padding: 14px 16px;
  border: 1px solid var(--medux-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
}

.api-reference-panel li a {
  display: inline-block;
  color: var(--medux-brand-strong);
  font-weight: 780;
  text-decoration: underline;
  text-decoration-color: rgba(79, 70, 229, .3);
  text-underline-offset: 3px;
}

.api-reference-panel li span {
  display: block;
  margin-top: 4px;
  color: var(--medux-copy);
  font-size: 14px;
  line-height: 1.55;
}

.seo-agent-workflow {
  padding: 28px 0 6px;
}

.agent-workflow-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 38px);
  border-color: rgba(99, 91, 255, .18) !important;
  background:
    radial-gradient(circle at 100% 0, rgba(56, 189, 248, .11), transparent 34%),
    linear-gradient(135deg, rgba(248, 247, 255, .98), rgba(255, 255, 255, .98)) !important;
}

.agent-workflow-panel::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--medux-purple), var(--medux-brand), var(--medux-cyan));
}

.agent-workflow-kicker {
  margin: 0 0 10px;
  color: var(--medux-brand-strong);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.agent-workflow-panel > h2 {
  max-width: 21ch;
  margin-bottom: 14px;
}

.agent-workflow-panel > p:not(.agent-workflow-kicker, .agent-workflow-distinction) {
  max-width: 82ch;
  color: var(--medux-copy);
  font-size: 17px;
  line-height: 1.72;
}

.agent-workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 16px;
  margin-top: 22px;
}

.agent-workflow-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(226, 232, 240, .96);
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
}

.agent-workflow-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.agent-workflow-card h3:not(:first-child) {
  margin-top: 20px;
}

.agent-workflow-card p {
  margin: 0;
  color: var(--medux-copy);
}

.agent-workflow-card pre {
  margin: 14px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agent-workflow-distinction {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(99, 91, 255, .18);
  border-radius: 15px;
  color: #373064;
  background: rgba(238, 242, 255, .78);
}

@media (max-width: 760px) {
  .search-intent-panel,
  .api-reference-panel {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px;
  }

  .agent-workflow-grid {
    grid-template-columns: 1fr;
  }

  .agent-workflow-card {
    padding: 17px;
  }
}

@media print {
  .tutorial-page :where(.site-nav, .nav),
  .tutorial-index .site-header,
  .skip-link {
    display: none !important;
  }

  body.tutorial-page,
  body.tutorial-index {
    background: #fff !important;
  }

  :where(.tutorial-page, .tutorial-index) * {
    box-shadow: none !important;
  }
}
