/* Compact icon navigation and a scroll ruler, inspired by the reference layout. */
:root { --site-header-height: 86px; }
html { scroll-padding-top: calc(var(--site-header-height) + 24px); }
.site-header {
  position: sticky; top: 0; height: var(--site-header-height); padding: 0 40px;
  justify-content: flex-start; gap: 30px; background: #20211ff5;
  border-bottom: 1px solid #ffffff08; backdrop-filter: blur(12px);
}
.brand { margin-right: auto; }
.desktop-nav { margin: 0; gap: 30px; align-items: center; flex-shrink: 0; }
.desktop-nav a {
  display: inline-flex; align-items: center; gap: 9px; color: #aeada8;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: .12px; line-height: 1; min-height: 44px; white-space: nowrap;
}
.desktop-nav a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.desktop-nav a::after { display: none; }
.desktop-nav a:hover, .desktop-nav a[aria-current="page"] { color: #ff625e; }
.desktop-nav a[data-collection="trading"][aria-current="page"] { color: var(--mint); }
.nav-english { font-size: 12px; }
.nav-actions { gap: 16px; flex-shrink: 0; }
.github-icon { width: 28px; height: 42px; color: #aeada8; }
.github-icon svg { width: 20px; height: 20px; }
.nav-contact {
  border: 0; border-radius: 5px; padding: 12px 18px; gap: 14px;
  font: 600 13px/1 var(--mono); letter-spacing: .12px;
  color: #ff625e; background: #ff625e18; min-height: 42px;
}
.nav-contact:hover { background: #ff625e2b; color: #ff8e84; }
.motion-toggle { color: #858681; width: 25px; font-size: 17px; }
.reader-active .motion-toggle { display: none; }
.hero { min-height: calc(100svh - var(--site-header-height)); }
.hero h1, .section-heading h2, .community-copy h2, .reader-article-header h1 { font-weight: 700; }
.collection-entry { display: inline-flex; align-items: center; gap: 20px; font-size: 14px; color: var(--coral); padding: 15px 0; margin-top: 20px; border-bottom: 1px solid currentColor; }
.collection-entry span { font: 11px var(--mono); margin-left: 12px; }
.collection-entry:hover { color: var(--text); }
.collection-entry.is-trading { color: var(--mint); }
.site-footer { padding-bottom: 88px; }
.reader-article { padding-bottom: 108px; }
.contact-invitation { font-size: clamp(27px, 2.7vw, 39px); font-weight: 500; line-height: 1.5; margin: 18px 0 12px; letter-spacing: -.7px; }
.contact-intro { font-size: 14px; line-height: 1.9; color: var(--muted); }

/* The red playhead measures actual scroll position on both home and article pages. */
.scroll-meter {
  position: fixed; z-index: 55; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); right: calc(32px + env(safe-area-inset-right, 0px)); left: auto;
  transform: translateY(12px); width: min(380px, calc(100vw - 64px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); max-width: var(--meter-width, 380px); height: 48px;
  display: flex; align-items: center; padding: 0 18px; border-radius: 14px;
  background: #32312ff5; box-shadow: 0 8px 36px #0002;
  opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease;
}
.scroll-meter[data-visible="true"], .scroll-meter:focus-within { opacity: 1; transform: translateY(0); pointer-events: auto; }
.scroll-meter-track { position: relative; width: 100%; height: 44px; display: flex; align-items: center; }
.scroll-meter-track::before { content: ""; pointer-events: none; position: absolute; left: 0; right: 0; top: 14px; bottom: 14px; background: repeating-linear-gradient(90deg, #777470 0, #777470 1px, transparent 1px, transparent 6px); opacity: .64; }
.scroll-meter input { appearance: none; -webkit-appearance: none; position: relative; margin: 0; padding: 0; width: 100%; height: 44px; background: transparent; border: 0; cursor: ew-resize; touch-action: none; }
.scroll-meter input::-webkit-slider-runnable-track { height: 20px; background: transparent; }
.scroll-meter input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 4px; height: 20px; background: #ff625e; border-radius: 3px; border: 0; box-shadow: 0 0 8px #ff625e18; }
.scroll-meter input::-moz-range-track { height: 20px; background: transparent; }
.scroll-meter input::-moz-range-thumb { width: 4px; height: 20px; border-radius: 3px; border: 0; background: #ff625e; }
.scroll-meter input:focus-visible { outline: 1px solid #bcb6b0; outline-offset: 2px; border-radius: 3px; }
.toast { bottom: 102px; }

@media (max-width: 1180px) {
  .site-header { gap: 23px; padding-inline: 28px; }
  .desktop-nav { gap: 22px; }
  .nav-english { display: none; }
  .nav-actions { gap: 12px; }
  .brand small { display: none; }
}
@media (max-width: 850px) {
  :root { --site-header-height: 70px; }
  .site-header { height: var(--site-header-height); padding-inline: 22px; gap: 16px; }
  .desktop-nav { display: none; }
  .brand>span { font-size: 23px; }
  .brand svg { width: 27px; height: 27px; }
  .nav-actions { gap: 13px; }
  .motion-toggle { display: grid; width: 24px; }
  .menu-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 30px; height: 42px; padding: 3px; }
  .menu-toggle span { display: block; width: 21px; height: 1px; background: #c7c5bd; transition: transform .2s; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .mobile-nav { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; padding: 16px 25px 24px; background: #242422; border-bottom: 1px solid var(--line); box-shadow: 0 22px 30px #0003; }
  .mobile-nav a { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 4px; font-size: 16px; border-bottom: 1px solid #ffffff0d; }
  .mobile-nav a small { font: 11px var(--mono); color: var(--faint); letter-spacing: .8px; }
  .mobile-nav a[aria-current="page"] { color: #ff625e; }
  .mobile-nav a[data-collection="trading"][aria-current="page"] { color: var(--mint); }
  .nav-contact { display: inline-flex; min-height: 38px; padding: 10px 13px; font-size: 11px; gap: 10px; }
  .scroll-meter { width: min(260px, calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); height: 44px; border-radius: 12px; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); padding-inline: 16px; }
  .collection-entry { font-size: 13px; }
  .reader-article { padding-bottom: 94px; }
}
@media (max-width: 420px) {
  .site-header { padding-inline: 18px; gap: 8px; }
  .brand { gap: 7px; }
  .brand>span { font-size: 21px; }
  .brand-dot { margin-right: 0; }
  .nav-actions { gap: 10px; }
  .github-icon { width: 25px; }
  .nav-contact { font-size: 0; padding: 9px 11px; gap: 0; }
  .nav-contact>span { font-size: 18px; }
  .collection-entry span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .scroll-meter { transition: none; } }
