/* Triangle-grid eddies.
   Include on any page with triangle-growth.js. All rules are scoped
   so the motif can be added or removed without touching the rest of the blog. */

.tt-growth-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.tt-growth-on header,
.tt-growth-on .mobile-menu-header {
  z-index: 5;
}

.tt-growth-on footer {
  position: relative;
  z-index: 3;
}

/* The left column uses fade-in with fill-mode:forwards. That keeps an
   opacity stacking context (z-index:auto) around the whole column, and
   the canvas — position:fixed; z-index:0; appended later — would paint
   over every cover and button. Drop the animation while the lattice is
   on so those widgets can sit above the strokes. Do not lift the whole
   .column.left: its padding-left is empty space, and a stacking context
   there clips the left colony. */
.tt-growth-on .column.left.fade-in {
  animation: none;
  opacity: 1;
}

.tt-growth-on .column.middle,
.tt-growth-on .column.right,
.tt-growth-on .column.left .article-box,
.tt-growth-on .subscribe-container,
.tt-growth-on .subscribe-container-border,
.tt-growth-on .image-box,
.tt-growth-on .book-image-container,
.tt-growth-on .lp-announcement,
.tt-growth-on .meditation-app-box,
.tt-growth-on .app-img {
  position: relative;
  z-index: 2;
}

/* The behind Lucilius cover uses z-index:-2 so it tucks under the front
   book. Keep that pairing local so it cannot fall behind the canvas. */
.tt-growth-on .book-image-container {
  isolation: isolate;
}

.tt-growth-on .lp-side-bar-image-behind {
  z-index: 0;
}

.tt-growth-on .lp-top-book {
  position: relative;
  z-index: 1;
}

/* ---- experiment page only ---- */

.tt-growth-page {
  overflow-x: hidden;
}

.tt-growth-essay {
  width: min(36rem, 88%);
  margin: 0 auto;
  padding: 0.5rem 1.4rem 5.5rem;
  background: transparent;
  position: relative;
  z-index: 2;
}

.tt-growth-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin: 0 0 0.75rem;
}

html[data-theme="dark"] .tt-growth-kicker {
  color: var(--dm-text-dim);
}

.tt-growth-essay h2 {
  font-family: "Alegreya Sans SC", "Trebuchet MS", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0 0 1.4rem;
}

.tt-growth-essay p {
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 1.1rem;
}

.tt-growth-essay code {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1em 0.35em;
}

html[data-theme="dark"] .tt-growth-essay code {
  background: rgba(255, 255, 255, 0.06);
}

.tt-growth-tinker {
  margin: 2.2rem 0 0;
  border: 1px solid #ddd;
  padding: 0.85rem 1rem 1rem;
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .tt-growth-tinker {
  border-color: var(--dm-border);
  background: rgba(21, 23, 26, 0.72);
}

.tt-growth-tinker summary {
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.04em;
  list-style: none;
}

.tt-growth-tinker summary::-webkit-details-marker {
  display: none;
}

.tt-growth-tinker-grid {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.55rem 0.85rem;
  align-items: center;
  margin-top: 1rem;
  font-size: 13px;
}

.tt-growth-tinker-grid label {
  color: #666;
}

html[data-theme="dark"] .tt-growth-tinker-grid label {
  color: var(--dm-text-soft);
}

.tt-growth-tinker-grid input[type="range"] {
  width: 100%;
}

.tt-growth-tinker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tt-growth-tinker-actions button {
  font: inherit;
  font-size: 13px;
  padding: 0.35rem 0.7rem;
  background: transparent;
  border: 1px solid #bbb;
  color: inherit;
  cursor: pointer;
}

html[data-theme="dark"] .tt-growth-tinker-actions button {
  border-color: var(--dm-border);
  color: var(--dm-text);
}

.tt-growth-tinker-actions button:hover {
  border-color: #888;
}

.tt-growth-stat {
  margin-top: 0.85rem;
  font-size: 12px;
  color: #888;
}

html[data-theme="dark"] .tt-growth-stat {
  color: var(--dm-text-dim);
}

@media only screen and (max-width: 480px) {
  .tt-growth-essay {
    width: 92%;
    padding: 0.5rem 0.9rem 4.5rem;
  }
}
