/* =========================================================
   Devmaniac Docs — Grandmaster Static CSS
   Path: /assets/styles.css
   ========================================================= */

/* -----------------------------
   Design Tokens
----------------------------- */

:root {
  color-scheme: dark;

  --bg: #070707;
  --bg-soft: #0b0b0d;
  --bg-elevated: #111113;
  --bg-card: rgba(255, 255, 255, 0.035);

  --text: #fafafa;
  --text-soft: #e4e4e7;
  --muted: #a1a1aa;
  --muted-2: #71717a;

  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.15);

  --orange: #f97316;
  --orange-strong: #fb923c;
  --orange-soft: rgba(249, 115, 22, 0.14);
  --orange-border: rgba(249, 115, 22, 0.38);

  --red: #ef4444;
  --green: #22c55e;
  --blue: #38bdf8;
  --purple: #a78bfa;

  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.42);
  --shadow-orange: 0 0 40px rgba(249, 115, 22, 0.12);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --container: 1180px;
  --article: 780px;

  --font-sans:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", sans-serif;

  --font-mono:
    "JetBrains Mono", "Fira Code", Consolas, "SFMono-Regular",
    Menlo, Monaco, "Liberation Mono", monospace;
}

/* -----------------------------
   Base Reset
----------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(249, 115, 22, 0.20), transparent 32rem),
    radial-gradient(circle at 90% 8%, rgba(251, 146, 60, 0.10), transparent 28rem),
    linear-gradient(180deg, #090909 0%, #070707 46%, #050505 100%);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

img,
svg,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  color: #111;
  background: var(--orange-strong);
}

/* -----------------------------
   Header / Navbar
----------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(7, 7, 7, 0.90), rgba(7, 7, 7, 0.72));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.navbar {
  width: min(var(--container), calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  letter-spacing: -0.04em;
  font-size: 18px;
  color: var(--text);
}

.brand::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 0 30px rgba(249, 115, 22, 0.85);
}

.brand:hover {
  color: var(--orange-strong);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 999px;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

/* -----------------------------
   Docs Layout
----------------------------- */

.doc-layout {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 56px;
  padding: 48px 0 88px;
}

.sidebar {
  position: sticky;
  top: 104px;
  align-self: start;
  max-height: calc(100vh - 128px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  box-shadow: var(--shadow-soft);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.sidebar-title {
  margin: 18px 0 8px;
  padding: 0 10px;
  color: var(--orange-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-title:first-child {
  margin-top: 0;
}

.sidebar a {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.sidebar a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  transform: translateX(2px);
}

.sidebar a.active {
  color: var(--orange-strong);
  background: var(--orange-soft);
  border-color: var(--orange-border);
}

/* -----------------------------
   Article Content
----------------------------- */

.doc-content {
  width: min(100%, var(--article));
  padding-bottom: 40px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--orange-strong);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.doc-content h1 {
  margin: 0 0 24px;
  max-width: 860px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.94;
  letter-spacing: -0.075em;
  font-weight: 900;
}

.doc-content .lead {
  color: var(--text-soft);
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.65;
  margin: 0 0 28px;
}

.doc-content h2 {
  position: relative;
  margin: 56px 0 16px;
  padding-top: 4px;
  color: var(--text);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-weight: 850;
}

.doc-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: -14px;
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), transparent);
}

.doc-content h3 {
  margin: 34px 0 10px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.doc-content p {
  margin: 16px 0;
  color: var(--muted);
  font-size: 16.5px;
}

.doc-content strong {
  color: var(--text);
  font-weight: 800;
}

.doc-content em {
  color: var(--text-soft);
}

.doc-content a {
  color: var(--orange-strong);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(249, 115, 22, 0.35);
  text-underline-offset: 4px;
}

.doc-content a:hover {
  text-decoration-color: var(--orange-strong);
}

.doc-content ul,
.doc-content ol {
  margin: 18px 0 26px;
  padding-left: 22px;
  color: var(--muted);
}

.doc-content li {
  margin: 10px 0;
  padding-left: 4px;
}

.doc-content li::marker {
  color: var(--orange);
}

.doc-content blockquote {
  margin: 28px 0;
  padding: 20px 22px;
  border: 1px solid var(--orange-border);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.14), rgba(255, 255, 255, 0.025));
  color: var(--text-soft);
  box-shadow: var(--shadow-orange);
}

.doc-content blockquote p,
.doc-content blockquote {
  font-size: 16.5px;
}

.doc-content hr {
  border: 0;
  height: 1px;
  margin: 52px 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* -----------------------------
   Code / Pre
----------------------------- */

code {
  font-family: var(--font-mono);
  color: #fed7aa;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.18);
  padding: 0.18em 0.38em;
  border-radius: 7px;
  font-size: 0.88em;
}

pre {
  margin: 26px 0;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    #09090b;
  box-shadow: var(--shadow-soft);
}

pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e4e4e7;
  font-size: 13.5px;
  line-height: 1.75;
}

/* -----------------------------
   Cards / Grids / Home Sections
----------------------------- */

.hero {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 84px 0 54px;
}

.hero .eyebrow {
  margin-bottom: 16px;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(46px, 8vw, 92px);
  line-height: 0.9;
  letter-spacing: -0.08em;
  font-weight: 950;
}

.hero p {
  max-width: 720px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
}

.docs-grid {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 96px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  box-shadow: var(--shadow-soft);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.card::after {
  content: "";
  position: absolute;
  inset: auto -30% -50% auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.10);
  filter: blur(16px);
  transition: opacity 180ms ease, transform 180ms ease;
  opacity: 0;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--orange-border);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.10), rgba(255, 255, 255, 0.025));
}

.card:hover::after {
  opacity: 1;
  transform: scale(1.08);
}

.card h2,
.card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
}

.card .card-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--orange-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* -----------------------------
   Buttons / CTA
----------------------------- */

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 800;
  font-size: 14px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.075);
}

.btn-primary {
  border-color: rgba(249, 115, 22, 0.65);
  background: linear-gradient(135deg, var(--orange), #ea580c);
  color: #111;
  box-shadow: 0 14px 38px rgba(249, 115, 22, 0.20);
}

.btn-primary:hover {
  border-color: var(--orange-strong);
  background: linear-gradient(135deg, #fb923c, #f97316);
}

/* -----------------------------
   Next Page Navigation
----------------------------- */

.next-page {
  margin-top: 64px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.10), rgba(255, 255, 255, 0.025));
}

.next-page span {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.next-page a {
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.next-page a:hover {
  color: var(--orange-strong);
}

/* -----------------------------
   Tables
----------------------------- */

table {
  width: 100%;
  margin: 28px 0;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.045);
}

td {
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

/* -----------------------------
   Callouts
----------------------------- */

.callout {
  margin: 28px 0;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.callout p {
  margin: 0;
}

.callout.info {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.callout.success {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.callout.warning {
  border-color: rgba(249, 115, 22, 0.42);
  background: rgba(249, 115, 22, 0.10);
}

.callout.danger {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.08);
}

/* -----------------------------
   Footer
----------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

/* -----------------------------
   Utility Classes
----------------------------- */

.muted {
  color: var(--muted);
}

.text-orange {
  color: var(--orange-strong);
}

.max-article {
  max-width: var(--article);
}

.hide {
  display: none !important;
}

/* -----------------------------
   Responsive
----------------------------- */

@media (max-width: 980px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 28px;
  }

  .sidebar {
    position: relative;
    top: auto;
    max-height: none;
  }

  .doc-content {
    width: 100%;
  }

  .docs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .navbar {
    width: min(100% - 28px, var(--container));
    min-height: auto;
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    gap: 4px;
  }

  .nav-links a {
    padding: 8px 10px;
    font-size: 13px;
  }

  .doc-layout,
  .hero,
  .docs-grid {
    width: min(100% - 28px, var(--container));
  }

  .doc-layout {
    padding-bottom: 64px;
  }

  .doc-content h1 {
    font-size: clamp(40px, 14vw, 58px);
  }

  .doc-content h2 {
    margin-top: 46px;
  }

  .doc-content p,
  .doc-content li {
    font-size: 16px;
  }

  .hero {
    padding-top: 52px;
  }

  .hero h1 {
    font-size: clamp(44px, 15vw, 66px);
  }

  .card {
    min-height: auto;
    padding: 22px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .sidebar {
    padding: 14px;
    border-radius: 18px;
  }

  .doc-content blockquote,
  .next-page,
  .callout {
    padding: 18px;
  }

  .doc-content h1 {
    letter-spacing: -0.06em;
  }
}

/* -----------------------------
   Reduced Motion
----------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}