/* MUSINGS LINK — typography */
.musings-main {
  display: inline-block;
  white-space: nowrap;
  font-size: clamp(18px, 1.8vw, 32px);
  line-height: .86;
  font-weight: 200;
  font-variation-settings: "wght" 200;
  letter-spacing: -0.085em;
  color: rgba(246,242,234,.58);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: color 0.25s ease;
}
.musings-link:hover .musings-main { color: rgba(246,242,234,1); }
.musings-main .mm { font-weight: 500; font-variation-settings: "wght" 500; letter-spacing: -0.09em; }
.musings-word-gap { display: inline-block; width: .10em; }

.musings-sub {
  font-size: 9px;
  line-height: 1;
  font-weight: 300;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(246,242,234,.5);
  white-space: nowrap;
  transition: color 0.25s ease;
}
.musings-link:hover .musings-sub { color: rgba(246,242,234,.75); }
@media (max-width: 640px) {
  .musings-main { font-size: clamp(20px, 6vw, 28px); letter-spacing: -.072em; }
  .musings-sub { font-size: 8px; margin-top: 5px; }
}
@media (max-width: 380px) {
  .musings-main { font-size: clamp(16px, 5vw, 20px); }
  .musings-enter { font-size: 7.5px; }
}

/* ============================================================
   BIO ASIDE — layout (single source of truth)
   ============================================================ */
#bio .bio-aside { position: relative; overflow: visible; }
#bio .bio-aside::before {
  content: '';
  position: absolute; inset: -30% -24% -10% -24%;
  background: url('../assets/philosographer_bokeh.jpg') center 36% / cover no-repeat;
  opacity: .28;
  -webkit-mask-image: radial-gradient(ellipse 72% 60% at 50% 42%, black 22%, rgba(0,0,0,.5) 54%, transparent 84%);
  mask-image: radial-gradient(ellipse 72% 60% at 50% 42%, black 22%, rgba(0,0,0,.5) 54%, transparent 84%);
  pointer-events: none; z-index: 0; mix-blend-mode: screen;
  animation: bioBokehBreathe 15s ease-in-out infinite;
}
@keyframes bioBokehBreathe {
  0%, 100% { opacity: .24; transform: scale(1); }
  50%      { opacity: .42; transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  #bio .bio-aside::before { animation: none; }
}

@media (min-width: 901px) {
  #bio .bio-aside { position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; }
  #bio .bio-aside .bio-motto-wrap { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; position: relative; z-index: 1; margin: 0; transform: none; }
  #bio .bio-aside .musings-link { position: relative; right: auto; bottom: auto; margin: 0 auto clamp(24px, 3.2vw, 52px); transform: none; z-index: 1; align-self: center; }
}

@media (max-width: 900px) {
  #bio .bio-aside {
    /* riga 1 (38px) compensa l'offset fisso sopra l'aforisma —
       gap di .bio-layout 36px + margin 12px + padding 14px = 62px —
       cosicché gap-sopra (62+38) e gap-sotto (riga 3) siano entrambi 100px */
    display: grid; grid-template-rows: 38px auto 100px auto;
    justify-items: center;
    width: 100%;
    margin: 12px 0 28px; padding: 14px 0 34px;
    position: relative; overflow: visible;
  }
  #bio .bio-aside .bio-motto-wrap { grid-row: 2; display: flex; align-items: center; justify-content: center; width: min(86vw, 360px); max-width: none; position: relative; z-index: 1; transform: none; }
  #bio .bio-aside .musings-link { grid-row: 4; justify-self: center; position: relative; transform: none; z-index: 1; }
}

@media (max-width: 640px) {
  #bio .bio-aside { padding-bottom: 38px; }
}

/* ============================================================
   CONTACT — single-column desktop layout
   ============================================================ */
@media (min-width: 901px) {
  .contact-wrap { max-width: 1120px; grid-template-columns: 1fr; gap: 26px; }
  .contact-header, .contact-intro, .contact-cards, .contact-cta-row { grid-column: 1; }
  .contact-header { max-width: 620px; }
  .contact-title { font-size: clamp(36px, 3.2vw, 48px); max-width: 560px; }
  .contact-intro { margin: -4px 0 10px; max-width: 680px; font-size: clamp(14px, .95vw, 16px); }
  .contact-cards { max-width: 760px; }
  .contact-cta-row { max-width: 760px; }
}
/* ============================================================
   PROGRESSIVE IMAGE — blur-up loading
   ============================================================ */
:where(.archive-card, .category-card, .topshot-card, .randomshot-card)::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(110deg, rgba(255,255,255,.08), rgba(255,255,255,.16), rgba(255,255,255,.08));
  opacity: .22; transition: opacity 1.15s ease;
}
:where(.archive-card, .category-card, .topshot-card, .randomshot-card):has(img.progressive-img.low-ready)::before  { opacity: .14; }
:where(.archive-card, .category-card, .topshot-card, .randomshot-card):has(img.progressive-img.high-ready)::before { opacity: 0; }

:where(.archive-card, .category-card, .topshot-card, .randomshot-card) img.progressive-img {
  position: relative; z-index: 1; opacity: .9; filter: blur(22px); transform: scale(1.022);
  transition: filter 3.25s cubic-bezier(.16,.84,.24,1), opacity 2.85s ease, transform 2.60s cubic-bezier(.2,.7,.1,1);
  will-change: filter, opacity, transform;
}
:where(.archive-card, .category-card, .topshot-card, .randomshot-card) img.progressive-img.low-ready { opacity: 1; }
:where(.archive-card:not(.is-nsfw), .category-card:not(.is-nsfw), .topshot-card:not(.is-nsfw), .randomshot-card:not(.is-nsfw)) img.progressive-img.high-ready,
body.reveal-nsfw :where(.archive-card.is-nsfw, .category-card.is-nsfw, .topshot-card.is-nsfw, .randomshot-card.is-nsfw) img.progressive-img.high-ready,
:where(.archive-card.is-nsfw:hover, .category-card.is-nsfw:hover, .topshot-card.is-nsfw:hover, .randomshot-card.is-nsfw:hover) img.progressive-img.high-ready {
  opacity: 1; filter: blur(0); transform: scale(1.022);
}

/* ============================================================
   BIO COLLAGE — responsive positioning
   (la .bio-collage-wrap riempie .bio-hero in absolute;
    l'altezza è gestita da .bio-hero in sections.css)
   ============================================================ */
@media (min-width: 769px) {
  .bio-collage-img { object-position: center 62%; }
}
@media (min-width: 901px) and (max-width: 1240px) {
  .bio-collage-img { object-position: center 58% !important; --bio-collage-scale: 1.24 !important; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .bio-collage-img { object-position: center 60% !important; --bio-collage-scale: 1.22 !important; }
}
@media (max-width: 640px) {
  .bio-collage-img { object-position: center 68% !important; --bio-collage-scale: 1.26 !important; }
}

/* ============================================================
   MUSINGS — card CTA
   ============================================================ */
#bio .musings-link {
  padding: 15px 19px;
  border: 1px solid rgba(175,133,112,.22);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(175,133,112,.07), rgba(175,133,112,.01));
  transition: border-color .35s ease, background .35s ease,
              transform .35s cubic-bezier(.2,.7,.1,1), box-shadow .35s ease;
}
#bio .musings-link:hover {
  border-color: rgba(199,154,130,.5);
  background: linear-gradient(160deg, rgba(175,133,112,.13), rgba(175,133,112,.03));
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0,0,0,.4);
}
@media (prefers-reduced-motion: reduce) {
  #bio .musings-link { transition: border-color .35s ease, background .35s ease; }
  #bio .musings-link:hover { transform: none; }
}

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
@media (pointer: fine) {
  html, body, a, button, [role="button"],
  .archive-card, .category-card, .topshot-card,
  .center-mark, .filter-btn, .nsfw-toggle,
  .back-to-top, .lightbox-close, .lightbox-arrow {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M7 12V7h5M20 7h5v5M25 20v5h-5M12 25H7v-5' fill='none' stroke='rgba(246,242,234,0.92)' stroke-width='1.7' stroke-linecap='round'/%3E%3Cpath d='M16 13v6M13 16h6' stroke='rgba(246,242,234,0.55)' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E") 16 16, crosshair;
  }
  input, textarea, select, [contenteditable="true"] { cursor: text; }
}

/* ============================================================
   M ENTRY — base visual fixes + impact animations
   ============================================================ */
.m-entry:not(.exploding) .m-entry-mark { filter: none !important; }
.m-entry:not(.exploding) .m-triangle   { filter: none !important; }
html { overflow-y: scroll; scrollbar-gutter: stable; }
body.pre-entry { overflow: visible !important; }
.m-entry { overflow: hidden !important; }
.m-entry-text { bottom: clamp(22px, 4.2vh, 46px) !important; }

/* Hero logo — mobile sizing (desktop overridden by patches.css) */
@media (max-width: 768px) { .hero-logo-wrap { width: clamp(280px, 82vw, 380px) !important; top: clamp(34px, 5.2vh, 48px) !important; } }
@media (max-width: 430px) { .hero-logo-wrap { width: clamp(250px, 86vw, 340px) !important; top: 38px !important; } }

.m-entry-mark { isolation: isolate; }
.m-entry-mark::after {
  content: ""; position: absolute; inset: -22%; pointer-events: none;
  opacity: 0; border-radius: 999px;
  background: radial-gradient(circle at center, rgba(255,255,255,.42) 0%, rgba(255,255,255,.18) 24%, rgba(255,255,255,.06) 42%, transparent 68%);
  transform: scale(.72); mix-blend-mode: screen;
}
.m-entry.exploding .m-entry-mark        { animation: mMarkImpact .34s cubic-bezier(.18,.82,.18,1) forwards; }
.m-entry.exploding .m-entry-mark::after { animation: mMarkHalo   .34s cubic-bezier(.16,.84,.20,1) forwards; }
.m-entry.exploding .m-entry-text        { transition-delay: .14s; }

@keyframes mMarkImpact {
  0%   { transform: translateY(-8px) scale(1);     filter: none; }
  38%  { transform: translateY(-8px) scale(1.085); filter: drop-shadow(0 0 16px rgba(255,255,255,.28)) drop-shadow(0 0 34px rgba(255,255,255,.18)); }
  100% { transform: translateY(-8px) scale(1.02);  filter: drop-shadow(0 0 12px rgba(255,255,255,.10)); }
}
@keyframes mMarkHalo {
  0%   { opacity: 0;   transform: scale(.72); }
  24%  { opacity: .98; transform: scale(1.00); }
  100% { opacity: 0;   transform: scale(1.34); }
}
