/* jpowers.io — shared site chrome
   Loaded by site/base.html. Page-specific styles live in each page
   template's {% block page_css %}. */

:root {
  --blue: #0044FF;
  --orange: #FF4D00;
  --yellow: #FFC400;
  --red: #E8102D;
  --brown: #977462;
  --ink: #101010;
  --paper: #FEFEFE;
  --line: #EAEAEA;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Paper grain. Tiled fractal noise, pinned to the viewport rather than the
   document so a long page never paints one enormous layer. Sits behind the
   frame so type stays crisp — this textures the ground, not the words. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.frame { position: relative; z-index: 1; }

/* ---------- centered page frame ----------
   Default: locks to viewport height (home, goals). Pages
   that need to grow past the viewport (about) add .frame-scroll. */
.frame {
  max-width: 960px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.frame main { flex: 1; min-height: 0; overflow: auto; }
.frame.frame-scroll { height: auto; min-height: 100dvh; }
.frame.frame-scroll main { overflow: visible; }

/* ---------- header ---------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 62px;
  padding: 0 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line);
}
header .site { font-weight: 700; font-size: 13px; letter-spacing: 0.04em; color: var(--ink); text-decoration: none; }
header .meta {
  color: #999;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
header .meta:hover { color: var(--ink); }
header .meta svg { width: 14px; height: 14px; display: block; opacity: 0.55; }

/* ---------- main ---------- */
main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(18px, 4vh, 56px) 24px clamp(20px, 4.5vh, 64px);
}

.dataset-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #999;
  white-space: nowrap;
  gap: 12px;
}
.dataset-label .k { color: var(--ink); font-weight: 700; }

h1 {
  margin-top: 10px;
  font-size: clamp(32px, min(5.6vw, 6.4vh), 61px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.95;
}
h1 span { color: var(--brown); }

/* ---------- burger + dropdown menu ---------- */
.head-left { display: flex; align-items: center; gap: 16px; }
.burger {
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  display: block;
}
.burger svg { width: 100%; height: 100%; display: block; }
.burger:hover { color: var(--brown); }
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 15px);
  left: -13px;
  min-width: 208px;
  background: #fff;
  border: 1px solid var(--ink);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 50;
}
.menu.open { opacity: 1; visibility: visible; transform: none; }
.menu a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 13px 16px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.15s ease, padding-left 0.15s ease;
}
.menu a:last-child { border-bottom: none; }
.menu a small {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 9px;
  color: #999;
  letter-spacing: 0.08em;
}
.menu a[data-c="brown"]:hover  { box-shadow: inset 3px 0 0 var(--brown); padding-left: 20px; }
.menu a[data-c="blue"]:hover   { box-shadow: inset 3px 0 0 var(--blue); padding-left: 20px; }
.menu a[data-c="orange"]:hover { box-shadow: inset 3px 0 0 var(--orange); padding-left: 20px; }
.menu a[data-c="yellow"]:hover { box-shadow: inset 3px 0 0 var(--yellow); padding-left: 20px; }
.menu a.active { box-shadow: inset 3px 0 0 var(--ink); }
.menu a.active small { color: var(--ink); }

/* ---------- footer ---------- */
footer {
  display: block;
  padding: 18px 32px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #999;
  border-top: 1px solid var(--line);
  /* stop iOS Safari from auto-inflating the small ticker text */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (max-width: 560px) {
  footer { padding: 14px 20px; font-size: 9px; }
}
.footer-fallback { display: flex; justify-content: space-between; }
footer .site { color: var(--ink); font-weight: 700; }

/* scrolling log ticker (replaces the fallback text when there's activity) */
.footer-ticker { overflow: hidden; white-space: nowrap; }
.footer-ticker__track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation-name: ticker-scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.footer-ticker__item {
  letter-spacing: 0.03em;
  text-decoration: none;
  color: inherit;
}
.footer-ticker__item:hover { color: var(--ink); }
.footer-ticker__icon {
  display: inline-flex;
  vertical-align: -0.15em;
  margin-right: 0.5em;
}
.footer-ticker__icon svg { width: 1.25em; height: 1.25em; }
.footer-ticker__sep { color: var(--line); margin: 0 1.6em; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .footer-ticker__track { animation: none; }
}
