/* ============================================================
   Grokkist Design System — Components
   Layered above colors_and_type.css.
   The new "soft rectangle + leaf radius" shape language replaces the
   previous pill-everywhere convention. Pills are now only for tags & badges.
   ============================================================ */

/* ------- Buttons ------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--r-3);          /* 12px — NOT a pill */
  background: var(--ground-cream);
  color: var(--fg-1);
  transition: background var(--dur-base) var(--ease-emerge),
              color var(--dur-base) var(--ease-emerge),
              border-color var(--dur-base) var(--ease-emerge),
              transform var(--dur-base) var(--ease-emerge),
              box-shadow var(--dur-base) var(--ease-emerge);
  text-decoration: none;
  user-select: none;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn:active { transform: translateY(1px); }

/* PRIMARY — forest green. Solid forest, cream type.
   On hover, the background brightens with a moss tint and lifts
   slightly so the affordance is unmistakeable. */
.btn-primary {
  background: var(--primary);
  color: var(--ground-cream);
  border-color: var(--primary);
  box-shadow: 0 1px 0 rgba(14, 42, 42, 0.0);
}
.btn-primary:hover {
  background: var(--biome-moss);              /* moss green — clearly different */
  border-color: var(--biome-moss);
  box-shadow: 0 6px 16px rgba(14, 42, 42, 0.18);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  box-shadow: none;
  transform: translateY(0);
}

/* SECONDARY — outlined forest. On hover, fills with cream-on-forest
   PLUS gains a subtle outer halo so it's clearly distinct from primary. */
.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover {
  background: var(--ground-bone);             /* warm cream fill, not full forest */
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary); /* doubled border, like a stamped tag */
}
.btn-secondary:active {
  background: var(--primary);
  color: var(--ground-cream);
}

/* TERTIARY — soft surface, used inside cards or denser UI. */
.btn-tertiary {
  background: var(--ground-cream);
  color: var(--fg-1);
  border-color: var(--rule);
}
.btn-tertiary:hover {
  border-color: var(--rule-strong);
  background: var(--ground-bone);
}

/* GHOST — type-only with arrow. The brand's preferred low-emphasis CTA.
   On hover, the underline thickens and slides into a moss tint —
   no garish color shift. The link feels like it's settling into place. */
.btn-ghost {
  background: transparent;
  color: var(--fg-1);
  border-color: transparent;
  padding: 10px 0;
  border-radius: 0;
  border-bottom: 1px solid var(--rule-strong);
}
.btn-ghost:hover {
  color: var(--biome-moss);
  border-bottom-color: var(--biome-moss);
  border-bottom-width: 2px;
  padding-bottom: 9px;                        /* keep same total height */
}
.btn-ghost:active { color: var(--primary); }

/* On dark / ecology mode, primary inverts to cream-on-forest-cream */
.dark .btn-primary, .ecology .btn-primary {
  background: var(--ground-cream);
  color: var(--ground-forest);
  border-color: var(--ground-cream);
}
.dark .btn-primary:hover, .ecology .btn-primary:hover {
  background: #FFFFFF;
}
.dark .btn-secondary, .ecology .btn-secondary {
  color: var(--ground-cream);
  border-color: var(--ground-cream);
}
.dark .btn-secondary:hover, .ecology .btn-secondary:hover {
  background: var(--ground-cream);
  color: var(--ground-forest);
}

/* Sizes */
.btn-sm { padding: 9px 14px; font-size: 13px; gap: 6px; }
.btn-lg { padding: 18px 28px; font-size: 17px; gap: 12px; }

/* Trailing arrow as the brand's signature affordance */
.btn .arrow {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-emerge);
}
.btn:hover .arrow { transform: translate(2px, -2px); }

/* ------- Cards ------- */
.card {
  background: var(--bg-raised);
  border-radius: var(--r-4);            /* 18px — softer than before */
  border: 1px solid var(--rule);
  padding: var(--s-6);
  transition: border-color var(--dur-base) var(--ease-emerge),
              transform var(--dur-base) var(--ease-emerge),
              box-shadow var(--dur-base) var(--ease-emerge);
}
.card:hover {
  border-color: var(--rule-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}
.card-leaf {
  /* Asymmetric "leaf" radius — used SPARINGLY for moments of warmth.
     One per page, max. */
  border-radius: var(--r-leaf);
}

/* ------- Tags & badges (pills live ONLY here) ------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--ground-bone);
  color: var(--biome-stone);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--rule);
}
.tag-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--biome-stone);
}

/* ------- Inputs ------- */
.input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--fg-1);
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  transition: border-color var(--dur-base) var(--ease-emerge),
              box-shadow var(--dur-base) var(--ease-emerge);
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 42, 42, 0.10);
}
.input::placeholder { color: var(--biome-stone); }

/* ------- Wordmark plate (replacing the old pill) ------- */
/* The old "Grokkist Network" pill broke on two lines. New approach:
   a soft rectangular plate in forest green with cream type, leaf-radius
   for warmth, and the mark sitting flush left. Always one line because
   it's sized to content with no min-width.

   Sub-label uses the SAME sans family at a lighter weight + slight
   tracking — the Cormorant italic was too editorial against the plate's
   architecture. Reads as "department name on a brass plaque". */
.wordmark-plate {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 14px;
  background: var(--primary);
  color: var(--ground-cream);
  border-radius: var(--r-leaf);
  white-space: nowrap;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.005em;
  text-decoration: none;
  box-shadow: var(--shadow-1);
}
.wordmark-plate .mark {
  width: 26px; height: 26px;
  flex-shrink: 0;
  object-fit: contain;
}
.wordmark-plate .sep {
  width: 1px;
  height: 16px;
  background: rgba(248, 242, 230, 0.32);
  margin: 0 2px;
}
.wordmark-plate .surface {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: rgba(248, 242, 230, 0.78);
}

/* ------- Section dividers ------- */
/* The "weave" — a curved, hand-feeling rainbow accent.
   Use as <span class="weave"></span> or via .has-weave-accent. */
.weave {
  display: block;
  height: 16px;
  width: 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 16' preserveAspectRatio='none'><path d='M0 8 Q 20 0, 40 8 T 80 8 T 120 8 T 160 8 T 200 8 T 240 8 T 280 8 T 320 8' fill='none' stroke='url(%23g)' stroke-width='2' stroke-linecap='round'/><defs><linearGradient id='g' x1='0' x2='1'><stop offset='0' stop-color='%23E42128'/><stop offset='0.18' stop-color='%23E6458F'/><stop offset='0.34' stop-color='%23F39702'/><stop offset='0.50' stop-color='%23F8B000'/><stop offset='0.68' stop-color='%2362B88D'/><stop offset='0.84' stop-color='%233568AC'/><stop offset='1' stop-color='%234A2E5E'/></linearGradient></defs></svg>");
  background-repeat: repeat-x;
  background-size: 240px 16px;
  background-position: center;
}
.weave-thick { height: 24px; background-size: 320px 24px; }
.weave-mono {
  /* single-color weave for restrained accents */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 16' preserveAspectRatio='none'><path d='M0 8 Q 20 0, 40 8 T 80 8 T 120 8 T 160 8 T 200 8 T 240 8 T 280 8 T 320 8' fill='none' stroke='%230E2A2A' stroke-width='1.5' stroke-linecap='round' stroke-opacity='0.32'/></svg>");
}

/* ------- Avatars ------- */
.av {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--biome-clay);
  color: var(--ground-cream);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-sans);
  flex-shrink: 0;
}
.av-sm { width: 28px; height: 28px; font-size: 11px; }
.av-lg { width: 56px; height: 56px; font-size: 18px; }

/* ------- Eyebrow with weave (the new section opener) ------- */
.eyebrow-weave {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--s-3);
}
.eyebrow-weave::before {
  content: "";
  display: block;
  height: 14px;
  width: 56px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 14' preserveAspectRatio='none'><path d='M0 7 Q 7 0, 14 7 T 28 7 T 42 7 T 56 7' fill='none' stroke='url(%23g)' stroke-width='2' stroke-linecap='round'/><defs><linearGradient id='g' x1='0' x2='1'><stop offset='0' stop-color='%23E42128'/><stop offset='0.5' stop-color='%23F8B000'/><stop offset='1' stop-color='%2362B88D'/></linearGradient></defs></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.eyebrow-weave .label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--biome-stone);
  font-weight: 500;
}
