/* social.pax.moe: Mastodon 4.6 themed to match pax.moe (green on black, Terminess).

   How it works, from the 4.6.11 source:
   - Mastodon colours almost everything through CSS custom properties (styles/mastodon/
     theme): a palette on `html`, and semantic tokens (--color-text-primary,
     --color-bg-primary, ...) on [data-color-scheme='dark'|'light']. Overriding the
     tokens reaches the whole UI; there are no hard coded Sass colours left.
   - Logged out visitors get a scheme from their OS (inline theme-selection.js sets
     data-color-scheme to light or dark), so both schemes are overridden, or a light mode
     laptop would get Mastodon's light tokens.
   - `html[data-color-scheme][data-contrast]` is specificity (0,2,1). It beats the scheme
     selectors (0,1,0) and (0,1,1) and the high contrast overrides (0,2,0). Both
     attributes are rendered server side on every page, so this matches everywhere.
   - This file is linked after the app styles, so equal specificity is enough to win. */

/* Fonts: Mastodon uses the family names below through @font-face. Redeclaring the same
   names here, later in the cascade, swaps the face everywhere without per component
   selectors. Every weight Mastodon declares is covered (400, 400 italic, 500, 700), or
   text at that weight would fall back to Roboto. Terminess has no italic file here, so
   italic renders upright. */
@font-face { font-family: mastodon-font-sans-serif; src: url('/paxfonts/TerminessNerdFontPropo-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: mastodon-font-sans-serif; src: url('/paxfonts/TerminessNerdFontPropo-Regular.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: mastodon-font-sans-serif; src: url('/paxfonts/TerminessNerdFontPropo-Bold.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: mastodon-font-sans-serif; src: url('/paxfonts/TerminessNerdFontPropo-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: mastodon-font-display;    src: url('/paxfonts/TerminessNerdFontPropo-Bold.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: mastodon-font-monospace;  src: url('/paxfonts/TerminessNerdFontPropo-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
/* Glyphs Terminess lacks (CJK, rare symbols) fall through to Unifont, as on pax.moe. */
@font-face { font-family: pax-unifont; src: url('/paxfonts/unifont.woff2') format('woff2'); font-display: swap; }

html[data-color-scheme][data-contrast] {
  color-scheme: dark; /* native controls, scrollbars and form widgets render dark */

  /* pax.moe's own scale */
  --pax-green: #00ff00;
  --pax-dim: rgb(0 255 0 / 66%);
  --pax-low: rgb(0 255 0 / 40%);
  --pax-line: rgb(0 255 0 / 14%);

  /* Palette: remapped too, for any component that reads it directly instead of a
     semantic token. Grey becomes a black to green ramp, indigo (the brand) green. */
  --color-grey-50: #00ff00;
  --color-grey-100: #00ff00;
  --color-grey-200: #33ff33;
  --color-grey-300: rgb(0 255 0 / 66%);
  --color-grey-400: rgb(0 255 0 / 45%);
  --color-grey-500: #0f5c0f;
  --color-grey-600: #0c420c;
  --color-grey-700: #093109;
  --color-grey-800: #062306;
  --color-grey-900: #031203;
  --color-grey-950: #000;
  --color-indigo-50: #e5ffe5;
  --color-indigo-100: #b3ffb3;
  --color-indigo-200: #80ff80;
  --color-indigo-300: #00ff00;
  --color-indigo-400: #00e600;
  --color-indigo-500: #00cc00;
  --color-indigo-600: #00b300;
  --color-indigo-700: #00ff00;
  --color-indigo-800: #00cc00;
  --color-indigo-900: #0a3a0a;
  --color-indigo-950: #041a04;

  /* Text */
  --color-text-primary: var(--pax-green);
  --color-text-secondary: var(--pax-dim);
  --color-text-tertiary: rgb(0 255 0 / 45%);
  --color-text-inverted: #000;
  --color-text-brand: var(--pax-green);
  --color-text-brand-soft: var(--pax-green);
  --color-text-on-brand-base: #000;
  --color-text-brand-on-inverted: #000;
  --color-text-status-links: var(--pax-green);
  --color-text-disabled: rgb(0 255 0 / 28%);
  --color-text-on-disabled: rgb(0 255 0 / 45%);
  --color-text-error: #ff6467;
  --color-text-warning: #ffd230;   /* favourite stars stay gold, readable as a state */
  --color-text-success: var(--pax-green);
  --color-text-on-media: #fff;     /* text over photos stays white */

  /* Backgrounds: black page, near black panels, faint green lift on hover */
  --color-bg-primary: #000;
  --color-bg-secondary: #031203;
  --color-bg-tertiary: #062306;
  --color-bg-inverted: var(--pax-green);
  --color-bg-overlay-base: rgb(0 0 0 / 80%);
  --color-bg-overlay-highlight: rgb(0 255 0 / 6%);
  --color-bg-overlay: #000;
  --color-bg-media-base: #000;
  --color-bg-disabled: #093109;

  /* Brand: primary buttons are solid green with black text, like pax.moe's selection */
  --color-bg-brand-base: var(--pax-green);
  --color-bg-brand-base-hover: #00cc00;
  --color-bg-brand-soft: #0a3a0a;
  --color-bg-brand-softest: #041a04;

  /* Borders: the thin rgba line pax.moe draws every box with */
  --color-border-primary: var(--pax-line);
  --color-border-brand: var(--pax-green);
  --color-border-brand-soft: var(--pax-low);
  --color-border-media: var(--pax-line);
  --color-border-success-soft: var(--pax-low);

  /* No soft drop shadows; boxes are lines, not cards floating on a page */
  --color-shadow-primary: rgb(0 0 0 / 90%);

  /* Code and rich text blocks (default is pink) */
  --rich-text-container-color: #031203;
  --rich-text-text-color: var(--pax-green);
  --rich-text-decorations-color: var(--pax-low);

  /* Shape: pax.moe's 3px corners instead of Mastodon's 8px rounded avatars */
  --avatar-border-radius: 3px;
  --outline-focus-default: 2px solid var(--pax-green);
}

/* High contrast (OS setting or Mastodon preference) keeps working: brighter secondary
   text and stronger lines, instead of being flattened by the theme above. */
html[data-color-scheme][data-contrast='high'] {
  --color-text-secondary: rgb(0 255 0 / 85%);
  --color-text-tertiary: rgb(0 255 0 / 70%);
  --color-border-primary: rgb(0 255 0 / 35%);
}

/* Mastodon flips some icons with filter: invert(1) depending on the scheme. The page is
   always dark now, so a light scheme visitor must get the dark behaviour. */
html[data-color-scheme='light'] .invert-on-light { filter: none; }
html[data-color-scheme='light'] .invert-on-dark { filter: invert(1); }

/* Base text: the faint phosphor glow pax.moe uses, Unifont as glyph fallback */
html body {
  font-family: mastodon-font-sans-serif, pax-unifont, ui-monospace, monospace;
  text-shadow: 0 0 6px rgb(0 255 0 / 18%);
}
/* No glow on text drawn over media or on solid green buttons */
.media-gallery, .video-player, .audio-player, .button, .button * { text-shadow: none; }

::selection { background: rgb(0 255 0 / 85%); color: #000; text-shadow: none; }
html { scrollbar-color: rgb(0 255 0 / 30%) #000; }

/* Buttons: pax.moe's square edge */
.button, .icon-button.button { border-radius: 3px; }

/* Links inside posts and the profile bio: underlined with a faint rule, so they read as
   links even though they share the text colour. Mentions and hashtags (class "mention",
   and "mention hashtag") keep Mastodon's own styling. The bio's class comes from a CSS
   module, but Mastodon names those from the file path (vite.config generateScopedName),
   not a hash, so _comp_account_bio__bio is stable within a release. */
.status__content a:not(.mention),
._comp_account_bio__bio a:not(.mention) {
  text-decoration: underline;
  text-decoration-color: var(--pax-low);
  text-underline-offset: 3px;
}
.status__content a:not(.mention):hover,
._comp_account_bio__bio a:not(.mention):hover { text-decoration-color: var(--pax-green); }

/* Logged out sidebar: drop Mastodon's built in "pax.moe is one of the many independent
   Mastodon servers..." line (server_banner.is_one_of_many, not an admin setting). The
   thumbnail and the server description below it stay. */
.server-banner__introduction { display: none; }

/* Avatars: Mastodon fills .account__avatar with --color-bg-tertiary as a loading
   placeholder, which shows through transparent PNG avatars as a green square. */
.account__avatar { background: transparent; }

/* Logo: the purple Mastodon elephant becomes the pax.moe cube (a true isometric cube,
   inlined as a data: URI, which the CSP allows under img-src data:).

   Icon (<svg class="logo logo--icon"><use href="#logo-symbol-icon">, and an <img> of the
   same class on the settings pages): hide the sprite, draw the cube, keep it square. */
svg.logo--icon { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%2300ff00' stroke='%23000' stroke-width='4' stroke-linejoin='round'%3E%3Cpath d='M50 3.8 90 26.9 50 50 10 26.9Z'/%3E%3Cpath d='M10 26.9 50 50 50 96.2 10 73.1Z'/%3E%3Cpath d='M90 26.9 90 73.1 50 96.2 50 50Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
svg.logo--icon use { display: none; }
img.logo--icon { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%2300ff00' stroke='%23000' stroke-width='4' stroke-linejoin='round'%3E%3Cpath d='M50 3.8 90 26.9 50 50 10 26.9Z'/%3E%3Cpath d='M10 26.9 50 50 50 96.2 10 73.1Z'/%3E%3Cpath d='M90 26.9 90 73.1 50 96.2 50 50Z'/%3E%3C/g%3E%3C/svg%3E"); object-fit: contain; }

/* Wordmark (web app sidebar): #logo-symbol-wordmark is one inline sprite, 261x66, with
   three paths, measured by rendering each alone: the elephant (gradient, x 0 to 61), its
   eye (a dot), and the word "mastodon" (currentColor, x 28 to 260, y 0 to 38.7). The
   word's "m" sits inside the elephant by design, so there is no room for a full size
   cube inside the sprite. Instead the svg gets left padding: backgrounds paint under
   padding while the content shifts right, so the cube gets its own space. Its visible
   faces are centred on the short letters, measured on the "m" (y 10.1 to 38.4 of 66),
   and drawn 1.2x the m's height so it reads as a mark: image 55.7% of the height,
   positioned 20.1% down. */
#logo-symbol-wordmark > path:nth-of-type(1),
#logo-symbol-wordmark > path:nth-of-type(2) { display: none; }
svg.logo--wordmark {
  padding-inline-start: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%2300ff00' stroke='%23000' stroke-width='4' stroke-linejoin='round'%3E%3Cpath d='M50 3.8 90 26.9 50 50 10 26.9Z'/%3E%3Cpath d='M10 26.9 50 50 50 96.2 10 73.1Z'/%3E%3Cpath d='M90 26.9 90 73.1 50 96.2 50 50Z'/%3E%3C/g%3E%3C/svg%3E") left 20.1% / auto 55.7% no-repeat;
}

/* Badges (role badge "Owner (pax.moe)", and friends): _comp_badge__badge, with the
   variant as a second class. The default and subtle variants become a thin green box
   instead of a filled pill. */
._comp_badge__default,
._comp_badge__subtle {
  background: transparent;
  border: 1px solid var(--pax-line);
  border-radius: 3px;
}

/* Badge and verified icons: icon_admin.svg (orange gradient shield) and
   icon_verified.svg (teal gradient seal) are both one shape filled with url(#...Gradient)
   plus one white stroked mark. Fill the shape green, draw the mark black, like the seams
   of the cube. The fill property beats the fill attribute. */
._comp_badge__badge svg path[fill^="url("],
._comp_account_header__fieldVerifiedIcon svg path[fill^="url("] { fill: var(--pax-green); }
._comp_badge__badge svg path[stroke="#fff"],
._comp_account_header__fieldVerifiedIcon svg path[stroke="#fff"] { stroke: #000; }
/* Verified field card: the same faint green tint as the brand, not the success green */
html[data-color-scheme][data-contrast] { --color-bg-success-softest: #041a04; }

/* Empty state elephant ("Showcase your favorite accounts" and other empty lists): an
   inline svg built to be recoloured, it reads six variables. Redrawn in pax.moe greens. */
._comp_empty_state_empty_state__defaultImage {
  --color-skin-1: #0c6b0c;
  --color-skin-2: #13a813;
  --color-skin-3: #0a520a;
  --color-outline: #021a02;
  --color-shadow: #041004;
  --color-highlight: #66ff66;
}
/* Error state: Mastodon's "oops" elephant is a raster gif, so recolouring cannot reach
   it. The cube stands in, kept square. */
img._comp_empty_state_empty_state__errorImage {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%2300ff00' stroke='%23000' stroke-width='4' stroke-linejoin='round'%3E%3Cpath d='M50 3.8 90 26.9 50 50 10 26.9Z'/%3E%3Cpath d='M10 26.9 50 50 50 96.2 10 73.1Z'/%3E%3Cpath d='M90 26.9 90 73.1 50 96.2 50 50Z'/%3E%3C/g%3E%3C/svg%3E");
  object-fit: contain;
  width: 160px;
  height: 160px;
  margin: 0;
}
/* The paper plane elephant in the compose drawer and announcements is the admin Mascot
   setting (src = mascot ?? elephant_ui_plane.svg). Replace it there with an image upload,
   not here. */

/* Logged-out visitors: no sign-up/login prompts. Login lives on the tailnet name only;
   the public name 302s /auth there. Only renders when signed out, so the lab UI is
   unaffected once logged in (sign in at social.lab.pax.moe/auth/sign_in). */
.sign-in-banner,
.ui__navigation-bar__sign-up,
a.button[href="/auth/sign_in"] { display: none !important; }


