/* ==========================================================================
   wire.css — shared styles for the wireframe redesign
   Palette: deep space dark #111110 / burnt orange #d4643a / warm off-white
   Type:    Inter (body) + JetBrains Mono (labels, code)
   ========================================================================== */

:root {
  --bg:        #111110;
  --bg-deep:   #0c0c0b;
  --panel:     rgba(20, 20, 18, 0.78);
  --panel-hi:  rgba(26, 25, 23, 0.88);
  --line:      rgba(234, 230, 223, 0.09);
  --line-hi:   rgba(234, 230, 223, 0.18);
  --text:      #eae6df;
  --text-dim:  #a49c92;
  --text-mute: #6e675f;
  --accent:    #d4643a;
  --accent-hi: #e58753;
  --accent-dim: rgba(212, 100, 58, 0.35);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #111110; }

a { color: inherit; }

/* ---------- fixed canvas layer ---------- */

#wire-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 50% 20%, #161513 0%, var(--bg) 65%);
}

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

/* drag-to-orbit */
body.orbiting { cursor: grabbing; }
body.orbiting * { cursor: grabbing !important; }
body.orbiting { -webkit-user-select: none; user-select: none; }

/* ---------- index: hero ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 6rem 2.5rem 4rem;
  position: relative;
}

.hero-inner { max-width: 34rem; position: relative; }

/* soft scrim so the wireframe never fights the headline */
.hero-inner::before {
  content: "";
  position: absolute;
  inset: -3rem -4rem;
  background: radial-gradient(ellipse 100% 100% at 30% 50%, rgba(17,17,16,0.88) 0%, rgba(17,17,16,0.55) 55%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
}
.kicker .dim { color: var(--text-mute); }

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin-bottom: 1.6rem;
}
.hero h1 .accent { color: var(--accent); }

.hero .intro {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 32rem;
  margin-bottom: 2.2rem;
}
.hero .intro strong { color: var(--text); font-weight: 500; }
.hero .intro a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--accent-dim); transition: border-color .2s; }
.hero .intro a:hover { border-color: var(--accent); }

.hero-links { display: flex; gap: 1.6rem; font-family: var(--mono); font-size: 0.8rem; }
.hero-links a {
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color .2s;
}
.hero-links a::before { content: "→ "; color: var(--accent); }
.hero-links a:hover, .hero-links a:focus-visible { color: var(--text); }

.scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 2.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.scroll-hint::after {
  content: "";
  width: 1px;
  height: 2.4rem;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: drop 2.2s ease-in-out infinite;
}
@keyframes drop {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: .5; }
  50%       { transform: scaleY(1);  transform-origin: top; opacity: 1; }
}

/* ---------- index: sections ---------- */

.sections {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 2.5rem 6rem;
}

section.block { padding: 4.5rem 0 1rem; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.8rem;
  font-family: var(--mono);
}
.sec-head .num { color: var(--accent); font-size: 0.78rem; }
.sec-head h2 {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.sec-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--line-hi), transparent);
  align-self: center;
}

/* cards */

.card {
  display: grid;
  grid-template-columns: 3.4rem 1fr auto;
  gap: 0 1.2rem;
  align-items: center;
  padding: 1.3rem 1.5rem;
  margin-bottom: 0.9rem;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: border-color .25s, background .25s, transform .25s;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform .25s ease;
  transform-origin: bottom;
}
.card:hover, .card:focus-visible {
  border-color: var(--line-hi);
  background: var(--panel-hi);
  transform: translateX(4px);
  outline: none;
}
.card:hover::before, .card:focus-visible::before { transform: scaleY(1); }

.card .idx {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-mute);
  transition: color .25s;
}
.card:hover .idx { color: var(--accent); }

.card .logo {
  width: 2.6rem; height: 2.6rem;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.card .body { min-width: 0; }
.card .title {
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.card .title .meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}
.card .desc {
  display: block;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}
.card .tags {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
}
.card .tags span { color: var(--accent-dim); }

.card .arrow {
  font-family: var(--mono);
  color: var(--text-mute);
  transition: transform .25s, color .25s;
}
.card:hover .arrow { transform: translateX(4px); color: var(--accent); }

/* online links */

.online {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.online a {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 6px;
  padding: 0.7rem 1.3rem;
  transition: border-color .25s, color .25s, transform .25s;
}
.online a:hover, .online a:focus-visible {
  color: var(--text);
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  outline: none;
}
.online a .at { color: var(--accent); }

/* footer */

footer.site {
  max-width: 760px;
  margin: 0 auto;
  padding: 7rem 2.5rem 3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-mute);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  letter-spacing: 0.04em;
}
footer.site > span:last-child { flex-basis: 100%; margin-top: 0.4rem; }
footer.site .engine { color: var(--text-mute); }
footer.site .engine b { color: var(--accent); font-weight: 500; }

/* ---------- subpages ---------- */

.page-bar {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.6rem 2.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.back {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color .2s;
}
.back:hover, .back:focus-visible { color: var(--accent); }
.orn { width: 88px; height: 88px; opacity: 0.9; }

article.prose {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 2.5rem 6rem;
}

.prose .p-kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.prose h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 0.7rem;
}

.prose .subtitle {
  font-size: 1.08rem;
  color: var(--text-dim);
  margin-bottom: 1.4rem;
  max-width: 40rem;
}

.prose .meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  padding-bottom: 1.8rem;
  margin-bottom: 2.4rem;
  border-bottom: 1px solid var(--line);
  line-height: 2;
}
.prose .meta a { color: var(--text-dim); text-decoration: none; border-bottom: 1px solid var(--accent-dim); transition: color .2s, border-color .2s; }
.prose .meta a:hover { color: var(--text); border-color: var(--accent); }
.prose .meta .k { color: var(--accent); }

.prose h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 3rem 0 1rem;
  padding-top: 0.4rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.prose h2::before {
  content: "//";
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 400;
}

.prose h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2.2rem 0 0.8rem;
}

.prose p { margin-bottom: 1.1rem; color: #cfc9c0; }
.prose strong { color: var(--text); font-weight: 500; }
.prose em { color: var(--text); }

.prose a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--accent-dim); transition: color .2s, border-color .2s; }
.prose a:hover { color: var(--accent-hi); border-color: var(--accent); }

.prose ul, .prose ol { margin: 0 0 1.2rem 1.4rem; color: #cfc9c0; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--accent); }

.prose hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 2.6rem 0;
}

/* code */

.prose code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: rgba(234, 230, 223, 0.07);
  border: 1px solid rgba(234, 230, 223, 0.06);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: #e6ddd1;
}

.prose pre {
  background: var(--bg-deep);
  border: 1px solid rgba(234, 230, 223, 0.08);
  border-left: 2px solid var(--accent-dim);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  margin: 1.4rem 0 1.6rem;
  overflow-x: auto;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: #d8d2c8;
}
.prose pre .cm  { color: #756d63; }               /* comment */
.prose pre .kw  { color: #d4643a; }               /* keyword */
.prose pre .fn  { color: #e5b567; }               /* function */
.prose pre .st  { color: #a8b87c; }               /* string  */
.prose pre .nu  { color: #c39ac9; }               /* number  */
.prose pre .tp  { color: #7da9b8; }               /* type    */

/* tables */

.prose .tbl-wrap { overflow-x: auto; margin: 1.4rem 0 1.6rem; }
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}
.prose th {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  font-weight: 500;
  text-align: left;
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--line-hi);
}
.prose td {
  padding: 0.55rem 1rem 0.55rem 0;
  border-bottom: 1px solid var(--line);
  color: #cfc9c0;
  vertical-align: top;
}
.prose tr:hover td { color: var(--text); }

/* math — hand-set, no MathJax on this site */

.prose .math {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  text-align: center;
  font-size: 1.06rem;
  color: var(--text);
  margin: 1.5rem 0 1.7rem;
  overflow-x: auto;
  padding: 0.2rem 0;
}
.prose .imath { font-family: Georgia, "Times New Roman", serif; font-style: italic; color: var(--text); white-space: nowrap; }
.prose .frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  margin: 0 0.15em;
  line-height: 1.25;
}
.prose .frac > span:first-child { border-bottom: 1px solid currentColor; padding: 0 0.25em 0.05em; }
.prose .frac > span:last-child  { padding: 0 0.25em; }
.prose .math sub, .prose .imath sub { font-size: 0.7em; }
.prose .math sup, .prose .imath sup { font-size: 0.7em; }
.prose .bigop { font-size: 1.5em; font-style: normal; vertical-align: -0.15em; }

/* images / demo gifs */

.prose img {
  max-width: 100%;
  display: block;
  border: 1px solid var(--line-hi);
  border-radius: 8px;
  margin: 1.4rem 0;
}
.prose figure { margin: 1.4rem 0; }
.prose figure img { margin: 0; }
.prose .caption,
.prose figcaption {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  margin-top: -0.6rem;
  margin-bottom: 1.6rem;
}
.prose figcaption { margin-top: 0.5rem; margin-bottom: 0; }

/* pandoc-built pages: blockquotes and native MathML */
.prose blockquote {
  border-left: 2px solid var(--accent-dim);
  padding: 0.2rem 0 0.2rem 1.2rem;
  margin: 1.4rem 0;
  color: var(--text-dim);
}
.prose math { font-size: 1.06em; }
.prose math[display="block"] {
  display: block;
  margin: 1.6rem auto;
  text-align: center;
}

/* references */

.prose .refs { font-size: 0.85rem; }
.prose .refs li { margin-bottom: 0.5rem; color: var(--text-dim); }

/* footer on subpages */

.page-foot {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 2.5rem 3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-mute);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  letter-spacing: 0.04em;
}
.page-foot a { color: var(--text-mute); text-decoration: none; }
.page-foot a:hover { color: var(--accent); }

/* focus visibility for keyboard users */
a:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  /* text hugs the top; the drone parks in the lower third (see wire.js) */
  .hero { justify-content: flex-start; padding: 5.5rem 1.4rem 4rem; }
  .hero-inner::before { inset: -2rem -1.5rem; }
  .scroll-hint { left: 1.4rem; }
  .sections { padding: 0 1.4rem 4rem; }
  section.block { padding: 4.5rem 0 0.5rem; }
  .card { grid-template-columns: 1fr auto; padding: 1.1rem 1.2rem; }
  .card .idx { display: none; }
  .card .logo { display: none; }
  .card.has-logo { grid-template-columns: 2.6rem 1fr auto; }
  .card.has-logo .logo { display: block; width: 2.2rem; height: 2.2rem; }
  footer.site { padding: 4rem 1.4rem 2.5rem; }
  footer.site .desktop-hint { display: none; }  /* no pointer, no keyboard */
  .page-bar { padding: 1.2rem 1.4rem 0; }
  .orn { width: 64px; height: 64px; }
  article.prose { padding: 1.4rem 1.4rem 4rem; }
  .prose pre { padding: 0.9rem 1rem; }
  .page-foot { padding: 0 1.4rem 2.5rem; }
}
