/* ==========================================================================
   moralpriest — custom skin for LinkPage
   Loaded last (after app.css), so this overrides the stock editorial theme.
   Self-hosted font; no third-party requests (CSP allows only 'self').
   ========================================================================== */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Design tokens: flip the stock light "editorial" theme to dark -------- */
:root {
  color-scheme: dark;

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system,
    'Segoe UI', Roboto, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;

  --color-primary: #f4f4fb;
  --color-secondary: #cfcfe4;
  --color-tertiary: #9494ab;
  --color-accent: #8b7dff;
  --color-accent-hover: #a99cff;

  --color-surface: rgba(255, 255, 255, 0.045);
  --color-surface-alt: rgba(255, 255, 255, 0.03);
  --color-border: rgba(255, 255, 255, 0.12);
  --color-border-light: rgba(255, 255, 255, 0.08);

  --brand-a: #8b7dff;
  --brand-b: #41e0d0;

  --card-radius: 16px;
  --max-width: 620px;
}

/* --- Page background: near-black with brand glows ------------------------- */
body {
  background:
    radial-gradient(1100px 560px at 50% -8%, rgba(139, 125, 255, 0.20), transparent 60%),
    radial-gradient(820px 480px at 92% 6%, rgba(65, 224, 208, 0.10), transparent 55%),
    #07070c;
  background-attachment: fixed;
  color: var(--color-primary);
}

.page-wrapper {
  padding: 1.5rem 1.25rem 2.5rem;
}

/* --- Hero artwork --------------------------------------------------------- */
/* "Moral Priest" art sits as a rounded poster above the header. LinkPage's
   templates are embedded, so it is injected with a pseudo-element. */
.page-wrapper::before {
  content: '';
  display: block;
  align-self: center;
  width: min(100%, 440px);
  aspect-ratio: 1 / 1;
  margin: 0.25rem auto 1.75rem;
  border-radius: 22px;
  background: #000000 url('/assets/banner.jpg') center / cover no-repeat;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* --- Header -------------------------------------------------------------- */
.site-header {
  padding: 2.5rem 0 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: none;
}

.logo-image {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  filter: drop-shadow(0 8px 28px rgba(139, 125, 255, 0.35));
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 8vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
  background: linear-gradient(100deg, #ffffff 0%, #b9aeff 55%, #41e0d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.site-tagline {
  font-size: 1rem;
  color: var(--color-tertiary);
  letter-spacing: 0.01em;
}

/* --- Link cards: compact glass rows -------------------------------------- */
.content-grid {
  gap: 0.7rem;
  margin-bottom: 2rem;
}

.card-link {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.18s ease, border-color 0.18s ease,
    background 0.18s ease, box-shadow 0.18s ease;
}

/* kill the stock left accent bar */
.card-link::before {
  display: none;
}

.card-link:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(139, 125, 255, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(139, 125, 255, 0.15);
}

.card-link:active {
  transform: translateY(0);
}

/* no images in this deployment — hide the empty thumbnail area */
.card-media {
  display: none;
}

.card-body {
  gap: 0.15rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

.card-link:hover .card-title {
  color: #ffffff;
}

.card-description {
  color: var(--color-tertiary);
  font-size: 0.875rem;
}

/* trailing chevron */
.card-link::after {
  content: '→';
  margin-left: auto;
  font-size: 1.05rem;
  color: var(--color-tertiary);
  opacity: 0.5;
  transition: transform 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.card-link:hover::after {
  color: var(--brand-b);
  opacity: 1;
  transform: translateX(3px);
}

/* --- Footer / socials ---------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border-light);
  padding-top: 1.75rem;
}

.social-links {
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.social-icon {
  width: 44px;
  height: 44px;
  color: var(--color-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.social-icon:hover {
  color: #ffffff;
  border-color: rgba(139, 125, 255, 0.6);
  background: rgba(139, 125, 255, 0.14);
  box-shadow: 0 6px 20px rgba(139, 125, 255, 0.25);
}

/* X (formerly Twitter): Feather only ships the old bird, so hide it and
   draw the current X logo via an alpha mask (inherits currentColor/hover). */
.social-icon[aria-label="x"] svg {
  display: none;
}

.social-icon[aria-label="x"]::after {
  content: '';
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: url('/assets/x.svg') center / contain no-repeat;
  mask: url('/assets/x.svg') center / contain no-repeat;
}

/* Repurpose the hidden "Powered by LinkPage" block as the shareable QR.
   The QR itself is generated by qrencode at build time (see nixos/caddy.nix). */
.footer-credit {
  display: block;
  margin-top: 1.75rem;
}

.footer-credit span,
.footer-credit a {
  display: none;
}

.footer-credit::before {
  content: 'Scan to share';
  display: block;
  margin-bottom: 0.7rem;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--color-tertiary);
}

.footer-credit::after {
  content: '';
  display: block;
  width: 156px;
  height: 156px;
  margin: 0 auto;
  border-radius: 14px;
  background: #ffffff url('/assets/qr.svg') center / 156px 156px no-repeat;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* --- Motion / accessibility --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .link-card {
    animation: none;
    opacity: 1;
  }
  .card-link,
  .card-link::after,
  .social-icon {
    transition: none;
  }
}
