/* ============================================================
   Veru365 Tutorial — brand stylesheet
   Derived from the Veru365 app design system:
   navy #182850 (brand) / #0f172a (primary), gold #d4a02a accent,
   slate borders, 0.5rem radius, flat shadcn-style cards,
   system font stack, light theme only.
   ============================================================ */

:root {
  --brand-navy: #182850;
  --brand-navy-deep: #0f1d3d;
  --brand-navy-bright: #3058a0;
  --brand-gold: #d4a02a;
  --brand-gold-bright: #f0c850;
  --brand-gold-deep: #b87818;

  --background: #ffffff;
  --foreground: #020817;
  --primary: #0f172a;
  --primary-foreground: #f8fafc;
  --secondary: #f1f5f9;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --card: #ffffff;

  --success: #15803d;
  --success-subtle: #ecfdf3;
  --warning: #c27803;
  --warning-subtle: #fff8eb;
  --info: #1d63d1;
  --info-subtle: #ebf3ff;
  --destructive: #ef4444;

  --radius: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 10px -2px rgb(15 23 42 / 0.08);

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --content-max: 76rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-navy-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top navigation ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: var(--content-max); margin: 0 auto;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.75rem 1.25rem;
}
.topnav-logo { display: flex; align-items: center; flex-shrink: 0; }
.topnav-logo img { height: 2rem; width: auto; }
.topnav-links { display: flex; gap: 0.25rem; margin-left: auto; flex-wrap: wrap; }
.topnav-links a {
  color: var(--muted-foreground); font-size: 0.875rem; font-weight: 500;
  padding: 0.45rem 0.8rem; border-radius: 0.375rem; white-space: nowrap;
}
.topnav-links a:hover { color: var(--foreground); background: var(--secondary); text-decoration: none; }
.topnav-links a.active { color: var(--brand-navy); background: var(--secondary); font-weight: 600; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--border);
  border-radius: 0.375rem; padding: 0.4rem 0.65rem; font-size: 1rem; cursor: pointer;
  color: var(--foreground);
}

/* ---------- Hero (index) ---------- */
.hero {
  background:
    radial-gradient(ellipse 60% 80% at 80% 10%, rgba(48, 88, 160, 0.45), transparent),
    radial-gradient(ellipse 50% 60% at 15% 90%, rgba(212, 160, 42, 0.16), transparent),
    linear-gradient(160deg, var(--brand-navy-deep) 0%, var(--brand-navy) 55%, #1e3161 100%);
  color: #f8fafc;
  padding: 4.5rem 1.25rem 5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 25%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 25% 60%, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 40% 15%, rgba(240,200,80,0.8), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 70% 70%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 85% 30%, rgba(240,200,80,0.7), transparent),
    radial-gradient(1.5px 1.5px at 92% 80%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 65% 90%, rgba(255,255,255,0.45), transparent);
  pointer-events: none;
}
.hero-inner { max-width: var(--content-max); margin: 0 auto; position: relative; }
.hero-emblem { height: 7rem; width: auto; margin-bottom: 1.75rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; max-width: 46rem; }
.hero h1 .gold { color: var(--brand-gold-bright); }
.hero p.lead { font-size: 1.125rem; color: #cbd5e1; margin-top: 1.25rem; max-width: 42rem; }
.hero-actions { margin-top: 2.25rem; display: flex; gap: 0.9rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: 0.375rem; font-size: 0.9375rem; font-weight: 600;
  padding: 0.7rem 1.4rem; cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  border: none;
}
.btn:hover { transform: scale(1.02); text-decoration: none; }
.btn-gold { background: linear-gradient(135deg, var(--brand-gold-bright), var(--brand-gold)); color: var(--brand-navy-deep); box-shadow: 0 2px 12px rgba(212,160,42,0.35); }
.btn-gold:hover { box-shadow: 0 4px 18px rgba(212,160,42,0.5); }
.btn-outline-light { background: transparent; color: #f8fafc; border: 1px solid rgba(248,250,252,0.4); }
.btn-outline-light:hover { background: rgba(248,250,252,0.1); }
.btn-navy { background: var(--primary); color: var(--primary-foreground); }
.btn-navy:hover { background: #1e293b; }

/* ---------- Layout: docs shell ---------- */
.page { max-width: var(--content-max); margin: 0 auto; padding: 2.5rem 1.25rem 5rem; }
.docs-shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 3rem; }
.docs-sidebar { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow-y: auto; padding-right: 0.5rem; }
.docs-sidebar h4 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted-foreground); font-weight: 600; margin: 1.4rem 0 0.5rem;
}
.docs-sidebar h4:first-child { margin-top: 0; }
.docs-sidebar a {
  display: block; font-size: 0.875rem; color: var(--muted-foreground);
  padding: 0.3rem 0.6rem; border-radius: 0.375rem; border-left: 2px solid transparent;
}
.docs-sidebar a:hover { color: var(--foreground); background: var(--secondary); text-decoration: none; }
.docs-sidebar a.current { color: var(--brand-navy); font-weight: 600; border-left-color: var(--brand-gold); background: var(--secondary); }

/* ---------- Typography ---------- */
.docs-content h1 { font-size: 2.125rem; font-weight: 700; letter-spacing: -0.02em; color: var(--brand-navy); line-height: 1.2; }
.docs-content .subtitle { font-size: 1.0625rem; color: var(--muted-foreground); margin-top: 0.6rem; max-width: 46rem; }
.docs-content h2 {
  font-size: 1.5rem; font-weight: 650; letter-spacing: -0.01em; color: var(--foreground);
  margin: 3rem 0 0.9rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.docs-content h3 { font-size: 1.125rem; font-weight: 600; margin: 1.9rem 0 0.6rem; color: var(--foreground); }
.docs-content p { margin: 0.7rem 0; max-width: 48rem; }
.docs-content ul, .docs-content ol { margin: 0.7rem 0 0.7rem 1.4rem; max-width: 46rem; }
.docs-content li { margin: 0.35rem 0; }
.docs-content code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: 0.25rem; padding: 0.1rem 0.35rem; color: var(--brand-navy);
}
.kbd, .ui {
  font-size: 0.85em; font-weight: 600; color: var(--brand-navy);
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: 0.25rem; padding: 0.05rem 0.4rem; white-space: nowrap;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}
.card h3 { margin-top: 0 !important; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.card-grid .card { display: flex; flex-direction: column; gap: 0.4rem; transition: box-shadow 0.15s ease, transform 0.15s ease; }
a.card { color: inherit; }
a.card:hover { text-decoration: none; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .card-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 0.35rem; }
.card h4 { font-size: 1rem; font-weight: 600; color: var(--brand-navy); }
.card p { font-size: 0.875rem; color: var(--muted-foreground); margin: 0; }
.card .card-link { margin-top: auto; padding-top: 0.6rem; font-size: 0.8125rem; font-weight: 600; color: var(--brand-gold-deep); }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 1.2rem 0; counter-reset: step; max-width: 48rem; padding-left: 0; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 1.4rem 3.1rem; margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.1rem; height: 2.1rem; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-gold-bright), var(--brand-gold));
  color: var(--brand-navy-deep); font-weight: 700; font-size: 0.9375rem;
  box-shadow: 0 1px 4px rgba(212,160,42,0.4);
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 1.02rem; top: 2.4rem; bottom: 0.2rem;
  width: 2px; background: var(--border);
}
.steps > li strong.step-title { display: block; font-weight: 600; color: var(--foreground); margin-bottom: 0.15rem; }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius); border: 1px solid; padding: 0.9rem 1.1rem;
  margin: 1.2rem 0; font-size: 0.9375rem; max-width: 48rem;
}
.callout strong:first-child { display: block; margin-bottom: 0.2rem; }
.callout.tip { background: var(--warning-subtle); border-color: #f5d78e; color: #6b4a05; }
.callout.tip strong:first-child { color: var(--brand-gold-deep); }
.callout.note { background: var(--info-subtle); border-color: #bcd6ff; color: #133a75; }
.callout.note strong:first-child { color: var(--info); }
.callout.success { background: var(--success-subtle); border-color: #a9e5c0; color: #14532d; }
.callout.warn { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th {
  text-align: left; background: var(--secondary); color: var(--brand-navy);
  font-weight: 600; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  border-radius: 9999px; padding: 0.12rem 0.6rem; white-space: nowrap;
}
.badge.gold { background: linear-gradient(135deg, var(--brand-gold-bright), var(--brand-gold)); color: var(--brand-navy-deep); }
.badge.navy { background: var(--brand-navy); color: #f8fafc; }
.badge.green { background: var(--success-subtle); color: var(--success); border: 1px solid #a9e5c0; }
.badge.blue { background: var(--info-subtle); color: var(--info); border: 1px solid #bcd6ff; }
.badge.red { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge.slate { background: var(--secondary); color: var(--muted-foreground); border: 1px solid var(--border); }

/* ---------- Persona chips ---------- */
.persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.persona { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.persona::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.persona.freddy::before { background: linear-gradient(90deg, var(--brand-navy), var(--brand-navy-bright)); }
.persona.harvey::before { background: linear-gradient(90deg, var(--brand-gold-deep), var(--brand-gold-bright)); }
.persona.anna::before { background: linear-gradient(90deg, #7c3aed, #c084fc); }
.persona h4 { font-size: 1.05rem; font-weight: 650; color: var(--brand-navy); margin-bottom: 0.2rem; }
.persona .persona-role { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-gold-deep); margin-bottom: 0.5rem; }
.persona p { font-size: 0.875rem; color: var(--muted-foreground); margin: 0; }

/* ---------- Section band (index) ---------- */
.band { padding: 3.5rem 1.25rem; }
.band.alt { background: #f8fafc; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.band-inner { max-width: var(--content-max); margin: 0 auto; }
.band h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; color: var(--brand-navy); margin-bottom: 0.4rem; }
.band > .band-inner > p.band-lead { color: var(--muted-foreground); max-width: 44rem; margin-bottom: 1rem; }

/* ---------- Footer ---------- */
.footer {
  background: linear-gradient(160deg, var(--brand-navy-deep), var(--brand-navy));
  color: #cbd5e1; padding: 3rem 1.25rem 2.5rem; margin-top: 4rem;
}
.footer-inner { max-width: var(--content-max); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; align-items: flex-start; }
.footer img { height: 2.4rem; width: auto; margin-bottom: 0.9rem; }
.footer .tagline { font-size: 0.9rem; font-style: italic; color: #94a3b8; max-width: 22rem; }
.footer nav { display: flex; flex-direction: column; gap: 0.4rem; }
.footer nav h5 { color: #f8fafc; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.footer nav a { color: #cbd5e1; font-size: 0.875rem; }
.footer nav a:hover { color: var(--brand-gold-bright); }
.footer .fineprint { max-width: var(--content-max); margin: 2.5rem auto 0; padding-top: 1.25rem; border-top: 1px solid rgba(203,213,225,0.2); font-size: 0.8125rem; color: #94a3b8; }

/* ---------- Page-turn footer nav ---------- */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 4rem; }
.pager a {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1.2rem; box-shadow: var(--shadow-sm); color: inherit;
}
.pager a:hover { text-decoration: none; box-shadow: var(--shadow-md); }
.pager .pager-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); }
.pager .pager-title { font-weight: 600; color: var(--brand-navy); }
.pager a.next { text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  .nav-toggle { display: block; }
  .topnav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: #ffffff; border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem 1rem; box-shadow: var(--shadow-md);
  }
  .topnav-links.open { display: flex; }
}
