/* =========================================
   Liquid Desktop — Whitepaper
   Swiss-inspired minimal design
   ========================================= */

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

:root {
  --text: #111;
  --text-2: #555;
  --text-3: #999;
  --border: #e5e5e5;
  --border-light: #eee;
  --bg: #fff;
  --bg-subtle: #f8f8f8;
  --cw: 640px;
  --hh: 48px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  letter-spacing: -0.011em;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

::selection {
  background: rgba(0, 0, 0, 0.07);
}

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

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

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--hh);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  max-width: var(--cw);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.02em;
  font-feature-settings: 'tnum';
}

.header-sep { opacity: 0.35; font-size: 10px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-3);
  transition: color 0.2s ease, background 0.2s ease;
  letter-spacing: 0.01em;
}

.header-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.header-btn svg { flex-shrink: 0; }

.btn-download svg { transition: transform 0.2s ease; }
.btn-download:hover svg { transform: translateY(1.5px); }

/* ---- Side Timeline ---- */

.timeline {
  position: fixed;
  left: calc((100vw - var(--cw)) / 2 - 48px);
  top: 50%;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.6s ease 0.5s;
}

.timeline.visible { opacity: 1; }

.timeline-track {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: var(--border-light);
}

.timeline-fill {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: var(--text);
  height: 0;
  transition: height 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.timeline-dot {
  position: absolute;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  z-index: 1;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.timeline-dot:hover {
  transform: scale(1.7) !important;
  background: var(--text-2) !important;
  opacity: 1 !important;
}

.timeline-dot.passed {
  background: var(--text);
  opacity: 0.3;
}

.timeline-dot.active {
  background: var(--text);
  transform: scale(1.5);
  opacity: 1;
}

.timeline-dot::after {
  content: attr(data-label);
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 450;
}

.timeline-dot:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

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

.content {
  max-width: var(--cw);
  margin: 0 auto;
  padding: 56px 24px 120px;
  opacity: 0;
}

.content.loaded {
  animation: fadeInUp 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Typography ---- */

.content h1 {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.content h1 + h3 {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.55;
  margin-top: 2px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.content h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-top: 56px;
  margin-bottom: 20px;
  scroll-margin-top: 72px;
}

.content h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.4;
  margin-top: 36px;
  margin-bottom: 10px;
}

.content p {
  font-size: 15px;
  margin-bottom: 18px;
}

.content strong { font-weight: 600; }
.content em { font-style: italic; }

/* Metadata line */
.content .meta-line {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.02em;
  margin-bottom: 0;
  font-feature-settings: 'tnum';
}
.content .meta-line strong { font-weight: 400; }

/* Intro epigraph */
.content .intro {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 8px;
}

/* ---- Dividers ---- */

.content hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 40px 0;
}

/* ---- Blockquotes ---- */

.content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 20px;
  margin: 28px 0;
  color: var(--text-2);
}

.content blockquote p {
  font-size: 14.5px;
  line-height: 1.7;
}

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

.table-wrap {
  overflow-x: auto;
  margin: 28px 0;
  -webkit-overflow-scrolling: touch;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 480px;
}

.content thead th {
  text-align: left;
  font-weight: 500;
  padding: 6px 10px 8px;
  border-bottom: 1.5px solid var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  white-space: nowrap;
}

.content tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  color: var(--text-2);
}

.content tbody td:first-child {
  font-weight: 500;
  color: var(--text);
}

.content tbody tr:last-child td { border-bottom: none; }

/* ---- Lists ---- */

.content ul, .content ol {
  padding-left: 22px;
  margin-bottom: 18px;
}

.content li {
  font-size: 15px;
  margin-bottom: 4px;
}

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

.content code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  font-size: 13px;
  background: var(--bg-subtle);
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0;
}

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

.footer {
  border-top: 1px solid var(--border-light);
  padding: 32px 24px;
}

.footer-inner {
  max-width: var(--cw);
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.footer a {
  font-size: 12px;
  color: var(--text-3);
  transition: color 0.2s ease;
  letter-spacing: 0.01em;
}

.footer a:hover { color: var(--text); }

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

@media (max-width: 960px) {
  .timeline { display: none !important; }
}

@media (max-width: 640px) {
  .content { padding: 40px 20px 80px; }
  .content h1 { font-size: 28px; }
  .content h1 + h3 { font-size: 15px; }
  .content h2 { font-size: 18px; margin-top: 48px; }
  .header-meta .header-status { display: none; }
}
