/* ScanLabs – site styles (v0) */
:root {
  --ink: #0F172A;
  --ink-2: #334155;
  --ink-3: #475569;
  --muted: #64748B;
  --line: #E2E8F0;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --accent: #0B5E4E;
  --accent-dark: #063F34;
  --accent-soft: #E6F2EE;
  --hero: #0F172A;
  --hero-accent: #5EEAD4;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }
.mono { font-family: var(--mono); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: #fff; padding: 8px 12px; border-radius: 8px; }

/* Header */
.site-header { background: var(--hero); color: #F8FAFC; }
.site-header .inner { max-width: 1360px; margin: 0 auto; padding: 14px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: #F8FAFC; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand strong { font-size: 18px; letter-spacing: -0.01em; }
.brand span { font-size: 13px; color: #94A3B8; }
.top-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.top-nav a { color: #CBD5E1; text-decoration: none; }
.top-nav a:hover { color: #fff; text-decoration: underline; }
.menu-toggle { display: none; height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid #475569; background: #1E293B; color: #F8FAFC; font: inherit; font-size: 14px; cursor: pointer; }

/* Under construction banner */
.construction { background: #FEF3C7; border-bottom: 1px solid #FCD34D; color: #78350F; }
.construction .inner { max-width: 1360px; margin: 0 auto; padding: 12px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.construction p { margin: 0; flex: 1 1 280px; font-size: 15px; }
.construction svg { flex: none; }
.construction .btn-old { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 10px; background: #78350F; color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; }
.construction .btn-old:hover { background: #451A03; color: #fff; }
.group-title { margin: 8px 0 -4px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Layout */
.layout { max-width: 1360px; margin: 0 auto; padding: 28px; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start; }
.sidebar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px; }
.sidebar h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 16px 12px 6px; }
.sidebar h2:first-child { margin-top: 4px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.sidebar a:hover { background: var(--bg); color: var(--ink); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar a .label { flex: 1; }
.sidebar svg { flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #94A3B8; flex: none; }
.dot.stable { background: #16A34A; }
.dot.new { background: #D97706; }

main { min-width: 0; display: flex; flex-direction: column; gap: 24px; }

/* Cards & sections */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; }
.card h2 { margin: 0 0 12px; font-size: 18px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

.hero { background: var(--hero); color: #F8FAFC; border-radius: 16px; padding: 48px 44px; display: flex; flex-direction: column; gap: 18px; }
.hero .kicker { font-family: var(--mono); font-size: 13px; color: var(--hero-accent); }
.hero h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.12; letter-spacing: -0.02em; max-width: 780px; }
.hero p { margin: 0; font-size: 17px; line-height: 1.6; color: #CBD5E1; max-width: 680px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }
.btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 10px; font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-hero { background: var(--hero-accent); color: #042F2A; }
.btn-hero:hover { background: #99F6E4; color: #042F2A; }
.btn-ghost { border-color: #CBD5E1; color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-youtube { gap: 10px; background: #CC0000; color: #fff; }
.btn-youtube:hover { background: #A30000; color: #fff; }
.btn-ghost-dark { border-color: #475569; color: #F8FAFC; }
.btn-ghost-dark:hover { border-color: #94A3B8; color: #fff; }

.latest { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.latest a { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); }
.latest a:hover { border-color: #94A3B8; }
.latest .title { font-size: 16px; font-weight: 600; }
.latest .text { font-size: 14px; color: var(--ink-3); }

.section-title { margin: 0; font-size: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--ink); text-decoration: none; }
.project-card:hover { border-color: #94A3B8; color: var(--ink); }
.project-card .name { font-size: 17px; font-weight: 600; }
.project-card .summary { font-size: 14px; color: var(--ink-3); }
.project-card .more { margin-top: auto; font-size: 14px; font-weight: 600; color: var(--accent); }

.badge { align-self: flex-start; display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #F1F5F9; color: var(--ink-2); }
.badge.stable { background: #DCFCE7; color: #14532D; }
.badge.new { background: #FEF3C7; color: #92400E; }
.badge.classic { background: #DBEAFE; color: #1E3A8A; }
.dot.classic { background: #2563EB; }
.project-card .code { font-size: 12px; color: var(--muted); margin-top: -6px; }
.project-head .nav-label { font-size: 15px; font-weight: 700; color: var(--accent); margin-bottom: -10px; }

/* Project page */
.breadcrumb { font-size: 14px; color: var(--muted); }
.project-head { display: flex; flex-direction: column; gap: 16px; padding: 36px 40px; border-radius: 16px; }
.project-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.project-head .meta .mono { font-size: 13px; color: var(--ink-3); }
.project-head h1 { margin: 0; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -0.02em; }
.project-head p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 720px; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; gap: 10px; font-size: 15px; color: var(--ink-2); }
.checks li::before { content: "✓"; color: var(--accent); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips span { font-size: 13px; padding: 6px 10px; border-radius: 6px; background: #F1F5F9; color: #1E293B; }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.placeholder { background: #FEF9C3; color: #713F12; padding: 0 4px; border-radius: 4px; }

/* Project header image */
.project-head.has-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 360px); grid-template-areas: "text media" "actions actions"; column-gap: 36px; row-gap: 20px; align-items: center; }
.project-head .head-text { grid-area: text; display: flex; flex-direction: column; gap: 16px; }
.project-head .head-media { grid-area: media; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0F172A; }
.project-head .head-media img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: cover; transition: transform .2s; }
.project-head .head-media:hover img { transform: scale(1.02); }
.project-head .actions { grid-area: actions; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { min-height: 44px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink-3); cursor: pointer; margin-bottom: -1px; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html:not(.js) .tabs { display: none; }
.tabpanel[hidden] { display: none; }

/* Video */
.video { max-width: 880px; position: relative; aspect-ratio: 16 / 9; background: #0F172A; border-radius: 10px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 0; background: radial-gradient(circle at center, #1E293B, #0F172A); color: #F8FAFC; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.video-play:hover svg circle { opacity: 1; fill: var(--accent); }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #F1F5F9; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.03); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(15, 23, 42, .85); }
.lightbox img { display: block; max-width: 94vw; max-height: 92vh; border-radius: 8px; }
.lightbox-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .8); color: #fff; font-size: 18px; cursor: pointer; }

/* Long-form text: manuals and notes */
.notes { margin-top: 24px; }
.prose { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.prose h1 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); }
.prose h2 { margin: 32px 0 10px; font-size: 20px; color: var(--ink); scroll-margin-top: 16px; }
.prose h3 { margin: 24px 0 8px; font-size: 17px; color: var(--ink); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 12px; }
.prose ol, .prose ul { margin: 0 0 12px; padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose code { font-family: var(--mono); font-size: 13px; background: #F1F5F9; padding: 2px 6px; border-radius: 4px; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 8px 0 16px; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: #F8FAFC; color: var(--ink); font-weight: 600; }
.prose .lead { font-size: 16px; color: var(--ink-3); margin-bottom: 20px; }
.toc { background: #F8FAFC; border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin: 0 0 8px; }
.toc h2 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.toc ul { list-style: none; padding: 0; margin: 0; columns: 2 240px; column-gap: 24px; }
.toc li { margin: 4px 0; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Live device map */
.map-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.map-title { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; }
.map-intro p { margin: 6px 0 0; font-size: 16px; color: var(--ink-3); }
.map-card { background: #0F172A; border-radius: 16px; padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.map-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.map-filters button { min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; background: transparent; color: #E2E8F0; border: 1px solid #475569; }
.map-filters button[aria-pressed="true"] { background: #5EEAD4; color: #042F2A; border-color: #5EEAD4; }
.map-filters button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #CBD5E1; }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.key.touch, .map-dot.touch .core, .map-dot.touch .ring { background: #FBBF24; }
.key.bridge, .map-dot.bridge .core, .map-dot.bridge .ring { background: #F472B6; }
.map-dot.mixed .core, .map-dot.mixed .ring { background: #F8FAFC; }
.map-dot.many { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.map-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.map-stage { position: relative; min-width: 560px; }
.key.mixed { background: #F8FAFC; }
.map-stage img, .map-stage .map-world { display: block; width: 100%; height: auto; }
.map-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; padding: 0; border: 0; background: none; cursor: pointer; }
.map-dot.many { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.map-dot .core { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #0F172A; box-sizing: border-box; color: #0F172A; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.map-dot .ring { position: absolute; inset: 0; border-radius: 50%; animation: map-ping 1.8s ease-out infinite; pointer-events: none; }
.map-dot:focus-visible .core { box-shadow: 0 0 0 3px #fff; }
@keyframes map-ping { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .map-dot .ring { animation: none; opacity: 0; } }
.map-tip { position: absolute; transform: translate(-50%, calc(-100% - 16px)); background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35); white-space: nowrap; display: flex; flex-direction: column; gap: 2px; font-size: 13px; z-index: 2; }
.map-tip.below { transform: translate(-50%, 16px); }
.map-tip[hidden] { display: none; }
.map-tip strong { font-size: 14px; }
.map-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 13px; color: #94A3B8; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card); }
.site-footer .inner { max-width: 1360px; margin: 0 auto; padding: 20px 28px; display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 14px; color: var(--ink-3); }

/* Mobile */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .js .sidebar { display: none; }
  .js .sidebar.open { display: block; }
  .hero { padding: 32px 24px; }
  .project-head { padding: 28px 24px; }
  .project-head.has-media { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "text" "actions"; }
  .project-head .head-media { max-width: 420px; }
  .card { padding: 20px; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .site-header .inner { padding: 12px 16px; }
}
