/** @format */

/* /entrepreneurs — a forest field guide.

   The palette is a deep-forest range: two near-black greens for ground and
   canopy, a mid green for panels, a pale sage for accents and rules, and a
   warm cream for body copy. Everything below is built from those five values,
   named for the forest floor upward — bark, soil, canopy, moss, fern, lichen,
   sage, cream, parchment — plus one ochre for the rare warm highlight.

   Type is EB Garamond over Europa: Europa is the site's own face, so the page
   reads as part of strangestloop.io rather than as a stranger, and Garamond
   gives the headings the bookish, natural-history-plate quality the subject
   wants. Lowercase headings with modest letter-spacing follow the house style.

   The page is self-contained: no /styles.css, no shared /header, no jQuery. */

@font-face {
  font-family: europa;
  font-display: swap;
  src: url("/fonts/europa.woff2") format("woff2"),
    url("/fonts/europa.woff") format("woff"),
    url("/fonts/europa.ttf") format("truetype");
}

:root {
  --bark: #0b0e0b;
  --soil: #0e110e;
  --canopy: #121712;
  --moss: #1c211b;
  --fern: #2a382c;
  --lichen: #527357;
  --sage: #95b084;
  --sage-dim: #6f8a63;
  --cream: #d9d2c5;
  --parchment: #eef3e9;
  --ochre: #c8a86b;

  --edge: rgba(149, 176, 132, 0.16);
  --edge-lit: rgba(149, 176, 132, 0.42);

  --display: "EB Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --body: europa, "Avenir Next", "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body.ent-page {
  margin: 0;
  background: var(--soil);
  color: var(--cream);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The scroll lock (set while a card is held open) hides the scrollbar; the
   gutter keeps the page from jumping sideways when it does.

   Scrollbars are themed in both syntaxes: the standard properties cover
   Firefox and current Chrome, the ::-webkit- rules cover Safari and older
   Blink. A default light scrollbar on a near-black page is the one piece of
   chrome that gives the theme away. */
html {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(149, 176, 132, 0.26) transparent;
}

body.ent-page::-webkit-scrollbar {
  width: 11px;
}

body.ent-page::-webkit-scrollbar-track {
  background: var(--bark);
}

body.ent-page::-webkit-scrollbar-thumb {
  background: rgba(149, 176, 132, 0.22);
  border-radius: 100px;
  border: 3px solid transparent;
  background-clip: content-box;
}

body.ent-page::-webkit-scrollbar-thumb:hover {
  background: rgba(149, 176, 132, 0.42);
  background-clip: content-box;
}

/* ---------------------------------------------------------------- forest ---
   Three stacked fixed layers make the depth: a colour wash, a canopy of
   overlapping radial "crowns", and a grain overlay. All are pointer-events:
   none and paint once — no scroll listeners involved. */

.forest {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.forest-wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      120% 80% at 50% -10%,
      #1b241b 0%,
      var(--canopy) 42%,
      var(--soil) 74%,
      var(--bark) 100%
    ),
    linear-gradient(180deg, transparent 60%, rgba(11, 14, 11, 0.9) 100%);
}

/* Soft overlapping light-through-leaves pools. */
.forest-canopy {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 90vh;
  background: radial-gradient(
      38% 46% at 12% 8%,
      rgba(82, 115, 87, 0.3),
      transparent 70%
    ),
    radial-gradient(
      30% 40% at 78% 2%,
      rgba(149, 176, 132, 0.14),
      transparent 70%
    ),
    radial-gradient(
      44% 50% at 52% -8%,
      rgba(42, 56, 44, 0.75),
      transparent 72%
    ),
    radial-gradient(
      26% 34% at 92% 26%,
      rgba(82, 115, 87, 0.16),
      transparent 70%
    );
  filter: blur(6px);
}

/* Fine grain so the large flat greens never read as flat digital fields. */
.forest-grain {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.5'/></svg>");
}

/* Drifting motes. Twelve elements, each on its own long loop. */
.motes {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.mote {
  position: absolute;
  bottom: -8vh;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--sage);
  opacity: 0;
  filter: blur(0.4px);
  animation: drift linear infinite;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(0.6);
    opacity: 0;
  }
  12% {
    opacity: 0.5;
  }
  70% {
    opacity: 0.32;
  }
  100% {
    transform: translate3d(var(--dx, 40px), -112vh, 0) scale(1);
    opacity: 0;
  }
}

/* --------------------------------------------------------------- masthead ---*/

.ent-mast {
  position: relative;
  z-index: 3;
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.35rem var(--gutter) 0;
}

.ent-mast a {
  font-size: 0.76rem;
  letter-spacing: 0.26em;
  text-transform: lowercase;
  color: var(--cream);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.ent-mast a:hover {
  color: var(--parchment);
}

/* ------------------------------------------------------------------ shell ---*/

.ent-shell {
  position: relative;
  z-index: 2;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--gutter) 7rem;
}

/* ------------------------------------------------------------------- hero ---
   Centred: the title carries the page, the count is a quiet subtitle under it.
   No rule under the title — it was doing decoration, not work. */

.ent-hero {
  padding: clamp(1.1rem, 2.6vw, 2.25rem) 0 clamp(2.25rem, 4vw, 3.25rem);
  text-align: center;
}

.ent-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--parchment);
}

/* Matches the share image: the same italic Garamond line in sage under the
   title, so the page and the card someone sees on X read as one thing. */
.ent-sub {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.6vw, 1.9rem);
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--sage);
  /* Scales with the viewport: the tight gap is right when the title is small,
     but the wide view sets a much bigger title and needs room to match. */
  margin: clamp(0.55rem, 1.5vw, 1.6rem) 0 0;
}

.ent-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 2.4rem;
}

.ent-shuffle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--edge);
  color: var(--sage);
  font-family: var(--body);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  padding: 0.66rem 1.3rem;
  border-radius: 100px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

.ent-shuffle:hover,
.ent-shuffle:focus-visible {
  border-color: var(--edge-lit);
  color: var(--parchment);
  background: rgba(149, 176, 132, 0.07);
  outline: none;
}

.ent-shuffle svg {
  width: 13px;
  height: 13px;
  transition: transform 0.5s var(--ease);
}

.ent-shuffle:hover svg {
  transform: rotate(180deg);
}


/* ------------------------------------------------------------------- grid ---*/

.ent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 1.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.card {
  position: relative;
  height: 336px;
  list-style: none;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.75s var(--ease) forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* While a card is lifted out into the feature panel its cell would otherwise
   go blank, leaving a hole in the grid. A faint outline holds the place. */
.card.is-source::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(149, 176, 132, 0.16);
  border-radius: 3px;
}

.card-inner {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    170deg,
    var(--moss) 0%,
    var(--canopy) 60%,
    #0f130f 100%
  );
  border: 1px solid var(--edge);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 0;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.card-inner:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}

/* A small lift on hover, so the grid still answers the pointer before the
   panel opens. */
.card-inner:hover {
  border-color: var(--edge-lit);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.8);
}

.card-frame {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* portrait ------------------------------------------------------------- */

.card-portrait {
  position: relative;
  flex: 0 0 auto;
  height: 212px;
  overflow: hidden;
  background: var(--bark);
}

.card-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Square avatars framed by their owners: dead centre is the right read now
     that the images are no longer a zoomed-in crop. */
  object-position: center;
  display: block;
  /* The source images are a mix of photographs, artwork and logos, so a
     shared green cast is what makes them read as one set. sepia + hue-rotate
     is what tints it green; the grayscale ahead of them sets how far the
     originals are pulled toward that cast. Half-strength: enough to unify,
     not so much that faces go murky. Hover and the open panel clear it. */
  filter: grayscale(0.5) sepia(0.24) hue-rotate(52deg) saturate(1.15)
    brightness(0.88) contrast(1.04);
  transform: scale(1.02);
  transition: filter 0.5s var(--ease), transform 0.7s var(--ease);
}

.card-inner:hover .card-portrait img {
  filter: none;
}

/* Just enough scrim under the name to keep it legible over a bright photo. */
.card-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 55%,
    rgba(15, 19, 15, 0.75) 100%
  );
  transition: opacity 0.5s var(--ease);
}

/* meta ----------------------------------------------------------------- */

.card-meta {
  position: relative;
  padding: 1.05rem 1.15rem 1.15rem;
  flex: 1 1 auto;
  min-height: 0;
}

.card-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0 0 0.4rem;
  color: var(--parchment);
}

.card-headline {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--sage);
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* body — only ever shown in the feature panel -------------------------- */

.card-body {
  display: none;
}

.card-bio {
  margin: 1.15rem 0 0;
  font-size: 0.95rem;
  line-height: 1.68;
  color: rgba(217, 210, 197, 0.86);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--edge);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--sage);
  text-decoration: none;
  padding: 0.44rem 0.78rem;
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: rgba(11, 14, 11, 0.4);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    background-color 0.25s var(--ease);
}

.card-link:hover {
  color: var(--bark);
  background: var(--sage);
  border-color: var(--sage);
}

.card-link svg {
  width: 12px;
  height: 12px;
  flex: none;
}

/* Click-to-copy. The idle and copied labels are both in the DOM and swapped by
   class, so nothing has to stash and restore the original text. */
.card-permalink {
  appearance: none;
  display: inline-flex;
  align-items: center;
  margin-top: 1.1rem;
  padding: 0.4rem 0.7rem 0.4rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: rgba(149, 176, 132, 0.5);
  cursor: pointer;
  text-align: left;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    background-color 0.25s var(--ease);
}

.card-permalink:hover,
.card-permalink:focus-visible {
  color: var(--sage);
  border-color: var(--edge);
  background: rgba(11, 14, 11, 0.45);
  outline: none;
}

.card-permalink svg {
  width: 12px;
  height: 12px;
  flex: none;
  margin-right: 0.45rem;
}

.card-permalink-idle,
.card-permalink-done {
  display: inline-flex;
  align-items: center;
  word-break: break-all;
}

.card-permalink-done {
  display: none;
  color: var(--ochre);
}

.card-permalink.is-copied .card-permalink-idle {
  display: none;
}

.card-permalink.is-copied .card-permalink-done {
  display: inline-flex;
}

.card-permalink.is-copied {
  color: var(--ochre);
  border-color: rgba(200, 168, 107, 0.35);
  background: rgba(200, 168, 107, 0.07);
}

/* A quiet marker on the one entry whose public material is genuinely thin,
   so the card doesn't imply more research than exists. */
.card-thin {
  margin-top: 0.8rem;
  font-size: 0.74rem;
  color: rgba(200, 168, 107, 0.62);
}

/* close ---------------------------------------------------------------- */

.card-close {
  display: none;
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 4;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: rgba(11, 14, 11, 0.72);
  color: var(--sage);
  cursor: pointer;
  place-items: center;
  padding: 0;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    background-color 0.25s var(--ease);
}

.card-close svg {
  width: 14px;
  height: 14px;
}

.card-close:hover {
  color: var(--parchment);
  border-color: var(--edge-lit);
  background: rgba(42, 56, 44, 0.9);
}

/* ---------------------------------------------------------------- feature ---
   The open state is not an inline expansion — it is a takeover. The card
   leaves the grid flow (position: fixed), grows to a centred panel, and the
   scrim drops the grove behind it. The panel scales up out of the card's own
   position on screen (transform-origin is set inline by the script), so it
   reads as that card growing rather than a dialog appearing from nowhere. */

.ent-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 9, 7, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--ease);
}

.ent-scrim.is-on {
  opacity: 1;
  pointer-events: auto;
}

/* The stage sits above the scrim in the root stacking context; the open card
   is moved into it so it can actually paint above the dimmed grove. */
.ent-stage {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.ent-stage > * {
  pointer-events: auto;
}

.card-inner.is-feature {
  position: fixed;
  /* Clear the resting `inset: 0` BEFORE setting top/left — the shorthand
     resets all four sides, so listing it after would blow them away again. */
  inset: auto;
  top: 50%;
  left: 50%;
  z-index: 90;
  width: min(920px, 94vw);
  height: min(540px, 84vh);
  cursor: default;
  border-color: var(--edge-lit);
  background: linear-gradient(160deg, #202a1f 0%, var(--canopy) 58%, #0d110d 100%);
  box-shadow: 0 44px 100px -24px rgba(0, 0, 0, 0.92),
    0 0 0 1px rgba(149, 176, 132, 0.08), 0 0 90px -30px rgba(82, 115, 87, 0.5);
  transform: translate(-50%, -50%);
  animation: feature-in 0.4s var(--ease) both;
}

@keyframes feature-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.card-inner.is-feature:hover {
  transform: translate(-50%, -50%);
  box-shadow: 0 44px 100px -24px rgba(0, 0, 0, 0.92),
    0 0 0 1px rgba(149, 176, 132, 0.08), 0 0 90px -30px rgba(82, 115, 87, 0.5);
}

/* Portrait beside the text, not above it — at this size a stacked layout
   wastes the width and pushes the bio below the fold. */
.card-inner.is-feature .card-frame {
  flex-direction: row;
  align-items: stretch;
}

.card-inner.is-feature .card-portrait {
  flex: 0 0 38%;
  height: auto;
  align-self: stretch;
}

.card-inner.is-feature .card-portrait img {
  filter: none;
  object-position: center 30%;
  transform: none;
}

.card-inner.is-feature .card-portrait::after {
  background: linear-gradient(
    90deg,
    transparent 60%,
    rgba(15, 19, 15, 0.55) 100%
  );
}

.card-inner.is-feature .card-meta {
  padding: 2.5rem 2.6rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(149, 176, 132, 0.34) transparent;
}

.card-inner.is-feature .card-meta::-webkit-scrollbar {
  width: 9px;
}

.card-inner.is-feature .card-meta::-webkit-scrollbar-track {
  background: transparent;
}

.card-inner.is-feature .card-meta::-webkit-scrollbar-thumb {
  background: rgba(149, 176, 132, 0.3);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.card-inner.is-feature .card-meta::-webkit-scrollbar-thumb:hover {
  background: rgba(149, 176, 132, 0.52);
  background-clip: content-box;
}

.card-inner.is-feature .card-name {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  margin-bottom: 0.55rem;
}

.card-inner.is-feature .card-headline {
  font-size: 1.02rem;
  opacity: 1;
  -webkit-line-clamp: unset;
  display: block;
}

.card-inner.is-feature .card-body {
  display: block;
}

.card-inner.is-feature .card-close {
  display: grid;
}

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

@media (max-width: 900px) {
  .ent-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }

  .card {
    height: 326px;
  }

  .card-portrait {
    height: 190px;
  }
}

/* Below the site's 750px breakpoint the panel becomes a near-full-screen
   sheet, and the portrait goes back above the text — there is no width to
   put it beside. */
@media (max-width: 750px) {
  .ent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
  }

  .card {
    height: 300px;
  }

  .card-portrait {
    height: 168px;
  }

  .card-name {
    font-size: 1.2rem;
  }

  .card-headline {
    font-size: 0.78rem;
  }

  .card-inner.is-feature {
    width: 94vw;
    height: auto;
    max-height: 88vh;
  }

  .card-inner.is-feature .card-frame {
    flex-direction: column;
    max-height: 88vh;
  }

  .card-inner.is-feature .card-portrait {
    flex: 0 0 auto;
    height: 34vh;
  }

  .card-inner.is-feature .card-portrait::after {
    background: linear-gradient(
      180deg,
      transparent 55%,
      rgba(15, 19, 15, 0.7) 100%
    );
  }

  .card-inner.is-feature .card-meta {
    padding: 1.6rem 1.5rem 1.9rem;
  }

  .card-inner.is-feature .card-name {
    font-size: 1.9rem;
  }
}

@media (max-width: 460px) {
  .ent-grid {
    grid-template-columns: 1fr;
  }

  .card {
    height: 320px;
  }

  .card-portrait {
    height: 200px;
  }
}

/* ------------------------------------------------------------ motion pref ---*/

@media (prefers-reduced-motion: reduce) {
  .motes {
    display: none;
  }

  .card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .card-inner.is-feature {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
