/* ============================================
   Non-Optical LiDAR Fall Prevention — study site
   Palette: editorial blue/grey + teal accent
   ============================================ */

:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border: #e2e8f0;
  --accent: #0e7490;
  --accent-2: #155e75;
  --accent-soft: #ecfeff;
  --callout-bg: #fef3c7;
  --callout-border: #f59e0b;
  --hero-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0e7490 100%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 880px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Hero
   ============================================ */

.hero {
  background: var(--hero-bg);
  color: #f8fafc;
  padding: 80px 24px 64px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(14, 116, 144, 0.3), transparent),
    radial-gradient(ellipse 50% 30% at 10% 90%, rgba(20, 184, 166, 0.15), transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.kicker {
  font-size: 0.85rem;
  font-weight: 500;
  color: #67e8f9;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.lede {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #cbd5e1;
  max-width: 700px;
  line-height: 1.6;
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.hero-nav a {
  color: #f1f5f9;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 14px;
  border: 1px solid rgba(248, 250, 252, 0.25);
  border-radius: 999px;
  transition: all 0.15s ease;
}

.hero-nav a:hover {
  background: rgba(14, 116, 144, 0.3);
  border-color: #67e8f9;
  color: #67e8f9;
}

/* ============================================
   Sections
   ============================================ */

main { max-width: var(--max-width); margin: 0 auto; padding: 32px 24px 64px; }

.section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type { border-bottom: none; }

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
  position: relative;
  padding-left: 16px;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--accent-2);
}

p { margin-bottom: 16px; color: var(--text); }

strong { color: var(--text); font-weight: 600; }
em { color: var(--text-muted); font-style: italic; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover { color: var(--accent-2); }

ul, ol { margin-left: 24px; margin-bottom: 16px; }
li { margin-bottom: 8px; }

.bullets { list-style: none; margin-left: 0; }
.bullets li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
}
.bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* ============================================
   Cards / grid
   ============================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  color: var(--accent);
}

.card p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }

.footnote {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 8px;
}

/* ============================================
   Aside / callout
   ============================================ */

.aside {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 24px 0;
}

.callout {
  background: var(--callout-bg);
  border-left: 4px solid var(--callout-border);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: #78350f;
  margin: 24px 0;
}

/* ============================================
   Case studies
   ============================================ */

.case-study {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.case-study h3 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.1rem;
}

.case-study .meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* ============================================
   Tables
   ============================================ */

.table-wrap { overflow-x: auto; margin: 24px 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.92rem;
}

thead { background: var(--surface-2); }

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

th {
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================
   Thesis statement
   ============================================ */

.thesis-statement {
  font-size: 1.15rem;
  line-height: 1.6;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #f0f9ff 100%);
  border-left: 6px solid var(--accent);
  padding: 24px 28px;
  border-radius: var(--radius);
  color: var(--text);
  margin: 24px 0 32px;
  font-weight: 500;
}

.thesis-statement strong { color: var(--accent-2); font-weight: 700; }

/* ============================================
   Modality cards
   ============================================ */

.modality {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.modality h3 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.1rem;
}

.modality.winner {
  border-left-color: var(--accent);
  border-left-width: 6px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 100%);
}

.modality.winner h3 {
  color: var(--accent);
}

.modality p { font-size: 0.95rem; }

/* ============================================
   Advantages
   ============================================ */

.advantage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.advantage h3 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.05rem;
}

.advantage p { font-size: 0.92rem; color: var(--text-muted); }

/* ============================================
   Sources list
   ============================================ */

.sources-list {
  margin-left: 0;
  padding-left: 24px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.sources-list li {
  margin-bottom: 12px;
  color: var(--text-muted);
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  user-select: none;
}

details summary:hover { color: var(--accent-2); }

details[open] summary { margin-bottom: 16px; }

.meta-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ============================================
   Conclusions
   ============================================ */

.conclusions { background: var(--accent-soft); margin: 0 -24px; padding: 48px 24px; border-radius: var(--radius); }

.conclusions ol {
  margin-left: 0;
  padding-left: 0;
  counter-reset: conclusion-counter;
  list-style: none;
}

.conclusions ol li {
  counter-increment: conclusion-counter;
  position: relative;
  padding-left: 40px;
  margin-bottom: 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 20px 20px 20px 56px;
  box-shadow: var(--shadow-sm);
}

.conclusions ol li::before {
  content: counter(conclusion-counter);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 48px 24px;
  margin-top: 64px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer p { color: #cbd5e1; font-size: 0.85rem; margin-bottom: 12px; }
.footer p:last-child { margin-bottom: 0; }

.footer a { color: #67e8f9; text-decoration: none; }
.footer a:hover { color: #f0f9ff; text-decoration: underline; }

.repo { margin-top: 16px; padding-top: 16px; border-top: 1px solid #1e293b; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
  .hero { padding: 48px 20px 40px; }
  main { padding: 24px 16px 48px; }
  .section { padding: 32px 0; }
  .conclusions { margin: 0 -16px; padding: 32px 16px; }
  .hero-nav { gap: 6px; }
  .hero-nav a { font-size: 0.85rem; padding: 5px 12px; }
  .grid { grid-template-columns: 1fr; }
}

/* ============================================
   Print styles
   ============================================ */

@media print {
  .hero { background: white; color: black; padding: 24px; }
  .hero::before { display: none; }
  .hero-nav, .footer { display: none; }
  .section { page-break-inside: avoid; border: none; }
  details[open] > * { display: block; }
  details > summary { display: none; }
}