/* ==============================================================
   CROWNIGO LABORATORIES — PRODUCT PAGES
   Self-contained. These pages deliberately share no stylesheet
   with the personal site, so they carry none of its branding.
   Loaded alone: /styles/apps.css
============================================================== */

/* --- Tokens ----------------------------------------------------- */
:root {
  --bg: #FDFCFB;
  --surface: #FFFFFF;
  --surface-2: #F7F6F4;
  --text-main: #1C1C1E;
  --text-muted: #58585D;
  --text-light: #8E8E93;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #4F46E5;
  --accent-secondary: #7C3AED;
  --accent-glow: rgba(79, 70, 229, 0.12);

  --radius: 20px;
  --max-w: 1080px;
  --nav-height: 68px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 12px 24px -6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px -6px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
  --bg: #0F0F13;
  --surface: #1A1A1E;
  --surface-2: #232329;
  --text-main: #F5F5F7;
  --text-muted: #B8B8BC;
  --text-light: #85858A;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #8B83FF;
  --accent-secondary: #A78BFA;
  --accent-glow: rgba(139, 131, 255, 0.16);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 24px -6px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px -6px rgba(0, 0, 0, 0.45);
}

/* --- Base ------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  background: var(--bg);
  color: var(--text-main);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-height);
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

p {
  margin: 0 0 1.4em;
  color: var(--text-muted);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==============================================================
   NAVIGATION
============================================================== */
.vq-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg); /* fallback for browsers without color-mix */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--line);
}

.vq-nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand ---------------------------------------------------------- */
.vq-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.vq-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  box-shadow: 0 4px 12px -3px var(--accent-glow);
  transition: transform 0.3s var(--ease);
}

.vq-brand:hover .vq-brand-mark {
  transform: translateY(-1px) scale(1.04);
}

.vq-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.vq-brand-text strong {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.vq-brand-text small {
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Links ---------------------------------------------------------- */
.vq-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.vq-links a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.vq-links a:hover {
  color: var(--text-main);
  background: var(--surface-2);
}

.vq-links a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Actions -------------------------------------------------------- */
.vq-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vq-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.vq-icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Hamburger ------------------------------------------------------ */
.vq-burger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.vq-burger .bar {
  display: block;
  width: 16px;
  height: 2px;
  margin: 0 auto;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.28s var(--ease), opacity 0.2s ease;
}

.vq-burger .bar + .bar {
  margin-top: 4px;
}

.vq-burger.active .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.vq-burger.active .bar:nth-child(2) {
  opacity: 0;
}

.vq-burger.active .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile nav ----------------------------------------------------- */
@media (max-width: 760px) {
  .vq-burger {
    display: block;
  }

  .vq-brand-text small {
    display: none;
  }

  .vq-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s var(--ease), visibility 0.22s;
  }

  .vq-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .vq-links a {
    padding: 12px 14px;
    font-size: 0.95rem;
  }
}

/* ==============================================================
   PAGE LAYOUT
============================================================== */
.bx-main {
  padding: 52px 0 32px;
}

.bx-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 26px;
}

.bx-breadcrumb a:hover {
  color: var(--accent);
}

.bx-breadcrumb .sep {
  opacity: 0.5;
}

.bx-breadcrumb [aria-current="page"] {
  color: var(--text-muted);
}

.bx-head {
  max-width: 760px;
  margin-bottom: 40px;
}

.bx-head h1 {
  font-size: 2.1rem;
  margin-bottom: 14px;
}

.bx-lead {
  font-size: 1.08rem;
  color: var(--text-muted);
}

.bx-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--text-light);
}

.bx-meta-line span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bx-section {
  margin-bottom: 24px;
}

.bx-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.bx-card > h2 {
  font-size: 1.25rem;
  margin-bottom: 6px;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

/* Pill ----------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

/* Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -4px var(--accent-glow);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text-main);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- App hero --------------------------------------------------- */
.bx-app-hero {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.bx-app-icon {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  box-shadow: 0 12px 28px -8px var(--accent-glow);
}

/* --- Badges ----------------------------------------------------- */
.bx-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bx-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}

.bx-badge i {
  font-size: 0.72rem;
  opacity: 0.8;
}

.bx-badge-accent {
  background: var(--accent-glow);
  border-color: transparent;
  color: var(--accent);
}

.bx-badge-ok {
  background: rgba(16, 185, 129, 0.1);
  border-color: transparent;
  color: #047857;
}

body.dark-mode .bx-badge-ok {
  color: #34D399;
  background: rgba(52, 211, 153, 0.13);
}

/* --- Definition rows -------------------------------------------- */
.bx-dl {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.bx-dl > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 720px) {
  .bx-dl > div {
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: baseline;
  }
}

.bx-dl dt {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.bx-dl dd {
  font-size: 0.98rem;
  color: var(--text-main);
  word-break: break-word;
}

/* --- Features --------------------------------------------------- */
.bx-features {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

@media (min-width: 700px) {
  .bx-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bx-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.bx-feature-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.9rem;
}

.bx-feature h4 {
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.bx-feature p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* --- Steps ------------------------------------------------------ */
.bx-steps {
  counter-reset: bxstep;
  list-style: none;
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

.bx-steps li {
  counter-increment: bxstep;
  position: relative;
  padding-left: 44px;
  color: var(--text-muted);
}

.bx-steps li::before {
  content: counter(bxstep);
  position: absolute;
  left: 0;
  top: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
}

/* --- Prose ------------------------------------------------------ */
.bx-prose {
  max-width: 760px;
}

.bx-prose h2 {
  font-size: 1.2rem;
  margin: 40px 0 12px;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.bx-prose > h2:first-child {
  margin-top: 0;
}

.bx-prose h3 {
  font-size: 1rem;
  margin: 24px 0 8px;
}

.bx-prose p,
.bx-prose li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.bx-prose ul,
.bx-prose ol {
  margin: 0 0 1.5em 1.2em;
  display: grid;
  gap: 8px;
}

.bx-prose li::marker {
  color: var(--accent);
}

.bx-prose a:not(.btn) {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-glow);
}

.bx-prose a:not(.btn):hover {
  border-bottom-color: var(--accent);
}

.bx-prose strong {
  color: var(--text-main);
  font-weight: 600;
}

.bx-prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 36px 0;
}

/* --- TOC -------------------------------------------------------- */
.bx-toc {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 20px 24px;
  margin-bottom: 36px;
}

.bx-toc p {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-light);
  margin-bottom: 10px;
}

.bx-toc ol {
  margin: 0 0 0 1.1em;
  display: grid;
  gap: 6px;
}

.bx-toc a {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.bx-toc a:hover {
  color: var(--accent);
}

/* --- Callout ---------------------------------------------------- */
.bx-callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 0 12px 12px 0;
  padding: 18px 22px;
  margin: 24px 0;
}

.bx-callout p:last-child {
  margin-bottom: 0;
}

.bx-callout strong {
  color: var(--text-main);
}

/* --- Tables ----------------------------------------------------- */
.bx-table-wrap {
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.bx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 520px;
}

.bx-table th,
.bx-table td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--text-muted);
}

.bx-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  background: var(--surface-2);
}

.bx-table tr:last-child td {
  border-bottom: none;
}

/* --- Contact ---------------------------------------------------- */
.bx-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* --- Placeholders ----------------------------------------------- */
.fill-me {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.88em;
  font-weight: 500;
  color: #92400E;
  background: rgba(251, 191, 36, 0.18);
  border: 1px dashed rgba(217, 119, 6, 0.55);
}

body.dark-mode .fill-me {
  color: #FCD34D;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.45);
}

/* ==============================================================
   FOOTER
============================================================== */
.vq-footer {
  margin-top: 40px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

.vq-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vq-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.vq-footer-links a:hover {
  color: var(--accent);
}

.vq-footer-links .divider {
  opacity: 0.4;
}

/* ==============================================================
   RESPONSIVE + PRINT
============================================================== */
@media (max-width: 600px) {
  .bx-main {
    padding-top: 32px;
  }

  .bx-head h1 {
    font-size: 1.7rem;
  }

  .bx-card {
    padding: 22px;
  }

  .bx-app-icon {
    width: 66px;
    height: 66px;
    border-radius: 18px;
    font-size: 1.6rem;
  }
}

@media print {
  .vq-header,
  .vq-footer,
  .bx-breadcrumb {
    display: none !important;
  }

  body {
    padding-top: 0;
    background: #fff;
  }

  .bx-card {
    box-shadow: none;
    border-color: #ddd;
    break-inside: avoid;
  }
}
